parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"MVLi":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],o=function(t){return t&&t.Math==Math&&t};module.exports=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof t&&t)||function(){return this}()||Function("return this")();
},{}],"pWu7":[function(require,module,exports) {
module.exports=function(r){try{return!!r()}catch(t){return!0}};
},{}],"A8Ob":[function(require,module,exports) {
var e=require("../internals/fails");module.exports=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]});
},{"../internals/fails":"pWu7"}],"sC3y":[function(require,module,exports) {
"use strict";var r={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,t=e&&!r.call({1:2},1);exports.f=t?function(r){var t=e(this,r);return!!t&&t.enumerable}:r;
},{}],"oNyT":[function(require,module,exports) {
module.exports=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}};
},{}],"jUdy":[function(require,module,exports) {
var r={}.toString;module.exports=function(t){return r.call(t).slice(8,-1)};
},{}],"Nn1j":[function(require,module,exports) {
var r=require("../internals/fails"),e=require("../internals/classof-raw"),t="".split;module.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(r){return"String"==e(r)?t.call(r,""):Object(r)}:Object;
},{"../internals/fails":"pWu7","../internals/classof-raw":"jUdy"}],"RWPB":[function(require,module,exports) {
module.exports=function(o){if(null==o)throw TypeError("Can't call method on "+o);return o};
},{}],"ebRX":[function(require,module,exports) {
var e=require("../internals/indexed-object"),r=require("../internals/require-object-coercible");module.exports=function(i){return e(r(i))};
},{"../internals/indexed-object":"Nn1j","../internals/require-object-coercible":"RWPB"}],"AsqF":[function(require,module,exports) {
module.exports=function(o){return"object"==typeof o?null!==o:"function"==typeof o};
},{}],"wZyz":[function(require,module,exports) {
var t=require("../internals/is-object");module.exports=function(r,e){if(!t(r))return r;var n,o;if(e&&"function"==typeof(n=r.toString)&&!t(o=n.call(r)))return o;if("function"==typeof(n=r.valueOf)&&!t(o=n.call(r)))return o;if(!e&&"function"==typeof(n=r.toString)&&!t(o=n.call(r)))return o;throw TypeError("Can't convert object to primitive value")};
},{"../internals/is-object":"AsqF"}],"jYdl":[function(require,module,exports) {
var r={}.hasOwnProperty;module.exports=function(e,n){return r.call(e,n)};
},{}],"tvdn":[function(require,module,exports) {

var e=require("../internals/global"),r=require("../internals/is-object"),t=e.document,n=r(t)&&r(t.createElement);module.exports=function(e){return n?t.createElement(e):{}};
},{"../internals/global":"MVLi","../internals/is-object":"AsqF"}],"nSk9":[function(require,module,exports) {
var e=require("../internals/descriptors"),r=require("../internals/fails"),n=require("../internals/document-create-element");module.exports=!e&&!r(function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a});
},{"../internals/descriptors":"A8Ob","../internals/fails":"pWu7","../internals/document-create-element":"tvdn"}],"zm15":[function(require,module,exports) {
var e=require("../internals/descriptors"),r=require("../internals/object-property-is-enumerable"),i=require("../internals/create-property-descriptor"),t=require("../internals/to-indexed-object"),n=require("../internals/to-primitive"),s=require("../internals/has"),a=require("../internals/ie8-dom-define"),o=Object.getOwnPropertyDescriptor;exports.f=e?o:function(e,c){if(e=t(e),c=n(c,!0),a)try{return o(e,c)}catch(u){}if(s(e,c))return i(!r.f.call(e,c),e[c])};
},{"../internals/descriptors":"A8Ob","../internals/object-property-is-enumerable":"sC3y","../internals/create-property-descriptor":"oNyT","../internals/to-indexed-object":"ebRX","../internals/to-primitive":"wZyz","../internals/has":"jYdl","../internals/ie8-dom-define":"nSk9"}],"eAPg":[function(require,module,exports) {
var r=require("../internals/is-object");module.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e};
},{"../internals/is-object":"AsqF"}],"AtXZ":[function(require,module,exports) {
var e=require("../internals/descriptors"),r=require("../internals/ie8-dom-define"),i=require("../internals/an-object"),t=require("../internals/to-primitive"),n=Object.defineProperty;exports.f=e?n:function(e,o,s){if(i(e),o=t(o,!0),i(s),r)try{return n(e,o,s)}catch(u){}if("get"in s||"set"in s)throw TypeError("Accessors not supported");return"value"in s&&(e[o]=s.value),e};
},{"../internals/descriptors":"A8Ob","../internals/ie8-dom-define":"nSk9","../internals/an-object":"eAPg","../internals/to-primitive":"wZyz"}],"GwPZ":[function(require,module,exports) {
var r=require("../internals/descriptors"),e=require("../internals/object-define-property"),t=require("../internals/create-property-descriptor");module.exports=r?function(r,n,i){return e.f(r,n,t(1,i))}:function(r,e,t){return r[e]=t,r};
},{"../internals/descriptors":"A8Ob","../internals/object-define-property":"AtXZ","../internals/create-property-descriptor":"oNyT"}],"ScNd":[function(require,module,exports) {

var e=require("../internals/global"),r=require("../internals/create-non-enumerable-property");module.exports=function(n,t){try{r(e,n,t)}catch(a){e[n]=t}return t};
},{"../internals/global":"MVLi","../internals/create-non-enumerable-property":"GwPZ"}],"VcUc":[function(require,module,exports) {

var e=require("../internals/global"),r=require("../internals/set-global"),l="__core-js_shared__",a=e[l]||r(l,{});module.exports=a;
},{"../internals/global":"MVLi","../internals/set-global":"ScNd"}],"DE9Q":[function(require,module,exports) {
var e=require("../internals/shared-store"),n=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(e){return n.call(e)}),module.exports=e.inspectSource;
},{"../internals/shared-store":"VcUc"}],"Z7Ix":[function(require,module,exports) {

var e=require("../internals/global"),r=require("../internals/inspect-source"),t=e.WeakMap;module.exports="function"==typeof t&&/native code/.test(r(t));
},{"../internals/global":"MVLi","../internals/inspect-source":"DE9Q"}],"tGwT":[function(require,module,exports) {
module.exports=!1;
},{}],"B1yS":[function(require,module,exports) {
var r=require("../internals/is-pure"),e=require("../internals/shared-store");(module.exports=function(r,i){return e[r]||(e[r]=void 0!==i?i:{})})("versions",[]).push({version:"3.9.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});
},{"../internals/is-pure":"tGwT","../internals/shared-store":"VcUc"}],"bxyG":[function(require,module,exports) {
var o=0,r=Math.random();module.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++o+r).toString(36)};
},{}],"OIOG":[function(require,module,exports) {
var e=require("../internals/shared"),r=require("../internals/uid"),n=e("keys");module.exports=function(e){return n[e]||(n[e]=r(e))};
},{"../internals/shared":"B1yS","../internals/uid":"bxyG"}],"Ln6o":[function(require,module,exports) {
module.exports={};
},{}],"vLSK":[function(require,module,exports) {

var e,r,n,t=require("../internals/native-weak-map"),a=require("../internals/global"),i=require("../internals/is-object"),u=require("../internals/create-non-enumerable-property"),s=require("../internals/has"),o=require("../internals/shared-store"),l=require("../internals/shared-key"),c=require("../internals/hidden-keys"),f=a.WeakMap,q=function(t){return n(t)?r(t):e(t,{})},d=function(e){return function(n){var t;if(!i(n)||(t=r(n)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return t}};if(t){var p=o.state||(o.state=new f),h=p.get,v=p.has,y=p.set;e=function(e,r){return r.facade=e,y.call(p,e,r),r},r=function(e){return h.call(p,e)||{}},n=function(e){return v.call(p,e)}}else{var b=l("state");c[b]=!0,e=function(e,r){return r.facade=e,u(e,b,r),r},r=function(e){return s(e,b)?e[b]:{}},n=function(e){return s(e,b)}}module.exports={set:e,get:r,has:n,enforce:q,getterFor:d};
},{"../internals/native-weak-map":"Z7Ix","../internals/global":"MVLi","../internals/is-object":"AsqF","../internals/create-non-enumerable-property":"GwPZ","../internals/has":"jYdl","../internals/shared-store":"VcUc","../internals/shared-key":"OIOG","../internals/hidden-keys":"Ln6o"}],"ztZs":[function(require,module,exports) {

var e=require("../internals/global"),n=require("../internals/create-non-enumerable-property"),r=require("../internals/has"),t=require("../internals/set-global"),i=require("../internals/inspect-source"),o=require("../internals/internal-state"),s=o.get,a=o.enforce,u=String(String).split("String");(module.exports=function(i,o,s,l){var c,p=!!l&&!!l.unsafe,f=!!l&&!!l.enumerable,g=!!l&&!!l.noTargetGet;"function"==typeof s&&("string"!=typeof o||r(s,"name")||n(s,"name",o),(c=a(s)).source||(c.source=u.join("string"==typeof o?o:""))),i!==e?(p?!g&&i[o]&&(f=!0):delete i[o],f?i[o]=s:n(i,o,s)):f?i[o]=s:t(o,s)})(Function.prototype,"toString",function(){return"function"==typeof this&&s(this).source||i(this)});
},{"../internals/global":"MVLi","../internals/create-non-enumerable-property":"GwPZ","../internals/has":"jYdl","../internals/set-global":"ScNd","../internals/inspect-source":"DE9Q","../internals/internal-state":"vLSK"}],"hMfB":[function(require,module,exports) {

var e=require("../internals/global");module.exports=e;
},{"../internals/global":"MVLi"}],"mLk8":[function(require,module,exports) {

var n=require("../internals/path"),e=require("../internals/global"),r=function(n){return"function"==typeof n?n:void 0};module.exports=function(t,i){return arguments.length<2?r(n[t])||r(e[t]):n[t]&&n[t][i]||e[t]&&e[t][i]};
},{"../internals/path":"hMfB","../internals/global":"MVLi"}],"GwUC":[function(require,module,exports) {
var o=Math.ceil,r=Math.floor;module.exports=function(t){return isNaN(t=+t)?0:(t>0?r:o)(t)};
},{}],"j9AG":[function(require,module,exports) {
var e=require("../internals/to-integer"),r=Math.min;module.exports=function(n){return n>0?r(e(n),9007199254740991):0};
},{"../internals/to-integer":"GwUC"}],"QLhU":[function(require,module,exports) {
var r=require("../internals/to-integer"),e=Math.max,t=Math.min;module.exports=function(n,a){var i=r(n);return i<0?e(i+a,0):t(i,a)};
},{"../internals/to-integer":"GwUC"}],"b2MC":[function(require,module,exports) {
var e=require("../internals/to-indexed-object"),r=require("../internals/to-length"),n=require("../internals/to-absolute-index"),t=function(t){return function(i,u,o){var l,f=e(i),s=r(f.length),a=n(o,s);if(t&&u!=u){for(;s>a;)if((l=f[a++])!=l)return!0}else for(;s>a;a++)if((t||a in f)&&f[a]===u)return t||a||0;return!t&&-1}};module.exports={includes:t(!0),indexOf:t(!1)};
},{"../internals/to-indexed-object":"ebRX","../internals/to-length":"j9AG","../internals/to-absolute-index":"QLhU"}],"ijOr":[function(require,module,exports) {
var e=require("../internals/has"),r=require("../internals/to-indexed-object"),n=require("../internals/array-includes").indexOf,i=require("../internals/hidden-keys");module.exports=function(s,t){var u,a=r(s),d=0,l=[];for(u in a)!e(i,u)&&e(a,u)&&l.push(u);for(;t.length>d;)e(a,u=t[d++])&&(~n(l,u)||l.push(u));return l};
},{"../internals/has":"jYdl","../internals/to-indexed-object":"ebRX","../internals/array-includes":"b2MC","../internals/hidden-keys":"Ln6o"}],"asST":[function(require,module,exports) {
module.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];
},{}],"QFCk":[function(require,module,exports) {
var e=require("../internals/object-keys-internal"),r=require("../internals/enum-bug-keys"),t=r.concat("length","prototype");exports.f=Object.getOwnPropertyNames||function(r){return e(r,t)};
},{"../internals/object-keys-internal":"ijOr","../internals/enum-bug-keys":"asST"}],"uqTD":[function(require,module,exports) {
exports.f=Object.getOwnPropertySymbols;
},{}],"uZDC":[function(require,module,exports) {
var e=require("../internals/get-built-in"),r=require("../internals/object-get-own-property-names"),n=require("../internals/object-get-own-property-symbols"),t=require("../internals/an-object");module.exports=e("Reflect","ownKeys")||function(e){var o=r.f(t(e)),i=n.f;return i?o.concat(i(e)):o};
},{"../internals/get-built-in":"mLk8","../internals/object-get-own-property-names":"QFCk","../internals/object-get-own-property-symbols":"uqTD","../internals/an-object":"eAPg"}],"dZUE":[function(require,module,exports) {
var e=require("../internals/has"),r=require("../internals/own-keys"),n=require("../internals/object-get-own-property-descriptor"),t=require("../internals/object-define-property");module.exports=function(i,o){for(var a=r(o),s=t.f,l=n.f,p=0;p<a.length;p++){var u=a[p];e(i,u)||s(i,u,l(o,u))}};
},{"../internals/has":"jYdl","../internals/own-keys":"uZDC","../internals/object-get-own-property-descriptor":"zm15","../internals/object-define-property":"AtXZ"}],"Y6Gi":[function(require,module,exports) {
var r=require("../internals/fails"),e=/#|\.prototype\./,t=function(e,t){var u=o[n(e)];return u==i||u!=a&&("function"==typeof t?r(t):!!t)},n=t.normalize=function(r){return String(r).replace(e,".").toLowerCase()},o=t.data={},a=t.NATIVE="N",i=t.POLYFILL="P";module.exports=t;
},{"../internals/fails":"pWu7"}],"rhEq":[function(require,module,exports) {

var e=require("../internals/global"),r=require("../internals/object-get-own-property-descriptor").f,t=require("../internals/create-non-enumerable-property"),n=require("../internals/redefine"),o=require("../internals/set-global"),i=require("../internals/copy-constructor-properties"),a=require("../internals/is-forced");module.exports=function(s,l){var p,u,f,c,q,d=s.target,g=s.global,y=s.stat;if(p=g?e:y?e[d]||o(d,{}):(e[d]||{}).prototype)for(u in l){if(c=l[u],f=s.noTargetGet?(q=r(p,u))&&q.value:p[u],!a(g?u:d+(y?".":"#")+u,s.forced)&&void 0!==f){if(typeof c==typeof f)continue;i(c,f)}(s.sham||f&&f.sham)&&t(c,"sham",!0),n(p,u,c,s)}};
},{"../internals/global":"MVLi","../internals/object-get-own-property-descriptor":"zm15","../internals/create-non-enumerable-property":"GwPZ","../internals/redefine":"ztZs","../internals/set-global":"ScNd","../internals/copy-constructor-properties":"dZUE","../internals/is-forced":"Y6Gi"}],"dxME":[function(require,module,exports) {

var r=require("../internals/classof-raw"),e=require("../internals/global");module.exports="process"==r(e.process);
},{"../internals/classof-raw":"jUdy","../internals/global":"MVLi"}],"ds3C":[function(require,module,exports) {
var e=require("../internals/get-built-in");module.exports=e("navigator","userAgent")||"";
},{"../internals/get-built-in":"mLk8"}],"mpuz":[function(require,module,exports) {


var e,r,s=require("../internals/global"),n=require("../internals/engine-user-agent"),a=s.process,i=a&&a.versions,t=i&&i.v8;t?r=(e=t.split("."))[0]+e[1]:n&&(!(e=n.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=n.match(/Chrome\/(\d+)/))&&(r=e[1]),module.exports=r&&+r;
},{"../internals/global":"MVLi","../internals/engine-user-agent":"ds3C"}],"PgsN":[function(require,module,exports) {
var e=require("../internals/engine-is-node"),n=require("../internals/engine-v8-version"),r=require("../internals/fails");module.exports=!!Object.getOwnPropertySymbols&&!r(function(){return!Symbol.sham&&(e?38===n:n>37&&n<41)});
},{"../internals/engine-is-node":"dxME","../internals/engine-v8-version":"mpuz","../internals/fails":"pWu7"}],"zoTj":[function(require,module,exports) {
var e=require("../internals/native-symbol");module.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator;
},{"../internals/native-symbol":"PgsN"}],"oqXF":[function(require,module,exports) {
var r=require("../internals/classof-raw");module.exports=Array.isArray||function(a){return"Array"==r(a)};
},{"../internals/classof-raw":"jUdy"}],"Q9KC":[function(require,module,exports) {
var e=require("../internals/require-object-coercible");module.exports=function(r){return Object(e(r))};
},{"../internals/require-object-coercible":"RWPB"}],"rmL3":[function(require,module,exports) {
var e=require("../internals/object-keys-internal"),r=require("../internals/enum-bug-keys");module.exports=Object.keys||function(n){return e(n,r)};
},{"../internals/object-keys-internal":"ijOr","../internals/enum-bug-keys":"asST"}],"ZdKd":[function(require,module,exports) {
var e=require("../internals/descriptors"),r=require("../internals/object-define-property"),n=require("../internals/an-object"),t=require("../internals/object-keys");module.exports=e?Object.defineProperties:function(e,i){n(e);for(var o,s=t(i),a=s.length,u=0;a>u;)r.f(e,o=s[u++],i[o]);return e};
},{"../internals/descriptors":"A8Ob","../internals/object-define-property":"AtXZ","../internals/an-object":"eAPg","../internals/object-keys":"rmL3"}],"tTwY":[function(require,module,exports) {
var e=require("../internals/get-built-in");module.exports=e("document","documentElement");
},{"../internals/get-built-in":"mLk8"}],"zWsZ":[function(require,module,exports) {
var e,n=require("../internals/an-object"),r=require("../internals/object-define-properties"),t=require("../internals/enum-bug-keys"),i=require("../internals/hidden-keys"),u=require("../internals/html"),o=require("../internals/document-create-element"),c=require("../internals/shared-key"),l=">",a="<",s="prototype",d="script",m=c("IE_PROTO"),p=function(){},f=function(e){return a+d+l+e+a+"/"+d+l},v=function(e){e.write(f("")),e.close();var n=e.parentWindow.Object;return e=null,n},b=function(){var e,n=o("iframe"),r="java"+d+":";return n.style.display="none",u.appendChild(n),n.src=String(r),(e=n.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F},h=function(){try{e=document.domain&&new ActiveXObject("htmlfile")}catch(r){}h=e?v(e):b();for(var n=t.length;n--;)delete h[s][t[n]];return h()};i[m]=!0,module.exports=Object.create||function(e,t){var i;return null!==e?(p[s]=n(e),i=new p,p[s]=null,i[m]=e):i=h(),void 0===t?i:r(i,t)};
},{"../internals/an-object":"eAPg","../internals/object-define-properties":"ZdKd","../internals/enum-bug-keys":"asST","../internals/hidden-keys":"Ln6o","../internals/html":"tTwY","../internals/document-create-element":"tvdn","../internals/shared-key":"OIOG"}],"BNtO":[function(require,module,exports) {
var e=require("../internals/to-indexed-object"),t=require("../internals/object-get-own-property-names").f,r={}.toString,n="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function(e){try{return t(e)}catch(r){return n.slice()}};module.exports.f=function(i){return n&&"[object Window]"==r.call(i)?o(i):t(e(i))};
},{"../internals/to-indexed-object":"ebRX","../internals/object-get-own-property-names":"QFCk"}],"Q0EA":[function(require,module,exports) {

var e=require("../internals/global"),r=require("../internals/shared"),i=require("../internals/has"),n=require("../internals/uid"),t=require("../internals/native-symbol"),s=require("../internals/use-symbol-as-uid"),l=r("wks"),u=e.Symbol,a=s?u:u&&u.withoutSetter||n;module.exports=function(e){return i(l,e)&&(t||"string"==typeof l[e])||(t&&i(u,e)?l[e]=u[e]:l[e]=a("Symbol."+e)),l[e]};
},{"../internals/global":"MVLi","../internals/shared":"B1yS","../internals/has":"jYdl","../internals/uid":"bxyG","../internals/native-symbol":"PgsN","../internals/use-symbol-as-uid":"zoTj"}],"Odzx":[function(require,module,exports) {
var e=require("../internals/well-known-symbol");exports.f=e;
},{"../internals/well-known-symbol":"Q0EA"}],"TzLT":[function(require,module,exports) {
var e=require("../internals/path"),r=require("../internals/has"),n=require("../internals/well-known-symbol-wrapped"),l=require("../internals/object-define-property").f;module.exports=function(a){var i=e.Symbol||(e.Symbol={});r(i,a)||l(i,a,{value:n.f(a)})};
},{"../internals/path":"hMfB","../internals/has":"jYdl","../internals/well-known-symbol-wrapped":"Odzx","../internals/object-define-property":"AtXZ"}],"kLCt":[function(require,module,exports) {
var e=require("../internals/object-define-property").f,r=require("../internals/has"),n=require("../internals/well-known-symbol"),o=n("toStringTag");module.exports=function(n,t,i){n&&!r(n=i?n:n.prototype,o)&&e(n,o,{configurable:!0,value:t})};
},{"../internals/object-define-property":"AtXZ","../internals/has":"jYdl","../internals/well-known-symbol":"Q0EA"}],"SOPX":[function(require,module,exports) {
module.exports=function(n){if("function"!=typeof n)throw TypeError(String(n)+" is not a function");return n};
},{}],"dEmF":[function(require,module,exports) {
var n=require("../internals/a-function");module.exports=function(r,t,e){if(n(r),void 0===t)return r;switch(e){case 0:return function(){return r.call(t)};case 1:return function(n){return r.call(t,n)};case 2:return function(n,e){return r.call(t,n,e)};case 3:return function(n,e,u){return r.call(t,n,e,u)}}return function(){return r.apply(t,arguments)}};
},{"../internals/a-function":"SOPX"}],"e6WL":[function(require,module,exports) {
var r=require("../internals/is-object"),e=require("../internals/is-array"),n=require("../internals/well-known-symbol"),o=n("species");module.exports=function(n,i){var t;return e(n)&&("function"!=typeof(t=n.constructor)||t!==Array&&!e(t.prototype)?r(t)&&null===(t=t[o])&&(t=void 0):t=void 0),new(void 0===t?Array:t)(0===i?0:i)};
},{"../internals/is-object":"AsqF","../internals/is-array":"oqXF","../internals/well-known-symbol":"Q0EA"}],"EUh8":[function(require,module,exports) {
var e=require("../internals/function-bind-context"),r=require("../internals/indexed-object"),n=require("../internals/to-object"),t=require("../internals/to-length"),i=require("../internals/array-species-create"),a=[].push,s=function(s){var c=1==s,u=2==s,l=3==s,o=4==s,f=6==s,d=7==s,h=5==s||f;return function(q,v,p,x){for(var b,m,g=n(q),j=r(g),w=e(v,p,3),y=t(j.length),E=0,I=x||i,O=c?I(q,y):u||d?I(q,0):void 0;y>E;E++)if((h||E in j)&&(m=w(b=j[E],E,g),s))if(c)O[E]=m;else if(m)switch(s){case 3:return!0;case 5:return b;case 6:return E;case 2:a.call(O,b)}else switch(s){case 4:return!1;case 7:a.call(O,b)}return f?-1:l||o?o:O}};module.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterOut:s(7)};
},{"../internals/function-bind-context":"dEmF","../internals/indexed-object":"Nn1j","../internals/to-object":"Q9KC","../internals/to-length":"j9AG","../internals/array-species-create":"e6WL"}],"diqY":[function(require,module,exports) {

"use strict";var e=require("../internals/export"),r=require("../internals/global"),t=require("../internals/get-built-in"),n=require("../internals/is-pure"),i=require("../internals/descriptors"),o=require("../internals/native-symbol"),s=require("../internals/use-symbol-as-uid"),a=require("../internals/fails"),u=require("../internals/has"),l=require("../internals/is-array"),c=require("../internals/is-object"),f=require("../internals/an-object"),p=require("../internals/to-object"),y=require("../internals/to-indexed-object"),b=require("../internals/to-primitive"),d=require("../internals/create-property-descriptor"),g=require("../internals/object-create"),q=require("../internals/object-keys"),h=require("../internals/object-get-own-property-names"),m=require("../internals/object-get-own-property-names-external"),v=require("../internals/object-get-own-property-symbols"),w=require("../internals/object-get-own-property-descriptor"),j=require("../internals/object-define-property"),O=require("../internals/object-property-is-enumerable"),S=require("../internals/create-non-enumerable-property"),k=require("../internals/redefine"),P=require("../internals/shared"),E=require("../internals/shared-key"),x=require("../internals/hidden-keys"),N=require("../internals/uid"),F=require("../internals/well-known-symbol"),J=require("../internals/well-known-symbol-wrapped"),T=require("../internals/define-well-known-symbol"),C=require("../internals/set-to-string-tag"),D=require("../internals/internal-state"),I=require("../internals/array-iteration").forEach,Q=E("hidden"),z="Symbol",A="prototype",B=F("toPrimitive"),G=D.set,H=D.getterFor(z),K=Object[A],L=r.Symbol,M=t("JSON","stringify"),R=w.f,U=j.f,V=m.f,W=O.f,X=P("symbols"),Y=P("op-symbols"),Z=P("string-to-symbol-registry"),$=P("symbol-to-string-registry"),_=P("wks"),ee=r.QObject,re=!ee||!ee[A]||!ee[A].findChild,te=i&&a(function(){return 7!=g(U({},"a",{get:function(){return U(this,"a",{value:7}).a}})).a})?function(e,r,t){var n=R(K,r);n&&delete K[r],U(e,r,t),n&&e!==K&&U(K,r,n)}:U,ne=function(e,r){var t=X[e]=g(L[A]);return G(t,{type:z,tag:e,description:r}),i||(t.description=r),t},ie=s?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof L},oe=function(e,r,t){e===K&&oe(Y,r,t),f(e);var n=b(r,!0);return f(t),u(X,n)?(t.enumerable?(u(e,Q)&&e[Q][n]&&(e[Q][n]=!1),t=g(t,{enumerable:d(0,!1)})):(u(e,Q)||U(e,Q,d(1,{})),e[Q][n]=!0),te(e,n,t)):U(e,n,t)},se=function(e,r){f(e);var t=y(r),n=q(t).concat(fe(t));return I(n,function(r){i&&!ue.call(t,r)||oe(e,r,t[r])}),e},ae=function(e,r){return void 0===r?g(e):se(g(e),r)},ue=function(e){var r=b(e,!0),t=W.call(this,r);return!(this===K&&u(X,r)&&!u(Y,r))&&(!(t||!u(this,r)||!u(X,r)||u(this,Q)&&this[Q][r])||t)},le=function(e,r){var t=y(e),n=b(r,!0);if(t!==K||!u(X,n)||u(Y,n)){var i=R(t,n);return!i||!u(X,n)||u(t,Q)&&t[Q][n]||(i.enumerable=!0),i}},ce=function(e){var r=V(y(e)),t=[];return I(r,function(e){u(X,e)||u(x,e)||t.push(e)}),t},fe=function(e){var r=e===K,t=V(r?Y:y(e)),n=[];return I(t,function(e){!u(X,e)||r&&!u(K,e)||n.push(X[e])}),n};if(o||(k((L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,r=N(e),t=function(e){this===K&&t.call(Y,e),u(this,Q)&&u(this[Q],r)&&(this[Q][r]=!1),te(this,r,d(1,e))};return i&&re&&te(K,r,{configurable:!0,set:t}),ne(r,e)})[A],"toString",function(){return H(this).tag}),k(L,"withoutSetter",function(e){return ne(N(e),e)}),O.f=ue,j.f=oe,w.f=le,h.f=m.f=ce,v.f=fe,J.f=function(e){return ne(F(e),e)},i&&(U(L[A],"description",{configurable:!0,get:function(){return H(this).description}}),n||k(K,"propertyIsEnumerable",ue,{unsafe:!0}))),e({global:!0,wrap:!0,forced:!o,sham:!o},{Symbol:L}),I(q(_),function(e){T(e)}),e({target:z,stat:!0,forced:!o},{for:function(e){var r=String(e);if(u(Z,r))return Z[r];var t=L(r);return Z[r]=t,$[t]=r,t},keyFor:function(e){if(!ie(e))throw TypeError(e+" is not a symbol");if(u($,e))return $[e]},useSetter:function(){re=!0},useSimple:function(){re=!1}}),e({target:"Object",stat:!0,forced:!o,sham:!i},{create:ae,defineProperty:oe,defineProperties:se,getOwnPropertyDescriptor:le}),e({target:"Object",stat:!0,forced:!o},{getOwnPropertyNames:ce,getOwnPropertySymbols:fe}),e({target:"Object",stat:!0,forced:a(function(){v.f(1)})},{getOwnPropertySymbols:function(e){return v.f(p(e))}}),M){var pe=!o||a(function(){var e=L();return"[null]"!=M([e])||"{}"!=M({a:e})||"{}"!=M(Object(e))});e({target:"JSON",stat:!0,forced:pe},{stringify:function(e,r,t){for(var n,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=r,(c(r)||void 0!==e)&&!ie(e))return l(r)||(r=function(e,r){if("function"==typeof n&&(r=n.call(this,e,r)),!ie(r))return r}),i[1]=r,M.apply(null,i)}})}L[A][B]||S(L[A],B,L[A].valueOf),C(L,z),x[Q]=!0;
},{"../internals/export":"rhEq","../internals/global":"MVLi","../internals/get-built-in":"mLk8","../internals/is-pure":"tGwT","../internals/descriptors":"A8Ob","../internals/native-symbol":"PgsN","../internals/use-symbol-as-uid":"zoTj","../internals/fails":"pWu7","../internals/has":"jYdl","../internals/is-array":"oqXF","../internals/is-object":"AsqF","../internals/an-object":"eAPg","../internals/to-object":"Q9KC","../internals/to-indexed-object":"ebRX","../internals/to-primitive":"wZyz","../internals/create-property-descriptor":"oNyT","../internals/object-create":"zWsZ","../internals/object-keys":"rmL3","../internals/object-get-own-property-names":"QFCk","../internals/object-get-own-property-names-external":"BNtO","../internals/object-get-own-property-symbols":"uqTD","../internals/object-get-own-property-descriptor":"zm15","../internals/object-define-property":"AtXZ","../internals/object-property-is-enumerable":"sC3y","../internals/create-non-enumerable-property":"GwPZ","../internals/redefine":"ztZs","../internals/shared":"B1yS","../internals/shared-key":"OIOG","../internals/hidden-keys":"Ln6o","../internals/uid":"bxyG","../internals/well-known-symbol":"Q0EA","../internals/well-known-symbol-wrapped":"Odzx","../internals/define-well-known-symbol":"TzLT","../internals/set-to-string-tag":"kLCt","../internals/internal-state":"vLSK","../internals/array-iteration":"EUh8"}],"N3MB":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("asyncIterator");
},{"../internals/define-well-known-symbol":"TzLT"}],"LYOo":[function(require,module,exports) {

"use strict";var r=require("../internals/export"),e=require("../internals/descriptors"),t=require("../internals/global"),i=require("../internals/has"),o=require("../internals/is-object"),n=require("../internals/object-define-property").f,s=require("../internals/copy-constructor-properties"),a=t.Symbol;if(e&&"function"==typeof a&&(!("description"in a.prototype)||void 0!==a().description)){var l={},c=function(){var r=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof c?new a(r):void 0===r?a():a(r);return""===r&&(l[e]=!0),e};s(c,a);var p=c.prototype=a.prototype;p.constructor=c;var u=p.toString,v="Symbol(test)"==String(a("test")),f=/^Symbol\((.*)\)[^)]+$/;n(p,"description",{configurable:!0,get:function(){var r=o(this)?this.valueOf():this,e=u.call(r);if(i(l,r))return"";var t=v?e.slice(7,-1):e.replace(f,"$1");return""===t?void 0:t}}),r({global:!0,forced:!0},{Symbol:c})}
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/global":"MVLi","../internals/has":"jYdl","../internals/is-object":"AsqF","../internals/object-define-property":"AtXZ","../internals/copy-constructor-properties":"dZUE"}],"rFss":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("hasInstance");
},{"../internals/define-well-known-symbol":"TzLT"}],"stDf":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("isConcatSpreadable");
},{"../internals/define-well-known-symbol":"TzLT"}],"WXoU":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("iterator");
},{"../internals/define-well-known-symbol":"TzLT"}],"Hc3y":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("match");
},{"../internals/define-well-known-symbol":"TzLT"}],"lVca":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("matchAll");
},{"../internals/define-well-known-symbol":"TzLT"}],"pvvP":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("replace");
},{"../internals/define-well-known-symbol":"TzLT"}],"rdEa":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("search");
},{"../internals/define-well-known-symbol":"TzLT"}],"jSLd":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("species");
},{"../internals/define-well-known-symbol":"TzLT"}],"c6b0":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("split");
},{"../internals/define-well-known-symbol":"TzLT"}],"sek4":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("toPrimitive");
},{"../internals/define-well-known-symbol":"TzLT"}],"uDx9":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("toStringTag");
},{"../internals/define-well-known-symbol":"TzLT"}],"yT7s":[function(require,module,exports) {
var e=require("../internals/define-well-known-symbol");e("unscopables");
},{"../internals/define-well-known-symbol":"TzLT"}],"x9wq":[function(require,module,exports) {
var t=require("../internals/fails");module.exports=!t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype});
},{"../internals/fails":"pWu7"}],"xeyN":[function(require,module,exports) {
var t=require("../internals/has"),e=require("../internals/to-object"),r=require("../internals/shared-key"),o=require("../internals/correct-prototype-getter"),n=r("IE_PROTO"),c=Object.prototype;module.exports=o?Object.getPrototypeOf:function(r){return r=e(r),t(r,n)?r[n]:"function"==typeof r.constructor&&r instanceof r.constructor?r.constructor.prototype:r instanceof Object?c:null};
},{"../internals/has":"jYdl","../internals/to-object":"Q9KC","../internals/shared-key":"OIOG","../internals/correct-prototype-getter":"x9wq"}],"ckfP":[function(require,module,exports) {
var r=require("../internals/is-object");module.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t};
},{"../internals/is-object":"AsqF"}],"eDCX":[function(require,module,exports) {
var t=require("../internals/an-object"),r=require("../internals/a-possible-prototype");module.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,o=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),o=n instanceof Array}catch(c){}return function(n,c){return t(n),r(c),o?e.call(n,c):n.__proto__=c,n}}():void 0);
},{"../internals/an-object":"eAPg","../internals/a-possible-prototype":"ckfP"}],"XTOV":[function(require,module,exports) {
var r=require("../internals/well-known-symbol"),e=require("../internals/iterators"),t=r("iterator"),o=Array.prototype;module.exports=function(r){return void 0!==r&&(e.Array===r||o[t]===r)};
},{"../internals/well-known-symbol":"Q0EA","../internals/iterators":"Ln6o"}],"PN7D":[function(require,module,exports) {
var e=require("../internals/well-known-symbol"),r=e("toStringTag"),n={};n[r]="z",module.exports="[object z]"===String(n);
},{"../internals/well-known-symbol":"Q0EA"}],"rs2T":[function(require,module,exports) {
var n=require("../internals/to-string-tag-support"),r=require("../internals/classof-raw"),t=require("../internals/well-known-symbol"),e=t("toStringTag"),u="Arguments"==r(function(){return arguments}()),i=function(n,r){try{return n[r]}catch(t){}};module.exports=n?r:function(n){var t,o,l;return void 0===n?"Undefined":null===n?"Null":"string"==typeof(o=i(t=Object(n),e))?o:u?r(t):"Object"==(l=r(t))&&"function"==typeof t.callee?"Arguments":l};
},{"../internals/to-string-tag-support":"PN7D","../internals/classof-raw":"jUdy","../internals/well-known-symbol":"Q0EA"}],"VM64":[function(require,module,exports) {
var r=require("../internals/classof"),e=require("../internals/iterators"),n=require("../internals/well-known-symbol"),t=n("iterator");module.exports=function(n){if(null!=n)return n[t]||n["@@iterator"]||e[r(n)]};
},{"../internals/classof":"rs2T","../internals/iterators":"Ln6o","../internals/well-known-symbol":"Q0EA"}],"mMyD":[function(require,module,exports) {
var r=require("../internals/an-object");module.exports=function(e){var n=e.return;if(void 0!==n)return r(n.call(e)).value};
},{"../internals/an-object":"eAPg"}],"Oj1G":[function(require,module,exports) {
var e=require("../internals/an-object"),t=require("../internals/is-array-iterator-method"),r=require("../internals/to-length"),n=require("../internals/function-bind-context"),i=require("../internals/get-iterator-method"),o=require("../internals/iterator-close"),a=function(e,t){this.stopped=e,this.result=t};module.exports=function(u,l,f){var s,c,h,T,d,p,q,E=f&&f.that,w=!(!f||!f.AS_ENTRIES),y=!(!f||!f.IS_ITERATOR),R=!(!f||!f.INTERRUPTED),b=n(l,E,1+w+R),g=function(e){return s&&o(s),new a(!0,e)},I=function(t){return w?(e(t),R?b(t[0],t[1],g):b(t[0],t[1])):R?b(t,g):b(t)};if(y)s=u;else{if("function"!=typeof(c=i(u)))throw TypeError("Target is not iterable");if(t(c)){for(h=0,T=r(u.length);T>h;h++)if((d=I(u[h]))&&d instanceof a)return d;return new a(!1)}s=c.call(u)}for(p=s.next;!(q=p.call(s)).done;){try{d=I(q.value)}catch(m){throw o(s),m}if("object"==typeof d&&d&&d instanceof a)return d}return new a(!1)};
},{"../internals/an-object":"eAPg","../internals/is-array-iterator-method":"XTOV","../internals/to-length":"j9AG","../internals/function-bind-context":"dEmF","../internals/get-iterator-method":"VM64","../internals/iterator-close":"mMyD"}],"Simp":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/object-get-prototype-of"),t=require("../internals/object-set-prototype-of"),o=require("../internals/object-create"),n=require("../internals/create-non-enumerable-property"),i=require("../internals/create-property-descriptor"),a=require("../internals/iterate"),s=function(r,o){var i=this;if(!(i instanceof s))return new s(r,o);t&&(i=t(new Error(void 0),e(i))),void 0!==o&&n(i,"message",String(o));var p=[];return a(r,p.push,{that:p}),n(i,"errors",p),i};s.prototype=o(Error.prototype,{constructor:i(5,s),message:i(5,""),name:i(5,"AggregateError")}),r({global:!0},{AggregateError:s});
},{"../internals/export":"rhEq","../internals/object-get-prototype-of":"xeyN","../internals/object-set-prototype-of":"eDCX","../internals/object-create":"zWsZ","../internals/create-non-enumerable-property":"GwPZ","../internals/create-property-descriptor":"oNyT","../internals/iterate":"Oj1G"}],"DQY6":[function(require,module,exports) {
var r=require("../internals/an-object"),e=require("../internals/iterator-close");module.exports=function(t,n,o,a){try{return a?n(r(o)[0],o[1]):n(o)}catch(i){throw e(t),i}};
},{"../internals/an-object":"eAPg","../internals/iterator-close":"mMyD"}],"qU9w":[function(require,module,exports) {
"use strict";var e=require("../internals/to-primitive"),r=require("../internals/object-define-property"),i=require("../internals/create-property-descriptor");module.exports=function(t,n,o){var p=e(n);p in t?r.f(t,p,i(0,o)):t[p]=o};
},{"../internals/to-primitive":"wZyz","../internals/object-define-property":"AtXZ","../internals/create-property-descriptor":"oNyT"}],"ITnL":[function(require,module,exports) {
"use strict";var e=require("../internals/function-bind-context"),r=require("../internals/to-object"),t=require("../internals/call-with-safe-iteration-closing"),n=require("../internals/is-array-iterator-method"),i=require("../internals/to-length"),l=require("../internals/create-property"),a=require("../internals/get-iterator-method");module.exports=function(o){var s,u,c,h,d,f,q=r(o),v="function"==typeof this?this:Array,g=arguments.length,y=g>1?arguments[1]:void 0,p=void 0!==y,m=a(q),w=0;if(p&&(y=e(y,g>2?arguments[2]:void 0,2)),null==m||v==Array&&n(m))for(u=new v(s=i(q.length));s>w;w++)f=p?y(q[w],w):q[w],l(u,w,f);else for(d=(h=m.call(q)).next,u=new v;!(c=d.call(h)).done;w++)f=p?t(h,y,[c.value,w],!0):c.value,l(u,w,f);return u.length=w,u};
},{"../internals/function-bind-context":"dEmF","../internals/to-object":"Q9KC","../internals/call-with-safe-iteration-closing":"DQY6","../internals/is-array-iterator-method":"XTOV","../internals/to-length":"j9AG","../internals/create-property":"qU9w","../internals/get-iterator-method":"VM64"}],"XOlJ":[function(require,module,exports) {
var r=require("../internals/well-known-symbol"),n=r("iterator"),t=!1;try{var e=0,o={next:function(){return{done:!!e++}},return:function(){t=!0}};o[n]=function(){return this},Array.from(o,function(){throw 2})}catch(u){}module.exports=function(r,e){if(!e&&!t)return!1;var o=!1;try{var i={};i[n]=function(){return{next:function(){return{done:o=!0}}}},r(i)}catch(u){}return o};
},{"../internals/well-known-symbol":"Q0EA"}],"Tzrg":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/array-from"),t=require("../internals/check-correctness-of-iteration"),a=!t(function(r){Array.from(r)});r({target:"Array",stat:!0,forced:a},{from:e});
},{"../internals/export":"rhEq","../internals/array-from":"ITnL","../internals/check-correctness-of-iteration":"XOlJ"}],"hjCR":[function(require,module,exports) {
var r=require("../internals/export"),a=require("../internals/is-array");r({target:"Array",stat:!0},{isArray:a});
},{"../internals/export":"rhEq","../internals/is-array":"oqXF"}],"nKOp":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/fails"),e=require("../internals/create-property"),n=t(function(){function r(){}return!(Array.of.call(r)instanceof r)});r({target:"Array",stat:!0,forced:n},{of:function(){for(var r=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>r;)e(n,r,arguments[r++]);return n.length=t,n}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/create-property":"qU9w"}],"A5g0":[function(require,module,exports) {
var n=require("../internals/fails"),e=require("../internals/well-known-symbol"),r=require("../internals/engine-v8-version"),o=e("species");module.exports=function(e){return r>=51||!n(function(){var n=[];return(n.constructor={})[o]=function(){return{foo:1}},1!==n[e](Boolean).foo})};
},{"../internals/fails":"pWu7","../internals/well-known-symbol":"Q0EA","../internals/engine-v8-version":"mpuz"}],"nHCj":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/fails"),n=require("../internals/is-array"),t=require("../internals/is-object"),i=require("../internals/to-object"),a=require("../internals/to-length"),o=require("../internals/create-property"),s=require("../internals/array-species-create"),l=require("../internals/array-method-has-species-support"),u=require("../internals/well-known-symbol"),c=require("../internals/engine-v8-version"),f=u("isConcatSpreadable"),p=9007199254740991,q="Maximum allowed index exceeded",h=c>=51||!e(function(){var r=[];return r[f]=!1,r.concat()[0]!==r}),d=l("concat"),y=function(r){if(!t(r))return!1;var e=r[f];return void 0!==e?!!e:n(r)},v=!h||!d;r({target:"Array",proto:!0,forced:v},{concat:function(r){var e,n,t,l,u,c=i(this),f=s(c,0),h=0;for(e=-1,t=arguments.length;e<t;e++)if(u=-1===e?c:arguments[e],y(u)){if(h+(l=a(u.length))>p)throw TypeError(q);for(n=0;n<l;n++,h++)n in u&&o(f,h,u[n])}else{if(h>=p)throw TypeError(q);o(f,h++,u)}return f.length=h,f}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/is-array":"oqXF","../internals/is-object":"AsqF","../internals/to-object":"Q9KC","../internals/to-length":"j9AG","../internals/create-property":"qU9w","../internals/array-species-create":"e6WL","../internals/array-method-has-species-support":"A5g0","../internals/well-known-symbol":"Q0EA","../internals/engine-v8-version":"mpuz"}],"A81S":[function(require,module,exports) {
"use strict";var e=require("../internals/to-object"),t=require("../internals/to-absolute-index"),i=require("../internals/to-length"),n=Math.min;module.exports=[].copyWithin||function(r,o){var l=e(this),s=i(l.length),u=t(r,s),a=t(o,s),h=arguments.length>2?arguments[2]:void 0,d=n((void 0===h?s:t(h,s))-a,s-u),c=1;for(a<u&&u<a+d&&(c=-1,a+=d-1,u+=d-1);d-- >0;)a in l?l[u]=l[a]:delete l[u],u+=c,a+=c;return l};
},{"../internals/to-object":"Q9KC","../internals/to-absolute-index":"QLhU","../internals/to-length":"j9AG"}],"Tevp":[function(require,module,exports) {
var e=require("../internals/well-known-symbol"),r=require("../internals/object-create"),n=require("../internals/object-define-property"),l=e("unscopables"),o=Array.prototype;null==o[l]&&n.f(o,l,{configurable:!0,value:r(null)}),module.exports=function(e){o[l][e]=!0};
},{"../internals/well-known-symbol":"Q0EA","../internals/object-create":"zWsZ","../internals/object-define-property":"AtXZ"}],"knYQ":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/array-copy-within"),i=require("../internals/add-to-unscopables");r({target:"Array",proto:!0},{copyWithin:e}),i("copyWithin");
},{"../internals/export":"rhEq","../internals/array-copy-within":"A81S","../internals/add-to-unscopables":"Tevp"}],"Y60H":[function(require,module,exports) {
"use strict";var n=require("../internals/fails");module.exports=function(r,t){var u=[][r];return!!u&&n(function(){u.call(null,t||function(){throw 1},1)})};
},{"../internals/fails":"pWu7"}],"YjOc":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/array-iteration").every,t=require("../internals/array-method-is-strict"),i=t("every");r({target:"Array",proto:!0,forced:!i},{every:function(r){return e(this,r,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/array-iteration":"EUh8","../internals/array-method-is-strict":"Y60H"}],"Vois":[function(require,module,exports) {
"use strict";var e=require("../internals/to-object"),t=require("../internals/to-absolute-index"),r=require("../internals/to-length");module.exports=function(i){for(var n=e(this),o=r(n.length),l=arguments.length,s=t(l>1?arguments[1]:void 0,o),u=l>2?arguments[2]:void 0,a=void 0===u?o:t(u,o);a>s;)n[s++]=i;return n};
},{"../internals/to-object":"Q9KC","../internals/to-absolute-index":"QLhU","../internals/to-length":"j9AG"}],"wrzr":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/array-fill"),a=require("../internals/add-to-unscopables");r({target:"Array",proto:!0},{fill:e}),a("fill");
},{"../internals/export":"rhEq","../internals/array-fill":"Vois","../internals/add-to-unscopables":"Tevp"}],"OImK":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/array-iteration").filter,t=require("../internals/array-method-has-species-support"),i=t("filter");r({target:"Array",proto:!0,forced:!i},{filter:function(r){return e(this,r,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/array-iteration":"EUh8","../internals/array-method-has-species-support":"A5g0"}],"aGSB":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),n=require("../internals/array-iteration").find,e=require("../internals/add-to-unscopables"),i="find",t=!0;i in[]&&Array(1)[i](function(){t=!1}),r({target:"Array",proto:!0,forced:t},{find:function(r){return n(this,r,arguments.length>1?arguments[1]:void 0)}}),e(i);
},{"../internals/export":"rhEq","../internals/array-iteration":"EUh8","../internals/add-to-unscopables":"Tevp"}],"BKbk":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),n=require("../internals/array-iteration").findIndex,e=require("../internals/add-to-unscopables"),i="findIndex",t=!0;i in[]&&Array(1)[i](function(){t=!1}),r({target:"Array",proto:!0,forced:t},{findIndex:function(r){return n(this,r,arguments.length>1?arguments[1]:void 0)}}),e(i);
},{"../internals/export":"rhEq","../internals/array-iteration":"EUh8","../internals/add-to-unscopables":"Tevp"}],"Ygpf":[function(require,module,exports) {
"use strict";var e=require("../internals/is-array"),r=require("../internals/to-length"),t=require("../internals/function-bind-context"),n=function(i,a,l,o,s,u,c,f){for(var h,d=s,g=0,p=!!c&&t(c,f,3);g<o;){if(g in l){if(h=p?p(l[g],g,a):l[g],u>0&&e(h))d=n(i,a,h,r(h.length),d,u-1)-1;else{if(d>=9007199254740991)throw TypeError("Exceed the acceptable array length");i[d]=h}d++}g++}return d};module.exports=n;
},{"../internals/is-array":"oqXF","../internals/to-length":"j9AG","../internals/function-bind-context":"dEmF"}],"PATC":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/flatten-into-array"),t=require("../internals/to-object"),n=require("../internals/to-length"),i=require("../internals/to-integer"),a=require("../internals/array-species-create");e({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,l=t(this),o=n(l.length),s=a(l,0);return s.length=r(s,l,l,o,0,void 0===e?1:i(e)),s}});
},{"../internals/export":"rhEq","../internals/flatten-into-array":"Ygpf","../internals/to-object":"Q9KC","../internals/to-length":"j9AG","../internals/to-integer":"GwUC","../internals/array-species-create":"e6WL"}],"dPcl":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/flatten-into-array"),t=require("../internals/to-object"),n=require("../internals/to-length"),a=require("../internals/a-function"),i=require("../internals/array-species-create");r({target:"Array",proto:!0},{flatMap:function(r){var l,s=t(this),o=n(s.length);return a(r),(l=i(s,0)).length=e(l,s,s,o,0,1,r,arguments.length>1?arguments[1]:void 0),l}});
},{"../internals/export":"rhEq","../internals/flatten-into-array":"Ygpf","../internals/to-object":"Q9KC","../internals/to-length":"j9AG","../internals/a-function":"SOPX","../internals/array-species-create":"e6WL"}],"VXzW":[function(require,module,exports) {
"use strict";var r=require("../internals/array-iteration").forEach,t=require("../internals/array-method-is-strict"),e=t("forEach");module.exports=e?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)};
},{"../internals/array-iteration":"EUh8","../internals/array-method-is-strict":"Y60H"}],"n8x2":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/array-for-each");r({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e});
},{"../internals/export":"rhEq","../internals/array-for-each":"VXzW"}],"hJi2":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/array-includes").includes,n=require("../internals/add-to-unscopables");r({target:"Array",proto:!0},{includes:function(r){return e(this,r,arguments.length>1?arguments[1]:void 0)}}),n("includes");
},{"../internals/export":"rhEq","../internals/array-includes":"b2MC","../internals/add-to-unscopables":"Tevp"}],"L3SF":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/array-includes").indexOf,i=require("../internals/array-method-is-strict"),t=[].indexOf,n=!!t&&1/[1].indexOf(1,-0)<0,a=i("indexOf");r({target:"Array",proto:!0,forced:n||!a},{indexOf:function(r){return n?t.apply(this,arguments)||0:e(this,r,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/array-includes":"b2MC","../internals/array-method-is-strict":"Y60H"}],"HkIz":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/indexed-object"),t=require("../internals/to-indexed-object"),i=require("../internals/array-method-is-strict"),n=[].join,o=r!=Object,a=i("join",",");e({target:"Array",proto:!0,forced:o||!a},{join:function(e){return n.call(t(this),void 0===e?",":e)}});
},{"../internals/export":"rhEq","../internals/indexed-object":"Nn1j","../internals/to-indexed-object":"ebRX","../internals/array-method-is-strict":"Y60H"}],"aZkb":[function(require,module,exports) {
"use strict";var e=require("../internals/to-indexed-object"),t=require("../internals/to-integer"),r=require("../internals/to-length"),n=require("../internals/array-method-is-strict"),i=Math.min,s=[].lastIndexOf,a=!!s&&1/[1].lastIndexOf(1,-0)<0,l=n("lastIndexOf"),u=a||!l;module.exports=u?function(n){if(a)return s.apply(this,arguments)||0;var l=e(this),u=r(l.length),o=u-1;for(arguments.length>1&&(o=i(o,t(arguments[1]))),o<0&&(o=u+o);o>=0;o--)if(o in l&&l[o]===n)return o||0;return-1}:s;
},{"../internals/to-indexed-object":"ebRX","../internals/to-integer":"GwUC","../internals/to-length":"j9AG","../internals/array-method-is-strict":"Y60H"}],"YJwX":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/array-last-index-of");r({target:"Array",proto:!0,forced:e!==[].lastIndexOf},{lastIndexOf:e});
},{"../internals/export":"rhEq","../internals/array-last-index-of":"aZkb"}],"XwPX":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/array-iteration").map,t=require("../internals/array-method-has-species-support"),a=t("map");r({target:"Array",proto:!0,forced:!a},{map:function(r){return e(this,r,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/array-iteration":"EUh8","../internals/array-method-has-species-support":"A5g0"}],"SMmH":[function(require,module,exports) {
var e=require("../internals/a-function"),r=require("../internals/to-object"),n=require("../internals/indexed-object"),i=require("../internals/to-length"),t=function(t){return function(o,a,u,f){e(a);var l=r(o),c=n(l),h=i(l.length),s=t?h-1:0,d=t?-1:1;if(u<2)for(;;){if(s in c){f=c[s],s+=d;break}if(s+=d,t?s<0:h<=s)throw TypeError("Reduce of empty array with no initial value")}for(;t?s>=0:h>s;s+=d)s in c&&(f=a(f,c[s],s,l));return f}};module.exports={left:t(!1),right:t(!0)};
},{"../internals/a-function":"SOPX","../internals/to-object":"Q9KC","../internals/indexed-object":"Nn1j","../internals/to-length":"j9AG"}],"MGOS":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/array-reduce").left,n=require("../internals/array-method-is-strict"),i=require("../internals/engine-v8-version"),t=require("../internals/engine-is-node"),a=n("reduce"),s=!t&&i>79&&i<83;e({target:"Array",proto:!0,forced:!a||s},{reduce:function(e){return r(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/array-reduce":"SMmH","../internals/array-method-is-strict":"Y60H","../internals/engine-v8-version":"mpuz","../internals/engine-is-node":"dxME"}],"qThj":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/array-reduce").right,i=require("../internals/array-method-is-strict"),t=require("../internals/engine-v8-version"),n=require("../internals/engine-is-node"),a=i("reduceRight"),s=!n&&t>79&&t<83;e({target:"Array",proto:!0,forced:!a||s},{reduceRight:function(e){return r(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/array-reduce":"SMmH","../internals/array-method-is-strict":"Y60H","../internals/engine-v8-version":"mpuz","../internals/engine-is-node":"dxME"}],"ZdoE":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/is-array"),t=[].reverse,i=[1,2];r({target:"Array",proto:!0,forced:String(i)===String(i.reverse())},{reverse:function(){return e(this)&&(this.length=this.length),t.call(this)}});
},{"../internals/export":"rhEq","../internals/is-array":"oqXF"}],"I5XU":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/is-object"),t=require("../internals/is-array"),i=require("../internals/to-absolute-index"),n=require("../internals/to-length"),o=require("../internals/to-indexed-object"),a=require("../internals/create-property"),s=require("../internals/well-known-symbol"),l=require("../internals/array-method-has-species-support"),u=l("slice"),c=s("species"),p=[].slice,d=Math.max;r({target:"Array",proto:!0,forced:!u},{slice:function(r,s){var l,u,y,q=o(this),h=n(q.length),v=i(r,h),f=i(void 0===s?h:s,h);if(t(q)&&("function"!=typeof(l=q.constructor)||l!==Array&&!t(l.prototype)?e(l)&&null===(l=l[c])&&(l=void 0):l=void 0,l===Array||void 0===l))return p.call(q,v,f);for(u=new(void 0===l?Array:l)(d(f-v,0)),y=0;v<f;v++,y++)v in q&&a(u,y,q[v]);return u.length=y,u}});
},{"../internals/export":"rhEq","../internals/is-object":"AsqF","../internals/is-array":"oqXF","../internals/to-absolute-index":"QLhU","../internals/to-length":"j9AG","../internals/to-indexed-object":"ebRX","../internals/create-property":"qU9w","../internals/well-known-symbol":"Q0EA","../internals/array-method-has-species-support":"A5g0"}],"HTrq":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/array-iteration").some,t=require("../internals/array-method-is-strict"),i=t("some");r({target:"Array",proto:!0,forced:!i},{some:function(r){return e(this,r,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/array-iteration":"EUh8","../internals/array-method-is-strict":"Y60H"}],"sDKH":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/a-function"),e=require("../internals/to-object"),i=require("../internals/fails"),n=require("../internals/array-method-is-strict"),o=[],s=o.sort,a=i(function(){o.sort(void 0)}),l=i(function(){o.sort(null)}),u=n("sort"),c=a||!l||!u;r({target:"Array",proto:!0,forced:c},{sort:function(r){return void 0===r?s.call(e(this)):s.call(e(this),t(r))}});
},{"../internals/export":"rhEq","../internals/a-function":"SOPX","../internals/to-object":"Q9KC","../internals/fails":"pWu7","../internals/array-method-is-strict":"Y60H"}],"AZfT":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/to-absolute-index"),t=require("../internals/to-integer"),i=require("../internals/to-length"),n=require("../internals/to-object"),a=require("../internals/array-species-create"),l=require("../internals/create-property"),o=require("../internals/array-method-has-species-support"),s=o("splice"),u=Math.max,h=Math.min,c=9007199254740991,p="Maximum allowed length exceeded";e({target:"Array",proto:!0,forced:!s},{splice:function(e,o){var s,f,d,g,q,m,x=n(this),y=i(x.length),M=r(e,y),b=arguments.length;if(0===b?s=f=0:1===b?(s=0,f=y-M):(s=b-2,f=h(u(t(o),0),y-M)),y+s-f>c)throw TypeError(p);for(d=a(x,f),g=0;g<f;g++)(q=M+g)in x&&l(d,g,x[q]);if(d.length=f,s<f){for(g=M;g<y-f;g++)m=g+s,(q=g+f)in x?x[m]=x[q]:delete x[m];for(g=y;g>y-f+s;g--)delete x[g-1]}else if(s>f)for(g=y-f;g>M;g--)m=g+s-1,(q=g+f-1)in x?x[m]=x[q]:delete x[m];for(g=0;g<s;g++)x[g+M]=arguments[g+2];return x.length=y-f+s,d}});
},{"../internals/export":"rhEq","../internals/to-absolute-index":"QLhU","../internals/to-integer":"GwUC","../internals/to-length":"j9AG","../internals/to-object":"Q9KC","../internals/array-species-create":"e6WL","../internals/create-property":"qU9w","../internals/array-method-has-species-support":"A5g0"}],"bDBP":[function(require,module,exports) {
"use strict";var e=require("../internals/get-built-in"),r=require("../internals/object-define-property"),i=require("../internals/well-known-symbol"),n=require("../internals/descriptors"),t=i("species");module.exports=function(i){var s=e(i),u=r.f;n&&s&&!s[t]&&u(s,t,{configurable:!0,get:function(){return this}})};
},{"../internals/get-built-in":"mLk8","../internals/object-define-property":"AtXZ","../internals/well-known-symbol":"Q0EA","../internals/descriptors":"A8Ob"}],"GKV3":[function(require,module,exports) {
var e=require("../internals/set-species");e("Array");
},{"../internals/set-species":"bDBP"}],"bFKh":[function(require,module,exports) {
var a=require("../internals/add-to-unscopables");a("flat");
},{"../internals/add-to-unscopables":"Tevp"}],"AKUe":[function(require,module,exports) {
var a=require("../internals/add-to-unscopables");a("flatMap");
},{"../internals/add-to-unscopables":"Tevp"}],"Fgxq":[function(require,module,exports) {
"use strict";var e,r,t,n=require("../internals/fails"),i=require("../internals/object-get-prototype-of"),o=require("../internals/create-non-enumerable-property"),a=require("../internals/has"),l=require("../internals/well-known-symbol"),s=require("../internals/is-pure"),u=l("iterator"),p=!1,c=function(){return this};[].keys&&("next"in(t=[].keys())?(r=i(i(t)))!==Object.prototype&&(e=r):p=!0);var y=null==e||n(function(){var r={};return e[u].call(r)!==r});y&&(e={}),s&&!y||a(e,u)||o(e,u,c),module.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:p};
},{"../internals/fails":"pWu7","../internals/object-get-prototype-of":"xeyN","../internals/create-non-enumerable-property":"GwPZ","../internals/has":"jYdl","../internals/well-known-symbol":"Q0EA","../internals/is-pure":"tGwT"}],"v9Wl":[function(require,module,exports) {
"use strict";var r=require("../internals/iterators-core").IteratorPrototype,e=require("../internals/object-create"),t=require("../internals/create-property-descriptor"),i=require("../internals/set-to-string-tag"),n=require("../internals/iterators"),o=function(){return this};module.exports=function(a,s,u){var c=s+" Iterator";return a.prototype=e(r,{next:t(1,u)}),i(a,c,!1,!0),n[c]=o,a};
},{"../internals/iterators-core":"Fgxq","../internals/object-create":"zWsZ","../internals/create-property-descriptor":"oNyT","../internals/set-to-string-tag":"kLCt","../internals/iterators":"Ln6o"}],"CpaJ":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/create-iterator-constructor"),t=require("../internals/object-get-prototype-of"),n=require("../internals/object-set-prototype-of"),i=require("../internals/set-to-string-tag"),o=require("../internals/create-non-enumerable-property"),s=require("../internals/redefine"),a=require("../internals/well-known-symbol"),u=require("../internals/is-pure"),c=require("../internals/iterators"),l=require("../internals/iterators-core"),f=l.IteratorPrototype,p=l.BUGGY_SAFARI_ITERATORS,q=a("iterator"),y="keys",w="values",b="entries",h=function(){return this};module.exports=function(a,l,g,m,v,A,I){r(g,l,m);var d,j,k,x=function(e){if(e===v&&T)return T;if(!p&&e in O)return O[e];switch(e){case y:case w:case b:return function(){return new g(this,e)}}return function(){return new g(this)}},R=l+" Iterator",G=!1,O=a.prototype,S=O[q]||O["@@iterator"]||v&&O[v],T=!p&&S||x(v),_="Array"==l&&O.entries||S;if(_&&(d=t(_.call(new a)),f!==Object.prototype&&d.next&&(u||t(d)===f||(n?n(d,f):"function"!=typeof d[q]&&o(d,q,h)),i(d,R,!0,!0),u&&(c[R]=h))),v==w&&S&&S.name!==w&&(G=!0,T=function(){return S.call(this)}),u&&!I||O[q]===T||o(O,q,T),c[l]=T,v)if(j={values:x(w),keys:A?T:x(y),entries:x(b)},I)for(k in j)!p&&!G&&k in O||s(O,k,j[k]);else e({target:l,proto:!0,forced:p||G},j);return j};
},{"../internals/export":"rhEq","../internals/create-iterator-constructor":"v9Wl","../internals/object-get-prototype-of":"xeyN","../internals/object-set-prototype-of":"eDCX","../internals/set-to-string-tag":"kLCt","../internals/create-non-enumerable-property":"GwPZ","../internals/redefine":"ztZs","../internals/well-known-symbol":"Q0EA","../internals/is-pure":"tGwT","../internals/iterators":"Ln6o","../internals/iterators-core":"Fgxq"}],"S91k":[function(require,module,exports) {
"use strict";var e=require("../internals/to-indexed-object"),r=require("../internals/add-to-unscopables"),t=require("../internals/iterators"),n=require("../internals/internal-state"),a=require("../internals/define-iterator"),i="Array Iterator",s=n.set,u=n.getterFor(i);module.exports=a(Array,"Array",function(r,t){s(this,{type:i,target:e(r),index:0,kind:t})},function(){var e=u(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==t?{value:n,done:!1}:"values"==t?{value:r[n],done:!1}:{value:[n,r[n]],done:!1}},"values"),t.Arguments=t.Array,r("keys"),r("values"),r("entries");
},{"../internals/to-indexed-object":"ebRX","../internals/add-to-unscopables":"Tevp","../internals/iterators":"Ln6o","../internals/internal-state":"vLSK","../internals/define-iterator":"CpaJ"}],"evUJ":[function(require,module,exports) {
"use strict";var n=require("../internals/a-function"),t=require("../internals/is-object"),r=[].slice,e={},i=function(n,t,r){if(!(t in e)){for(var i=[],o=0;o<t;o++)i[o]="a["+o+"]";e[t]=Function("C,a","return new C("+i.join(",")+")")}return e[t](n,r)};module.exports=Function.bind||function(e){var o=n(this),a=r.call(arguments,1),c=function(){var n=a.concat(r.call(arguments));return this instanceof c?i(o,n.length,n):o.apply(e,n)};return t(o.prototype)&&(c.prototype=o.prototype),c};
},{"../internals/a-function":"SOPX","../internals/is-object":"AsqF"}],"rLkX":[function(require,module,exports) {
var n=require("../internals/export"),r=require("../internals/function-bind");n({target:"Function",proto:!0},{bind:r});
},{"../internals/export":"rhEq","../internals/function-bind":"evUJ"}],"kzOy":[function(require,module,exports) {
var r=require("../internals/descriptors"),t=require("../internals/object-define-property").f,e=Function.prototype,n=e.toString,i=/^\s*function ([^ (]*)/,c="name";!r||c in e||t(e,c,{configurable:!0,get:function(){try{return n.call(this).match(i)[1]}catch(r){return""}}});
},{"../internals/descriptors":"A8Ob","../internals/object-define-property":"AtXZ"}],"xOWp":[function(require,module,exports) {
"use strict";var e=require("../internals/is-object"),t=require("../internals/object-define-property"),r=require("../internals/object-get-prototype-of"),n=require("../internals/well-known-symbol"),i=n("hasInstance"),o=Function.prototype;i in o||t.f(o,i,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=r(t);)if(this.prototype===t)return!0;return!1}});
},{"../internals/is-object":"AsqF","../internals/object-define-property":"AtXZ","../internals/object-get-prototype-of":"xeyN","../internals/well-known-symbol":"Q0EA"}],"Sw1f":[function(require,module,exports) {

var l=require("../internals/export"),r=require("../internals/global");l({global:!0},{globalThis:r});
},{"../internals/export":"rhEq","../internals/global":"MVLi"}],"aWUw":[function(require,module,exports) {
"use strict";var e=require("../internals/descriptors"),r=require("../internals/fails"),n=require("../internals/object-keys"),t=require("../internals/object-get-own-property-symbols"),i=require("../internals/object-property-is-enumerable"),o=require("../internals/to-object"),a=require("../internals/indexed-object"),s=Object.assign,l=Object.defineProperty;module.exports=!s||r(function(){if(e&&1!==s({b:1},s(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var r={},t={},i=Symbol();return r[i]=7,"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),7!=s({},r)[i]||"abcdefghijklmnopqrst"!=n(s({},t)).join("")})?function(r,s){for(var l=o(r),u=arguments.length,c=1,b=t.f,f=i.f;u>c;)for(var j,p=a(arguments[c++]),q=b?n(p).concat(b(p)):n(p),m=q.length,d=0;m>d;)j=q[d++],e&&!f.call(p,j)||(l[j]=p[j]);return l}:s;
},{"../internals/descriptors":"A8Ob","../internals/fails":"pWu7","../internals/object-keys":"rmL3","../internals/object-get-own-property-symbols":"uqTD","../internals/object-property-is-enumerable":"sC3y","../internals/to-object":"Q9KC","../internals/indexed-object":"Nn1j"}],"d93j":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/object-assign");e({target:"Object",stat:!0,forced:Object.assign!==r},{assign:r});
},{"../internals/export":"rhEq","../internals/object-assign":"aWUw"}],"pv5m":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/object-create");e({target:"Object",stat:!0,sham:!r},{create:t});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/object-create":"zWsZ"}],"XOQw":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/object-define-property");e({target:"Object",stat:!0,forced:!r,sham:!r},{defineProperty:t.f});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/object-define-property":"AtXZ"}],"ddJ4":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/object-define-properties");e({target:"Object",stat:!0,forced:!r,sham:!r},{defineProperties:t});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/object-define-properties":"ZdKd"}],"v9Vj":[function(require,module,exports) {
var e=require("../internals/descriptors"),r=require("../internals/object-keys"),n=require("../internals/to-indexed-object"),t=require("../internals/object-property-is-enumerable").f,i=function(i){return function(s){for(var u,o=n(s),l=r(o),a=l.length,c=0,p=[];a>c;)u=l[c++],e&&!t.call(o,u)||p.push(i?[u,o[u]]:o[u]);return p}};module.exports={entries:i(!0),values:i(!1)};
},{"../internals/descriptors":"A8Ob","../internals/object-keys":"rmL3","../internals/to-indexed-object":"ebRX","../internals/object-property-is-enumerable":"sC3y"}],"KgVf":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/object-to-array").entries;e({target:"Object",stat:!0},{entries:function(e){return r(e)}});
},{"../internals/export":"rhEq","../internals/object-to-array":"v9Vj"}],"ZrZO":[function(require,module,exports) {
var e=require("../internals/fails");module.exports=!e(function(){return Object.isExtensible(Object.preventExtensions({}))});
},{"../internals/fails":"pWu7"}],"Cjms":[function(require,module,exports) {
var e=require("../internals/hidden-keys"),r=require("../internals/is-object"),n=require("../internals/has"),t=require("../internals/object-define-property").f,i=require("../internals/uid"),u=require("../internals/freezing"),a=i("meta"),f=0,o=Object.isExtensible||function(){return!0},s=function(e){t(e,a,{value:{objectID:"O"+ ++f,weakData:{}}})},c=function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!n(e,a)){if(!o(e))return"F";if(!t)return"E";s(e)}return e[a].objectID},l=function(e,r){if(!n(e,a)){if(!o(e))return!0;if(!r)return!1;s(e)}return e[a].weakData},b=function(e){return u&&D.REQUIRED&&o(e)&&!n(e,a)&&s(e),e},D=module.exports={REQUIRED:!1,fastKey:c,getWeakData:l,onFreeze:b};e[a]=!0;
},{"../internals/hidden-keys":"Ln6o","../internals/is-object":"AsqF","../internals/has":"jYdl","../internals/object-define-property":"AtXZ","../internals/uid":"bxyG","../internals/freezing":"ZrZO"}],"LUIK":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/freezing"),n=require("../internals/fails"),t=require("../internals/is-object"),i=require("../internals/internal-metadata").onFreeze,a=Object.freeze,s=n(function(){a(1)});e({target:"Object",stat:!0,forced:s,sham:!r},{freeze:function(e){return a&&t(e)?a(i(e)):e}});
},{"../internals/export":"rhEq","../internals/freezing":"ZrZO","../internals/fails":"pWu7","../internals/is-object":"AsqF","../internals/internal-metadata":"Cjms"}],"UciR":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/iterate"),t=require("../internals/create-property");r({target:"Object",stat:!0},{fromEntries:function(r){var n={};return e(r,function(r,e){t(n,r,e)},{AS_ENTRIES:!0}),n}});
},{"../internals/export":"rhEq","../internals/iterate":"Oj1G","../internals/create-property":"qU9w"}],"WFGt":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/fails"),t=require("../internals/to-indexed-object"),n=require("../internals/object-get-own-property-descriptor").f,i=require("../internals/descriptors"),o=r(function(){n(1)}),s=!i||o;e({target:"Object",stat:!0,forced:s,sham:!i},{getOwnPropertyDescriptor:function(e,r){return n(t(e),r)}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/to-indexed-object":"ebRX","../internals/object-get-own-property-descriptor":"zm15","../internals/descriptors":"A8Ob"}],"aLxV":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/own-keys"),n=require("../internals/to-indexed-object"),i=require("../internals/object-get-own-property-descriptor"),o=require("../internals/create-property");e({target:"Object",stat:!0,sham:!r},{getOwnPropertyDescriptors:function(e){for(var r,s,a=n(e),p=i.f,c=t(a),u={},l=0;c.length>l;)void 0!==(s=p(a,r=c[l++]))&&o(u,r,s);return u}});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/own-keys":"uZDC","../internals/to-indexed-object":"ebRX","../internals/object-get-own-property-descriptor":"zm15","../internals/create-property":"qU9w"}],"LvRP":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/fails"),t=require("../internals/object-get-own-property-names-external").f,n=r(function(){return!Object.getOwnPropertyNames(1)});e({target:"Object",stat:!0,forced:n},{getOwnPropertyNames:t});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/object-get-own-property-names-external":"BNtO"}],"jz0x":[function(require,module,exports) {
var e=require("../internals/export"),t=require("../internals/fails"),r=require("../internals/to-object"),n=require("../internals/object-get-prototype-of"),o=require("../internals/correct-prototype-getter"),i=t(function(){n(1)});e({target:"Object",stat:!0,forced:i,sham:!o},{getPrototypeOf:function(e){return n(r(e))}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/to-object":"Q9KC","../internals/object-get-prototype-of":"xeyN","../internals/correct-prototype-getter":"x9wq"}],"bfhi":[function(require,module,exports) {
module.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};
},{}],"uxHM":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/same-value");e({target:"Object",stat:!0},{is:r});
},{"../internals/export":"rhEq","../internals/same-value":"bfhi"}],"jX7X":[function(require,module,exports) {
var e=require("../internals/export"),t=require("../internals/fails"),r=require("../internals/is-object"),i=Object.isExtensible,n=t(function(){i(1)});e({target:"Object",stat:!0,forced:n},{isExtensible:function(e){return!!r(e)&&(!i||i(e))}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/is-object":"AsqF"}],"kdOB":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/fails"),t=require("../internals/is-object"),n=Object.isFrozen,i=r(function(){n(1)});e({target:"Object",stat:!0,forced:i},{isFrozen:function(e){return!t(e)||!!n&&n(e)}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/is-object":"AsqF"}],"gpJf":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/fails"),t=require("../internals/is-object"),i=Object.isSealed,n=r(function(){i(1)});e({target:"Object",stat:!0,forced:n},{isSealed:function(e){return!t(e)||!!i&&i(e)}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/is-object":"AsqF"}],"Y3qw":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/to-object"),t=require("../internals/object-keys"),n=require("../internals/fails"),i=n(function(){t(1)});e({target:"Object",stat:!0,forced:i},{keys:function(e){return t(r(e))}});
},{"../internals/export":"rhEq","../internals/to-object":"Q9KC","../internals/object-keys":"rmL3","../internals/fails":"pWu7"}],"WvM7":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/is-object"),n=require("../internals/internal-metadata").onFreeze,t=require("../internals/freezing"),i=require("../internals/fails"),a=Object.preventExtensions,s=i(function(){a(1)});e({target:"Object",stat:!0,forced:s,sham:!t},{preventExtensions:function(e){return a&&r(e)?a(n(e)):e}});
},{"../internals/export":"rhEq","../internals/is-object":"AsqF","../internals/internal-metadata":"Cjms","../internals/freezing":"ZrZO","../internals/fails":"pWu7"}],"bZLD":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/is-object"),n=require("../internals/internal-metadata").onFreeze,t=require("../internals/freezing"),a=require("../internals/fails"),i=Object.seal,s=a(function(){i(1)});e({target:"Object",stat:!0,forced:s,sham:!t},{seal:function(e){return i&&r(e)?i(n(e)):e}});
},{"../internals/export":"rhEq","../internals/is-object":"AsqF","../internals/internal-metadata":"Cjms","../internals/freezing":"ZrZO","../internals/fails":"pWu7"}],"Cykw":[function(require,module,exports) {
var t=require("../internals/export"),e=require("../internals/object-set-prototype-of");t({target:"Object",stat:!0},{setPrototypeOf:e});
},{"../internals/export":"rhEq","../internals/object-set-prototype-of":"eDCX"}],"HUM5":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/object-to-array").values;e({target:"Object",stat:!0},{values:function(e){return r(e)}});
},{"../internals/export":"rhEq","../internals/object-to-array":"v9Vj"}],"oSqY":[function(require,module,exports) {
"use strict";var t=require("../internals/to-string-tag-support"),r=require("../internals/classof");module.exports=t?{}.toString:function(){return"[object "+r(this)+"]"};
},{"../internals/to-string-tag-support":"PN7D","../internals/classof":"rs2T"}],"ecHe":[function(require,module,exports) {
var e=require("../internals/to-string-tag-support"),r=require("../internals/redefine"),t=require("../internals/object-to-string");e||r(Object.prototype,"toString",t,{unsafe:!0});
},{"../internals/to-string-tag-support":"PN7D","../internals/redefine":"ztZs","../internals/object-to-string":"oSqY"}],"S61D":[function(require,module,exports) {

"use strict";var e=require("../internals/is-pure"),r=require("../internals/global"),n=require("../internals/fails");module.exports=e||!n(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete r[e]});
},{"../internals/is-pure":"tGwT","../internals/global":"MVLi","../internals/fails":"pWu7"}],"PTAU":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/object-prototype-accessors-forced"),i=require("../internals/to-object"),n=require("../internals/a-function"),o=require("../internals/object-define-property");r&&e({target:"Object",proto:!0,forced:t},{__defineGetter__:function(e,r){o.f(i(this),e,{get:n(r),enumerable:!0,configurable:!0})}});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/object-prototype-accessors-forced":"S61D","../internals/to-object":"Q9KC","../internals/a-function":"SOPX","../internals/object-define-property":"AtXZ"}],"PzdO":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/object-prototype-accessors-forced"),i=require("../internals/to-object"),n=require("../internals/a-function"),o=require("../internals/object-define-property");r&&e({target:"Object",proto:!0,forced:t},{__defineSetter__:function(e,r){o.f(i(this),e,{set:n(r),enumerable:!0,configurable:!0})}});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/object-prototype-accessors-forced":"S61D","../internals/to-object":"Q9KC","../internals/a-function":"SOPX","../internals/object-define-property":"AtXZ"}],"haYq":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/object-prototype-accessors-forced"),o=require("../internals/to-object"),i=require("../internals/to-primitive"),n=require("../internals/object-get-prototype-of"),s=require("../internals/object-get-own-property-descriptor").f;r&&e({target:"Object",proto:!0,forced:t},{__lookupGetter__:function(e){var r,t=o(this),c=i(e,!0);do{if(r=s(t,c))return r.get}while(t=n(t))}});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/object-prototype-accessors-forced":"S61D","../internals/to-object":"Q9KC","../internals/to-primitive":"wZyz","../internals/object-get-prototype-of":"xeyN","../internals/object-get-own-property-descriptor":"zm15"}],"vTXd":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/object-prototype-accessors-forced"),o=require("../internals/to-object"),i=require("../internals/to-primitive"),n=require("../internals/object-get-prototype-of"),s=require("../internals/object-get-own-property-descriptor").f;r&&e({target:"Object",proto:!0,forced:t},{__lookupSetter__:function(e){var r,t=o(this),c=i(e,!0);do{if(r=s(t,c))return r.set}while(t=n(t))}});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/object-prototype-accessors-forced":"S61D","../internals/to-object":"Q9KC","../internals/to-primitive":"wZyz","../internals/object-get-prototype-of":"xeyN","../internals/object-get-own-property-descriptor":"zm15"}],"VRfe":[function(require,module,exports) {
var r=require("../internals/export"),t=require("../internals/to-absolute-index"),o=String.fromCharCode,e=String.fromCodePoint,n=!!e&&1!=e.length;r({target:"String",stat:!0,forced:n},{fromCodePoint:function(r){for(var e,n=[],i=arguments.length,a=0;i>a;){if(e=+arguments[a++],t(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}});
},{"../internals/export":"rhEq","../internals/to-absolute-index":"QLhU"}],"qnyo":[function(require,module,exports) {
var r=require("../internals/export"),t=require("../internals/to-indexed-object"),e=require("../internals/to-length");r({target:"String",stat:!0},{raw:function(r){for(var n=t(r.raw),i=e(n.length),a=arguments.length,g=[],o=0;i>o;)g.push(String(n[o++])),o<a&&g.push(String(arguments[o]));return g.join("")}});
},{"../internals/export":"rhEq","../internals/to-indexed-object":"ebRX","../internals/to-length":"j9AG"}],"FQEJ":[function(require,module,exports) {
var e=require("../internals/to-integer"),r=require("../internals/require-object-coercible"),t=function(t){return function(n,i){var c,o,a=String(r(n)),u=e(i),l=a.length;return u<0||u>=l?t?"":void 0:(c=a.charCodeAt(u))<55296||c>56319||u+1===l||(o=a.charCodeAt(u+1))<56320||o>57343?t?a.charAt(u):c:t?a.slice(u,u+2):o-56320+(c-55296<<10)+65536}};module.exports={codeAt:t(!1),charAt:t(!0)};
},{"../internals/to-integer":"GwUC","../internals/require-object-coercible":"RWPB"}],"X12Q":[function(require,module,exports) {
"use strict";var t=require("../internals/export"),r=require("../internals/string-multibyte").codeAt;t({target:"String",proto:!0},{codePointAt:function(t){return r(this,t)}});
},{"../internals/export":"rhEq","../internals/string-multibyte":"FQEJ"}],"fTdC":[function(require,module,exports) {
var e=require("../internals/is-object"),r=require("../internals/classof-raw"),n=require("../internals/well-known-symbol"),i=n("match");module.exports=function(n){var a;return e(n)&&(void 0!==(a=n[i])?!!a:"RegExp"==r(n))};
},{"../internals/is-object":"AsqF","../internals/classof-raw":"jUdy","../internals/well-known-symbol":"Q0EA"}],"gIbS":[function(require,module,exports) {
var e=require("../internals/is-regexp");module.exports=function(r){if(e(r))throw TypeError("The method doesn't accept regular expressions");return r};
},{"../internals/is-regexp":"fTdC"}],"cTby":[function(require,module,exports) {
var r=require("../internals/well-known-symbol"),t=r("match");module.exports=function(r){var e=/./;try{"/./"[r](e)}catch(n){try{return e[t]=!1,"/./"[r](e)}catch(a){}}return!1};
},{"../internals/well-known-symbol":"Q0EA"}],"xRPP":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/object-get-own-property-descriptor").f,t=require("../internals/to-length"),i=require("../internals/not-a-regexp"),n=require("../internals/require-object-coercible"),o=require("../internals/correct-is-regexp-logic"),s=require("../internals/is-pure"),l="".endsWith,a=Math.min,c=o("endsWith"),u=!s&&!c&&!!function(){var e=r(String.prototype,"endsWith");return e&&!e.writable}();e({target:"String",proto:!0,forced:!u&&!c},{endsWith:function(e){var r=String(n(this));i(e);var o=arguments.length>1?arguments[1]:void 0,s=t(r.length),c=void 0===o?s:a(t(o),s),u=String(e);return l?l.call(r,u,c):r.slice(c-u.length,c)===u}});
},{"../internals/export":"rhEq","../internals/object-get-own-property-descriptor":"zm15","../internals/to-length":"j9AG","../internals/not-a-regexp":"gIbS","../internals/require-object-coercible":"RWPB","../internals/correct-is-regexp-logic":"cTby","../internals/is-pure":"tGwT"}],"oCSF":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/not-a-regexp"),i=require("../internals/require-object-coercible"),t=require("../internals/correct-is-regexp-logic");e({target:"String",proto:!0,forced:!t("includes")},{includes:function(e){return!!~String(i(this)).indexOf(r(e),arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/not-a-regexp":"gIbS","../internals/require-object-coercible":"RWPB","../internals/correct-is-regexp-logic":"cTby"}],"Mfpp":[function(require,module,exports) {
"use strict";var e=require("../internals/an-object");module.exports=function(){var i=e(this),t="";return i.global&&(t+="g"),i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.dotAll&&(t+="s"),i.unicode&&(t+="u"),i.sticky&&(t+="y"),t};
},{"../internals/an-object":"eAPg"}],"Gsvy":[function(require,module,exports) {
"use strict";var r=require("./fails");function e(r,e){return RegExp(r,e)}exports.UNSUPPORTED_Y=r(function(){var r=e("a","y");return r.lastIndex=2,null!=r.exec("abcd")}),exports.BROKEN_CARET=r(function(){var r=e("^r","gy");return r.lastIndex=2,null!=r.exec("str")});
},{"./fails":"pWu7"}],"OSep":[function(require,module,exports) {
"use strict";var e=require("./regexp-flags"),l=require("./regexp-sticky-helpers"),t=RegExp.prototype.exec,n=String.prototype.replace,i=t,a=function(){var e=/a/,l=/b*/g;return t.call(e,"a"),t.call(l,"a"),0!==e.lastIndex||0!==l.lastIndex}(),r=l.UNSUPPORTED_Y||l.BROKEN_CARET,s=void 0!==/()??/.exec("")[1],x=a||s||r;x&&(i=function(l){var i,x,c,d,g=this,o=r&&g.sticky,p=e.call(g),u=g.source,I=0,f=l;return o&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),f=String(l).slice(g.lastIndex),g.lastIndex>0&&(!g.multiline||g.multiline&&"\n"!==l[g.lastIndex-1])&&(u="(?: "+u+")",f=" "+f,I++),x=new RegExp("^(?:"+u+")",p)),s&&(x=new RegExp("^"+u+"$(?!\\s)",p)),a&&(i=g.lastIndex),c=t.call(o?x:g,f),o?c?(c.input=c.input.slice(I),c[0]=c[0].slice(I),c.index=g.lastIndex,g.lastIndex+=c[0].length):g.lastIndex=0:a&&c&&(g.lastIndex=g.global?c.index+c[0].length:i),s&&c&&c.length>1&&n.call(c[0],x,function(){for(d=1;d<arguments.length-2;d++)void 0===arguments[d]&&(c[d]=void 0)}),c}),module.exports=i;
},{"./regexp-flags":"Mfpp","./regexp-sticky-helpers":"Gsvy"}],"MlTh":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/regexp-exec");e({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r});
},{"../internals/export":"rhEq","../internals/regexp-exec":"OSep"}],"xXXd":[function(require,module,exports) {
"use strict";require("../modules/es.regexp.exec");var e=require("../internals/redefine"),r=require("../internals/fails"),n=require("../internals/well-known-symbol"),t=require("../internals/regexp-exec"),u=require("../internals/create-non-enumerable-property"),a=n("species"),i=!r(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),c="$0"==="a".replace(/./,"$0"),l=n("replace"),o=!!/./[l]&&""===/./[l]("a","$0"),s=!r(function(){var e=/(?:)/,r=e.exec;e.exec=function(){return r.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});module.exports=function(l,p,f,E){var x=n(l),v=!r(function(){var e={};return e[x]=function(){return 7},7!=""[l](e)}),g=v&&!r(function(){var e=!1,r=/a/;return"split"===l&&((r={}).constructor={},r.constructor[a]=function(){return r},r.flags="",r[x]=/./[x]),r.exec=function(){return e=!0,null},r[x](""),!e});if(!v||!g||"replace"===l&&(!i||!c||o)||"split"===l&&!s){var d=/./[x],q=f(x,""[l],function(e,r,n,u,a){return r.exec===t?v&&!a?{done:!0,value:d.call(r,n,u)}:{done:!0,value:e.call(n,r,u)}:{done:!1}},{REPLACE_KEEPS_$0:c,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:o}),y=q[0],R=q[1];e(String.prototype,l,y),e(RegExp.prototype,x,2==p?function(e,r){return R.call(e,this,r)}:function(e){return R.call(e,this)})}E&&u(RegExp.prototype[x],"sham",!0)};
},{"../modules/es.regexp.exec":"MlTh","../internals/redefine":"ztZs","../internals/fails":"pWu7","../internals/well-known-symbol":"Q0EA","../internals/regexp-exec":"OSep","../internals/create-non-enumerable-property":"GwPZ"}],"AIo2":[function(require,module,exports) {
"use strict";var t=require("../internals/string-multibyte").charAt;module.exports=function(r,e,n){return e+(n?t(r,e).length:1)};
},{"../internals/string-multibyte":"FQEJ"}],"hv6q":[function(require,module,exports) {
var e=require("./classof-raw"),r=require("./regexp-exec");module.exports=function(o,t){var c=o.exec;if("function"==typeof c){var n=c.call(o,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==e(o))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(o,t)};
},{"./classof-raw":"jUdy","./regexp-exec":"OSep"}],"gtN7":[function(require,module,exports) {
"use strict";var e=require("../internals/fix-regexp-well-known-symbol-logic"),r=require("../internals/an-object"),n=require("../internals/to-length"),i=require("../internals/require-object-coercible"),t=require("../internals/advance-string-index"),l=require("../internals/regexp-exec-abstract");e("match",1,function(e,a,u){return[function(r){var n=i(this),t=null==r?void 0:r[e];return void 0!==t?t.call(r,n):new RegExp(r)[e](String(n))},function(e){var i=u(a,e,this);if(i.done)return i.value;var s=r(e),o=String(this);if(!s.global)return l(s,o);var c=s.unicode;s.lastIndex=0;for(var v,g=[],d=0;null!==(v=l(s,o));){var x=String(v[0]);g[d]=x,""===x&&(s.lastIndex=t(o,n(s.lastIndex),c)),d++}return 0===d?null:g}]});
},{"../internals/fix-regexp-well-known-symbol-logic":"xXXd","../internals/an-object":"eAPg","../internals/to-length":"j9AG","../internals/require-object-coercible":"RWPB","../internals/advance-string-index":"AIo2","../internals/regexp-exec-abstract":"hv6q"}],"mxIp":[function(require,module,exports) {
var e=require("../internals/an-object"),n=require("../internals/a-function"),r=require("../internals/well-known-symbol"),i=r("species");module.exports=function(r,o){var t,l=e(r).constructor;return void 0===l||null==(t=e(l)[i])?o:n(t)};
},{"../internals/an-object":"eAPg","../internals/a-function":"SOPX","../internals/well-known-symbol":"Q0EA"}],"ftnR":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3],r=require("../internals/export"),n=require("../internals/create-iterator-constructor"),t=require("../internals/require-object-coercible"),i=require("../internals/to-length"),l=require("../internals/a-function"),a=require("../internals/an-object"),o=require("../internals/classof-raw"),s=require("../internals/is-regexp"),u=require("../internals/regexp-flags"),c=require("../internals/create-non-enumerable-property"),g=require("../internals/fails"),f=require("../internals/well-known-symbol"),p=require("../internals/species-constructor"),d=require("../internals/advance-string-index"),x=require("../internals/internal-state"),q=require("../internals/is-pure"),v=f("matchAll"),h="RegExp String",y=h+" Iterator",b=x.set,w=x.getterFor(y),E=RegExp.prototype,m=E.exec,R="".matchAll,S=!!R&&!g(function(){"a".matchAll(/./)}),I=function(e,r){var n,t=e.exec;if("function"==typeof t){if("object"!=typeof(n=t.call(e,r)))throw TypeError("Incorrect exec result");return n}return m.call(e,r)},A=n(function(e,r,n,t){b(this,{type:y,regexp:e,string:r,global:n,unicode:t,done:!1})},h,function(){var e=w(this);if(e.done)return{value:void 0,done:!0};var r=e.regexp,n=e.string,t=I(r,n);return null===t?{value:void 0,done:e.done=!0}:e.global?(""==String(t[0])&&(r.lastIndex=d(n,i(r.lastIndex),e.unicode)),{value:t,done:!1}):(e.done=!0,{value:t,done:!1})}),j=function(e){var r,n,t,l,o,s,c=a(this),g=String(e);return r=p(c,RegExp),void 0===(n=c.flags)&&c instanceof RegExp&&!("flags"in E)&&(n=u.call(c)),t=void 0===n?"":String(n),l=new r(r===RegExp?c.source:c,t),o=!!~t.indexOf("g"),s=!!~t.indexOf("u"),l.lastIndex=i(c.lastIndex),new A(l,g,o,s)};r({target:"String",proto:!0,forced:S},{matchAll:function(e){var r,n,i,a=t(this);if(null!=e){if(s(e)&&!~String(t("flags"in E?e.flags:u.call(e))).indexOf("g"))throw TypeError("`.matchAll` does not allow non-global regexes");if(S)return R.apply(a,arguments);if(void 0===(n=e[v])&&q&&"RegExp"==o(e)&&(n=j),null!=n)return l(n).call(e,a)}else if(S)return R.apply(a,arguments);return r=String(a),i=new RegExp(e,"g"),q?j.call(i,r):i[v](r)}}),q||v in E||c(E,v,j);
},{"../internals/export":"rhEq","../internals/create-iterator-constructor":"v9Wl","../internals/require-object-coercible":"RWPB","../internals/to-length":"j9AG","../internals/a-function":"SOPX","../internals/an-object":"eAPg","../internals/classof-raw":"jUdy","../internals/is-regexp":"fTdC","../internals/regexp-flags":"Mfpp","../internals/create-non-enumerable-property":"GwPZ","../internals/fails":"pWu7","../internals/well-known-symbol":"Q0EA","../internals/species-constructor":"mxIp","../internals/advance-string-index":"AIo2","../internals/internal-state":"vLSK","../internals/is-pure":"tGwT"}],"xEiV":[function(require,module,exports) {
"use strict";var r=require("../internals/to-integer"),e=require("../internals/require-object-coercible");module.exports="".repeat||function(t){var i=String(e(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(i+=i))1&o&&(n+=i);return n};
},{"../internals/to-integer":"GwUC","../internals/require-object-coercible":"RWPB"}],"O1JD":[function(require,module,exports) {
var e=require("../internals/to-length"),r=require("../internals/string-repeat"),t=require("../internals/require-object-coercible"),n=Math.ceil,i=function(i){return function(l,a,u){var c,o,g=String(t(l)),s=g.length,h=void 0===u?" ":String(u),q=e(a);return q<=s||""==h?g:(c=q-s,(o=r.call(h,n(c/h.length))).length>c&&(o=o.slice(0,c)),i?g+o:o+g)}};module.exports={start:i(!1),end:i(!0)};
},{"../internals/to-length":"j9AG","../internals/string-repeat":"xEiV","../internals/require-object-coercible":"RWPB"}],"HpXu":[function(require,module,exports) {
var e=require("../internals/engine-user-agent");module.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(e);
},{"../internals/engine-user-agent":"ds3C"}],"wchC":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/string-pad").end,t=require("../internals/string-pad-webkit-bug");r({target:"String",proto:!0,forced:t},{padEnd:function(r){return e(this,r,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/string-pad":"O1JD","../internals/string-pad-webkit-bug":"HpXu"}],"QpWr":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/string-pad").start,e=require("../internals/string-pad-webkit-bug");r({target:"String",proto:!0,forced:e},{padStart:function(r){return t(this,r,arguments.length>1?arguments[1]:void 0)}});
},{"../internals/export":"rhEq","../internals/string-pad":"O1JD","../internals/string-pad-webkit-bug":"HpXu"}],"JXxO":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/string-repeat");r({target:"String",proto:!0},{repeat:e});
},{"../internals/export":"rhEq","../internals/string-repeat":"xEiV"}],"lml7":[function(require,module,exports) {
var r=require("../internals/to-object"),e=Math.floor,t="".replace,a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;module.exports=function(n,i,u,l,o,s){var v=u+n.length,d=l.length,h=c;return void 0!==o&&(o=r(o),h=a),t.call(s,h,function(r,t){var a;switch(t.charAt(0)){case"$":return"$";case"&":return n;case"`":return i.slice(0,u);case"'":return i.slice(v);case"<":a=o[t.slice(1,-1)];break;default:var c=+t;if(0===c)return r;if(c>d){var s=e(c/10);return 0===s?r:s<=d?void 0===l[s-1]?t.charAt(1):l[s-1]+t.charAt(1):r}a=l[c-1]}return void 0===a?"":a})};
},{"../internals/to-object":"Q9KC"}],"x0yB":[function(require,module,exports) {
var global = arguments[3];
var r=arguments[3],e=require("../internals/fix-regexp-well-known-symbol-logic"),n=require("../internals/an-object"),i=require("../internals/to-length"),t=require("../internals/to-integer"),a=require("../internals/require-object-coercible"),l=require("../internals/advance-string-index"),u=require("../internals/get-substitution"),o=require("../internals/regexp-exec-abstract"),s=Math.max,g=Math.min,c=function(r){return void 0===r?r:String(r)};e("replace",2,function(r,e,v,f){var d=f.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,h=f.REPLACE_KEEPS_$0,E=d?"$":"$0";return[function(n,i){var t=a(this),l=null==n?void 0:n[r];return void 0!==l?l.call(n,t,i):e.call(String(t),n,i)},function(r,a){if(!d&&h||"string"==typeof a&&-1===a.indexOf(E)){var f=v(e,r,this,a);if(f.done)return f.value}var p=n(r),x=String(this),S="function"==typeof a;S||(a=String(a));var b=p.global;if(b){var q=p.unicode;p.lastIndex=0}for(var _=[];;){var I=o(p,x);if(null===I)break;if(_.push(I),!b)break;""===String(I[0])&&(p.lastIndex=l(x,i(p.lastIndex),q))}for(var P="",m=0,y=0;y<_.length;y++){I=_[y];for(var R=String(I[0]),T=s(g(t(I.index),x.length),0),U=[],k=1;k<I.length;k++)U.push(c(I[k]));var A=I.groups;if(S){var C=[R].concat(U,T,x);void 0!==A&&C.push(A);var $=String(a.apply(void 0,C))}else $=u(R,x,T,U,A,a);T>=m&&(P+=x.slice(m,T)+$,m=T+R.length)}return P+x.slice(m)}]});
},{"../internals/fix-regexp-well-known-symbol-logic":"xXXd","../internals/an-object":"eAPg","../internals/to-length":"j9AG","../internals/to-integer":"GwUC","../internals/require-object-coercible":"RWPB","../internals/advance-string-index":"AIo2","../internals/get-substitution":"lml7","../internals/regexp-exec-abstract":"hv6q"}],"TMNY":[function(require,module,exports) {
"use strict";var e=require("../internals/fix-regexp-well-known-symbol-logic"),r=require("../internals/an-object"),n=require("../internals/require-object-coercible"),i=require("../internals/same-value"),t=require("../internals/regexp-exec-abstract");e("search",1,function(e,a,l){return[function(r){var i=n(this),t=null==r?void 0:r[e];return void 0!==t?t.call(r,i):new RegExp(r)[e](String(i))},function(e){var n=l(a,e,this);if(n.done)return n.value;var s=r(e),u=String(this),c=s.lastIndex;i(c,0)||(s.lastIndex=0);var o=t(s,u);return i(s.lastIndex,c)||(s.lastIndex=c),null===o?-1:o.index}]});
},{"../internals/fix-regexp-well-known-symbol-logic":"xXXd","../internals/an-object":"eAPg","../internals/require-object-coercible":"RWPB","../internals/same-value":"bfhi","../internals/regexp-exec-abstract":"hv6q"}],"TTVC":[function(require,module,exports) {
"use strict";var e=require("../internals/fix-regexp-well-known-symbol-logic"),n=require("../internals/is-regexp"),i=require("../internals/an-object"),r=require("../internals/require-object-coercible"),t=require("../internals/species-constructor"),l=require("../internals/advance-string-index"),s=require("../internals/to-length"),u=require("../internals/regexp-exec-abstract"),a=require("../internals/regexp-exec"),c=require("../internals/fails"),g=[].push,o=Math.min,h=4294967295,p=!c(function(){return!RegExp(h,"y")});e("split",2,function(e,c,d){var f;return f="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,i){var t=String(r(this)),l=void 0===i?h:i>>>0;if(0===l)return[];if(void 0===e)return[t];if(!n(e))return c.call(t,e,l);for(var s,u,o,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,v=new RegExp(e.source,d+"g");(s=a.call(v,t))&&!((u=v.lastIndex)>f&&(p.push(t.slice(f,s.index)),s.length>1&&s.index<t.length&&g.apply(p,s.slice(1)),o=s[0].length,f=u,p.length>=l));)v.lastIndex===s.index&&v.lastIndex++;return f===t.length?!o&&v.test("")||p.push(""):p.push(t.slice(f)),p.length>l?p.slice(0,l):p}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:c.call(this,e,n)}:c,[function(n,i){var t=r(this),l=null==n?void 0:n[e];return void 0!==l?l.call(n,t,i):f.call(String(t),n,i)},function(e,n){var r=d(f,e,this,n,f!==c);if(r.done)return r.value;var a=i(e),g=String(this),v=t(a,RegExp),x=a.unicode,q=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(p?"y":"g"),b=new v(p?a:"^(?:"+a.source+")",q),m=void 0===n?h:n>>>0;if(0===m)return[];if(0===g.length)return null===u(b,g)?[g]:[];for(var y=0,I=0,w=[];I<g.length;){b.lastIndex=p?I:0;var E,R=u(b,p?g:g.slice(I));if(null===R||(E=o(s(b.lastIndex+(p?0:I)),g.length))===y)I=l(g,I,x);else{if(w.push(g.slice(y,I)),w.length===m)return w;for(var S=1;S<=R.length-1;S++)if(w.push(R[S]),w.length===m)return w;I=y=E}}return w.push(g.slice(y)),w}]},!p);
},{"../internals/fix-regexp-well-known-symbol-logic":"xXXd","../internals/is-regexp":"fTdC","../internals/an-object":"eAPg","../internals/require-object-coercible":"RWPB","../internals/species-constructor":"mxIp","../internals/advance-string-index":"AIo2","../internals/to-length":"j9AG","../internals/regexp-exec-abstract":"hv6q","../internals/regexp-exec":"OSep","../internals/fails":"pWu7"}],"GB8Q":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/object-get-own-property-descriptor").f,e=require("../internals/to-length"),i=require("../internals/not-a-regexp"),n=require("../internals/require-object-coercible"),s=require("../internals/correct-is-regexp-logic"),a=require("../internals/is-pure"),o="".startsWith,l=Math.min,c=s("startsWith"),u=!a&&!c&&!!function(){var r=t(String.prototype,"startsWith");return r&&!r.writable}();r({target:"String",proto:!0,forced:!u&&!c},{startsWith:function(r){var t=String(n(this));i(r);var s=e(l(arguments.length>1?arguments[1]:void 0,t.length)),a=String(r);return o?o.call(t,a,s):t.slice(s,s+a.length)===a}});
},{"../internals/export":"rhEq","../internals/object-get-own-property-descriptor":"zm15","../internals/to-length":"j9AG","../internals/not-a-regexp":"gIbS","../internals/require-object-coercible":"RWPB","../internals/correct-is-regexp-logic":"cTby","../internals/is-pure":"tGwT"}],"t1eM":[function(require,module,exports) {
module.exports="\t\n\v\f\r                　\u2028\u2029\ufeff";
},{}],"Fme6":[function(require,module,exports) {
var e=require("../internals/require-object-coercible"),r=require("../internals/whitespaces"),t="["+r+"]",n=RegExp("^"+t+t+"*"),i=RegExp(t+t+"*$"),a=function(r){return function(t){var a=String(e(t));return 1&r&&(a=a.replace(n,"")),2&r&&(a=a.replace(i,"")),a}};module.exports={start:a(1),end:a(2),trim:a(3)};
},{"../internals/require-object-coercible":"RWPB","../internals/whitespaces":"t1eM"}],"EdVG":[function(require,module,exports) {
var e=require("../internals/fails"),r=require("../internals/whitespaces"),n="​᠎";module.exports=function(i){return e(function(){return!!r[i]()||n[i]()!=n||r[i].name!==i})};
},{"../internals/fails":"pWu7","../internals/whitespaces":"t1eM"}],"AFCH":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/string-trim").trim,i=require("../internals/string-trim-forced");r({target:"String",proto:!0,forced:i("trim")},{trim:function(){return t(this)}});
},{"../internals/export":"rhEq","../internals/string-trim":"Fme6","../internals/string-trim-forced":"EdVG"}],"jY0J":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/string-trim").start,i=require("../internals/string-trim-forced"),e=i("trimStart"),n=e?function(){return t(this)}:"".trimStart;r({target:"String",proto:!0,forced:e},{trimStart:n,trimLeft:n});
},{"../internals/export":"rhEq","../internals/string-trim":"Fme6","../internals/string-trim-forced":"EdVG"}],"dAVn":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/string-trim").end,i=require("../internals/string-trim-forced"),e=i("trimEnd"),n=e?function(){return t(this)}:"".trimEnd;r({target:"String",proto:!0,forced:e},{trimEnd:n,trimRight:n});
},{"../internals/export":"rhEq","../internals/string-trim":"Fme6","../internals/string-trim-forced":"EdVG"}],"PSYM":[function(require,module,exports) {
"use strict";var t=require("../internals/string-multibyte").charAt,e=require("../internals/internal-state"),r=require("../internals/define-iterator"),n="String Iterator",i=e.set,a=e.getterFor(n);r(String,"String",function(t){i(this,{type:n,string:String(t),index:0})},function(){var e,r=a(this),n=r.string,i=r.index;return i>=n.length?{value:void 0,done:!0}:(e=t(n,i),r.index+=e.length,{value:e,done:!1})});
},{"../internals/string-multibyte":"FQEJ","../internals/internal-state":"vLSK","../internals/define-iterator":"CpaJ"}],"vMTH":[function(require,module,exports) {
var r=require("../internals/require-object-coercible"),e=/"/g;module.exports=function(t,i,n,o){var u=String(r(t)),c="<"+i;return""!==n&&(c+=" "+n+'="'+String(o).replace(e,"&quot;")+'"'),c+">"+u+"</"+i+">"};
},{"../internals/require-object-coercible":"RWPB"}],"zmSx":[function(require,module,exports) {
var r=require("../internals/fails");module.exports=function(e){return r(function(){var r=""[e]('"');return r!==r.toLowerCase()||r.split('"').length>3})};
},{"../internals/fails":"pWu7"}],"J8PS":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("anchor")},{anchor:function(r){return e(this,"a","name",r)}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"alkc":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("big")},{big:function(){return e(this,"big","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"AYvZ":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("blink")},{blink:function(){return e(this,"blink","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"jQTw":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("bold")},{bold:function(){return e(this,"b","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"It3T":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("fixed")},{fixed:function(){return e(this,"tt","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"sE8q":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/create-html"),e=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:e("fontcolor")},{fontcolor:function(r){return t(this,"font","color",r)}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"ABfs":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("fontsize")},{fontsize:function(r){return e(this,"font","size",r)}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"zvaT":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),t=require("../internals/create-html"),e=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:e("italics")},{italics:function(){return t(this,"i","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"QJ0z":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("link")},{link:function(r){return e(this,"a","href",r)}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"Ai0M":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("small")},{small:function(){return e(this,"small","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"Scmo":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("strike")},{strike:function(){return e(this,"strike","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"e1aX":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("sub")},{sub:function(){return e(this,"sub","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"rC3x":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/create-html"),t=require("../internals/string-html-forced");r({target:"String",proto:!0,forced:t("sup")},{sup:function(){return e(this,"sup","","")}});
},{"../internals/export":"rhEq","../internals/create-html":"vMTH","../internals/string-html-forced":"zmSx"}],"h3Bv":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/require-object-coercible"),n=require("../internals/is-regexp"),i=require("../internals/regexp-flags"),t=require("../internals/get-substitution"),l=require("../internals/well-known-symbol"),o=require("../internals/is-pure"),a=l("replace"),s=RegExp.prototype,g=Math.max,u=function(e,r,n){return n>e.length?-1:""===r?n:e.indexOf(r,n)};e({target:"String",proto:!0},{replaceAll:function(e,l){var c,f,p,q,x,S,h,b,d=r(this),v=0,w=0,y="";if(null!=e){if((c=n(e))&&!~String(r("flags"in s?e.flags:i.call(e))).indexOf("g"))throw TypeError("`.replaceAll` does not allow non-global regexes");if(void 0!==(f=e[a]))return f.call(e,d,l);if(o&&c)return String(d).replace(e,l)}for(p=String(d),q=String(e),(x="function"==typeof l)||(l=String(l)),S=q.length,h=g(1,S),v=u(p,q,0);-1!==v;)b=x?String(l(q,v,p)):t(q,p,v,[],void 0,l),y+=p.slice(w,v)+b,w=v+S,v=u(p,q,v+h);return w<p.length&&(y+=p.slice(w)),y}});
},{"../internals/export":"rhEq","../internals/require-object-coercible":"RWPB","../internals/is-regexp":"fTdC","../internals/regexp-flags":"Mfpp","../internals/get-substitution":"lml7","../internals/well-known-symbol":"Q0EA","../internals/is-pure":"tGwT"}],"e5oz":[function(require,module,exports) {
var t=require("../internals/is-object"),e=require("../internals/object-set-prototype-of");module.exports=function(o,r,n){var p,i;return e&&"function"==typeof(p=r.constructor)&&p!==n&&t(i=p.prototype)&&i!==n.prototype&&e(o,i),o};
},{"../internals/is-object":"AsqF","../internals/object-set-prototype-of":"eDCX"}],"DbBn":[function(require,module,exports) {

var e=require("../internals/descriptors"),r=require("../internals/global"),n=require("../internals/is-forced"),i=require("../internals/inherit-if-required"),t=require("../internals/object-define-property").f,s=require("../internals/object-get-own-property-names").f,a=require("../internals/is-regexp"),o=require("../internals/regexp-flags"),u=require("../internals/regexp-sticky-helpers"),l=require("../internals/redefine"),c=require("../internals/fails"),f=require("../internals/internal-state").set,p=require("../internals/set-species"),g=require("../internals/well-known-symbol"),q=g("match"),y=r.RegExp,x=y.prototype,d=/a/g,h=/a/g,b=new y(d)!==d,v=u.UNSUPPORTED_Y,w=e&&n("RegExp",!b||v||c(function(){return h[q]=!1,y(d)!=d||y(h)==h||"/a/i"!=y(d,"i")}));if(w){for(var E=function(e,r){var n,t=this instanceof E,s=a(e),u=void 0===r;if(!t&&s&&e.constructor===E&&u)return e;b?s&&!u&&(e=e.source):e instanceof E&&(u&&(r=o.call(e)),e=e.source),v&&(n=!!r&&r.indexOf("y")>-1)&&(r=r.replace(/y/g,""));var l=i(b?new y(e,r):y(e,r),t?this:x,E);return v&&n&&f(l,{sticky:n}),l},R=function(e){e in E||t(E,e,{configurable:!0,get:function(){return y[e]},set:function(r){y[e]=r}})},k=s(y),m=0;k.length>m;)R(k[m++]);x.constructor=E,E.prototype=x,l(r,"RegExp",E)}p("RegExp");
},{"../internals/descriptors":"A8Ob","../internals/global":"MVLi","../internals/is-forced":"Y6Gi","../internals/inherit-if-required":"e5oz","../internals/object-define-property":"AtXZ","../internals/object-get-own-property-names":"QFCk","../internals/is-regexp":"fTdC","../internals/regexp-flags":"Mfpp","../internals/regexp-sticky-helpers":"Gsvy","../internals/redefine":"ztZs","../internals/fails":"pWu7","../internals/internal-state":"vLSK","../internals/set-species":"bDBP","../internals/well-known-symbol":"Q0EA"}],"ERpX":[function(require,module,exports) {
var e=require("../internals/descriptors"),r=require("../internals/object-define-property"),i=require("../internals/regexp-flags"),s=require("../internals/regexp-sticky-helpers").UNSUPPORTED_Y;e&&("g"!=/./g.flags||s)&&r.f(RegExp.prototype,"flags",{configurable:!0,get:i});
},{"../internals/descriptors":"A8Ob","../internals/object-define-property":"AtXZ","../internals/regexp-flags":"Mfpp","../internals/regexp-sticky-helpers":"Gsvy"}],"TNvt":[function(require,module,exports) {
var e=require("../internals/descriptors"),r=require("../internals/regexp-sticky-helpers").UNSUPPORTED_Y,t=require("../internals/object-define-property").f,i=require("../internals/internal-state").get,n=RegExp.prototype;e&&r&&t(RegExp.prototype,"sticky",{configurable:!0,get:function(){if(this!==n){if(this instanceof RegExp)return!!i(this).sticky;throw TypeError("Incompatible receiver, RegExp required")}}});
},{"../internals/descriptors":"A8Ob","../internals/regexp-sticky-helpers":"Gsvy","../internals/object-define-property":"AtXZ","../internals/internal-state":"vLSK"}],"LJgt":[function(require,module,exports) {
"use strict";require("../modules/es.regexp.exec");var e=require("../internals/export"),t=require("../internals/is-object"),r=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),n=/./.test;e({target:"RegExp",proto:!0,forced:!r},{test:function(e){if("function"!=typeof this.exec)return n.call(this,e);var r=this.exec(e);if(null!==r&&!t(r))throw new Error("RegExp exec method returned something other than an Object or null");return!!r}});
},{"../modules/es.regexp.exec":"MlTh","../internals/export":"rhEq","../internals/is-object":"AsqF"}],"g0xY":[function(require,module,exports) {
"use strict";var e=require("../internals/redefine"),r=require("../internals/an-object"),n=require("../internals/fails"),t=require("../internals/regexp-flags"),i="toString",a=RegExp.prototype,s=a[i],l=n(function(){return"/a/b"!=s.call({source:"a",flags:"b"})}),o=s.name!=i;(l||o)&&e(RegExp.prototype,i,function(){var e=r(this),n=String(e.source),i=e.flags;return"/"+n+"/"+String(void 0===i&&e instanceof RegExp&&!("flags"in a)?t.call(e):i)},{unsafe:!0});
},{"../internals/redefine":"ztZs","../internals/an-object":"eAPg","../internals/fails":"pWu7","../internals/regexp-flags":"Mfpp"}],"brK6":[function(require,module,exports) {

var r=require("../internals/global"),e=require("../internals/string-trim").trim,t=require("../internals/whitespaces"),i=r.parseInt,n=/^[+-]?0[Xx]/,s=8!==i(t+"08")||22!==i(t+"0x16");module.exports=s?function(r,t){var s=e(String(r));return i(s,t>>>0||(n.test(s)?16:10))}:i;
},{"../internals/global":"MVLi","../internals/string-trim":"Fme6","../internals/whitespaces":"t1eM"}],"GhQi":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/number-parse-int");r({global:!0,forced:parseInt!=e},{parseInt:e});
},{"../internals/export":"rhEq","../internals/number-parse-int":"brK6"}],"LbIr":[function(require,module,exports) {

var r=require("../internals/global"),e=require("../internals/string-trim").trim,t=require("../internals/whitespaces"),i=r.parseFloat,n=1/i(t+"-0")!=-1/0;module.exports=n?function(r){var t=e(String(r)),n=i(t);return 0===n&&"-"==t.charAt(0)?-0:n}:i;
},{"../internals/global":"MVLi","../internals/string-trim":"Fme6","../internals/whitespaces":"t1eM"}],"kPoD":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/number-parse-float");r({global:!0,forced:parseFloat!=e},{parseFloat:e});
},{"../internals/export":"rhEq","../internals/number-parse-float":"LbIr"}],"BqHT":[function(require,module,exports) {

"use strict";var e=require("../internals/descriptors"),r=require("../internals/global"),t=require("../internals/is-forced"),i=require("../internals/redefine"),n=require("../internals/has"),a=require("../internals/classof-raw"),s=require("../internals/inherit-if-required"),o=require("../internals/to-primitive"),l=require("../internals/fails"),u=require("../internals/object-create"),c=require("../internals/object-get-own-property-names").f,f=require("../internals/object-get-own-property-descriptor").f,I=require("../internals/object-define-property").f,N=require("../internals/string-trim").trim,p="Number",q=r[p],g=q.prototype,h=a(u(g))==p,E=function(e){var r,t,i,n,a,s,l,u,c=o(e,!1);if("string"==typeof c&&c.length>2)if(43===(r=(c=N(c)).charCodeAt(0))||45===r){if(88===(t=c.charCodeAt(2))||120===t)return NaN}else if(48===r){switch(c.charCodeAt(1)){case 66:case 98:i=2,n=49;break;case 79:case 111:i=8,n=55;break;default:return+c}for(s=(a=c.slice(2)).length,l=0;l<s;l++)if((u=a.charCodeAt(l))<48||u>n)return NaN;return parseInt(a,i)}return+c};if(t(p,!q(" 0o1")||!q("0b1")||q("+0x1"))){for(var d,A=function(e){var r=arguments.length<1?0:e,t=this;return t instanceof A&&(h?l(function(){g.valueOf.call(t)}):a(t)!=p)?s(new q(E(r)),t,A):E(r)},b=e?c(q):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),_=0;b.length>_;_++)n(q,d=b[_])&&!n(A,d)&&I(A,d,f(q,d));A.prototype=g,g.constructor=A,i(r,p,A)}
},{"../internals/descriptors":"A8Ob","../internals/global":"MVLi","../internals/is-forced":"Y6Gi","../internals/redefine":"ztZs","../internals/has":"jYdl","../internals/classof-raw":"jUdy","../internals/inherit-if-required":"e5oz","../internals/to-primitive":"wZyz","../internals/fails":"pWu7","../internals/object-create":"zWsZ","../internals/object-get-own-property-names":"QFCk","../internals/object-get-own-property-descriptor":"zm15","../internals/object-define-property":"AtXZ","../internals/string-trim":"Fme6"}],"SaF2":[function(require,module,exports) {
var r=require("../internals/export");r({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)});
},{"../internals/export":"rhEq"}],"DaQS":[function(require,module,exports) {

var e=require("../internals/global"),i=e.isFinite;module.exports=Number.isFinite||function(e){return"number"==typeof e&&i(e)};
},{"../internals/global":"MVLi"}],"xykq":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/number-is-finite");e({target:"Number",stat:!0},{isFinite:r});
},{"../internals/export":"rhEq","../internals/number-is-finite":"DaQS"}],"HM9H":[function(require,module,exports) {
var e=require("../internals/is-object"),r=Math.floor;module.exports=function(i){return!e(i)&&isFinite(i)&&r(i)===i};
},{"../internals/is-object":"AsqF"}],"mK5P":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/is-integer");e({target:"Number",stat:!0},{isInteger:r});
},{"../internals/export":"rhEq","../internals/is-integer":"HM9H"}],"jYuH":[function(require,module,exports) {
var r=require("../internals/export");r({target:"Number",stat:!0},{isNaN:function(r){return r!=r}});
},{"../internals/export":"rhEq"}],"BAEw":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/is-integer"),t=Math.abs;e({target:"Number",stat:!0},{isSafeInteger:function(e){return r(e)&&t(e)<=9007199254740991}});
},{"../internals/export":"rhEq","../internals/is-integer":"HM9H"}],"D9EQ":[function(require,module,exports) {
var r=require("../internals/export");r({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991});
},{"../internals/export":"rhEq"}],"WlNN":[function(require,module,exports) {
var r=require("../internals/export");r({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991});
},{"../internals/export":"rhEq"}],"tHG2":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/number-parse-float");r({target:"Number",stat:!0,forced:Number.parseFloat!=e},{parseFloat:e});
},{"../internals/export":"rhEq","../internals/number-parse-float":"LbIr"}],"eX39":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/number-parse-int");r({target:"Number",stat:!0,forced:Number.parseInt!=e},{parseInt:e});
},{"../internals/export":"rhEq","../internals/number-parse-int":"brK6"}],"bMZq":[function(require,module,exports) {
var r=require("../internals/classof-raw");module.exports=function(e){if("number"!=typeof e&&"Number"!=r(e))throw TypeError("Incorrect invocation");return+e};
},{"../internals/classof-raw":"jUdy"}],"qTD4":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/to-integer"),t=require("../internals/this-number-value"),i=require("../internals/string-repeat"),n=require("../internals/fails"),o=1..toFixed,a=Math.floor,f=function(r,e,t){return 0===e?t:e%2==1?f(r,e-1,t*r):f(r*r,e/2,t)},u=function(r){for(var e=0,t=r;t>=4096;)e+=12,t/=4096;for(;t>=2;)e+=1,t/=2;return e},l=function(r,e,t){for(var i=-1,n=t;++i<6;)n+=e*r[i],r[i]=n%1e7,n=a(n/1e7)},c=function(r,e){for(var t=6,i=0;--t>=0;)i+=r[t],r[t]=a(i/e),i=i%e*1e7},s=function(r){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==r[e]){var n=String(r[e]);t=""===t?n:t+i.call("0",7-n.length)+n}return t},d=o&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(function(){o.call({})});r({target:"Number",proto:!0,forced:d},{toFixed:function(r){var n,o,a,d,g=t(this),v=e(r),x=[0,0,0,0,0,0],h="",F="0";if(v<0||v>20)throw RangeError("Incorrect fraction digits");if(g!=g)return"NaN";if(g<=-1e21||g>=1e21)return String(g);if(g<0&&(h="-",g=-g),g>1e-21)if(o=(n=u(g*f(2,69,1))-69)<0?g*f(2,-n,1):g/f(2,n,1),o*=4503599627370496,(n=52-n)>0){for(l(x,0,o),a=v;a>=7;)l(x,1e7,0),a-=7;for(l(x,f(10,a,1),0),a=n-1;a>=23;)c(x,1<<23),a-=23;c(x,1<<a),l(x,1,1),c(x,2),F=s(x)}else l(x,0,o),l(x,1<<-n,0),F=s(x)+i.call("0",v);return F=v>0?h+((d=F.length)<=v?"0."+i.call("0",v-d)+F:F.slice(0,d-v)+"."+F.slice(d-v)):h+F}});
},{"../internals/export":"rhEq","../internals/to-integer":"GwUC","../internals/this-number-value":"bMZq","../internals/string-repeat":"xEiV","../internals/fails":"pWu7"}],"PZps":[function(require,module,exports) {
"use strict";var r=require("../internals/export"),e=require("../internals/fails"),i=require("../internals/this-number-value"),t=1..toPrecision,n=e(function(){return"1"!==t.call(1,void 0)})||!e(function(){t.call({})});r({target:"Number",proto:!0,forced:n},{toPrecision:function(r){return void 0===r?t.call(i(this)):t.call(i(this),r)}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/this-number-value":"bMZq"}],"EUym":[function(require,module,exports) {
var e=Math.log;module.exports=Math.log1p||function(o){return(o=+o)>-1e-8&&o<1e-8?o-o*o/2:e(1+o)};
},{}],"szh2":[function(require,module,exports) {
var t=require("../internals/export"),a=require("../internals/math-log1p"),r=Math.acosh,e=Math.log,h=Math.sqrt,o=Math.LN2,n=!r||710!=Math.floor(r(Number.MAX_VALUE))||r(1/0)!=1/0;t({target:"Math",stat:!0,forced:n},{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?e(t)+o:a(t-1+h(t-1)*h(t+1))}});
},{"../internals/export":"rhEq","../internals/math-log1p":"EUym"}],"lX9L":[function(require,module,exports) {
var t=require("../internals/export"),a=Math.asinh,r=Math.log,e=Math.sqrt;function i(t){return isFinite(t=+t)&&0!=t?t<0?-i(-t):r(t+e(t*t+1)):t}t({target:"Math",stat:!0,forced:!(a&&1/a(0)>0)},{asinh:i});
},{"../internals/export":"rhEq"}],"dF5J":[function(require,module,exports) {
var t=require("../internals/export"),a=Math.atanh,r=Math.log;t({target:"Math",stat:!0,forced:!(a&&1/a(-0)<0)},{atanh:function(t){return 0==(t=+t)?t:r((1+t)/(1-t))/2}});
},{"../internals/export":"rhEq"}],"wL8P":[function(require,module,exports) {
module.exports=Math.sign||function(n){return 0==(n=+n)||n!=n?n:n<0?-1:1};
},{}],"RF5g":[function(require,module,exports) {
var t=require("../internals/export"),r=require("../internals/math-sign"),a=Math.abs,e=Math.pow;t({target:"Math",stat:!0},{cbrt:function(t){return r(t=+t)*e(a(t),1/3)}});
},{"../internals/export":"rhEq","../internals/math-sign":"wL8P"}],"k2zs":[function(require,module,exports) {
var t=require("../internals/export"),r=Math.floor,a=Math.log,e=Math.LOG2E;t({target:"Math",stat:!0},{clz32:function(t){return(t>>>=0)?31-r(a(t+.5)*e):32}});
},{"../internals/export":"rhEq"}],"xAPX":[function(require,module,exports) {
var e=Math.expm1,t=Math.exp;module.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:t(e)-1}:e;
},{}],"KbzY":[function(require,module,exports) {
var t=require("../internals/export"),r=require("../internals/math-expm1"),a=Math.cosh,e=Math.abs,h=Math.E;t({target:"Math",stat:!0,forced:!a||a(710)===1/0},{cosh:function(t){var a=r(e(t)-1)+1;return(a+1/(a*h*h))*(h/2)}});
},{"../internals/export":"rhEq","../internals/math-expm1":"xAPX"}],"gE1J":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/math-expm1");e({target:"Math",stat:!0,forced:r!=Math.expm1},{expm1:r});
},{"../internals/export":"rhEq","../internals/math-expm1":"xAPX"}],"mXoY":[function(require,module,exports) {
var r=require("../internals/math-sign"),n=Math.abs,t=Math.pow,a=t(2,-52),e=t(2,-23),u=t(2,127)*(2-e),o=t(2,-126),i=function(r){return r+1/a-1/a};module.exports=Math.fround||function(t){var h,s,f=n(t),M=r(t);return f<o?M*i(f/o/e)*o*e:(s=(h=(1+e/a)*f)-(h-f))>u||s!=s?M*(1/0):M*s};
},{"../internals/math-sign":"wL8P"}],"zb0x":[function(require,module,exports) {
var r=require("../internals/export"),t=require("../internals/math-fround");r({target:"Math",stat:!0},{fround:t});
},{"../internals/export":"rhEq","../internals/math-fround":"mXoY"}],"B4cQ":[function(require,module,exports) {
var t=require("../internals/export"),r=Math.hypot,a=Math.abs,e=Math.sqrt,h=!!r&&r(1/0,NaN)!==1/0;t({target:"Math",stat:!0,forced:h},{hypot:function(t,r){for(var h,n,o=0,s=0,M=arguments.length,f=0;s<M;)f<(h=a(arguments[s++]))?(o=o*(n=f/h)*n+1,f=h):o+=h>0?(n=h/f)*n:h;return f===1/0?1/0:f*e(o)}});
},{"../internals/export":"rhEq"}],"Bl9f":[function(require,module,exports) {
var r=require("../internals/export"),t=require("../internals/fails"),e=Math.imul,n=t(function(){return-5!=e(4294967295,5)||2!=e.length});r({target:"Math",stat:!0,forced:n},{imul:function(r,t){var e=+r,n=+t,a=65535&e,i=65535&n;return 0|a*i+((65535&e>>>16)*i+a*(65535&n>>>16)<<16>>>0)}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7"}],"Zbeu":[function(require,module,exports) {
var t=require("../internals/export"),r=Math.log,a=Math.LOG10E;t({target:"Math",stat:!0},{log10:function(t){return r(t)*a}});
},{"../internals/export":"rhEq"}],"eVjJ":[function(require,module,exports) {
var r=require("../internals/export"),t=require("../internals/math-log1p");r({target:"Math",stat:!0},{log1p:t});
},{"../internals/export":"rhEq","../internals/math-log1p":"EUym"}],"HPCZ":[function(require,module,exports) {
var t=require("../internals/export"),r=Math.log,a=Math.LN2;t({target:"Math",stat:!0},{log2:function(t){return r(t)/a}});
},{"../internals/export":"rhEq"}],"wvgJ":[function(require,module,exports) {
var r=require("../internals/export"),t=require("../internals/math-sign");r({target:"Math",stat:!0},{sign:t});
},{"../internals/export":"rhEq","../internals/math-sign":"wL8P"}],"VNT8":[function(require,module,exports) {
var e=require("../internals/export"),t=require("../internals/fails"),r=require("../internals/math-expm1"),a=Math.abs,n=Math.exp,i=Math.E,h=t(function(){return-2e-17!=Math.sinh(-2e-17)});e({target:"Math",stat:!0,forced:h},{sinh:function(e){return a(e=+e)<1?(r(e)-r(-e))/2:(n(e-1)-n(-e-1))*(i/2)}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/math-expm1":"xAPX"}],"I2ip":[function(require,module,exports) {
var t=require("../internals/export"),r=require("../internals/math-expm1"),e=Math.exp;t({target:"Math",stat:!0},{tanh:function(t){var a=r(t=+t),n=r(-t);return a==1/0?1:n==1/0?-1:(a-n)/(e(t)+e(-t))}});
},{"../internals/export":"rhEq","../internals/math-expm1":"xAPX"}],"CevC":[function(require,module,exports) {
var t=require("../internals/set-to-string-tag");t(Math,"Math",!0);
},{"../internals/set-to-string-tag":"kLCt"}],"GaOn":[function(require,module,exports) {
var t=require("../internals/export"),r=Math.ceil,a=Math.floor;t({target:"Math",stat:!0},{trunc:function(t){return(t>0?a:r)(t)}});
},{"../internals/export":"rhEq"}],"Yqn8":[function(require,module,exports) {
var e=require("../internals/export");e({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}});
},{"../internals/export":"rhEq"}],"KP08":[function(require,module,exports) {
"use strict";var t=require("../internals/export"),r=require("../internals/fails"),e=require("../internals/to-object"),n=require("../internals/to-primitive"),i=r(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})});t({target:"Date",proto:!0,forced:i},{toJSON:function(t){var r=e(this),i=n(r);return"number"!=typeof i||isFinite(i)?r.toISOString():null}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/to-object":"Q9KC","../internals/to-primitive":"wZyz"}],"rnka":[function(require,module,exports) {
"use strict";var t=require("../internals/fails"),e=require("../internals/string-pad").start,i=Math.abs,r=Date.prototype,n=r.getTime,s=r.toISOString;module.exports=t(function(){return"0385-07-25T07:06:39.999Z"!=s.call(new Date(-5e13-1))})||!t(function(){s.call(new Date(NaN))})?function(){if(!isFinite(n.call(this)))throw RangeError("Invalid time value");var t=this.getUTCFullYear(),r=this.getUTCMilliseconds(),s=t<0?"-":t>9999?"+":"";return s+e(i(t),s?6:4,0)+"-"+e(this.getUTCMonth()+1,2,0)+"-"+e(this.getUTCDate(),2,0)+"T"+e(this.getUTCHours(),2,0)+":"+e(this.getUTCMinutes(),2,0)+":"+e(this.getUTCSeconds(),2,0)+"."+e(r,3,0)+"Z"}:s;
},{"../internals/fails":"pWu7","../internals/string-pad":"O1JD"}],"FvU6":[function(require,module,exports) {
var t=require("../internals/export"),r=require("../internals/date-to-iso-string");t({target:"Date",proto:!0,forced:Date.prototype.toISOString!==r},{toISOString:r});
},{"../internals/export":"rhEq","../internals/date-to-iso-string":"rnka"}],"GjHx":[function(require,module,exports) {
var e=require("../internals/redefine"),t=Date.prototype,a="Invalid Date",r="toString",i=t[r],n=t.getTime;new Date(NaN)+""!=a&&e(t,r,function(){var e=n.call(this);return e==e?i.call(this):a});
},{"../internals/redefine":"ztZs"}],"IBYR":[function(require,module,exports) {
"use strict";var r=require("../internals/an-object"),e=require("../internals/to-primitive");module.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return e(r(this),"number"!==t)};
},{"../internals/an-object":"eAPg","../internals/to-primitive":"wZyz"}],"bfeb":[function(require,module,exports) {
var e=require("../internals/create-non-enumerable-property"),r=require("../internals/date-to-primitive"),i=require("../internals/well-known-symbol"),t=i("toPrimitive"),n=Date.prototype;t in n||e(n,t,r);
},{"../internals/create-non-enumerable-property":"GwPZ","../internals/date-to-primitive":"IBYR","../internals/well-known-symbol":"Q0EA"}],"tFg0":[function(require,module,exports) {
var t=require("../internals/export"),r=require("../internals/get-built-in"),e=require("../internals/fails"),u=r("JSON","stringify"),n=/[\uD800-\uDFFF]/g,i=/^[\uD800-\uDBFF]$/,a=/^[\uDC00-\uDFFF]$/,s=function(t,r,e){var u=e.charAt(r-1),n=e.charAt(r+1);return i.test(t)&&!a.test(n)||a.test(t)&&!i.test(u)?"\\u"+t.charCodeAt(0).toString(16):t},d=e(function(){return'"\\udf06\\ud834"'!==u("\udf06\ud834")||'"\\udead"'!==u("\udead")});u&&t({target:"JSON",stat:!0,forced:d},{stringify:function(t,r,e){var i=u.apply(null,arguments);return"string"==typeof i?i.replace(n,s):i}});
},{"../internals/export":"rhEq","../internals/get-built-in":"mLk8","../internals/fails":"pWu7"}],"azWb":[function(require,module,exports) {

var r=require("../internals/global"),e=require("../internals/set-to-string-tag");e(r.JSON,"JSON",!0);
},{"../internals/global":"MVLi","../internals/set-to-string-tag":"kLCt"}],"O8N5":[function(require,module,exports) {

var e=require("../internals/global");module.exports=e.Promise;
},{"../internals/global":"MVLi"}],"oPIw":[function(require,module,exports) {
var r=require("../internals/redefine");module.exports=function(e,n,i){for(var o in n)r(e,o,n[o],i);return e};
},{"../internals/redefine":"ztZs"}],"pJoy":[function(require,module,exports) {
module.exports=function(o,r,n){if(!(o instanceof r))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return o};
},{}],"y6fo":[function(require,module,exports) {
var e=require("../internals/engine-user-agent");module.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e);
},{"../internals/engine-user-agent":"ds3C"}],"g1no":[function(require,module,exports) {


var e,n,t,i=require("../internals/global"),o=require("../internals/fails"),r=require("../internals/function-bind-context"),s=require("../internals/html"),a=require("../internals/document-create-element"),c=require("../internals/engine-is-ios"),u=require("../internals/engine-is-node"),l=i.location,f=i.setImmediate,p=i.clearImmediate,d=i.process,m=i.MessageChannel,g=i.Dispatch,h=0,q={},v="onreadystatechange",y=function(e){if(q.hasOwnProperty(e)){var n=q[e];delete q[e],n()}},w=function(e){return function(){y(e)}},M=function(e){y(e.data)},x=function(e){i.postMessage(e+"",l.protocol+"//"+l.host)};f&&p||(f=function(n){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return q[++h]=function(){("function"==typeof n?n:Function(n)).apply(void 0,t)},e(h),h},p=function(e){delete q[e]},u?e=function(e){d.nextTick(w(e))}:g&&g.now?e=function(e){g.now(w(e))}:m&&!c?(t=(n=new m).port2,n.port1.onmessage=M,e=r(t.postMessage,t,1)):i.addEventListener&&"function"==typeof postMessage&&!i.importScripts&&l&&"file:"!==l.protocol&&!o(x)?(e=x,i.addEventListener("message",M,!1)):e=v in a("script")?function(e){s.appendChild(a("script"))[v]=function(){s.removeChild(this),y(e)}}:function(e){setTimeout(w(e),0)}),module.exports={set:f,clear:p};
},{"../internals/global":"MVLi","../internals/fails":"pWu7","../internals/function-bind-context":"dEmF","../internals/html":"tTwY","../internals/document-create-element":"tvdn","../internals/engine-is-ios":"y6fo","../internals/engine-is-node":"dxME"}],"az1v":[function(require,module,exports) {
var e=require("../internals/engine-user-agent");module.exports=/web0s(?!.*chrome)/i.test(e);
},{"../internals/engine-user-agent":"ds3C"}],"jLqr":[function(require,module,exports) {


var e,n,r,t,i,o,a,s,c=require("../internals/global"),u=require("../internals/object-get-own-property-descriptor").f,l=require("../internals/task").set,v=require("../internals/engine-is-ios"),d=require("../internals/engine-is-webos-webkit"),f=require("../internals/engine-is-node"),b=c.MutationObserver||c.WebKitMutationObserver,q=c.document,x=c.process,g=c.Promise,p=u(c,"queueMicrotask"),w=p&&p.value;w||(e=function(){var e,i;for(f&&(e=x.domain)&&e.exit();n;){i=n.fn,n=n.next;try{i()}catch(o){throw n?t():r=void 0,o}}r=void 0,e&&e.enter()},v||f||d||!b||!q?g&&g.resolve?(a=g.resolve(void 0),s=a.then,t=function(){s.call(a,e)}):t=f?function(){x.nextTick(e)}:function(){l.call(c,e)}:(i=!0,o=q.createTextNode(""),new b(e).observe(o,{characterData:!0}),t=function(){o.data=i=!i})),module.exports=w||function(e){var i={fn:e,next:void 0};r&&(r.next=i),n||(n=i,t()),r=i};
},{"../internals/global":"MVLi","../internals/object-get-own-property-descriptor":"zm15","../internals/task":"g1no","../internals/engine-is-ios":"y6fo","../internals/engine-is-webos-webkit":"az1v","../internals/engine-is-node":"dxME"}],"NKSu":[function(require,module,exports) {
"use strict";var r=require("../internals/a-function"),e=function(e){var t,i;this.promise=new e(function(r,e){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=r,i=e}),this.resolve=r(t),this.reject=r(i)};module.exports.f=function(r){return new e(r)};
},{"../internals/a-function":"SOPX"}],"S6uO":[function(require,module,exports) {
var r=require("../internals/an-object"),e=require("../internals/is-object"),i=require("../internals/new-promise-capability");module.exports=function(n,t){if(r(n),e(t)&&t.constructor===n)return t;var o=i.f(n);return(0,o.resolve)(t),o.promise};
},{"../internals/an-object":"eAPg","../internals/is-object":"AsqF","../internals/new-promise-capability":"NKSu"}],"xiDB":[function(require,module,exports) {

var r=require("../internals/global");module.exports=function(e,o){var l=r.console;l&&l.error&&(1===arguments.length?l.error(e):l.error(e,o))};
},{"../internals/global":"MVLi"}],"coA3":[function(require,module,exports) {
module.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}};
},{}],"ItbG":[function(require,module,exports) {


"use strict";var e,n,t,r,i=require("../internals/export"),o=require("../internals/is-pure"),a=require("../internals/global"),c=require("../internals/get-built-in"),s=require("../internals/native-promise-constructor"),u=require("../internals/redefine"),l=require("../internals/redefine-all"),f=require("../internals/set-to-string-tag"),v=require("../internals/set-species"),p=require("../internals/is-object"),h=require("../internals/a-function"),d=require("../internals/an-instance"),m=require("../internals/inspect-source"),q=require("../internals/iterate"),y=require("../internals/check-correctness-of-iteration"),j=require("../internals/species-constructor"),g=require("../internals/task").set,b=require("../internals/microtask"),w=require("../internals/promise-resolve"),E=require("../internals/host-report-errors"),k=require("../internals/new-promise-capability"),P=require("../internals/perform"),x=require("../internals/internal-state"),R=require("../internals/is-forced"),F=require("../internals/well-known-symbol"),H=require("../internals/engine-is-node"),S=require("../internals/engine-v8-version"),T=F("species"),U="Promise",z=x.get,A=x.set,B=x.getterFor(U),C=s,D=a.TypeError,G=a.document,I=a.process,J=c("fetch"),K=k.f,L=K,M=!!(G&&G.createEvent&&a.dispatchEvent),N="function"==typeof PromiseRejectionEvent,O="unhandledrejection",Q="rejectionhandled",V=0,W=1,X=2,Y=1,Z=2,$=R(U,function(){if(!(m(C)!==String(C))){if(66===S)return!0;if(!H&&!N)return!0}if(o&&!C.prototype.finally)return!0;if(S>=51&&/native code/.test(C))return!1;var e=C.resolve(1),n=function(e){e(function(){},function(){})};return(e.constructor={})[T]=n,!(e.then(function(){})instanceof n)}),_=$||!y(function(e){C.all(e).catch(function(){})}),ee=function(e){var n;return!(!p(e)||"function"!=typeof(n=e.then))&&n},ne=function(e,n){if(!e.notified){e.notified=!0;var t=e.reactions;b(function(){for(var r=e.value,i=e.state==W,o=0;t.length>o;){var a,c,s,u=t[o++],l=i?u.ok:u.fail,f=u.resolve,v=u.reject,p=u.domain;try{l?(i||(e.rejection===Z&&oe(e),e.rejection=Y),!0===l?a=r:(p&&p.enter(),a=l(r),p&&(p.exit(),s=!0)),a===u.promise?v(D("Promise-chain cycle")):(c=ee(a))?c.call(a,f,v):f(a)):v(r)}catch(h){p&&!s&&p.exit(),v(h)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&re(e)})}},te=function(e,n,t){var r,i;M?((r=G.createEvent("Event")).promise=n,r.reason=t,r.initEvent(e,!1,!0),a.dispatchEvent(r)):r={promise:n,reason:t},!N&&(i=a["on"+e])?i(r):e===O&&E("Unhandled promise rejection",t)},re=function(e){g.call(a,function(){var n,t=e.facade,r=e.value;if(ie(e)&&(n=P(function(){H?I.emit("unhandledRejection",r,t):te(O,t,r)}),e.rejection=H||ie(e)?Z:Y,n.error))throw n.value})},ie=function(e){return e.rejection!==Y&&!e.parent},oe=function(e){g.call(a,function(){var n=e.facade;H?I.emit("rejectionHandled",n):te(Q,n,e.value)})},ae=function(e,n,t){return function(r){e(n,r,t)}},ce=function(e,n,t){e.done||(e.done=!0,t&&(e=t),e.value=n,e.state=X,ne(e,!0))},se=function(e,n,t){if(!e.done){e.done=!0,t&&(e=t);try{if(e.facade===n)throw D("Promise can't be resolved itself");var r=ee(n);r?b(function(){var t={done:!1};try{r.call(n,ae(se,t,e),ae(ce,t,e))}catch(i){ce(t,i,e)}}):(e.value=n,e.state=W,ne(e,!1))}catch(i){ce({done:!1},i,e)}}};$&&(C=function(n){d(this,C,U),h(n),e.call(this);var t=z(this);try{n(ae(se,t),ae(ce,t))}catch(r){ce(t,r)}},(e=function(e){A(this,{type:U,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:V,value:void 0})}).prototype=l(C.prototype,{then:function(e,n){var t=B(this),r=K(j(this,C));return r.ok="function"!=typeof e||e,r.fail="function"==typeof n&&n,r.domain=H?I.domain:void 0,t.parent=!0,t.reactions.push(r),t.state!=V&&ne(t,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),n=function(){var n=new e,t=z(n);this.promise=n,this.resolve=ae(se,t),this.reject=ae(ce,t)},k.f=K=function(e){return e===C||e===t?new n(e):L(e)},o||"function"!=typeof s||(r=s.prototype.then,u(s.prototype,"then",function(e,n){var t=this;return new C(function(e,n){r.call(t,e,n)}).then(e,n)},{unsafe:!0}),"function"==typeof J&&i({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return w(C,J.apply(a,arguments))}}))),i({global:!0,wrap:!0,forced:$},{Promise:C}),f(C,U,!1,!0),v(U),t=c(U),i({target:U,stat:!0,forced:$},{reject:function(e){var n=K(this);return n.reject.call(void 0,e),n.promise}}),i({target:U,stat:!0,forced:o||$},{resolve:function(e){return w(o&&this===t?C:this,e)}}),i({target:U,stat:!0,forced:_},{all:function(e){var n=this,t=K(n),r=t.resolve,i=t.reject,o=P(function(){var t=h(n.resolve),o=[],a=0,c=1;q(e,function(e){var s=a++,u=!1;o.push(void 0),c++,t.call(n,e).then(function(e){u||(u=!0,o[s]=e,--c||r(o))},i)}),--c||r(o)});return o.error&&i(o.value),t.promise},race:function(e){var n=this,t=K(n),r=t.reject,i=P(function(){var i=h(n.resolve);q(e,function(e){i.call(n,e).then(t.resolve,r)})});return i.error&&r(i.value),t.promise}});
},{"../internals/export":"rhEq","../internals/is-pure":"tGwT","../internals/global":"MVLi","../internals/get-built-in":"mLk8","../internals/native-promise-constructor":"O8N5","../internals/redefine":"ztZs","../internals/redefine-all":"oPIw","../internals/set-to-string-tag":"kLCt","../internals/set-species":"bDBP","../internals/is-object":"AsqF","../internals/a-function":"SOPX","../internals/an-instance":"pJoy","../internals/inspect-source":"DE9Q","../internals/iterate":"Oj1G","../internals/check-correctness-of-iteration":"XOlJ","../internals/species-constructor":"mxIp","../internals/task":"g1no","../internals/microtask":"jLqr","../internals/promise-resolve":"S6uO","../internals/host-report-errors":"xiDB","../internals/new-promise-capability":"NKSu","../internals/perform":"coA3","../internals/internal-state":"vLSK","../internals/is-forced":"Y6Gi","../internals/well-known-symbol":"Q0EA","../internals/engine-is-node":"dxME","../internals/engine-v8-version":"mpuz"}],"i5OW":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/a-function"),t=require("../internals/new-promise-capability"),i=require("../internals/perform"),n=require("../internals/iterate");e({target:"Promise",stat:!0},{allSettled:function(e){var a=this,s=t.f(a),u=s.resolve,l=s.reject,o=i(function(){var t=r(a.resolve),i=[],s=0,l=1;n(e,function(e){var r=s++,n=!1;i.push(void 0),l++,t.call(a,e).then(function(e){n||(n=!0,i[r]={status:"fulfilled",value:e},--l||u(i))},function(e){n||(n=!0,i[r]={status:"rejected",reason:e},--l||u(i))})}),--l||u(i)});return o.error&&l(o.value),s.promise}});
},{"../internals/export":"rhEq","../internals/a-function":"SOPX","../internals/new-promise-capability":"NKSu","../internals/perform":"coA3","../internals/iterate":"Oj1G"}],"rkDz":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/a-function"),n=require("../internals/get-built-in"),i=require("../internals/new-promise-capability"),t=require("../internals/perform"),a=require("../internals/iterate"),o="No one promise resolved";e({target:"Promise",stat:!0},{any:function(e){var s=this,u=i.f(s),l=u.resolve,c=u.reject,v=t(function(){var i=r(s.resolve),t=[],u=0,v=1,f=!1;a(e,function(e){var r=u++,a=!1;t.push(void 0),v++,i.call(s,e).then(function(e){a||f||(f=!0,l(e))},function(e){a||f||(a=!0,t[r]=e,--v||c(new(n("AggregateError"))(t,o)))})}),--v||c(new(n("AggregateError"))(t,o))});return v.error&&c(v.value),u.promise}});
},{"../internals/export":"rhEq","../internals/a-function":"SOPX","../internals/get-built-in":"mLk8","../internals/new-promise-capability":"NKSu","../internals/perform":"coA3","../internals/iterate":"Oj1G"}],"cWVQ":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/is-pure"),n=require("../internals/native-promise-constructor"),t=require("../internals/fails"),i=require("../internals/get-built-in"),o=require("../internals/species-constructor"),u=require("../internals/promise-resolve"),l=require("../internals/redefine"),s=!!n&&t(function(){n.prototype.finally.call({then:function(){}},function(){})});e({target:"Promise",proto:!0,real:!0,forced:s},{finally:function(e){var r=o(this,i("Promise")),n="function"==typeof e;return this.then(n?function(n){return u(r,e()).then(function(){return n})}:e,n?function(n){return u(r,e()).then(function(){throw n})}:e)}}),r||"function"!=typeof n||n.prototype.finally||l(n.prototype,"finally",i("Promise").prototype.finally);
},{"../internals/export":"rhEq","../internals/is-pure":"tGwT","../internals/native-promise-constructor":"O8N5","../internals/fails":"pWu7","../internals/get-built-in":"mLk8","../internals/species-constructor":"mxIp","../internals/promise-resolve":"S6uO","../internals/redefine":"ztZs"}],"eBDp":[function(require,module,exports) {

"use strict";var e=require("../internals/export"),r=require("../internals/global"),n=require("../internals/is-forced"),t=require("../internals/redefine"),i=require("../internals/internal-metadata"),a=require("../internals/iterate"),s=require("../internals/an-instance"),u=require("../internals/is-object"),o=require("../internals/fails"),l=require("../internals/check-correctness-of-iteration"),c=require("../internals/set-to-string-tag"),f=require("../internals/inherit-if-required");module.exports=function(d,h,q){var g=-1!==d.indexOf("Map"),p=-1!==d.indexOf("Weak"),v=g?"set":"add",w=r[d],x=w&&w.prototype,E=w,b={},y=function(e){var r=x[e];t(x,e,"add"==e?function(e){return r.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(p&&!u(e))&&r.call(this,0===e?0:e)}:"get"==e?function(e){return p&&!u(e)?void 0:r.call(this,0===e?0:e)}:"has"==e?function(e){return!(p&&!u(e))&&r.call(this,0===e?0:e)}:function(e,n){return r.call(this,0===e?0:e,n),this})};if(n(d,"function"!=typeof w||!(p||x.forEach&&!o(function(){(new w).entries().next()}))))E=q.getConstructor(h,d,g,v),i.REQUIRED=!0;else if(n(d,!0)){var R=new E,S=R[v](p?{}:-0,1)!=R,k=o(function(){R.has(1)}),m=l(function(e){new w(e)}),I=!p&&o(function(){for(var e=new w,r=5;r--;)e[v](r,r);return!e.has(-0)});m||((E=h(function(e,r){s(e,E,d);var n=f(new w,e,E);return null!=r&&a(r,n[v],{that:n,AS_ENTRIES:g}),n})).prototype=x,x.constructor=E),(k||I)&&(y("delete"),y("has"),g&&y("get")),(I||S)&&y(v),p&&x.clear&&delete x.clear}return b[d]=E,e({global:!0,forced:E!=w},b),c(E,d),p||q.setStrong(E,d,g),E};
},{"../internals/export":"rhEq","../internals/global":"MVLi","../internals/is-forced":"Y6Gi","../internals/redefine":"ztZs","../internals/internal-metadata":"Cjms","../internals/iterate":"Oj1G","../internals/an-instance":"pJoy","../internals/is-object":"AsqF","../internals/fails":"pWu7","../internals/check-correctness-of-iteration":"XOlJ","../internals/set-to-string-tag":"kLCt","../internals/inherit-if-required":"e5oz"}],"wHth":[function(require,module,exports) {
var define;
var e,t=require("../internals/object-define-property").f,r=require("../internals/object-create"),i=require("../internals/redefine-all"),n=require("../internals/function-bind-context"),s=require("../internals/an-instance"),a=require("../internals/iterate"),o=require("../internals/define-iterator"),u=require("../internals/set-species"),l=require("../internals/descriptors"),v=require("../internals/internal-metadata").fastKey,d=require("../internals/internal-state"),f=d.set,c=d.getterFor;module.exports={getConstructor:function(e,o,u,d){var p=e(function(e,t){s(e,p,o),f(e,{type:o,index:r(null),first:void 0,last:void 0,size:0}),l||(e.size=0),null!=t&&a(t,e[d],{that:e,AS_ENTRIES:u})}),x=c(o),h=function(e,t,r){var i,n,s=x(e),a=y(e,t);return a?a.value=r:(s.last=a={index:n=v(t,!0),key:t,value:r,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=a),i&&(i.next=a),l?s.size++:e.size++,"F"!==n&&(s.index[n]=a)),e},y=function(e,t){var r,i=x(e),n=v(t);if("F"!==n)return i.index[n];for(r=i.first;r;r=r.next)if(r.key==t)return r};return i(p.prototype,{clear:function(){for(var e=x(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,l?e.size=0:this.size=0},delete:function(e){var t=x(this),r=y(this,e);if(r){var i=r.next,n=r.previous;delete t.index[r.index],r.removed=!0,n&&(n.next=i),i&&(i.previous=n),t.first==r&&(t.first=i),t.last==r&&(t.last=n),l?t.size--:this.size--}return!!r},forEach:function(e){for(var t,r=x(this),i=n(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:r.first;)for(i(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!y(this,e)}}),i(p.prototype,u?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return h(this,0===e?0:e,t)}}:{add:function(e){return h(this,e=0===e?0:e,e)}}),l&&t(p.prototype,"size",{get:function(){return x(this).size}}),p},setStrong:function(e,t,r){var i=t+" Iterator",n=c(t),s=c(i);o(e,t,function(e,t){f(this,{type:i,target:e,state:n(e),kind:t,last:void 0})},function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})},r?"entries":"values",!r,!0),u(t)}};
},{"../internals/object-define-property":"AtXZ","../internals/object-create":"zWsZ","../internals/redefine-all":"oPIw","../internals/function-bind-context":"dEmF","../internals/an-instance":"pJoy","../internals/iterate":"Oj1G","../internals/define-iterator":"CpaJ","../internals/set-species":"bDBP","../internals/descriptors":"A8Ob","../internals/internal-metadata":"Cjms","../internals/internal-state":"vLSK"}],"hKUr":[function(require,module,exports) {
"use strict";var e=require("../internals/collection"),n=require("../internals/collection-strong");module.exports=e("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},n);
},{"../internals/collection":"eBDp","../internals/collection-strong":"wHth"}],"YQdF":[function(require,module,exports) {
"use strict";var e=require("../internals/collection"),t=require("../internals/collection-strong");module.exports=e("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},t);
},{"../internals/collection":"eBDp","../internals/collection-strong":"wHth"}],"cqZs":[function(require,module,exports) {
var define;
var e,t=require("../internals/redefine-all"),r=require("../internals/internal-metadata").getWeakData,n=require("../internals/an-object"),i=require("../internals/is-object"),u=require("../internals/an-instance"),a=require("../internals/iterate"),s=require("../internals/array-iteration"),o=require("../internals/has"),f=require("../internals/internal-state"),c=f.set,l=f.getterFor,d=s.find,h=s.findIndex,v=0,p=function(e){return e.frozen||(e.frozen=new q)},q=function(){this.entries=[]},g=function(e,t){return d(e.entries,function(e){return e[0]===t})};q.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var r=g(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=h(this.entries,function(t){return t[0]===e});return~t&&this.entries.splice(t,1),!!~t}},module.exports={getConstructor:function(e,s,f,d){var h=e(function(e,t){u(e,h,s),c(e,{type:s,id:v++,frozen:void 0}),null!=t&&a(t,e[d],{that:e,AS_ENTRIES:f})}),q=l(s),g=function(e,t,i){var u=q(e),a=r(n(t),!0);return!0===a?p(u).set(t,i):a[u.id]=i,e};return t(h.prototype,{delete:function(e){var t=q(this);if(!i(e))return!1;var n=r(e);return!0===n?p(t).delete(e):n&&o(n,t.id)&&delete n[t.id]},has:function(e){var t=q(this);if(!i(e))return!1;var n=r(e);return!0===n?p(t).has(e):n&&o(n,t.id)}}),t(h.prototype,f?{get:function(e){var t=q(this);if(i(e)){var n=r(e);return!0===n?p(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return g(this,e,t)}}:{add:function(e){return g(this,e,!0)}}),h}};
},{"../internals/redefine-all":"oPIw","../internals/internal-metadata":"Cjms","../internals/an-object":"eAPg","../internals/is-object":"AsqF","../internals/an-instance":"pJoy","../internals/iterate":"Oj1G","../internals/array-iteration":"EUh8","../internals/has":"jYdl","../internals/internal-state":"vLSK"}],"VLkh":[function(require,module,exports) {

"use strict";var e,t=require("../internals/global"),r=require("../internals/redefine-all"),n=require("../internals/internal-metadata"),i=require("../internals/collection"),l=require("../internals/collection-weak"),a=require("../internals/is-object"),s=require("../internals/internal-state").enforce,o=require("../internals/native-weak-map"),c=!t.ActiveXObject&&"ActiveXObject"in t,u=Object.isExtensible,f=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},h=module.exports=i("WeakMap",f,l);if(o&&c){e=l.getConstructor(f,"WeakMap",!0),n.REQUIRED=!0;var z=h.prototype,v=z.delete,q=z.has,d=z.get,b=z.set;r(z,{delete:function(t){if(a(t)&&!u(t)){var r=s(this);return r.frozen||(r.frozen=new e),v.call(this,t)||r.frozen.delete(t)}return v.call(this,t)},has:function(t){if(a(t)&&!u(t)){var r=s(this);return r.frozen||(r.frozen=new e),q.call(this,t)||r.frozen.has(t)}return q.call(this,t)},get:function(t){if(a(t)&&!u(t)){var r=s(this);return r.frozen||(r.frozen=new e),q.call(this,t)?d.call(this,t):r.frozen.get(t)}return d.call(this,t)},set:function(t,r){if(a(t)&&!u(t)){var n=s(this);n.frozen||(n.frozen=new e),q.call(this,t)?b.call(this,t,r):n.frozen.set(t,r)}else b.call(this,t,r);return this}})}
},{"../internals/global":"MVLi","../internals/redefine-all":"oPIw","../internals/internal-metadata":"Cjms","../internals/collection":"eBDp","../internals/collection-weak":"cqZs","../internals/is-object":"AsqF","../internals/internal-state":"vLSK","../internals/native-weak-map":"Z7Ix"}],"wv6n":[function(require,module,exports) {
"use strict";var e=require("../internals/collection"),n=require("../internals/collection-weak");e("WeakSet",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},n);
},{"../internals/collection":"eBDp","../internals/collection-weak":"cqZs"}],"qVzZ":[function(require,module,exports) {
module.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView;
},{}],"oe68":[function(require,module,exports) {
var r=require("../internals/to-integer"),e=require("../internals/to-length");module.exports=function(n){if(void 0===n)return 0;var t=r(n),i=e(t);if(t!==i)throw RangeError("Wrong length or index");return i};
},{"../internals/to-integer":"GwUC","../internals/to-length":"j9AG"}],"w3Al":[function(require,module,exports) {
var r=Math.abs,a=Math.pow,o=Math.floor,t=Math.log,n=Math.LN2,e=function(e,f,u){var h,l,M,c=new Array(u),i=8*u-f-1,p=(1<<i)-1,s=p>>1,v=23===f?a(2,-24)-a(2,-77):0,N=e<0||0===e&&1/e<0?1:0,g=0;for((e=r(e))!=e||e===1/0?(l=e!=e?1:0,h=p):(h=o(t(e)/n),e*(M=a(2,-h))<1&&(h--,M*=2),(e+=h+s>=1?v/M:v*a(2,1-s))*M>=2&&(h++,M/=2),h+s>=p?(l=0,h=p):h+s>=1?(l=(e*M-1)*a(2,f),h+=s):(l=e*a(2,s-1)*a(2,f),h=0));f>=8;c[g++]=255&l,l/=256,f-=8);for(h=h<<f|l,i+=f;i>0;c[g++]=255&h,h/=256,i-=8);return c[--g]|=128*N,c},f=function(r,o){var t,n=r.length,e=8*n-o-1,f=(1<<e)-1,u=f>>1,h=e-7,l=n-1,M=r[l--],c=127&M;for(M>>=7;h>0;c=256*c+r[l],l--,h-=8);for(t=c&(1<<-h)-1,c>>=-h,h+=o;h>0;t=256*t+r[l],l--,h-=8);if(0===c)c=1-u;else{if(c===f)return t?NaN:M?-1/0:1/0;t+=a(2,o),c-=u}return(M?-1:1)*t*a(2,c-o)};module.exports={pack:e,unpack:f};
},{}],"PaBh":[function(require,module,exports) {

"use strict";var t=require("../internals/global"),e=require("../internals/descriptors"),n=require("../internals/array-buffer-native"),r=require("../internals/create-non-enumerable-property"),i=require("../internals/redefine-all"),o=require("../internals/fails"),s=require("../internals/an-instance"),u=require("../internals/to-integer"),f=require("../internals/to-length"),a=require("../internals/to-index"),h=require("../internals/ieee754"),l=require("../internals/object-get-prototype-of"),c=require("../internals/object-set-prototype-of"),g=require("../internals/object-get-own-property-names").f,b=require("../internals/object-define-property").f,y=require("../internals/array-fill"),v=require("../internals/set-to-string-tag"),d=require("../internals/internal-state"),p=d.get,q=d.set,w="ArrayBuffer",I="DataView",L="prototype",U="Wrong length",O="Wrong index",j=t[w],m=j,F=t[I],x=F&&F[L],A=Object.prototype,W=t.RangeError,k=h.pack,B=h.unpack,D=function(t){return[255&t]},N=function(t){return[255&t,t>>8&255]},V=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},E=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},R=function(t){return k(t,23,4)},z=function(t){return k(t,52,8)},C=function(t,e){b(t[L],e,{get:function(){return p(this)[e]}})},G=function(t,e,n,r){var i=a(n),o=p(t);if(i+e>o.byteLength)throw W(O);var s=p(o.buffer).bytes,u=i+o.byteOffset,f=s.slice(u,u+e);return r?f:f.reverse()},H=function(t,e,n,r,i,o){var s=a(n),u=p(t);if(s+e>u.byteLength)throw W(O);for(var f=p(u.buffer).bytes,h=s+u.byteOffset,l=r(+i),c=0;c<e;c++)f[h+c]=l[o?c:e-c-1]};if(n){if(!o(function(){j(1)})||!o(function(){new j(-1)})||o(function(){return new j,new j(1.5),new j(NaN),j.name!=w})){for(var J,K=(m=function(t){return s(this,m),new j(a(t))})[L]=j[L],M=g(j),P=0;M.length>P;)(J=M[P++])in m||r(m,J,j[J]);K.constructor=m}c&&l(x)!==A&&c(x,A);var Q=new F(new m(2)),S=x.setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||i(x,{setInt8:function(t,e){S.call(this,t,e<<24>>24)},setUint8:function(t,e){S.call(this,t,e<<24>>24)}},{unsafe:!0})}else m=function(t){s(this,m,w);var n=a(t);q(this,{bytes:y.call(new Array(n),0),byteLength:n}),e||(this.byteLength=n)},F=function(t,n,r){s(this,F,I),s(t,m,I);var i=p(t).byteLength,o=u(n);if(o<0||o>i)throw W("Wrong offset");if(o+(r=void 0===r?i-o:f(r))>i)throw W(U);q(this,{buffer:t,byteLength:r,byteOffset:o}),e||(this.buffer=t,this.byteLength=r,this.byteOffset=o)},e&&(C(m,"byteLength"),C(F,"buffer"),C(F,"byteLength"),C(F,"byteOffset")),i(F[L],{getInt8:function(t){return G(this,1,t)[0]<<24>>24},getUint8:function(t){return G(this,1,t)[0]},getInt16:function(t){var e=G(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=G(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return E(G(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return E(G(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return B(G(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return B(G(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){H(this,1,t,D,e)},setUint8:function(t,e){H(this,1,t,D,e)},setInt16:function(t,e){H(this,2,t,N,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){H(this,2,t,N,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){H(this,4,t,V,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){H(this,4,t,V,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){H(this,4,t,R,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){H(this,8,t,z,e,arguments.length>2?arguments[2]:void 0)}});v(m,w),v(F,I),module.exports={ArrayBuffer:m,DataView:F};
},{"../internals/global":"MVLi","../internals/descriptors":"A8Ob","../internals/array-buffer-native":"qVzZ","../internals/create-non-enumerable-property":"GwPZ","../internals/redefine-all":"oPIw","../internals/fails":"pWu7","../internals/an-instance":"pJoy","../internals/to-integer":"GwUC","../internals/to-length":"j9AG","../internals/to-index":"oe68","../internals/ieee754":"w3Al","../internals/object-get-prototype-of":"xeyN","../internals/object-set-prototype-of":"eDCX","../internals/object-get-own-property-names":"QFCk","../internals/object-define-property":"AtXZ","../internals/array-fill":"Vois","../internals/set-to-string-tag":"kLCt","../internals/internal-state":"vLSK"}],"k7bY":[function(require,module,exports) {

"use strict";var r=require("../internals/export"),e=require("../internals/global"),a=require("../internals/array-buffer"),i=require("../internals/set-species"),s="ArrayBuffer",l=a[s],n=e[s];r({global:!0,forced:n!==l},{ArrayBuffer:l}),i(s);
},{"../internals/export":"rhEq","../internals/global":"MVLi","../internals/array-buffer":"PaBh","../internals/set-species":"bDBP"}],"WAtV":[function(require,module,exports) {

"use strict";var r,e=require("../internals/array-buffer-native"),t=require("../internals/descriptors"),n=require("../internals/global"),i=require("../internals/is-object"),o=require("../internals/has"),a=require("../internals/classof"),y=require("../internals/create-non-enumerable-property"),p=require("../internals/redefine"),f=require("../internals/object-define-property").f,u=require("../internals/object-get-prototype-of"),s=require("../internals/object-set-prototype-of"),l=require("../internals/well-known-symbol"),c=require("../internals/uid"),A=n.Int8Array,d=A&&A.prototype,T=n.Uint8ClampedArray,q=T&&T.prototype,v=A&&u(A),b=d&&u(d),g=Object.prototype,h=g.isPrototypeOf,E=l("toStringTag"),I=c("TYPED_ARRAY_TAG"),w=e&&!!s&&"Opera"!==a(n.opera),R=!1,U={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},_={BigInt64Array:8,BigUint64Array:8},j=function(r){if(!i(r))return!1;var e=a(r);return"DataView"===e||o(U,e)||o(_,e)},m=function(r){if(!i(r))return!1;var e=a(r);return o(U,e)||o(_,e)},F=function(r){if(m(r))return r;throw TypeError("Target is not a typed array")},Y=function(e){if(s){if(h.call(v,e))return e}else for(var t in U)if(o(U,r)){var i=n[t];if(i&&(e===i||h.call(i,e)))return e}throw TypeError("Target is not a typed array constructor")},P=function(r,e,i){if(t){if(i)for(var a in U){var y=n[a];y&&o(y.prototype,r)&&delete y.prototype[r]}b[r]&&!i||p(b,r,i?e:w&&d[r]||e)}},V=function(r,e,i){var a,y;if(t){if(s){if(i)for(a in U)(y=n[a])&&o(y,r)&&delete y[r];if(v[r]&&!i)return;try{return p(v,r,i?e:w&&A[r]||e)}catch(f){}}for(a in U)!(y=n[a])||y[r]&&!i||p(y,r,e)}};for(r in U)n[r]||(w=!1);if((!w||"function"!=typeof v||v===Function.prototype)&&(v=function(){throw TypeError("Incorrect invocation")},w))for(r in U)n[r]&&s(n[r],v);if((!w||!b||b===g)&&(b=v.prototype,w))for(r in U)n[r]&&s(n[r].prototype,b);if(w&&u(q)!==b&&s(q,b),t&&!o(b,E))for(r in R=!0,f(b,E,{get:function(){return i(this)?this[I]:void 0}}),U)n[r]&&y(n[r],I,r);module.exports={NATIVE_ARRAY_BUFFER_VIEWS:w,TYPED_ARRAY_TAG:R&&I,aTypedArray:F,aTypedArrayConstructor:Y,exportTypedArrayMethod:P,exportTypedArrayStaticMethod:V,isView:j,isTypedArray:m,TypedArray:v,TypedArrayPrototype:b};
},{"../internals/array-buffer-native":"qVzZ","../internals/descriptors":"A8Ob","../internals/global":"MVLi","../internals/is-object":"AsqF","../internals/has":"jYdl","../internals/classof":"rs2T","../internals/create-non-enumerable-property":"GwPZ","../internals/redefine":"ztZs","../internals/object-define-property":"AtXZ","../internals/object-get-prototype-of":"xeyN","../internals/object-set-prototype-of":"eDCX","../internals/well-known-symbol":"Q0EA","../internals/uid":"bxyG"}],"gshG":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/array-buffer-view-core"),i=e.NATIVE_ARRAY_BUFFER_VIEWS;r({target:"ArrayBuffer",stat:!0,forced:!i},{isView:e.isView});
},{"../internals/export":"rhEq","../internals/array-buffer-view-core":"WAtV"}],"hWBW":[function(require,module,exports) {
"use strict";var e=require("../internals/export"),r=require("../internals/fails"),t=require("../internals/array-buffer"),i=require("../internals/an-object"),n=require("../internals/to-absolute-index"),s=require("../internals/to-length"),a=require("../internals/species-constructor"),o=t.ArrayBuffer,u=t.DataView,l=o.prototype.slice,f=r(function(){return!new o(2).slice(1,void 0).byteLength});e({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:f},{slice:function(e,r){if(void 0!==l&&void 0===r)return l.call(i(this),e);for(var t=i(this).byteLength,f=n(e,t),c=n(void 0===r?t:r,t),h=new(a(this,o))(s(c-f)),q=new u(this),d=new u(h),v=0;f<c;)d.setUint8(v++,q.getUint8(f++));return h}});
},{"../internals/export":"rhEq","../internals/fails":"pWu7","../internals/array-buffer":"PaBh","../internals/an-object":"eAPg","../internals/to-absolute-index":"QLhU","../internals/to-length":"j9AG","../internals/species-constructor":"mxIp"}],"PIWk":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/array-buffer"),a=require("../internals/array-buffer-native");r({global:!0,forced:!a},{DataView:e.DataView});
},{"../internals/export":"rhEq","../internals/array-buffer":"PaBh","../internals/array-buffer-native":"qVzZ"}],"FTre":[function(require,module,exports) {

var e=require("../internals/global"),n=require("../internals/fails"),r=require("../internals/check-correctness-of-iteration"),i=require("../internals/array-buffer-view-core").NATIVE_ARRAY_BUFFER_VIEWS,t=e.ArrayBuffer,u=e.Int8Array;module.exports=!i||!n(function(){u(1)})||!n(function(){new u(-1)})||!r(function(e){new u,new u(null),new u(1.5),new u(e)},!0)||n(function(){return 1!==new u(new t(2),1,void 0).length});
},{"../internals/global":"MVLi","../internals/fails":"pWu7","../internals/check-correctness-of-iteration":"XOlJ","../internals/array-buffer-view-core":"WAtV"}],"sI92":[function(require,module,exports) {
var r=require("../internals/to-integer");module.exports=function(e){var n=r(e);if(n<0)throw RangeError("The argument can't be less than 0");return n};
},{"../internals/to-integer":"GwUC"}],"x7gX":[function(require,module,exports) {
var r=require("../internals/to-positive-integer");module.exports=function(e,o){var t=r(e);if(t%o)throw RangeError("Wrong offset");return t};
},{"../internals/to-positive-integer":"sI92"}],"FCc9":[function(require,module,exports) {
var e=require("../internals/to-object"),r=require("../internals/to-length"),t=require("../internals/get-iterator-method"),n=require("../internals/is-array-iterator-method"),i=require("../internals/function-bind-context"),o=require("../internals/array-buffer-view-core").aTypedArrayConstructor;module.exports=function(a){var l,u,s,c,d,f,h=e(a),q=arguments.length,v=q>1?arguments[1]:void 0,g=void 0!==v,y=t(h);if(null!=y&&!n(y))for(f=(d=y.call(h)).next,h=[];!(c=f.call(d)).done;)h.push(c.value);for(g&&q>2&&(v=i(v,arguments[2],2)),u=r(h.length),s=new(o(this))(u),l=0;u>l;l++)s[l]=g?v(h[l],l):h[l];return s};
},{"../internals/to-object":"Q9KC","../internals/to-length":"j9AG","../internals/get-iterator-method":"VM64","../internals/is-array-iterator-method":"XTOV","../internals/function-bind-context":"dEmF","../internals/array-buffer-view-core":"WAtV"}],"SkoY":[function(require,module,exports) {

"use strict";var e=require("../internals/export"),r=require("../internals/global"),t=require("../internals/descriptors"),n=require("../internals/typed-array-constructors-require-wrappers"),i=require("../internals/array-buffer-view-core"),a=require("../internals/array-buffer"),o=require("../internals/an-instance"),u=require("../internals/create-property-descriptor"),s=require("../internals/create-non-enumerable-property"),f=require("../internals/to-length"),l=require("../internals/to-index"),c=require("../internals/to-offset"),p=require("../internals/to-primitive"),y=require("../internals/has"),b=require("../internals/classof"),q=require("../internals/is-object"),d=require("../internals/object-create"),g=require("../internals/object-set-prototype-of"),h=require("../internals/object-get-own-property-names").f,w=require("../internals/typed-array-from"),v=require("../internals/array-iteration").forEach,A=require("../internals/set-species"),m=require("../internals/object-define-property"),E=require("../internals/object-get-own-property-descriptor"),T=require("../internals/internal-state"),j=require("../internals/inherit-if-required"),R=T.get,_=T.set,O=m.f,B=E.f,P=Math.round,S=r.RangeError,x=a.ArrayBuffer,L=a.DataView,Y=i.NATIVE_ARRAY_BUFFER_VIEWS,D=i.TYPED_ARRAY_TAG,V=i.TypedArray,C=i.TypedArrayPrototype,F=i.aTypedArrayConstructor,I=i.isTypedArray,M="BYTES_PER_ELEMENT",N="Wrong length",W=function(e,r){for(var t=0,n=r.length,i=new(F(e))(n);n>t;)i[t]=r[t++];return i},G=function(e,r){O(e,r,{get:function(){return R(this)[r]}})},U=function(e){var r;return e instanceof x||"ArrayBuffer"==(r=b(e))||"SharedArrayBuffer"==r},$=function(e,r){return I(e)&&"symbol"!=typeof r&&r in e&&String(+r)==String(r)},k=function(e,r){return $(e,r=p(r,!0))?u(2,e[r]):B(e,r)},z=function(e,r,t){return!($(e,r=p(r,!0))&&q(t)&&y(t,"value"))||y(t,"get")||y(t,"set")||t.configurable||y(t,"writable")&&!t.writable||y(t,"enumerable")&&!t.enumerable?O(e,r,t):(e[r]=t.value,e)};t?(Y||(E.f=k,m.f=z,G(C,"buffer"),G(C,"byteOffset"),G(C,"byteLength"),G(C,"length")),e({target:"Object",stat:!0,forced:!Y},{getOwnPropertyDescriptor:k,defineProperty:z}),module.exports=function(t,i,a){var u=t.match(/\d+$/)[0]/8,p=t+(a?"Clamped":"")+"Array",y="get"+t,b="set"+t,m=r[p],E=m,T=E&&E.prototype,B={},F=function(e,r){O(e,r,{get:function(){return function(e,r){var t=R(e);return t.view[y](r*u+t.byteOffset,!0)}(this,r)},set:function(e){return function(e,r,t){var n=R(e);a&&(t=(t=P(t))<0?0:t>255?255:255&t),n.view[b](r*u+n.byteOffset,t,!0)}(this,r,e)},enumerable:!0})};Y?n&&(E=i(function(e,r,t,n){return o(e,E,p),j(q(r)?U(r)?void 0!==n?new m(r,c(t,u),n):void 0!==t?new m(r,c(t,u)):new m(r):I(r)?W(E,r):w.call(E,r):new m(l(r)),e,E)}),g&&g(E,V),v(h(m),function(e){e in E||s(E,e,m[e])}),E.prototype=T):(E=i(function(e,r,t,n){o(e,E,p);var i,a,s,y=0,b=0;if(q(r)){if(!U(r))return I(r)?W(E,r):w.call(E,r);i=r,b=c(t,u);var d=r.byteLength;if(void 0===n){if(d%u)throw S(N);if((a=d-b)<0)throw S(N)}else if((a=f(n)*u)+b>d)throw S(N);s=a/u}else s=l(r),i=new x(a=s*u);for(_(e,{buffer:i,byteOffset:b,byteLength:a,length:s,view:new L(i)});y<s;)F(e,y++)}),g&&g(E,V),T=E.prototype=d(C)),T.constructor!==E&&s(T,"constructor",E),D&&s(T,D,p),B[p]=E,e({global:!0,forced:E!=m,sham:!Y},B),M in E||s(E,M,u),M in T||s(T,M,u),A(p)}):module.exports=function(){};
},{"../internals/export":"rhEq","../internals/global":"MVLi","../internals/descriptors":"A8Ob","../internals/typed-array-constructors-require-wrappers":"FTre","../internals/array-buffer-view-core":"WAtV","../internals/array-buffer":"PaBh","../internals/an-instance":"pJoy","../internals/create-property-descriptor":"oNyT","../internals/create-non-enumerable-property":"GwPZ","../internals/to-length":"j9AG","../internals/to-index":"oe68","../internals/to-offset":"x7gX","../internals/to-primitive":"wZyz","../internals/has":"jYdl","../internals/classof":"rs2T","../internals/is-object":"AsqF","../internals/object-create":"zWsZ","../internals/object-set-prototype-of":"eDCX","../internals/object-get-own-property-names":"QFCk","../internals/typed-array-from":"FCc9","../internals/array-iteration":"EUh8","../internals/set-species":"bDBP","../internals/object-define-property":"AtXZ","../internals/object-get-own-property-descriptor":"zm15","../internals/internal-state":"vLSK","../internals/inherit-if-required":"e5oz"}],"pj5Y":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Int8",function(r){return function(n,t,e){return r(this,n,t,e)}});
},{"../internals/typed-array-constructor":"SkoY"}],"bEo5":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Uint8",function(r){return function(n,t,e){return r(this,n,t,e)}});
},{"../internals/typed-array-constructor":"SkoY"}],"vkrB":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Uint8",function(r){return function(n,t,e){return r(this,n,t,e)}},!0);
},{"../internals/typed-array-constructor":"SkoY"}],"gVoK":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Int16",function(r){return function(n,t,e){return r(this,n,t,e)}});
},{"../internals/typed-array-constructor":"SkoY"}],"J7Nt":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Uint16",function(r){return function(n,t,e){return r(this,n,t,e)}});
},{"../internals/typed-array-constructor":"SkoY"}],"KYTa":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Int32",function(r){return function(n,t,e){return r(this,n,t,e)}});
},{"../internals/typed-array-constructor":"SkoY"}],"zDl8":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Uint32",function(r){return function(n,t,e){return r(this,n,t,e)}});
},{"../internals/typed-array-constructor":"SkoY"}],"YrPA":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Float32",function(r){return function(t,n,e){return r(this,t,n,e)}});
},{"../internals/typed-array-constructor":"SkoY"}],"UhAe":[function(require,module,exports) {
var r=require("../internals/typed-array-constructor");r("Float64",function(r){return function(t,n,e){return r(this,t,n,e)}});
},{"../internals/typed-array-constructor":"SkoY"}],"JVBr":[function(require,module,exports) {
"use strict";var r=require("../internals/typed-array-constructors-require-wrappers"),e=require("../internals/array-buffer-view-core").exportTypedArrayStaticMethod,a=require("../internals/typed-array-from");e("from",a,r);
},{"../internals/typed-array-constructors-require-wrappers":"FTre","../internals/array-buffer-view-core":"WAtV","../internals/typed-array-from":"FCc9"}],"LSqt":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/typed-array-constructors-require-wrappers"),t=r.aTypedArrayConstructor,a=r.exportTypedArrayStaticMethod;a("of",function(){for(var r=0,e=arguments.length,a=new(t(this))(e);e>r;)a[r]=arguments[r++];return a},e);
},{"../internals/array-buffer-view-core":"WAtV","../internals/typed-array-constructors-require-wrappers":"FTre"}],"Agsp":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-copy-within"),i=r.aTypedArray,t=r.exportTypedArrayMethod;t("copyWithin",function(r,t){return e.call(i(this),r,t,arguments.length>2?arguments[2]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-copy-within":"A81S"}],"b4EW":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-iteration").every,t=r.aTypedArray,a=r.exportTypedArrayMethod;a("every",function(r){return e(t(this),r,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-iteration":"EUh8"}],"nfIa":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-fill"),a=r.aTypedArray,i=r.exportTypedArrayMethod;i("fill",function(r){return e.apply(a(this),arguments)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-fill":"Vois"}],"ICTQ":[function(require,module,exports) {
var r=require("../internals/array-buffer-view-core").aTypedArrayConstructor,e=require("../internals/species-constructor");module.exports=function(n,t){for(var o=e(n,n.constructor),u=0,a=t.length,c=new(r(o))(a);a>u;)c[u]=t[u++];return c};
},{"../internals/array-buffer-view-core":"WAtV","../internals/species-constructor":"mxIp"}],"LZY1":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-iteration").filter,i=require("../internals/typed-array-from-species-and-list"),t=r.aTypedArray,a=r.exportTypedArrayMethod;a("filter",function(r){var a=e(t(this),r,arguments.length>1?arguments[1]:void 0);return i(this,a)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-iteration":"EUh8","../internals/typed-array-from-species-and-list":"ICTQ"}],"TGdF":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-iteration").find,i=r.aTypedArray,t=r.exportTypedArrayMethod;t("find",function(r){return e(i(this),r,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-iteration":"EUh8"}],"LiYi":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-iteration").findIndex,i=r.aTypedArray,n=r.exportTypedArrayMethod;n("findIndex",function(r){return e(i(this),r,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-iteration":"EUh8"}],"wEtZ":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-iteration").forEach,a=r.aTypedArray,i=r.exportTypedArrayMethod;i("forEach",function(r){e(a(this),r,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-iteration":"EUh8"}],"xkZq":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-includes").includes,i=r.aTypedArray,n=r.exportTypedArrayMethod;n("includes",function(r){return e(i(this),r,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-includes":"b2MC"}],"eoPP":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-includes").indexOf,i=r.aTypedArray,n=r.exportTypedArrayMethod;n("indexOf",function(r){return e(i(this),r,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-includes":"b2MC"}],"onHc":[function(require,module,exports) {

"use strict";var e=require("../internals/global"),r=require("../internals/array-buffer-view-core"),t=require("../modules/es.array.iterator"),a=require("../internals/well-known-symbol"),n=a("iterator"),i=e.Uint8Array,l=t.values,s=t.keys,u=t.entries,o=r.aTypedArray,y=r.exportTypedArrayMethod,c=i&&i.prototype[n],f=!!c&&("values"==c.name||null==c.name),p=function(){return l.call(o(this))};y("entries",function(){return u.call(o(this))}),y("keys",function(){return s.call(o(this))}),y("values",p,!f),y(n,p,!f);
},{"../internals/global":"MVLi","../internals/array-buffer-view-core":"WAtV","../modules/es.array.iterator":"S91k","../internals/well-known-symbol":"Q0EA"}],"Nwa1":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=r.aTypedArray,a=r.exportTypedArrayMethod,i=[].join;a("join",function(r){return i.apply(e(this),arguments)});
},{"../internals/array-buffer-view-core":"WAtV"}],"V6i5":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-last-index-of"),a=r.aTypedArray,t=r.exportTypedArrayMethod;t("lastIndexOf",function(r){return e.apply(a(this),arguments)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-last-index-of":"aZkb"}],"pY7Y":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-iteration").map,t=require("../internals/species-constructor"),n=r.aTypedArray,a=r.aTypedArrayConstructor,i=r.exportTypedArrayMethod;i("map",function(r){return e(n(this),r,arguments.length>1?arguments[1]:void 0,function(r,e){return new(a(t(r,r.constructor)))(e)})});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-iteration":"EUh8","../internals/species-constructor":"mxIp"}],"sz4a":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-reduce").left,t=r.aTypedArray,a=r.exportTypedArrayMethod;a("reduce",function(r){return e(t(this),r,arguments.length,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-reduce":"SMmH"}],"sg6r":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-reduce").right,t=r.aTypedArray,i=r.exportTypedArrayMethod;i("reduceRight",function(r){return e(t(this),r,arguments.length,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-reduce":"SMmH"}],"IpMQ":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=r.aTypedArray,t=r.exportTypedArrayMethod,i=Math.floor;t("reverse",function(){for(var r,t=e(this).length,s=i(t/2),a=0;a<s;)r=this[a],this[a++]=this[--t],this[t]=r;return this});
},{"../internals/array-buffer-view-core":"WAtV"}],"EEAA":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/to-length"),t=require("../internals/to-offset"),n=require("../internals/to-object"),i=require("../internals/fails"),a=r.aTypedArray,o=r.exportTypedArrayMethod,s=i(function(){new Int8Array(1).set({})});o("set",function(r){a(this);var i=t(arguments.length>1?arguments[1]:void 0,1),o=this.length,s=n(r),l=e(s.length),h=0;if(l+i>o)throw RangeError("Wrong length");for(;h<l;)this[i+h]=s[h++]},s);
},{"../internals/array-buffer-view-core":"WAtV","../internals/to-length":"j9AG","../internals/to-offset":"x7gX","../internals/to-object":"Q9KC","../internals/fails":"pWu7"}],"R8cM":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/species-constructor"),t=require("../internals/fails"),i=r.aTypedArray,n=r.aTypedArrayConstructor,s=r.exportTypedArrayMethod,a=[].slice,c=t(function(){new Int8Array(1).slice()});s("slice",function(r,t){for(var s=a.call(i(this),r,t),c=e(this,this.constructor),o=0,u=s.length,l=new(n(c))(u);u>o;)l[o]=s[o++];return l},c);
},{"../internals/array-buffer-view-core":"WAtV","../internals/species-constructor":"mxIp","../internals/fails":"pWu7"}],"elGv":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/array-iteration").some,t=r.aTypedArray,a=r.exportTypedArrayMethod;a("some",function(r){return e(t(this),r,arguments.length>1?arguments[1]:void 0)});
},{"../internals/array-buffer-view-core":"WAtV","../internals/array-iteration":"EUh8"}],"d3I6":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=r.aTypedArray,t=r.exportTypedArrayMethod,a=[].sort;t("sort",function(r){return a.call(e(this),r)});
},{"../internals/array-buffer-view-core":"WAtV"}],"vAVn":[function(require,module,exports) {
"use strict";var r=require("../internals/array-buffer-view-core"),e=require("../internals/to-length"),t=require("../internals/to-absolute-index"),n=require("../internals/species-constructor"),i=r.aTypedArray,a=r.exportTypedArrayMethod;a("subarray",function(r,a){var s=i(this),u=s.length,o=t(r,u);return new(n(s,s.constructor))(s.buffer,s.byteOffset+o*s.BYTES_PER_ELEMENT,e((void 0===a?u:t(a,u))-o))});
},{"../internals/array-buffer-view-core":"WAtV","../internals/to-length":"j9AG","../internals/to-absolute-index":"QLhU","../internals/species-constructor":"mxIp"}],"Y4JY":[function(require,module,exports) {

"use strict";var r=require("../internals/global"),e=require("../internals/array-buffer-view-core"),t=require("../internals/fails"),n=r.Int8Array,a=e.aTypedArray,i=e.exportTypedArrayMethod,o=[].toLocaleString,l=[].slice,c=!!n&&t(function(){o.call(new n(1))}),u=t(function(){return[1,2].toLocaleString()!=new n([1,2]).toLocaleString()})||!t(function(){n.prototype.toLocaleString.call([1,2])});i("toLocaleString",function(){return o.apply(c?l.call(a(this)):a(this),arguments)},u);
},{"../internals/global":"MVLi","../internals/array-buffer-view-core":"WAtV","../internals/fails":"pWu7"}],"pSqK":[function(require,module,exports) {

"use strict";var r=require("../internals/array-buffer-view-core").exportTypedArrayMethod,t=require("../internals/fails"),e=require("../internals/global"),i=e.Uint8Array,n=i&&i.prototype||{},a=[].toString,o=[].join;t(function(){a.call({})})&&(a=function(){return o.call(this)});var l=n.toString!=a;r("toString",a,l);
},{"../internals/array-buffer-view-core":"WAtV","../internals/fails":"pWu7","../internals/global":"MVLi"}],"HvHw":[function(require,module,exports) {
var e=require("../internals/export"),n=require("../internals/get-built-in"),r=require("../internals/a-function"),t=require("../internals/an-object"),i=require("../internals/fails"),a=n("Reflect","apply"),l=Function.apply,u=!i(function(){a(function(){})});e({target:"Reflect",stat:!0,forced:u},{apply:function(e,n,i){return r(e),t(i),a?a(e,n,i):l.call(e,n,i)}});
},{"../internals/export":"rhEq","../internals/get-built-in":"mLk8","../internals/a-function":"SOPX","../internals/an-object":"eAPg","../internals/fails":"pWu7"}],"DGs4":[function(require,module,exports) {
var e=require("../internals/export"),n=require("../internals/get-built-in"),r=require("../internals/a-function"),t=require("../internals/an-object"),i=require("../internals/is-object"),u=require("../internals/object-create"),a=require("../internals/function-bind"),c=require("../internals/fails"),s=n("Reflect","construct"),l=c(function(){function e(){}return!(s(function(){},[],e)instanceof e)}),o=!c(function(){s(function(){})}),f=l||o;e({target:"Reflect",stat:!0,forced:f,sham:f},{construct:function(e,n){r(e),t(n);var c=arguments.length<3?e:r(arguments[2]);if(o&&!l)return s(e,n,c);if(e==c){switch(n.length){case 0:return new e;case 1:return new e(n[0]);case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[1],n[2]);case 4:return new e(n[0],n[1],n[2],n[3])}var f=[null];return f.push.apply(f,n),new(a.apply(e,f))}var p=c.prototype,q=u(i(p)?p:Object.prototype),w=Function.apply.call(e,q,n);return i(w)?w:q}});
},{"../internals/export":"rhEq","../internals/get-built-in":"mLk8","../internals/a-function":"SOPX","../internals/an-object":"eAPg","../internals/is-object":"AsqF","../internals/object-create":"zWsZ","../internals/function-bind":"evUJ","../internals/fails":"pWu7"}],"Lhv1":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/descriptors"),t=require("../internals/an-object"),i=require("../internals/to-primitive"),n=require("../internals/object-define-property"),a=require("../internals/fails"),u=a(function(){Reflect.defineProperty(n.f({},1,{value:1}),1,{value:2})});e({target:"Reflect",stat:!0,forced:u,sham:!r},{defineProperty:function(e,r,a){t(e);var u=i(r,!0);t(a);try{return n.f(e,u,a),!0}catch(f){return!1}}});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/an-object":"eAPg","../internals/to-primitive":"wZyz","../internals/object-define-property":"AtXZ","../internals/fails":"pWu7"}],"sSoW":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/an-object"),t=require("../internals/object-get-own-property-descriptor").f;e({target:"Reflect",stat:!0},{deleteProperty:function(e,n){var a=t(r(e),n);return!(a&&!a.configurable)&&delete e[n]}});
},{"../internals/export":"rhEq","../internals/an-object":"eAPg","../internals/object-get-own-property-descriptor":"zm15"}],"hsSr":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/is-object"),t=require("../internals/an-object"),i=require("../internals/has"),n=require("../internals/object-get-own-property-descriptor"),a=require("../internals/object-get-prototype-of");function o(e,l){var s,u,c=arguments.length<3?e:arguments[2];return t(e)===c?e[l]:(s=n.f(e,l))?i(s,"value")?s.value:void 0===s.get?void 0:s.get.call(c):r(u=a(e))?o(u,l,c):void 0}e({target:"Reflect",stat:!0},{get:o});
},{"../internals/export":"rhEq","../internals/is-object":"AsqF","../internals/an-object":"eAPg","../internals/has":"jYdl","../internals/object-get-own-property-descriptor":"zm15","../internals/object-get-prototype-of":"xeyN"}],"cznX":[function(require,module,exports) {
var r=require("../internals/export"),e=require("../internals/descriptors"),t=require("../internals/an-object"),n=require("../internals/object-get-own-property-descriptor");r({target:"Reflect",stat:!0,sham:!e},{getOwnPropertyDescriptor:function(r,e){return n.f(t(r),e)}});
},{"../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/an-object":"eAPg","../internals/object-get-own-property-descriptor":"zm15"}],"ghbB":[function(require,module,exports) {
var e=require("../internals/export"),t=require("../internals/an-object"),r=require("../internals/object-get-prototype-of"),n=require("../internals/correct-prototype-getter");e({target:"Reflect",stat:!0,sham:!n},{getPrototypeOf:function(e){return r(t(e))}});
},{"../internals/export":"rhEq","../internals/an-object":"eAPg","../internals/object-get-prototype-of":"xeyN","../internals/correct-prototype-getter":"x9wq"}],"LCUf":[function(require,module,exports) {
var t=require("../internals/export");t({target:"Reflect",stat:!0},{has:function(t,e){return e in t}});
},{"../internals/export":"rhEq"}],"GX83":[function(require,module,exports) {
var e=require("../internals/export"),t=require("../internals/an-object"),r=Object.isExtensible;e({target:"Reflect",stat:!0},{isExtensible:function(e){return t(e),!r||r(e)}});
},{"../internals/export":"rhEq","../internals/an-object":"eAPg"}],"X8ou":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/own-keys");e({target:"Reflect",stat:!0},{ownKeys:r});
},{"../internals/export":"rhEq","../internals/own-keys":"uZDC"}],"bogC":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/get-built-in"),t=require("../internals/an-object"),n=require("../internals/freezing");e({target:"Reflect",stat:!0,sham:!n},{preventExtensions:function(e){t(e);try{var n=r("Object","preventExtensions");return n&&n(e),!0}catch(i){return!1}}});
},{"../internals/export":"rhEq","../internals/get-built-in":"mLk8","../internals/an-object":"eAPg","../internals/freezing":"ZrZO"}],"lAc1":[function(require,module,exports) {
var e=require("../internals/export"),r=require("../internals/an-object"),t=require("../internals/is-object"),i=require("../internals/has"),n=require("../internals/fails"),a=require("../internals/object-define-property"),o=require("../internals/object-get-own-property-descriptor"),f=require("../internals/object-get-prototype-of"),l=require("../internals/create-property-descriptor");function s(e,n,u){var c,p,q=arguments.length<4?e:arguments[3],b=o.f(r(e),n);if(!b){if(t(p=f(e)))return s(p,n,u,q);b=l(0)}if(i(b,"value")){if(!1===b.writable||!t(q))return!1;if(c=o.f(q,n)){if(c.get||c.set||!1===c.writable)return!1;c.value=u,a.f(q,n,c)}else a.f(q,n,l(0,u));return!0}return void 0!==b.set&&(b.set.call(q,u),!0)}var u=n(function(){var e=function(){},r=a.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,r)});e({target:"Reflect",stat:!0,forced:u},{set:s});
},{"../internals/export":"rhEq","../internals/an-object":"eAPg","../internals/is-object":"AsqF","../internals/has":"jYdl","../internals/fails":"pWu7","../internals/object-define-property":"AtXZ","../internals/object-get-own-property-descriptor":"zm15","../internals/object-get-prototype-of":"xeyN","../internals/create-property-descriptor":"oNyT"}],"kZtr":[function(require,module,exports) {
var e=require("../internals/export"),t=require("../internals/an-object"),r=require("../internals/a-possible-prototype"),n=require("../internals/object-set-prototype-of");n&&e({target:"Reflect",stat:!0},{setPrototypeOf:function(e,o){t(e),r(o);try{return n(e,o),!0}catch(a){return!1}}});
},{"../internals/export":"rhEq","../internals/an-object":"eAPg","../internals/a-possible-prototype":"ckfP","../internals/object-set-prototype-of":"eDCX"}],"aYc3":[function(require,module,exports) {

var e=require("../internals/export"),r=require("../internals/global"),t=require("../internals/set-to-string-tag");e({global:!0},{Reflect:{}}),t(r.Reflect,"Reflect",!0);
},{"../internals/export":"rhEq","../internals/global":"MVLi","../internals/set-to-string-tag":"kLCt"}],"L1QH":[function(require,module,exports) {
require("../modules/es.symbol"),require("../modules/es.symbol.async-iterator"),require("../modules/es.symbol.description"),require("../modules/es.symbol.has-instance"),require("../modules/es.symbol.is-concat-spreadable"),require("../modules/es.symbol.iterator"),require("../modules/es.symbol.match"),require("../modules/es.symbol.match-all"),require("../modules/es.symbol.replace"),require("../modules/es.symbol.search"),require("../modules/es.symbol.species"),require("../modules/es.symbol.split"),require("../modules/es.symbol.to-primitive"),require("../modules/es.symbol.to-string-tag"),require("../modules/es.symbol.unscopables"),require("../modules/es.aggregate-error"),require("../modules/es.array.from"),require("../modules/es.array.is-array"),require("../modules/es.array.of"),require("../modules/es.array.concat"),require("../modules/es.array.copy-within"),require("../modules/es.array.every"),require("../modules/es.array.fill"),require("../modules/es.array.filter"),require("../modules/es.array.find"),require("../modules/es.array.find-index"),require("../modules/es.array.flat"),require("../modules/es.array.flat-map"),require("../modules/es.array.for-each"),require("../modules/es.array.includes"),require("../modules/es.array.index-of"),require("../modules/es.array.join"),require("../modules/es.array.last-index-of"),require("../modules/es.array.map"),require("../modules/es.array.reduce"),require("../modules/es.array.reduce-right"),require("../modules/es.array.reverse"),require("../modules/es.array.slice"),require("../modules/es.array.some"),require("../modules/es.array.sort"),require("../modules/es.array.splice"),require("../modules/es.array.species"),require("../modules/es.array.unscopables.flat"),require("../modules/es.array.unscopables.flat-map"),require("../modules/es.array.iterator"),require("../modules/es.function.bind"),require("../modules/es.function.name"),require("../modules/es.function.has-instance"),require("../modules/es.global-this"),require("../modules/es.object.assign"),require("../modules/es.object.create"),require("../modules/es.object.define-property"),require("../modules/es.object.define-properties"),require("../modules/es.object.entries"),require("../modules/es.object.freeze"),require("../modules/es.object.from-entries"),require("../modules/es.object.get-own-property-descriptor"),require("../modules/es.object.get-own-property-descriptors"),require("../modules/es.object.get-own-property-names"),require("../modules/es.object.get-prototype-of"),require("../modules/es.object.is"),require("../modules/es.object.is-extensible"),require("../modules/es.object.is-frozen"),require("../modules/es.object.is-sealed"),require("../modules/es.object.keys"),require("../modules/es.object.prevent-extensions"),require("../modules/es.object.seal"),require("../modules/es.object.set-prototype-of"),require("../modules/es.object.values"),require("../modules/es.object.to-string"),require("../modules/es.object.define-getter"),require("../modules/es.object.define-setter"),require("../modules/es.object.lookup-getter"),require("../modules/es.object.lookup-setter"),require("../modules/es.string.from-code-point"),require("../modules/es.string.raw"),require("../modules/es.string.code-point-at"),require("../modules/es.string.ends-with"),require("../modules/es.string.includes"),require("../modules/es.string.match"),require("../modules/es.string.match-all"),require("../modules/es.string.pad-end"),require("../modules/es.string.pad-start"),require("../modules/es.string.repeat"),require("../modules/es.string.replace"),require("../modules/es.string.search"),require("../modules/es.string.split"),require("../modules/es.string.starts-with"),require("../modules/es.string.trim"),require("../modules/es.string.trim-start"),require("../modules/es.string.trim-end"),require("../modules/es.string.iterator"),require("../modules/es.string.anchor"),require("../modules/es.string.big"),require("../modules/es.string.blink"),require("../modules/es.string.bold"),require("../modules/es.string.fixed"),require("../modules/es.string.fontcolor"),require("../modules/es.string.fontsize"),require("../modules/es.string.italics"),require("../modules/es.string.link"),require("../modules/es.string.small"),require("../modules/es.string.strike"),require("../modules/es.string.sub"),require("../modules/es.string.sup"),require("../modules/es.string.replace-all"),require("../modules/es.regexp.constructor"),require("../modules/es.regexp.exec"),require("../modules/es.regexp.flags"),require("../modules/es.regexp.sticky"),require("../modules/es.regexp.test"),require("../modules/es.regexp.to-string"),require("../modules/es.parse-int"),require("../modules/es.parse-float"),require("../modules/es.number.constructor"),require("../modules/es.number.epsilon"),require("../modules/es.number.is-finite"),require("../modules/es.number.is-integer"),require("../modules/es.number.is-nan"),require("../modules/es.number.is-safe-integer"),require("../modules/es.number.max-safe-integer"),require("../modules/es.number.min-safe-integer"),require("../modules/es.number.parse-float"),require("../modules/es.number.parse-int"),require("../modules/es.number.to-fixed"),require("../modules/es.number.to-precision"),require("../modules/es.math.acosh"),require("../modules/es.math.asinh"),require("../modules/es.math.atanh"),require("../modules/es.math.cbrt"),require("../modules/es.math.clz32"),require("../modules/es.math.cosh"),require("../modules/es.math.expm1"),require("../modules/es.math.fround"),require("../modules/es.math.hypot"),require("../modules/es.math.imul"),require("../modules/es.math.log10"),require("../modules/es.math.log1p"),require("../modules/es.math.log2"),require("../modules/es.math.sign"),require("../modules/es.math.sinh"),require("../modules/es.math.tanh"),require("../modules/es.math.to-string-tag"),require("../modules/es.math.trunc"),require("../modules/es.date.now"),require("../modules/es.date.to-json"),require("../modules/es.date.to-iso-string"),require("../modules/es.date.to-string"),require("../modules/es.date.to-primitive"),require("../modules/es.json.stringify"),require("../modules/es.json.to-string-tag"),require("../modules/es.promise"),require("../modules/es.promise.all-settled"),require("../modules/es.promise.any"),require("../modules/es.promise.finally"),require("../modules/es.map"),require("../modules/es.set"),require("../modules/es.weak-map"),require("../modules/es.weak-set"),require("../modules/es.array-buffer.constructor"),require("../modules/es.array-buffer.is-view"),require("../modules/es.array-buffer.slice"),require("../modules/es.data-view"),require("../modules/es.typed-array.int8-array"),require("../modules/es.typed-array.uint8-array"),require("../modules/es.typed-array.uint8-clamped-array"),require("../modules/es.typed-array.int16-array"),require("../modules/es.typed-array.uint16-array"),require("../modules/es.typed-array.int32-array"),require("../modules/es.typed-array.uint32-array"),require("../modules/es.typed-array.float32-array"),require("../modules/es.typed-array.float64-array"),require("../modules/es.typed-array.from"),require("../modules/es.typed-array.of"),require("../modules/es.typed-array.copy-within"),require("../modules/es.typed-array.every"),require("../modules/es.typed-array.fill"),require("../modules/es.typed-array.filter"),require("../modules/es.typed-array.find"),require("../modules/es.typed-array.find-index"),require("../modules/es.typed-array.for-each"),require("../modules/es.typed-array.includes"),require("../modules/es.typed-array.index-of"),require("../modules/es.typed-array.iterator"),require("../modules/es.typed-array.join"),require("../modules/es.typed-array.last-index-of"),require("../modules/es.typed-array.map"),require("../modules/es.typed-array.reduce"),require("../modules/es.typed-array.reduce-right"),require("../modules/es.typed-array.reverse"),require("../modules/es.typed-array.set"),require("../modules/es.typed-array.slice"),require("../modules/es.typed-array.some"),require("../modules/es.typed-array.sort"),require("../modules/es.typed-array.subarray"),require("../modules/es.typed-array.to-locale-string"),require("../modules/es.typed-array.to-string"),require("../modules/es.reflect.apply"),require("../modules/es.reflect.construct"),require("../modules/es.reflect.define-property"),require("../modules/es.reflect.delete-property"),require("../modules/es.reflect.get"),require("../modules/es.reflect.get-own-property-descriptor"),require("../modules/es.reflect.get-prototype-of"),require("../modules/es.reflect.has"),require("../modules/es.reflect.is-extensible"),require("../modules/es.reflect.own-keys"),require("../modules/es.reflect.prevent-extensions"),require("../modules/es.reflect.set"),require("../modules/es.reflect.set-prototype-of"),require("../modules/es.reflect.to-string-tag");var e=require("../internals/path");module.exports=e;
},{"../modules/es.symbol":"diqY","../modules/es.symbol.async-iterator":"N3MB","../modules/es.symbol.description":"LYOo","../modules/es.symbol.has-instance":"rFss","../modules/es.symbol.is-concat-spreadable":"stDf","../modules/es.symbol.iterator":"WXoU","../modules/es.symbol.match":"Hc3y","../modules/es.symbol.match-all":"lVca","../modules/es.symbol.replace":"pvvP","../modules/es.symbol.search":"rdEa","../modules/es.symbol.species":"jSLd","../modules/es.symbol.split":"c6b0","../modules/es.symbol.to-primitive":"sek4","../modules/es.symbol.to-string-tag":"uDx9","../modules/es.symbol.unscopables":"yT7s","../modules/es.aggregate-error":"Simp","../modules/es.array.from":"Tzrg","../modules/es.array.is-array":"hjCR","../modules/es.array.of":"nKOp","../modules/es.array.concat":"nHCj","../modules/es.array.copy-within":"knYQ","../modules/es.array.every":"YjOc","../modules/es.array.fill":"wrzr","../modules/es.array.filter":"OImK","../modules/es.array.find":"aGSB","../modules/es.array.find-index":"BKbk","../modules/es.array.flat":"PATC","../modules/es.array.flat-map":"dPcl","../modules/es.array.for-each":"n8x2","../modules/es.array.includes":"hJi2","../modules/es.array.index-of":"L3SF","../modules/es.array.join":"HkIz","../modules/es.array.last-index-of":"YJwX","../modules/es.array.map":"XwPX","../modules/es.array.reduce":"MGOS","../modules/es.array.reduce-right":"qThj","../modules/es.array.reverse":"ZdoE","../modules/es.array.slice":"I5XU","../modules/es.array.some":"HTrq","../modules/es.array.sort":"sDKH","../modules/es.array.splice":"AZfT","../modules/es.array.species":"GKV3","../modules/es.array.unscopables.flat":"bFKh","../modules/es.array.unscopables.flat-map":"AKUe","../modules/es.array.iterator":"S91k","../modules/es.function.bind":"rLkX","../modules/es.function.name":"kzOy","../modules/es.function.has-instance":"xOWp","../modules/es.global-this":"Sw1f","../modules/es.object.assign":"d93j","../modules/es.object.create":"pv5m","../modules/es.object.define-property":"XOQw","../modules/es.object.define-properties":"ddJ4","../modules/es.object.entries":"KgVf","../modules/es.object.freeze":"LUIK","../modules/es.object.from-entries":"UciR","../modules/es.object.get-own-property-descriptor":"WFGt","../modules/es.object.get-own-property-descriptors":"aLxV","../modules/es.object.get-own-property-names":"LvRP","../modules/es.object.get-prototype-of":"jz0x","../modules/es.object.is":"uxHM","../modules/es.object.is-extensible":"jX7X","../modules/es.object.is-frozen":"kdOB","../modules/es.object.is-sealed":"gpJf","../modules/es.object.keys":"Y3qw","../modules/es.object.prevent-extensions":"WvM7","../modules/es.object.seal":"bZLD","../modules/es.object.set-prototype-of":"Cykw","../modules/es.object.values":"HUM5","../modules/es.object.to-string":"ecHe","../modules/es.object.define-getter":"PTAU","../modules/es.object.define-setter":"PzdO","../modules/es.object.lookup-getter":"haYq","../modules/es.object.lookup-setter":"vTXd","../modules/es.string.from-code-point":"VRfe","../modules/es.string.raw":"qnyo","../modules/es.string.code-point-at":"X12Q","../modules/es.string.ends-with":"xRPP","../modules/es.string.includes":"oCSF","../modules/es.string.match":"gtN7","../modules/es.string.match-all":"ftnR","../modules/es.string.pad-end":"wchC","../modules/es.string.pad-start":"QpWr","../modules/es.string.repeat":"JXxO","../modules/es.string.replace":"x0yB","../modules/es.string.search":"TMNY","../modules/es.string.split":"TTVC","../modules/es.string.starts-with":"GB8Q","../modules/es.string.trim":"AFCH","../modules/es.string.trim-start":"jY0J","../modules/es.string.trim-end":"dAVn","../modules/es.string.iterator":"PSYM","../modules/es.string.anchor":"J8PS","../modules/es.string.big":"alkc","../modules/es.string.blink":"AYvZ","../modules/es.string.bold":"jQTw","../modules/es.string.fixed":"It3T","../modules/es.string.fontcolor":"sE8q","../modules/es.string.fontsize":"ABfs","../modules/es.string.italics":"zvaT","../modules/es.string.link":"QJ0z","../modules/es.string.small":"Ai0M","../modules/es.string.strike":"Scmo","../modules/es.string.sub":"e1aX","../modules/es.string.sup":"rC3x","../modules/es.string.replace-all":"h3Bv","../modules/es.regexp.constructor":"DbBn","../modules/es.regexp.exec":"MlTh","../modules/es.regexp.flags":"ERpX","../modules/es.regexp.sticky":"TNvt","../modules/es.regexp.test":"LJgt","../modules/es.regexp.to-string":"g0xY","../modules/es.parse-int":"GhQi","../modules/es.parse-float":"kPoD","../modules/es.number.constructor":"BqHT","../modules/es.number.epsilon":"SaF2","../modules/es.number.is-finite":"xykq","../modules/es.number.is-integer":"mK5P","../modules/es.number.is-nan":"jYuH","../modules/es.number.is-safe-integer":"BAEw","../modules/es.number.max-safe-integer":"D9EQ","../modules/es.number.min-safe-integer":"WlNN","../modules/es.number.parse-float":"tHG2","../modules/es.number.parse-int":"eX39","../modules/es.number.to-fixed":"qTD4","../modules/es.number.to-precision":"PZps","../modules/es.math.acosh":"szh2","../modules/es.math.asinh":"lX9L","../modules/es.math.atanh":"dF5J","../modules/es.math.cbrt":"RF5g","../modules/es.math.clz32":"k2zs","../modules/es.math.cosh":"KbzY","../modules/es.math.expm1":"gE1J","../modules/es.math.fround":"zb0x","../modules/es.math.hypot":"B4cQ","../modules/es.math.imul":"Bl9f","../modules/es.math.log10":"Zbeu","../modules/es.math.log1p":"eVjJ","../modules/es.math.log2":"HPCZ","../modules/es.math.sign":"wvgJ","../modules/es.math.sinh":"VNT8","../modules/es.math.tanh":"I2ip","../modules/es.math.to-string-tag":"CevC","../modules/es.math.trunc":"GaOn","../modules/es.date.now":"Yqn8","../modules/es.date.to-json":"KP08","../modules/es.date.to-iso-string":"FvU6","../modules/es.date.to-string":"GjHx","../modules/es.date.to-primitive":"bfeb","../modules/es.json.stringify":"tFg0","../modules/es.json.to-string-tag":"azWb","../modules/es.promise":"ItbG","../modules/es.promise.all-settled":"i5OW","../modules/es.promise.any":"rkDz","../modules/es.promise.finally":"cWVQ","../modules/es.map":"hKUr","../modules/es.set":"YQdF","../modules/es.weak-map":"VLkh","../modules/es.weak-set":"wv6n","../modules/es.array-buffer.constructor":"k7bY","../modules/es.array-buffer.is-view":"gshG","../modules/es.array-buffer.slice":"hWBW","../modules/es.data-view":"PIWk","../modules/es.typed-array.int8-array":"pj5Y","../modules/es.typed-array.uint8-array":"bEo5","../modules/es.typed-array.uint8-clamped-array":"vkrB","../modules/es.typed-array.int16-array":"gVoK","../modules/es.typed-array.uint16-array":"J7Nt","../modules/es.typed-array.int32-array":"KYTa","../modules/es.typed-array.uint32-array":"zDl8","../modules/es.typed-array.float32-array":"YrPA","../modules/es.typed-array.float64-array":"UhAe","../modules/es.typed-array.from":"JVBr","../modules/es.typed-array.of":"LSqt","../modules/es.typed-array.copy-within":"Agsp","../modules/es.typed-array.every":"b4EW","../modules/es.typed-array.fill":"nfIa","../modules/es.typed-array.filter":"LZY1","../modules/es.typed-array.find":"TGdF","../modules/es.typed-array.find-index":"LiYi","../modules/es.typed-array.for-each":"wEtZ","../modules/es.typed-array.includes":"xkZq","../modules/es.typed-array.index-of":"eoPP","../modules/es.typed-array.iterator":"onHc","../modules/es.typed-array.join":"Nwa1","../modules/es.typed-array.last-index-of":"V6i5","../modules/es.typed-array.map":"pY7Y","../modules/es.typed-array.reduce":"sz4a","../modules/es.typed-array.reduce-right":"sg6r","../modules/es.typed-array.reverse":"IpMQ","../modules/es.typed-array.set":"EEAA","../modules/es.typed-array.slice":"R8cM","../modules/es.typed-array.some":"elGv","../modules/es.typed-array.sort":"d3I6","../modules/es.typed-array.subarray":"vAVn","../modules/es.typed-array.to-locale-string":"Y4JY","../modules/es.typed-array.to-string":"pSqK","../modules/es.reflect.apply":"HvHw","../modules/es.reflect.construct":"DGs4","../modules/es.reflect.define-property":"Lhv1","../modules/es.reflect.delete-property":"sSoW","../modules/es.reflect.get":"hsSr","../modules/es.reflect.get-own-property-descriptor":"cznX","../modules/es.reflect.get-prototype-of":"ghbB","../modules/es.reflect.has":"LCUf","../modules/es.reflect.is-extensible":"GX83","../modules/es.reflect.own-keys":"X8ou","../modules/es.reflect.prevent-extensions":"bogC","../modules/es.reflect.set":"lAc1","../modules/es.reflect.set-prototype-of":"kZtr","../modules/es.reflect.to-string-tag":"aYc3","../internals/path":"hMfB"}],"H4Sx":[function(require,module,exports) {
module.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};
},{}],"GFxX":[function(require,module,exports) {

var r=require("../internals/global"),e=require("../internals/dom-iterables"),a=require("../internals/array-for-each"),n=require("../internals/create-non-enumerable-property");for(var i in e){var o=r[i],t=o&&o.prototype;if(t&&t.forEach!==a)try{n(t,"forEach",a)}catch(l){t.forEach=a}}
},{"../internals/global":"MVLi","../internals/dom-iterables":"H4Sx","../internals/array-for-each":"VXzW","../internals/create-non-enumerable-property":"GwPZ"}],"dkdU":[function(require,module,exports) {

var r=require("../internals/global"),e=require("../internals/dom-iterables"),a=require("../modules/es.array.iterator"),i=require("../internals/create-non-enumerable-property"),t=require("../internals/well-known-symbol"),n=t("iterator"),o=t("toStringTag"),l=a.values;for(var s in e){var u=r[s],f=u&&u.prototype;if(f){if(f[n]!==l)try{i(f,n,l)}catch(c){f[n]=l}if(f[o]||i(f,o,s),e[s])for(var y in a)if(f[y]!==a[y])try{i(f,y,a[y])}catch(c){f[y]=a[y]}}}
},{"../internals/global":"MVLi","../internals/dom-iterables":"H4Sx","../modules/es.array.iterator":"S91k","../internals/create-non-enumerable-property":"GwPZ","../internals/well-known-symbol":"Q0EA"}],"hZLH":[function(require,module,exports) {

var e=require("../internals/export"),r=require("../internals/global"),a=require("../internals/task"),t=!r.setImmediate||!r.clearImmediate;e({global:!0,bind:!0,enumerable:!0,forced:t},{setImmediate:a.set,clearImmediate:a.clear});
},{"../internals/export":"rhEq","../internals/global":"MVLi","../internals/task":"g1no"}],"eiZc":[function(require,module,exports) {


var e=require("../internals/export"),r=require("../internals/global"),n=require("../internals/microtask"),i=require("../internals/engine-is-node"),a=r.process;e({global:!0,enumerable:!0,noTargetGet:!0},{queueMicrotask:function(e){var r=i&&a.domain;n(r?r.bind(e):e)}});
},{"../internals/export":"rhEq","../internals/global":"MVLi","../internals/microtask":"jLqr","../internals/engine-is-node":"dxME"}],"OTsy":[function(require,module,exports) {

var e=require("../internals/export"),n=require("../internals/global"),t=require("../internals/engine-user-agent"),r=[].slice,i=/MSIE .\./.test(t),l=function(e){return function(n,t){var i=arguments.length>2,l=i?r.call(arguments,2):void 0;return e(i?function(){("function"==typeof n?n:Function(n)).apply(this,l)}:n,t)}};e({global:!0,bind:!0,forced:i},{setTimeout:l(n.setTimeout),setInterval:l(n.setInterval)});
},{"../internals/export":"rhEq","../internals/global":"MVLi","../internals/engine-user-agent":"ds3C"}],"Yrjo":[function(require,module,exports) {
var a=require("../internals/fails"),e=require("../internals/well-known-symbol"),r=require("../internals/is-pure"),t=e("iterator");module.exports=!a(function(){var a=new URL("b?a=1&b=2&c=3","http://a"),e=a.searchParams,n="";return a.pathname="c%20d",e.forEach(function(a,r){e.delete("b"),n+=r+a}),r&&!a.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==a.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[t]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host});
},{"../internals/fails":"pWu7","../internals/well-known-symbol":"Q0EA","../internals/is-pure":"tGwT"}],"F0va":[function(require,module,exports) {
"use strict";var r=2147483647,e=36,t=1,o=26,n=38,u=700,a=72,f=128,h="-",s=/[^\0-\u007E]/,i=/[.\u3002\uFF0E\uFF61]/g,v="Overflow: input needs wider integers to process",l=e-t,p=Math.floor,g=String.fromCharCode,c=function(r){for(var e=[],t=0,o=r.length;t<o;){var n=r.charCodeAt(t++);if(n>=55296&&n<=56319&&t<o){var u=r.charCodeAt(t++);56320==(64512&u)?e.push(((1023&n)<<10)+(1023&u)+65536):(e.push(n),t--)}else e.push(n)}return e},d=function(r){return r+22+75*(r<26)},w=function(r,t,a){var f=0;for(r=a?p(r/u):r>>1,r+=p(r/t);r>l*o>>1;f+=e)r=p(r/l);return p(f+(l+1)*r/(r+n))},C=function(n){var u,s,i=[],l=(n=c(n)).length,C=f,E=0,F=a;for(u=0;u<n.length;u++)(s=n[u])<128&&i.push(g(s));var j=i.length,m=j;for(j&&i.push(h);m<l;){var x=r;for(u=0;u<n.length;u++)(s=n[u])>=C&&s<x&&(x=s);var A=m+1;if(x-C>p((r-E)/A))throw RangeError(v);for(E+=(x-C)*A,C=x,u=0;u<n.length;u++){if((s=n[u])<C&&++E>r)throw RangeError(v);if(s==C){for(var R=E,b=e;;b+=e){var k=b<=F?t:b>=F+o?o:b-F;if(R<k)break;var L=R-k,M=e-k;i.push(g(d(k+L%M))),R=p(L/M)}i.push(g(d(R))),F=w(E,A,m==j),E=0,++m}}++E,++C}return i.join("")};module.exports=function(r){var e,t,o=[],n=r.toLowerCase().replace(i,".").split(".");for(e=0;e<n.length;e++)t=n[e],o.push(s.test(t)?"xn--"+C(t):t);return o.join(".")};
},{}],"Uult":[function(require,module,exports) {
var r=require("../internals/an-object"),e=require("../internals/get-iterator-method");module.exports=function(t){var n=e(t);if("function"!=typeof n)throw TypeError(String(t)+" is not iterable");return r(n.call(t))};
},{"../internals/an-object":"eAPg","../internals/get-iterator-method":"VM64"}],"CpgZ":[function(require,module,exports) {
"use strict";require("../modules/es.array.iterator");var e=require("../internals/export"),t=require("../internals/get-built-in"),r=require("../internals/native-url"),n=require("../internals/redefine"),i=require("../internals/redefine-all"),a=require("../internals/set-to-string-tag"),u=require("../internals/create-iterator-constructor"),o=require("../internals/internal-state"),s=require("../internals/an-instance"),l=require("../internals/has"),c=require("../internals/function-bind-context"),h=require("../internals/classof"),f=require("../internals/an-object"),p=require("../internals/is-object"),g=require("../internals/object-create"),d=require("../internals/create-property-descriptor"),v=require("../internals/get-iterator"),y=require("../internals/get-iterator-method"),k=require("../internals/well-known-symbol"),q=t("fetch"),m=t("Headers"),b=k("iterator"),w="URLSearchParams",R=w+"Iterator",U=o.set,x=o.getterFor(w),L=o.getterFor(R),S=/\+/g,E=Array(4),j=function(e){return E[e-1]||(E[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},I=function(e){try{return decodeURIComponent(e)}catch(t){return e}},P=function(e){var t=e.replace(S," "),r=4;try{return decodeURIComponent(t)}catch(n){for(;r;)t=t.replace(j(r--),I);return t}},A=/[!'()~]|%20/g,C={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},F=function(e){return C[e]},T=function(e){return encodeURIComponent(e).replace(A,F)},H=function(e,t){if(t)for(var r,n,i=t.split("&"),a=0;a<i.length;)(r=i[a++]).length&&(n=r.split("="),e.push({key:P(n.shift()),value:P(n.join("="))}))},N=function(e){this.entries.length=0,H(this.entries,e)},z=function(e,t){if(e<t)throw TypeError("Not enough arguments")},B=u(function(e,t){U(this,{type:R,iterator:v(x(e).entries),kind:t})},"Iterator",function(){var e=L(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),D=function(){s(this,D,w);var e,t,r,n,i,a,u,o,c,h=arguments.length>0?arguments[0]:void 0,g=[];if(U(this,{type:w,entries:g,updateURL:function(){},updateSearchParams:N}),void 0!==h)if(p(h))if("function"==typeof(e=y(h)))for(r=(t=e.call(h)).next;!(n=r.call(t)).done;){if((u=(a=(i=v(f(n.value))).next).call(i)).done||(o=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");g.push({key:u.value+"",value:o.value+""})}else for(c in h)l(h,c)&&g.push({key:c,value:h[c]+""});else H(g,"string"==typeof h?"?"===h.charAt(0)?h.slice(1):h:h+"")},G=D.prototype;i(G,{append:function(e,t){z(arguments.length,2);var r=x(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){z(arguments.length,1);for(var t=x(this),r=t.entries,n=e+"",i=0;i<r.length;)r[i].key===n?r.splice(i,1):i++;t.updateURL()},get:function(e){z(arguments.length,1);for(var t=x(this).entries,r=e+"",n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){z(arguments.length,1);for(var t=x(this).entries,r=e+"",n=[],i=0;i<t.length;i++)t[i].key===r&&n.push(t[i].value);return n},has:function(e){z(arguments.length,1);for(var t=x(this).entries,r=e+"",n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){z(arguments.length,1);for(var r,n=x(this),i=n.entries,a=!1,u=e+"",o=t+"",s=0;s<i.length;s++)(r=i[s]).key===u&&(a?i.splice(s--,1):(a=!0,r.value=o));a||i.push({key:u,value:o}),n.updateURL()},sort:function(){var e,t,r,n=x(this),i=n.entries,a=i.slice();for(i.length=0,r=0;r<a.length;r++){for(e=a[r],t=0;t<r;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===r&&i.push(e)}n.updateURL()},forEach:function(e){for(var t,r=x(this).entries,n=c(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new B(this,"keys")},values:function(){return new B(this,"values")},entries:function(){return new B(this,"entries")}},{enumerable:!0}),n(G,b,G.entries),n(G,"toString",function(){for(var e,t=x(this).entries,r=[],n=0;n<t.length;)e=t[n++],r.push(T(e.key)+"="+T(e.value));return r.join("&")},{enumerable:!0}),a(D,w),e({global:!0,forced:!r},{URLSearchParams:D}),r||"function"!=typeof q||"function"!=typeof m||e({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,r,n,i=[e];return arguments.length>1&&(t=arguments[1],p(t)&&(r=t.body,h(r)===w&&((n=t.headers?new m(t.headers):new m).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=g(t,{body:d(0,String(r)),headers:d(0,n)}))),i.push(t)),q.apply(this,i)}}),module.exports={URLSearchParams:D,getState:x};
},{"../modules/es.array.iterator":"S91k","../internals/export":"rhEq","../internals/get-built-in":"mLk8","../internals/native-url":"Yrjo","../internals/redefine":"ztZs","../internals/redefine-all":"oPIw","../internals/set-to-string-tag":"kLCt","../internals/create-iterator-constructor":"v9Wl","../internals/internal-state":"vLSK","../internals/an-instance":"pJoy","../internals/has":"jYdl","../internals/function-bind-context":"dEmF","../internals/classof":"rs2T","../internals/an-object":"eAPg","../internals/is-object":"AsqF","../internals/object-create":"zWsZ","../internals/create-property-descriptor":"oNyT","../internals/get-iterator":"Uult","../internals/get-iterator-method":"VM64","../internals/well-known-symbol":"Q0EA"}],"ytq2":[function(require,module,exports) {

"use strict";require("../modules/es.string.iterator");var e,r=require("../internals/export"),t=require("../internals/descriptors"),n=require("../internals/native-url"),a=require("../internals/global"),s=require("../internals/object-define-properties"),i=require("../internals/redefine"),u=require("../internals/an-instance"),o=require("../internals/has"),l=require("../internals/object-assign"),f=require("../internals/array-from"),c=require("../internals/string-multibyte").codeAt,h=require("../internals/string-punycode-to-ascii"),p=require("../internals/set-to-string-tag"),m=require("../modules/web.url-search-params"),g=require("../internals/internal-state"),v=a.URL,d=m.URLSearchParams,q=m.getState,y=g.set,b=g.getterFor("URL"),w=Math.floor,A=Math.pow,L="Invalid authority",R="Invalid scheme",U="Invalid host",k="Invalid port",B=/[A-Za-z]/,S=/[\d+-.A-Za-z]/,j=/\d/,P=/^(0x|0X)/,I=/^[0-7]+$/,C=/^\d+$/,O=/^[\dA-Fa-f]+$/,F=/[\u0000\t\u000A\u000D #%/:?@[\\]]/,$=/[\u0000\t\u000A\u000D #/:?@[\\]]/,D=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,E=/[\t\u000A\u000D]/g,T=function(e,r){var t,n,a;if("["==r.charAt(0)){if("]"!=r.charAt(r.length-1))return U;if(!(t=z(r.slice(1,-1))))return U;e.host=t}else if(Q(e)){if(r=h(r),F.test(r))return U;if(null===(t=x(r)))return U;e.host=t}else{if($.test(r))return U;for(t="",n=f(r),a=0;a<n.length;a++)t+=H(n[a],J);e.host=t}},x=function(e){var r,t,n,a,s,i,u,o=e.split(".");if(o.length&&""==o[o.length-1]&&o.pop(),(r=o.length)>4)return e;for(t=[],n=0;n<r;n++){if(""==(a=o[n]))return e;if(s=10,a.length>1&&"0"==a.charAt(0)&&(s=P.test(a)?16:8,a=a.slice(8==s?1:2)),""===a)i=0;else{if(!(10==s?C:8==s?I:O).test(a))return e;i=parseInt(a,s)}t.push(i)}for(n=0;n<r;n++)if(i=t[n],n==r-1){if(i>=A(256,5-r))return null}else if(i>255)return null;for(u=t.pop(),n=0;n<t.length;n++)u+=t[n]*A(256,3-n);return u},z=function(e){var r,t,n,a,s,i,u,o=[0,0,0,0,0,0,0,0],l=0,f=null,c=0,h=function(){return e.charAt(c)};if(":"==h()){if(":"!=e.charAt(1))return;c+=2,f=++l}for(;h();){if(8==l)return;if(":"!=h()){for(r=t=0;t<4&&O.test(h());)r=16*r+parseInt(h(),16),c++,t++;if("."==h()){if(0==t)return;if(c-=t,l>6)return;for(n=0;h();){if(a=null,n>0){if(!("."==h()&&n<4))return;c++}if(!j.test(h()))return;for(;j.test(h());){if(s=parseInt(h(),10),null===a)a=s;else{if(0==a)return;a=10*a+s}if(a>255)return;c++}o[l]=256*o[l]+a,2!=++n&&4!=n||l++}if(4!=n)return;break}if(":"==h()){if(c++,!h())return}else if(h())return;o[l++]=r}else{if(null!==f)return;c++,f=++l}}if(null!==f)for(i=l-f,l=7;0!=l&&i>0;)u=o[l],o[l--]=o[f+i-1],o[f+--i]=u;else if(8!=l)return;return o},M=function(e){for(var r=null,t=1,n=null,a=0,s=0;s<8;s++)0!==e[s]?(a>t&&(r=n,t=a),n=null,a=0):(null===n&&(n=s),++a);return a>t&&(r=n,t=a),r},Z=function(e){var r,t,n,a;if("number"==typeof e){for(r=[],t=0;t<4;t++)r.unshift(e%256),e=w(e/256);return r.join(".")}if("object"==typeof e){for(r="",n=M(e),t=0;t<8;t++)a&&0===e[t]||(a&&(a=!1),n===t?(r+=t?":":"::",a=!0):(r+=e[t].toString(16),t<7&&(r+=":")));return"["+r+"]"}return e},J={},N=l({},J,{" ":1,'"':1,"<":1,">":1,"`":1}),X=l({},N,{"#":1,"?":1,"{":1,"}":1}),G=l({},X,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),H=function(e,r){var t=c(e,0);return t>32&&t<127&&!o(r,e)?e:encodeURIComponent(e)},K={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Q=function(e){return o(K,e.scheme)},V=function(e){return""!=e.username||""!=e.password},W=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Y=function(e,r){var t;return 2==e.length&&B.test(e.charAt(0))&&(":"==(t=e.charAt(1))||!r&&"|"==t)},_=function(e){var r;return e.length>1&&Y(e.slice(0,2))&&(2==e.length||"/"===(r=e.charAt(2))||"\\"===r||"?"===r||"#"===r)},ee=function(e){var r=e.path,t=r.length;!t||"file"==e.scheme&&1==t&&Y(r[0],!0)||r.pop()},re=function(e){return"."===e||"%2e"===e.toLowerCase()},te=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},ne={},ae={},se={},ie={},ue={},oe={},le={},fe={},ce={},he={},pe={},me={},ge={},ve={},de={},qe={},ye={},be={},we={},Ae={},Le={},Re=function(r,t,n,a){var s,i,u,l,c=n||ne,h=0,p="",m=!1,g=!1,v=!1;for(n||(r.scheme="",r.username="",r.password="",r.host=null,r.port=null,r.path=[],r.query=null,r.fragment=null,r.cannotBeABaseURL=!1,t=t.replace(D,"")),t=t.replace(E,""),s=f(t);h<=s.length;){switch(i=s[h],c){case ne:if(!i||!B.test(i)){if(n)return R;c=se;continue}p+=i.toLowerCase(),c=ae;break;case ae:if(i&&(S.test(i)||"+"==i||"-"==i||"."==i))p+=i.toLowerCase();else{if(":"!=i){if(n)return R;p="",c=se,h=0;continue}if(n&&(Q(r)!=o(K,p)||"file"==p&&(V(r)||null!==r.port)||"file"==r.scheme&&!r.host))return;if(r.scheme=p,n)return void(Q(r)&&K[r.scheme]==r.port&&(r.port=null));p="","file"==r.scheme?c=ve:Q(r)&&a&&a.scheme==r.scheme?c=ie:Q(r)?c=fe:"/"==s[h+1]?(c=ue,h++):(r.cannotBeABaseURL=!0,r.path.push(""),c=we)}break;case se:if(!a||a.cannotBeABaseURL&&"#"!=i)return R;if(a.cannotBeABaseURL&&"#"==i){r.scheme=a.scheme,r.path=a.path.slice(),r.query=a.query,r.fragment="",r.cannotBeABaseURL=!0,c=Le;break}c="file"==a.scheme?ve:oe;continue;case ie:if("/"!=i||"/"!=s[h+1]){c=oe;continue}c=ce,h++;break;case ue:if("/"==i){c=he;break}c=be;continue;case oe:if(r.scheme=a.scheme,i==e)r.username=a.username,r.password=a.password,r.host=a.host,r.port=a.port,r.path=a.path.slice(),r.query=a.query;else if("/"==i||"\\"==i&&Q(r))c=le;else if("?"==i)r.username=a.username,r.password=a.password,r.host=a.host,r.port=a.port,r.path=a.path.slice(),r.query="",c=Ae;else{if("#"!=i){r.username=a.username,r.password=a.password,r.host=a.host,r.port=a.port,r.path=a.path.slice(),r.path.pop(),c=be;continue}r.username=a.username,r.password=a.password,r.host=a.host,r.port=a.port,r.path=a.path.slice(),r.query=a.query,r.fragment="",c=Le}break;case le:if(!Q(r)||"/"!=i&&"\\"!=i){if("/"!=i){r.username=a.username,r.password=a.password,r.host=a.host,r.port=a.port,c=be;continue}c=he}else c=ce;break;case fe:if(c=ce,"/"!=i||"/"!=p.charAt(h+1))continue;h++;break;case ce:if("/"!=i&&"\\"!=i){c=he;continue}break;case he:if("@"==i){m&&(p="%40"+p),m=!0,u=f(p);for(var d=0;d<u.length;d++){var q=u[d];if(":"!=q||v){var y=H(q,G);v?r.password+=y:r.username+=y}else v=!0}p=""}else if(i==e||"/"==i||"?"==i||"#"==i||"\\"==i&&Q(r)){if(m&&""==p)return L;h-=f(p).length+1,p="",c=pe}else p+=i;break;case pe:case me:if(n&&"file"==r.scheme){c=qe;continue}if(":"!=i||g){if(i==e||"/"==i||"?"==i||"#"==i||"\\"==i&&Q(r)){if(Q(r)&&""==p)return U;if(n&&""==p&&(V(r)||null!==r.port))return;if(l=T(r,p))return l;if(p="",c=ye,n)return;continue}"["==i?g=!0:"]"==i&&(g=!1),p+=i}else{if(""==p)return U;if(l=T(r,p))return l;if(p="",c=ge,n==me)return}break;case ge:if(!j.test(i)){if(i==e||"/"==i||"?"==i||"#"==i||"\\"==i&&Q(r)||n){if(""!=p){var b=parseInt(p,10);if(b>65535)return k;r.port=Q(r)&&b===K[r.scheme]?null:b,p=""}if(n)return;c=ye;continue}return k}p+=i;break;case ve:if(r.scheme="file","/"==i||"\\"==i)c=de;else{if(!a||"file"!=a.scheme){c=be;continue}if(i==e)r.host=a.host,r.path=a.path.slice(),r.query=a.query;else if("?"==i)r.host=a.host,r.path=a.path.slice(),r.query="",c=Ae;else{if("#"!=i){_(s.slice(h).join(""))||(r.host=a.host,r.path=a.path.slice(),ee(r)),c=be;continue}r.host=a.host,r.path=a.path.slice(),r.query=a.query,r.fragment="",c=Le}}break;case de:if("/"==i||"\\"==i){c=qe;break}a&&"file"==a.scheme&&!_(s.slice(h).join(""))&&(Y(a.path[0],!0)?r.path.push(a.path[0]):r.host=a.host),c=be;continue;case qe:if(i==e||"/"==i||"\\"==i||"?"==i||"#"==i){if(!n&&Y(p))c=be;else if(""==p){if(r.host="",n)return;c=ye}else{if(l=T(r,p))return l;if("localhost"==r.host&&(r.host=""),n)return;p="",c=ye}continue}p+=i;break;case ye:if(Q(r)){if(c=be,"/"!=i&&"\\"!=i)continue}else if(n||"?"!=i)if(n||"#"!=i){if(i!=e&&(c=be,"/"!=i))continue}else r.fragment="",c=Le;else r.query="",c=Ae;break;case be:if(i==e||"/"==i||"\\"==i&&Q(r)||!n&&("?"==i||"#"==i)){if(te(p)?(ee(r),"/"==i||"\\"==i&&Q(r)||r.path.push("")):re(p)?"/"==i||"\\"==i&&Q(r)||r.path.push(""):("file"==r.scheme&&!r.path.length&&Y(p)&&(r.host&&(r.host=""),p=p.charAt(0)+":"),r.path.push(p)),p="","file"==r.scheme&&(i==e||"?"==i||"#"==i))for(;r.path.length>1&&""===r.path[0];)r.path.shift();"?"==i?(r.query="",c=Ae):"#"==i&&(r.fragment="",c=Le)}else p+=H(i,X);break;case we:"?"==i?(r.query="",c=Ae):"#"==i?(r.fragment="",c=Le):i!=e&&(r.path[0]+=H(i,J));break;case Ae:n||"#"!=i?i!=e&&("'"==i&&Q(r)?r.query+="%27":r.query+="#"==i?"%23":H(i,J)):(r.fragment="",c=Le);break;case Le:i!=e&&(r.fragment+=H(i,N))}h++}},Ue=function(e){var r,n,a=u(this,Ue,"URL"),s=arguments.length>1?arguments[1]:void 0,i=String(e),o=y(a,{type:"URL"});if(void 0!==s)if(s instanceof Ue)r=b(s);else if(n=Re(r={},String(s)))throw TypeError(n);if(n=Re(o,i,null,r))throw TypeError(n);var l=o.searchParams=new d,f=q(l);f.updateSearchParams(o.query),f.updateURL=function(){o.query=String(l)||null},t||(a.href=Be.call(a),a.origin=Se.call(a),a.protocol=je.call(a),a.username=Pe.call(a),a.password=Ie.call(a),a.host=Ce.call(a),a.hostname=Oe.call(a),a.port=Fe.call(a),a.pathname=$e.call(a),a.search=De.call(a),a.searchParams=Ee.call(a),a.hash=Te.call(a))},ke=Ue.prototype,Be=function(){var e=b(this),r=e.scheme,t=e.username,n=e.password,a=e.host,s=e.port,i=e.path,u=e.query,o=e.fragment,l=r+":";return null!==a?(l+="//",V(e)&&(l+=t+(n?":"+n:"")+"@"),l+=Z(a),null!==s&&(l+=":"+s)):"file"==r&&(l+="//"),l+=e.cannotBeABaseURL?i[0]:i.length?"/"+i.join("/"):"",null!==u&&(l+="?"+u),null!==o&&(l+="#"+o),l},Se=function(){var e=b(this),r=e.scheme,t=e.port;if("blob"==r)try{return new URL(r.path[0]).origin}catch(n){return"null"}return"file"!=r&&Q(e)?r+"://"+Z(e.host)+(null!==t?":"+t:""):"null"},je=function(){return b(this).scheme+":"},Pe=function(){return b(this).username},Ie=function(){return b(this).password},Ce=function(){var e=b(this),r=e.host,t=e.port;return null===r?"":null===t?Z(r):Z(r)+":"+t},Oe=function(){var e=b(this).host;return null===e?"":Z(e)},Fe=function(){var e=b(this).port;return null===e?"":String(e)},$e=function(){var e=b(this),r=e.path;return e.cannotBeABaseURL?r[0]:r.length?"/"+r.join("/"):""},De=function(){var e=b(this).query;return e?"?"+e:""},Ee=function(){return b(this).searchParams},Te=function(){var e=b(this).fragment;return e?"#"+e:""},xe=function(e,r){return{get:e,set:r,configurable:!0,enumerable:!0}};if(t&&s(ke,{href:xe(Be,function(e){var r=b(this),t=String(e),n=Re(r,t);if(n)throw TypeError(n);q(r.searchParams).updateSearchParams(r.query)}),origin:xe(Se),protocol:xe(je,function(e){var r=b(this);Re(r,String(e)+":",ne)}),username:xe(Pe,function(e){var r=b(this),t=f(String(e));if(!W(r)){r.username="";for(var n=0;n<t.length;n++)r.username+=H(t[n],G)}}),password:xe(Ie,function(e){var r=b(this),t=f(String(e));if(!W(r)){r.password="";for(var n=0;n<t.length;n++)r.password+=H(t[n],G)}}),host:xe(Ce,function(e){var r=b(this);r.cannotBeABaseURL||Re(r,String(e),pe)}),hostname:xe(Oe,function(e){var r=b(this);r.cannotBeABaseURL||Re(r,String(e),me)}),port:xe(Fe,function(e){var r=b(this);W(r)||(""==(e=String(e))?r.port=null:Re(r,e,ge))}),pathname:xe($e,function(e){var r=b(this);r.cannotBeABaseURL||(r.path=[],Re(r,e+"",ye))}),search:xe(De,function(e){var r=b(this);""==(e=String(e))?r.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),r.query="",Re(r,e,Ae)),q(r.searchParams).updateSearchParams(r.query)}),searchParams:xe(Ee),hash:xe(Te,function(e){var r=b(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),r.fragment="",Re(r,e,Le)):r.fragment=null})}),i(ke,"toJSON",function(){return Be.call(this)},{enumerable:!0}),i(ke,"toString",function(){return Be.call(this)},{enumerable:!0}),v){var ze=v.createObjectURL,Me=v.revokeObjectURL;ze&&i(Ue,"createObjectURL",function(e){return ze.apply(v,arguments)}),Me&&i(Ue,"revokeObjectURL",function(e){return Me.apply(v,arguments)})}p(Ue,"URL"),r({global:!0,forced:!n,sham:!t},{URL:Ue});
},{"../modules/es.string.iterator":"PSYM","../internals/export":"rhEq","../internals/descriptors":"A8Ob","../internals/native-url":"Yrjo","../internals/global":"MVLi","../internals/object-define-properties":"ZdKd","../internals/redefine":"ztZs","../internals/an-instance":"pJoy","../internals/has":"jYdl","../internals/object-assign":"aWUw","../internals/array-from":"ITnL","../internals/string-multibyte":"FQEJ","../internals/string-punycode-to-ascii":"F0va","../internals/set-to-string-tag":"kLCt","../modules/web.url-search-params":"CpgZ","../internals/internal-state":"vLSK"}],"tFEl":[function(require,module,exports) {
"use strict";var t=require("../internals/export");t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});
},{"../internals/export":"rhEq"}],"nUSM":[function(require,module,exports) {
require("../modules/web.dom-collections.for-each"),require("../modules/web.dom-collections.iterator"),require("../modules/web.immediate"),require("../modules/web.queue-microtask"),require("../modules/web.timers"),require("../modules/web.url"),require("../modules/web.url.to-json"),require("../modules/web.url-search-params");var e=require("../internals/path");module.exports=e;
},{"../modules/web.dom-collections.for-each":"GFxX","../modules/web.dom-collections.iterator":"dkdU","../modules/web.immediate":"hZLH","../modules/web.queue-microtask":"eiZc","../modules/web.timers":"OTsy","../modules/web.url":"ytq2","../modules/web.url.to-json":"tFEl","../modules/web.url-search-params":"CpgZ","../internals/path":"hMfB"}],"XqIO":[function(require,module,exports) {
require("../es"),require("../web");var e=require("../internals/path");module.exports=e;
},{"../es":"L1QH","../web":"nUSM","../internals/path":"hMfB"}],"QVnC":[function(require,module,exports) {
var define;
var t,r=function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{u({},"")}catch(P){u=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof d?r:d,i=Object.create(o.prototype),a=new G(n||[]);return i._invoke=function(t,r,e){var n=l;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===y){if("throw"===o)throw i;return F()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=j(a,e);if(c){if(c===v)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===l)throw n=y,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=p;var u=f(t,r,e);if("normal"===u.type){if(n=e.done?y:s,u.arg===v)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n=y,e.method="throw",e.arg=u.arg)}}}(t,e,a),i}function f(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(P){return{type:"throw",arg:P}}}t.wrap=h;var l="suspendedStart",s="suspendedYield",p="executing",y="completed",v={};function d(){}function g(){}function m(){}var w={};w[i]=function(){return this};var L=Object.getPrototypeOf,x=L&&L(L(N([])));x&&x!==e&&n.call(x,i)&&(w=x);var b=m.prototype=d.prototype=Object.create(w);function E(t){["next","throw","return"].forEach(function(r){u(t,r,function(t){return this._invoke(r,t)})})}function _(t,r){var e;this._invoke=function(o,i){function a(){return new r(function(e,a){!function e(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var h=u.arg,l=h.value;return l&&"object"==typeof l&&n.call(l,"__await")?r.resolve(l.__await).then(function(t){e("next",t,a,c)},function(t){e("throw",t,a,c)}):r.resolve(l).then(function(t){h.value=t,a(h)},function(t){return e("throw",t,a,c)})}c(u.arg)}(o,i,e,a)})}return e=e?e.then(a,a):a()}}function j(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,j(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function O(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function k(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function N(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}return{next:F}}function F(){return{value:r,done:!0}}return g.prototype=b.constructor=m,m.constructor=g,g.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===g||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},E(_.prototype),_.prototype[a]=function(){return this},t.AsyncIterator=_,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new _(h(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},E(b),u(b,c,"Generator"),b[i]=function(){return this},b.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),h=n.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),v},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),k(e),v}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;k(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),v}},t}("object"==typeof module?module.exports:{});try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}
},{}],"ag4i":[function(require,module,exports) {
"use strict";let e;function t(){return e||(e=n()),e}function n(){try{throw new Error}catch(e){const t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return r(t[0])}return"/"}function r(e){return(""+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getBundleURL=exports.getBaseURL=void 0,exports.getBundleURL=t,exports.getBaseURL=r;
},{}],"PmVK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isWorkerRuntime=exports.getWorkerImplementation=exports.defaultPoolSize=void 0;const e=require("./get-bundle-url.browser");exports.defaultPoolSize="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;const t=e=>/^(file|https?:)?\/\//i.test(e);function r(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function o(){if("undefined"==typeof Worker)return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class o extends Worker{constructor(o,n){"string"==typeof o&&n&&n._baseURL?o=new URL(o,n._baseURL):"string"==typeof o&&!t(o)&&e.getBundleURL().match(/^file:\/\//i)&&(o=new URL(o,e.getBundleURL().replace(/\/[^\/]+$/,"/")),o=r(`importScripts(${JSON.stringify(o)});`)),"string"==typeof o&&t(o)&&(o=r(`importScripts(${JSON.stringify(o)});`)),super(o,n)}}class n extends o{constructor(e,t){super(window.URL.createObjectURL(e),t)}static fromText(e,t){const r=new window.Blob([e],{type:"text/javascript"});return new n(r,t)}}return{blob:n,default:o}}let n;function i(){return n||(n=o()),n}function s(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)}exports.getWorkerImplementation=i,exports.isWorkerRuntime=s;
},{"./get-bundle-url.browser":"ag4i"}],"IAgR":[function(require,module,exports) {
var s=1e3,e=60*s,r=60*e,a=24*r,n=7*a,c=365.25*a;function t(t){if(!((t=String(t)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(u){var i=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*c;case"weeks":case"week":case"w":return i*n;case"days":case"day":case"d":return i*a;case"hours":case"hour":case"hrs":case"hr":case"h":return i*r;case"minutes":case"minute":case"mins":case"min":case"m":return i*e;case"seconds":case"second":case"secs":case"sec":case"s":return i*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function u(n){var c=Math.abs(n);return c>=a?Math.round(n/a)+"d":c>=r?Math.round(n/r)+"h":c>=e?Math.round(n/e)+"m":c>=s?Math.round(n/s)+"s":n+"ms"}function i(n){var c=Math.abs(n);return c>=a?o(n,c,a,"day"):c>=r?o(n,c,r,"hour"):c>=e?o(n,c,e,"minute"):c>=s?o(n,c,s,"second"):n+" ms"}function o(s,e,r,a){var n=e>=1.5*r;return Math.round(s/r)+" "+a+(n?"s":"")}module.exports=function(s,e){e=e||{};var r=typeof s;if("string"===r&&s.length>0)return t(s);if("number"===r&&isFinite(s))return e.long?i(s):u(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};
},{}],"Kest":[function(require,module,exports) {
function e(e){function n(e){let r,o=null;function s(...e){if(!s.enabled)return;const t=s,o=Number(new Date),l=o-(r||o);t.diff=l,t.prev=r,t.curr=o,r=o,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return"%";i++;const s=n.formatters[o];if("function"==typeof s){const n=e[i];r=s.call(t,n),e.splice(i,1),i--}return r}),n.formatArgs.call(t,e),(t.log||n.log).apply(t,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=t,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null===o?n.enabled(e):o,set:e=>{o=e}}),"function"==typeof n.init&&n.init(s),s}function t(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(r),...n.skips.map(r).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=require("ms"),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n}module.exports=e;
},{"ms":"IAgR"}],"pBGv":[function(require,module,exports) {

var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],"jcLW":[function(require,module,exports) {
var process = require("process");
var e=require("process");function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function t(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+module.exports.humanize(this.diff),!this.useColors)return;const o="color: "+this.color;e.splice(1,0,o,"color: inherit");let t=0,C=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(t++,"%c"===e&&(C=t))}),e.splice(C,0,o)}function C(e){try{e?exports.storage.setItem("debug",e):exports.storage.removeItem("debug")}catch(o){}}function r(){let o;try{o=exports.storage.getItem("debug")}catch(t){}return!o&&void 0!==e&&"env"in e&&(o=void 0),o}function n(){try{return localStorage}catch(e){}}exports.formatArgs=t,exports.save=C,exports.load=r,exports.useColors=o,exports.storage=n(),exports.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),exports.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],exports.log=console.debug||console.log||(()=>{}),module.exports=require("./common")(exports);const{formatters:s}=module.exports;s.j=function(e){try{return JSON.stringify(e)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};
},{"./common":"Kest","process":"pBGv"}],"sfrJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsyncSerialScheduler=void 0;var e=function(e,s,r,t){return new(r||(r=Promise))(function(i,n){function o(e){try{h(t.next(e))}catch(s){n(s)}}function c(e){try{h(t.throw(e))}catch(s){n(s)}}function h(e){e.done?i(e.value):new r(function(s){s(e.value)}).then(o,c)}h((t=t.apply(e,s||[])).next())})};class s{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch(e=>this._baseObserver.error(e))}error(e){this._baseObserver.error(e)}schedule(s){const r=Promise.all(this._pendingPromises),t=[],i=e=>t.push(e),n=Promise.resolve().then(()=>e(this,void 0,void 0,function*(){yield r,yield s(i),this._pendingPromises.delete(n);for(const e of t)this._baseObserver.next(e)})).catch(e=>{this._pendingPromises.delete(n),this._baseObserver.error(e)});this._pendingPromises.add(n)}}exports.AsyncSerialScheduler=s;
},{}],"lj3f":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.registerObservableSymbol=t,exports.getSymbol=exports.hasSymbol=exports.hasSymbols=void 0;const o=()=>"function"==typeof Symbol;exports.hasSymbols=o;const e=e=>o()&&Boolean(Symbol[e]);exports.hasSymbol=e;const s=o=>e(o)?Symbol[o]:"@@"+o;function t(){o()&&!e("observable")&&(Symbol.observable=Symbol("observable"))}exports.getSymbol=s,e("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));
},{}],"B9l3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Observable=exports.SubscriptionObserver=exports.Subscription=void 0;var e=require("./_symbols");const t=(0,e.getSymbol)("iterator"),r=(0,e.getSymbol)("observable"),o=(0,e.getSymbol)("species");function n(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function s(e){let t=e.constructor;return void 0!==t&&null===(t=t[o])&&(t=void 0),void 0!==t?t:d}function i(e){return e instanceof d}function c(e){c.log?c.log(e):setTimeout(()=>{throw e},0)}function u(e){Promise.resolve().then(()=>{try{e()}catch(t){c(t)}})}function l(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=n(t,"unsubscribe");e&&e.call(t)}}catch(r){c(r)}}function a(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function f(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const r of t)if(b(e,r.type,r.value),"closed"===e._state)break}}function b(e,t,r){e._state="running";const o=e._observer;try{const i=o?n(o,t):void 0;switch(t){case"next":i&&i.call(o,r);break;case"error":if(a(e),!i)throw r;i.call(o,r);break;case"complete":a(e),i&&i.call(o)}}catch(s){c(s)}"closed"===e._state?l(e):"running"===e._state&&(e._state="ready")}function p(e,t,r){if("closed"!==e._state)return"buffering"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void u(()=>f(e))):void b(e,t,r)}class h{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const r=new y(this);try{this._cleanup=t.call(void 0,r)}catch(o){r.error(o)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(a(this),l(this))}}exports.Subscription=h;class y{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){p(this._subscription,"next",e)}error(e){p(this._subscription,"error",e)}complete(){p(this._subscription,"complete")}}exports.SubscriptionObserver=y;class d{constructor(e){if(!(this instanceof d))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,t,r){return"object"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new h(e,this._subscriber)}pipe(e,...t){let r=this;for(const o of[e,...t])r=o(r);return r}tap(e,t,r){const o="object"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new d(e=>this.subscribe({next(t){o.next&&o.next(t),e.next(t)},error(t){o.error&&o.error(t),e.error(t)},complete(){o.complete&&o.complete(),e.complete()},start(e){o.start&&o.start(e)}}))}forEach(e){return new Promise((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function o(){n.unsubscribe(),t()}const n=this.subscribe({next(t){try{e(t,o)}catch(s){r(s),n.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(s(this))(t=>this.subscribe({next(r){let o=r;try{o=e(r)}catch(n){return t.error(n)}t.next(o)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(s(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(o){return t.error(o)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e,t){if("function"!=typeof e)throw new TypeError(e+" is not a function");const r=s(this),o=arguments.length>1;let n=!1,i=t;return new r(t=>this.subscribe({next(r){const s=!n;if(n=!0,!s||o)try{i=e(i,r)}catch(c){return t.error(c)}else i=r},error(e){t.error(e)},complete(){if(!n&&!o)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}}))}concat(...e){const t=s(this);return new t(r=>{let o,n=0;return function s(i){o=i.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){n===e.length?(o=void 0,r.complete()):s(t.from(e[n++]))}})}(this),()=>{o&&(o.unsubscribe(),o=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=s(this);return new t(r=>{const o=[],n=this.subscribe({next(n){let i;if(e)try{i=e(n)}catch(u){return r.error(u)}else i=n;const c=t.from(i).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=o.indexOf(c);e>=0&&o.splice(e,1),s()}});o.push(c)},error(e){r.error(e)},complete(){s()}});function s(){n.closed&&0===o.length&&r.complete()}return()=>{o.forEach(e=>e.unsubscribe()),n.unsubscribe()}})}[r](){return this}static from(o){const s="function"==typeof this?this:d;if(null==o)throw new TypeError(o+" is not an object");const c=n(o,r);if(c){const e=c.call(o);if(Object(e)!==e)throw new TypeError(e+" is not an object");return i(e)&&e.constructor===s?e:new s(t=>e.subscribe(t))}if((0,e.hasSymbol)("iterator")){const e=n(o,t);if(e)return new s(t=>{u(()=>{if(!t.closed){for(const r of e.call(o))if(t.next(r),t.closed)return;t.complete()}})})}if(Array.isArray(o))return new s(e=>{u(()=>{if(!e.closed){for(const t of o)if(e.next(t),e.closed)return;e.complete()}})});throw new TypeError(o+" is not observable")}static of(...e){return new("function"==typeof this?this:d)(t=>{u(()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}})})}static get[o](){return this}}exports.Observable=d,(0,e.hasSymbols)()&&Object.defineProperty(d,Symbol("extensions"),{value:{symbol:r,hostReportError:c},configurable:!0});var _=d;exports.default=_;
},{"./_symbols":"lj3f"}],"QC75":[function(require,module,exports) {
"use strict";function e(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e;exports.default=t;
},{}],"apmd":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./_scheduler"),r=n(require("./observable")),t=n(require("./unsubscribe"));function n(e){return e&&e.__esModule?e:{default:e}}var u=function(e,r,t,n){return new(t||(t=Promise))(function(u,o){function c(e){try{l(n.next(e))}catch(r){o(r)}}function i(e){try{l(n.throw(e))}catch(r){o(r)}}function l(e){e.done?u(e.value):new t(function(r){r(e.value)}).then(c,i)}l((n=n.apply(e,r||[])).next())})};function o(n){return o=>new r.default(r=>{const c=new e.AsyncSerialScheduler(r),i=o.subscribe({complete(){c.complete()},error(e){c.error(e)},next(e){c.schedule(r=>u(this,void 0,void 0,function*(){(yield n(e))&&r(e)}))}});return()=>(0,t.default)(i)})}var c=o;exports.default=c;
},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],"FgiE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isAsyncIterator=t,exports.isIterator=e;var r=require("./_symbols");function t(t){return t&&(0,r.hasSymbol)("asyncIterator")&&t[Symbol.asyncIterator]}function e(t){return t&&(0,r.hasSymbol)("iterator")&&t[Symbol.iterator]}
},{"./_symbols":"lj3f"}],"ltny":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./_scheduler"),r=require("./_util"),t=o(require("./observable")),n=o(require("./unsubscribe"));function o(e){return e&&e.__esModule?e:{default:e}}var u=function(e,r,t,n){return new(t||(t=Promise))(function(o,u){function i(e){try{l(n.next(e))}catch(r){u(r)}}function c(e){try{l(n.throw(e))}catch(r){u(r)}}function l(e){e.done?o(e.value):new t(function(r){r(e.value)}).then(i,c)}l((n=n.apply(e,r||[])).next())})},i=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,t=e[Symbol.asyncIterator];return t?t.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(t){r[t]=e[t]&&function(r){return new Promise(function(n,o){(function(e,r,t,n){Promise.resolve(n).then(function(r){e({value:r,done:t})},r)})(n,o,(r=e[t](r)).done,r.value)})}}};function c(o){return c=>new t.default(t=>{const l=new e.AsyncSerialScheduler(t),a=c.subscribe({complete(){l.complete()},error(e){l.error(e)},next(e){l.schedule(t=>u(this,void 0,void 0,function*(){var n,u;const c=yield o(e);if((0,r.isIterator)(c)||(0,r.isAsyncIterator)(c))try{for(var l,a=i(c);!(l=yield a.next()).done;){const e=l.value;t(e)}}catch(s){n={error:s}}finally{try{l&&!l.done&&(u=a.return)&&(yield u.call(a))}finally{if(n)throw n.error}}else c.map(e=>t(e))}))}});return()=>(0,n.default)(a)})}var l=c;exports.default=l;
},{"./_scheduler":"sfrJ","./_util":"FgiE","./observable":"B9l3","./unsubscribe":"QC75"}],"jAhG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=r;var e=require("./observable");function r(r){return new e.Observable(e=>{let t=0;const n=setInterval(()=>{e.next(t++)},r);return()=>clearInterval(n)})}
},{"./observable":"B9l3"}],"aP59":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./_scheduler"),r=n(require("./observable")),t=n(require("./unsubscribe"));function n(e){return e&&e.__esModule?e:{default:e}}var u=function(e,r,t,n){return new(t||(t=Promise))(function(u,o){function c(e){try{l(n.next(e))}catch(r){o(r)}}function i(e){try{l(n.throw(e))}catch(r){o(r)}}function l(e){e.done?u(e.value):new t(function(r){r(e.value)}).then(c,i)}l((n=n.apply(e,r||[])).next())})};function o(n){return o=>new r.default(r=>{const c=new e.AsyncSerialScheduler(r),i=o.subscribe({complete(){c.complete()},error(e){c.error(e)},next(e){c.schedule(r=>u(this,void 0,void 0,function*(){const t=yield n(e);r(t)}))}});return()=>(0,t.default)(i)})}var c=o;exports.default=c;
},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],"Rg1v":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./observable"),r=t(require("./unsubscribe"));function t(e){return e&&e.__esModule?e:{default:e}}function u(...t){return 0===t.length?e.Observable.from([]):new e.Observable(e=>{let u=0;const o=t.map(r=>r.subscribe({error(r){e.error(r),l()},next(r){e.next(r)},complete(){++u===t.length&&(e.complete(),l())}})),l=()=>{o.forEach(e=>(0,r.default)(e))};return l})}var o=u;exports.default=o;
},{"./observable":"B9l3","./unsubscribe":"QC75"}],"wtHd":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./observable"));function r(e){return e&&e.__esModule?e:{default:e}}class s extends e.default{constructor(){super(e=>(this._observers.add(e),()=>this._observers.delete(e))),this._observers=new Set}next(e){for(const r of this._observers)r.next(e)}error(e){for(const r of this._observers)r.error(e)}complete(){for(const e of this._observers)e.complete()}}var t=s;exports.default=t;
},{"./observable":"B9l3"}],"NgdC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./observable")),r=t(require("./subject")),u=t(require("./unsubscribe"));function t(e){return e&&e.__esModule?e:{default:e}}function s(t){const s=new r.default;let n,i=0;return new e.default(e=>{n||(n=t.subscribe(s));const r=s.subscribe(e);return i++,()=>{i--,r.unsubscribe(),0===i&&((0,u.default)(n),n=void 0)}})}var n=s;exports.default=n;
},{"./observable":"B9l3","./subject":"wtHd","./unsubscribe":"QC75"}],"b7o0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./_scheduler"),t=n(require("./observable")),r=n(require("./unsubscribe"));function n(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t,r,n){return new(r||(r=Promise))(function(u,o){function c(e){try{l(n.next(e))}catch(t){o(t)}}function i(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){e.done?u(e.value):new r(function(t){t(e.value)}).then(c,i)}l((n=n.apply(e,t||[])).next())})};function o(n,o){return c=>new t.default(t=>{let i,l=0;const s=new e.AsyncSerialScheduler(t),d=c.subscribe({complete(){s.complete()},error(e){s.error(e)},next(e){s.schedule(t=>u(this,void 0,void 0,function*(){const r=0===l?void 0===o?e:o:i;i=yield n(r,e,l++),t(i)}))}});return()=>(0,r.default)(d)})}var c=o;exports.default=c;
},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],"cyO3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"filter",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"flatMap",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"interval",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"map",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"merge",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"multicast",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"Observable",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"scan",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"Subject",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"unsubscribe",{enumerable:!0,get:function(){return l.default}});var e=b(require("./filter")),r=b(require("./flatMap")),t=b(require("./interval")),u=b(require("./map")),n=b(require("./merge")),i=b(require("./multicast")),a=b(require("./observable")),f=b(require("./scan")),o=b(require("./subject")),l=b(require("./unsubscribe"));function b(e){return e&&e.__esModule?e:{default:e}}
},{"./filter":"apmd","./flatMap":"ltny","./interval":"jAhG","./map":"aP59","./merge":"Rg1v","./multicast":"NgdC","./observable":"B9l3","./scan":"b7o0","./subject":"wtHd","./unsubscribe":"QC75"}],"Ed0r":[function(require,module,exports) {
"use strict";function e(e){return Promise.all(e.map(e=>{const t=e=>({status:"fulfilled",value:e}),r=e=>({status:"rejected",reason:e}),s=Promise.resolve(e);try{return s.then(t,r)}catch(l){return Promise.reject(l)}}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.allSettled=void 0,exports.allSettled=e;
},{}],"vLk9":[function(require,module,exports) {
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.PoolEventType=void 0,function(e){e.initialized="initialized",e.taskCanceled="taskCanceled",e.taskCompleted="taskCompleted",e.taskFailed="taskFailed",e.taskQueued="taskQueued",e.taskQueueDrained="taskQueueDrained",e.taskStart="taskStart",e.terminated="terminated"}(e=exports.PoolEventType||(exports.PoolEventType={}));
},{}],"NcLz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.$worker=exports.$transferable=exports.$terminate=exports.$events=exports.$errors=void 0,exports.$errors=Symbol("thread.errors"),exports.$events=Symbol("thread.events"),exports.$terminate=Symbol("thread.terminate"),exports.$transferable=Symbol("thread.transferable"),exports.$worker=Symbol("thread.worker");
},{}],"xitR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Thread=void 0;const e=require("../symbols");function r(e){throw Error(e)}exports.Thread={errors:s=>s[e.$errors]||r("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:s=>s[e.$events]||r("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:r=>r[e.$terminate]()};
},{"../symbols":"NcLz"}],"QKsy":[function(require,module,exports) {
"use strict";var e=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(s,r){function o(e){try{a(i.next(e))}catch(t){r(t)}}function u(e){try{a(i.throw(e))}catch(t){r(t)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,u)}a((i=i.apply(e,t||[])).next())})},t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Pool=exports.Thread=exports.PoolEventType=void 0;const n=t(require("debug")),i=require("observable-fns"),s=require("../ponyfills"),r=require("./implementation"),o=require("./pool-types");Object.defineProperty(exports,"PoolEventType",{enumerable:!0,get:function(){return o.PoolEventType}});const u=require("./thread");Object.defineProperty(exports,"Thread",{enumerable:!0,get:function(){return u.Thread}});let a=1;function l(e){const t=[];for(let n=0;n<e;n++)t.push(n);return t}function h(e){return new Promise(t=>setTimeout(t,e))}function d(e,t){return e.reduce((e,n)=>[...e,...t(n)],[])}function c(e){return e.replace(/\W/g," ").trim().replace(/\s+/g,"-")}function p(e,t){return l(t).map(()=>({init:e(),runningTasks:[]}))}class b{constructor(e,t){this.eventSubject=new i.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const s="number"==typeof t?{size:t}:t||{},{size:u=r.defaultPoolSize}=s;this.debug=n.default(`threads:pool:${c(s.name||String(a++))}`),this.options=s,this.workers=p(e,u),this.eventObservable=i.multicast(i.Observable.from(this.eventSubject)),Promise.all(this.workers.map(e=>e.init)).then(()=>this.eventSubject.next({type:o.PoolEventType.initialized,size:this.workers.length}),e=>{this.debug("Error while initializing pool worker:",e),this.eventSubject.error(e),this.initErrors.push(e)})}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find(t=>t.runningTasks.length<e)}runPoolTask(t,n){return e(this,void 0,void 0,function*(){const e=this.workers.indexOf(t)+1;this.debug(`Running task #${n.id} on worker #${e}...`),this.eventSubject.next({type:o.PoolEventType.taskStart,taskID:n.id,workerID:e});try{const s=yield n.run(yield t.init);this.debug(`Task #${n.id} completed successfully`),this.eventSubject.next({type:o.PoolEventType.taskCompleted,returnValue:s,taskID:n.id,workerID:e})}catch(i){this.debug(`Task #${n.id} failed`),this.eventSubject.next({type:o.PoolEventType.taskFailed,taskID:n.id,error:i,workerID:e})}})}run(t,n){return e(this,void 0,void 0,function*(){const i=(()=>e(this,void 0,void 0,function*(){yield h(0);try{yield this.runPoolTask(t,n)}finally{t.runningTasks=t.runningTasks.filter(e=>e!==i),this.isClosing||this.scheduleWork()}}))();t.runningTasks.push(i)})}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug("Task queue is empty"),void this.eventSubject.next({type:o.PoolEventType.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise((t,n)=>{const i=this.events().subscribe(s=>{s.type===o.PoolEventType.taskCompleted&&s.taskID===e?(i.unsubscribe(),t(s.returnValue)):s.type===o.PoolEventType.taskFailed&&s.taskID===e?(i.unsubscribe(),n(s.error)):s.type===o.PoolEventType.terminated&&(i.unsubscribe(),n(Error("Pool has been terminated before task was run.")))})})}settled(t=!1){return e(this,void 0,void 0,function*(){const e=()=>d(this.workers,e=>e.runningTasks),n=[],i=this.eventObservable.subscribe(e=>{e.type===o.PoolEventType.taskFailed&&n.push(e.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):t&&0===this.taskQueue.length?(yield s.allSettled(e()),n):(yield new Promise((e,t)=>{const n=this.eventObservable.subscribe({next(t){t.type===o.PoolEventType.taskQueueDrained&&(n.unsubscribe(),e())},error:t})}),yield s.allSettled(e()),i.unsubscribe(),n)})}completed(t=!1){return e(this,void 0,void 0,function*(){const e=this.settled(t),n=new Promise((t,n)=>{const i=this.eventObservable.subscribe({next(s){s.type===o.PoolEventType.taskQueueDrained?(i.unsubscribe(),t(e)):s.type===o.PoolEventType.taskFailed&&(i.unsubscribe(),n(s.error))},error:n})}),i=yield Promise.race([e,n]);if(i.length>0)throw i[0]})}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const n=this.nextTaskID++,i=this.taskCompletion(n);i.catch(e=>{this.debug(`Task #${n} errored:`,e)});const s={id:n,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(s)&&(this.taskQueue=this.taskQueue.filter(e=>e!==s),this.eventSubject.next({type:o.PoolEventType.taskCanceled,taskID:s.id}))},then:i.then.bind(i)};if(this.taskQueue.length>=t)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${s.id}...`),this.taskQueue.push(s),this.eventSubject.next({type:o.PoolEventType.taskQueued,taskID:s.id}),this.scheduleWork(),s}terminate(t){return e(this,void 0,void 0,function*(){this.isClosing=!0,t||(yield this.completed(!0)),this.eventSubject.next({type:o.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(t=>e(this,void 0,void 0,function*(){return u.Thread.terminate(yield t.init)})))})}}function k(e,t){return new b(e,t)}b.EventType=o.PoolEventType,k.EventType=o.PoolEventType,exports.Pool=k;
},{"debug":"jcLW","observable-fns":"cyO3","../ponyfills":"Ed0r","./implementation":"PmVK","./pool-types":"vLk9","./thread":"xitR"}],"huOx":[function(require,module,exports) {
"use strict";function e(e,r){const i=e.deserialize.bind(e),a=e.serialize.bind(e);return{deserialize:e=>r.deserialize(e,i),serialize:e=>r.serialize(e,a)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DefaultSerializer=exports.extendSerializer=void 0,exports.extendSerializer=e;const r={deserialize:e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),serialize:e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack})},i=e=>e&&"object"==typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker;exports.DefaultSerializer={deserialize:e=>i(e)?r.deserialize(e):e,serialize:e=>e instanceof Error?r.serialize(e):e};
},{}],"ujDW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.serialize=exports.deserialize=exports.registerSerializer=void 0;const e=require("./serializers");let r=e.DefaultSerializer;function i(i){r=e.extendSerializer(r,i)}function t(e){return r.deserialize(e)}function s(e){return r.serialize(e)}exports.registerSerializer=i,exports.deserialize=t,exports.serialize=s;
},{"./serializers":"huOx"}],"KV9o":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createPromiseWithResolver=void 0;const e=()=>void 0;function r(){let r,t=!1,o=e;return[new Promise(e=>{t?e(r):o=e}),e=>{t=!0,r=e,o()}]}exports.createPromiseWithResolver=r;
},{}],"DioG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerEventType=void 0;const e=require("../symbols");var r;!function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(r=exports.WorkerEventType||(exports.WorkerEventType={}));
},{"../symbols":"NcLz"}],"qMn5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ObservablePromise=void 0;const t=require("observable-fns"),e=()=>void 0,s=t=>t,r=t=>Promise.resolve().then(t);function i(t){throw t}function n(t){return t&&"function"==typeof t.then}class o extends t.Observable{constructor(t){super(e=>{const s=this,r=Object.assign(Object.assign({},e),{complete(){e.complete(),s.onCompletion()},error(t){e.error(t),s.onError(t)},next(t){e.next(t),s.onNext(t)}});try{return this.initHasRun=!0,t(r)}catch(i){r.error(i)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state="rejected",this.rejection=t;for(const e of this.rejectionCallbacks)r(()=>e(t))}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks)r(()=>t(this.firstValue))}then(t,e){const r=t||s,n=e||i;let o=!1;return new Promise((t,e)=>{const s=s=>{if(!o){o=!0;try{t(n(s))}catch(r){e(r)}}};return this.initHasRun||this.subscribe({error:s}),"fulfilled"===this.state?t(r(this.firstValue)):"rejected"===this.state?(o=!0,t(n(this.rejection))):(this.fulfillmentCallbacks.push(e=>{try{t(r(e))}catch(i){s(i)}}),void this.rejectionCallbacks.push(s))})}catch(t){return this.then(void 0,t)}finally(t){const s=t||e;return this.then(t=>(s(),t),()=>s())}static from(t){return n(t)?new o(e=>{t.then(t=>{e.next(t),e.complete()},t=>{e.error(t)})}):super.from(t)}}exports.ObservablePromise=o;
},{"observable-fns":"cyO3"}],"HnZs":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Transfer=exports.isTransferDescriptor=void 0;const r=require("./symbols");function e(r){return!(!r||"object"!=typeof r)}function t(e){return e&&"object"==typeof e&&e[r.$transferable]}function s(t,s){if(!s){if(!e(t))throw Error();s=[t]}return{[r.$transferable]:!0,send:t,transferables:s}}exports.isTransferDescriptor=t,exports.Transfer=s;
},{"./symbols":"NcLz"}],"No47":[function(require,module,exports) {
"use strict";var e,r;Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerMessageType=exports.MasterMessageType=void 0,function(e){e.cancel="cancel",e.run="run"}(e=exports.MasterMessageType||(exports.MasterMessageType={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(r=exports.WorkerMessageType||(exports.WorkerMessageType={}));
},{}],"WRyd":[function(require,module,exports) {
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.createProxyModule=exports.createProxyFunction=void 0;const r=e(require("debug")),s=require("observable-fns"),t=require("../common"),a=require("../observable-promise"),o=require("../transferable"),n=require("../types/messages"),i=r.default("threads:master:messages");let u=1;const l=e=>Array.from(new Set(e)),d=e=>e&&e.type===n.WorkerMessageType.error,c=e=>e&&e.type===n.WorkerMessageType.result,p=e=>e&&e.type===n.WorkerMessageType.running;function f(e,r){return new s.Observable(s=>{let a;const o=n=>{if(i("Message from worker:",n.data),n.data&&n.data.uid===r)if(p(n.data))a=n.data.resultType;else if(c(n.data))"promise"===a?(void 0!==n.data.payload&&s.next(t.deserialize(n.data.payload)),s.complete(),e.removeEventListener("message",o)):(n.data.payload&&s.next(t.deserialize(n.data.payload)),n.data.complete&&(s.complete(),e.removeEventListener("message",o)));else if(d(n.data)){const r=t.deserialize(n.data.error);s.error(r),e.removeEventListener("message",o)}};return e.addEventListener("message",o),()=>{if("observable"===a||!a){const s={type:n.MasterMessageType.cancel,uid:r};e.postMessage(s)}e.removeEventListener("message",o)}})}function m(e){if(0===e.length)return{args:[],transferables:[]};const r=[],s=[];for(const a of e)o.isTransferDescriptor(a)?(r.push(t.serialize(a.send)),s.push(...a.transferables)):r.push(t.serialize(a));return{args:r,transferables:0===s.length?s:l(s)}}function g(e,r){return(...t)=>{const o=u++,{args:l,transferables:d}=m(t),c={type:n.MasterMessageType.run,uid:o,method:r,args:l};i("Sending command to run function to worker:",c);try{e.postMessage(c,d)}catch(p){return a.ObservablePromise.from(Promise.reject(p))}return a.ObservablePromise.from(s.multicast(f(e,o)))}}function y(e,r){const s={};for(const t of r)s[t]=g(e,t);return s}exports.createProxyFunction=g,exports.createProxyModule=y;
},{"debug":"jcLW","observable-fns":"cyO3","../common":"ujDW","../observable-promise":"qMn5","../transferable":"HnZs","../types/messages":"No47"}],"Hy5Q":[function(require,module,exports) {
var process = require("process");
var e=require("process"),t=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.spawn=void 0;const n=r(require("debug")),i=require("observable-fns"),o=require("../common"),s=require("../promise"),a=require("../symbols"),u=require("../types/master"),c=require("./invocation-proxy"),d=n.default("threads:master:messages"),m=n.default("threads:master:spawn"),l=n.default("threads:master:thread-utils"),p=e=>e&&"init"===e.type,f=e=>e&&"uncaughtError"===e.type,v=1e4;function h(e,r,n){return t(this,void 0,void 0,function*(){let t;const i=new Promise((e,i)=>{t=setTimeout(()=>i(Error(n)),r)}),o=yield Promise.race([e,i]);return clearTimeout(t),o})}function y(e){return new Promise((t,r)=>{const n=i=>{d("Message from worker before finishing initialization:",i.data),p(i.data)?(e.removeEventListener("message",n),t(i.data)):f(i.data)&&(e.removeEventListener("message",n),r(o.deserialize(i.data.error)))};e.addEventListener("message",n)})}function w(e,t){return new i.Observable(r=>{const n=e=>{const t={type:u.WorkerEventType.message,data:e.data};r.next(t)},i=e=>{l("Unhandled promise rejection event in thread:",e);const t={type:u.WorkerEventType.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener("message",n),e.addEventListener("unhandledrejection",i),t.then(()=>{const t={type:u.WorkerEventType.termination};e.removeEventListener("message",n),e.removeEventListener("unhandledrejection",i),r.next(t),r.complete()})})}function E(e){const[r,n]=s.createPromiseWithResolver();return{terminate:()=>t(this,void 0,void 0,function*(){l("Terminating worker"),yield e.terminate(),n()}),termination:r}}function g(e,t,r,n){const i=r.filter(e=>e.type===u.WorkerEventType.internalError).map(e=>e.error);return Object.assign(e,{[a.$errors]:i,[a.$events]:r,[a.$terminate]:n,[a.$worker]:t})}function x(e,r){return t(this,void 0,void 0,function*(){m("Initializing new thread");const t=(yield h(y(e),r&&r.timeout?r.timeout:v,`Timeout: Did not receive an init message from worker after ${v}ms. Make sure the worker calls expose().`)).exposed,{termination:n,terminate:i}=E(e),o=w(e,n);if("function"===t.type){return g(c.createProxyFunction(e),e,o,i)}if("module"===t.type){return g(c.createProxyModule(e,t.methods),e,o,i)}{const e=t.type;throw Error(`Worker init message states unexpected type of expose(): ${e}`)}})}exports.spawn=x;
},{"debug":"jcLW","observable-fns":"cyO3","../common":"ujDW","../promise":"KV9o","../symbols":"NcLz","../types/master":"DioG","./invocation-proxy":"WRyd","process":"pBGv"}],"FHK0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Worker=exports.BlobWorker=exports.isWorkerRuntime=void 0;const e=require("./implementation");Object.defineProperty(exports,"isWorkerRuntime",{enumerable:!0,get:function(){return e.isWorkerRuntime}});var r=require("./pool");Object.defineProperty(exports,"Pool",{enumerable:!0,get:function(){return r.Pool}});var t=require("./spawn");Object.defineProperty(exports,"spawn",{enumerable:!0,get:function(){return t.spawn}});var o=require("./thread");Object.defineProperty(exports,"Thread",{enumerable:!0,get:function(){return o.Thread}}),exports.BlobWorker=e.getWorkerImplementation().blob,exports.Worker=e.getWorkerImplementation().default;
},{"./implementation":"PmVK","./pool":"QKsy","./spawn":"Hy5Q","./thread":"xitR"}],"Tmuk":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0});const r=require("./index");void 0!==e?e.Worker=r.Worker:"undefined"!=typeof window&&(window.Worker=r.Worker);
},{"./index":"FHK0"}],"IB1e":[function(require,module,exports) {
require("./dist/master/register");
},{"./dist/master/register":"Tmuk"}],"J4Nk":[function(require,module,exports) {
"use strict";var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;function n(r){if(null==r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function o(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(r){return t[r]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(r){n[r]=r}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(o){return!1}}module.exports=o()?Object.assign:function(o,c){for(var a,i,s=n(o),f=1;f<arguments.length;f++){for(var u in a=Object(arguments[f]))t.call(a,u)&&(s[u]=a[u]);if(r){i=r(a);for(var b=0;b<i.length;b++)e.call(a,i[b])&&(s[i[b]]=a[i[b]])}}return s};
},{}],"awqi":[function(require,module,exports) {
"use strict";var e=require("object-assign"),r="function"==typeof Symbol&&Symbol.for,t=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,f=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,i=r?Symbol.for("react.forward_ref"):60112,s=r?Symbol.for("react.suspense"):60113,a=r?Symbol.for("react.memo"):60115,p=r?Symbol.for("react.lazy"):60116,y="function"==typeof Symbol&&Symbol.iterator;function d(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)r+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h={};function m(e,r,t){this.props=e,this.context=r,this.refs=h,this.updater=t||v}function x(){}function b(e,r,t){this.props=e,this.context=r,this.refs=h,this.updater=t||v}m.prototype.isReactComponent={},m.prototype.setState=function(e,r){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(d(85));this.updater.enqueueSetState(this,e,r,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=m.prototype;var S=b.prototype=new x;S.constructor=b,e(S,m.prototype),S.isPureReactComponent=!0;var _={current:null},k=Object.prototype.hasOwnProperty,$={key:!0,ref:!0,__self:!0,__source:!0};function g(e,r,n){var o,u={},f=null,c=null;if(null!=r)for(o in void 0!==r.ref&&(c=r.ref),void 0!==r.key&&(f=""+r.key),r)k.call(r,o)&&!$.hasOwnProperty(o)&&(u[o]=r[o]);var l=arguments.length-2;if(1===l)u.children=n;else if(1<l){for(var i=Array(l),s=0;s<l;s++)i[s]=arguments[s+2];u.children=i}if(e&&e.defaultProps)for(o in l=e.defaultProps)void 0===u[o]&&(u[o]=l[o]);return{$$typeof:t,type:e,key:f,ref:c,props:u,_owner:_.current}}function w(e,r){return{$$typeof:t,type:e.type,key:r,ref:e.ref,props:e.props,_owner:e._owner}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function E(e){var r={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})}var R=/\/+/g,P=[];function j(e,r,t,n){if(P.length){var o=P.pop();return o.result=e,o.keyPrefix=r,o.func=t,o.context=n,o.count=0,o}return{result:e,keyPrefix:r,func:t,context:n,count:0}}function O(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>P.length&&P.push(e)}function A(e,r,o,u){var f=typeof e;"undefined"!==f&&"boolean"!==f||(e=null);var c=!1;if(null===e)c=!0;else switch(f){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case n:c=!0}}if(c)return o(u,e,""===r?"."+U(e,0):r),1;if(c=0,r=""===r?".":r+":",Array.isArray(e))for(var l=0;l<e.length;l++){var i=r+U(f=e[l],l);c+=A(f,i,o,u)}else if(null===e||"object"!=typeof e?i=null:i="function"==typeof(i=y&&e[y]||e["@@iterator"])?i:null,"function"==typeof i)for(e=i.call(e),l=0;!(f=e.next()).done;)c+=A(f=f.value,i=r+U(f,l++),o,u);else if("object"===f)throw o=""+e,Error(d(31,"[object Object]"===o?"object with keys {"+Object.keys(e).join(", ")+"}":o,""));return c}function I(e,r,t){return null==e?0:A(e,"",r,t)}function U(e,r){return"object"==typeof e&&null!==e&&null!=e.key?E(e.key):r.toString(36)}function q(e,r){e.func.call(e.context,r,e.count++)}function F(e,r,t){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,r,e.count++),Array.isArray(e)?L(e,n,t,function(e){return e}):null!=e&&(C(e)&&(e=w(e,o+(!e.key||r&&r.key===e.key?"":(""+e.key).replace(R,"$&/")+"/")+t)),n.push(e))}function L(e,r,t,n,o){var u="";null!=t&&(u=(""+t).replace(R,"$&/")+"/"),I(e,F,r=j(r,u,n,o)),O(r)}var M={current:null};function D(){var e=M.current;if(null===e)throw Error(d(321));return e}var V={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:_,IsSomeRendererActing:{current:!1},assign:e};exports.Children={map:function(e,r,t){if(null==e)return e;var n=[];return L(e,n,null,r,t),n},forEach:function(e,r,t){if(null==e)return e;I(e,q,r=j(null,null,r,t)),O(r)},count:function(e){return I(e,function(){return null},null)},toArray:function(e){var r=[];return L(e,r,null,function(e){return e}),r},only:function(e){if(!C(e))throw Error(d(143));return e}},exports.Component=m,exports.Fragment=o,exports.Profiler=f,exports.PureComponent=b,exports.StrictMode=u,exports.Suspense=s,exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,exports.cloneElement=function(r,n,o){if(null==r)throw Error(d(267,r));var u=e({},r.props),f=r.key,c=r.ref,l=r._owner;if(null!=n){if(void 0!==n.ref&&(c=n.ref,l=_.current),void 0!==n.key&&(f=""+n.key),r.type&&r.type.defaultProps)var i=r.type.defaultProps;for(s in n)k.call(n,s)&&!$.hasOwnProperty(s)&&(u[s]=void 0===n[s]&&void 0!==i?i[s]:n[s])}var s=arguments.length-2;if(1===s)u.children=o;else if(1<s){i=Array(s);for(var a=0;a<s;a++)i[a]=arguments[a+2];u.children=i}return{$$typeof:t,type:r.type,key:f,ref:c,props:u,_owner:l}},exports.createContext=function(e,r){return void 0===r&&(r=null),(e={$$typeof:l,_calculateChangedBits:r,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},exports.createElement=g,exports.createFactory=function(e){var r=g.bind(null,e);return r.type=e,r},exports.createRef=function(){return{current:null}},exports.forwardRef=function(e){return{$$typeof:i,render:e}},exports.isValidElement=C,exports.lazy=function(e){return{$$typeof:p,_ctor:e,_status:-1,_result:null}},exports.memo=function(e,r){return{$$typeof:a,type:e,compare:void 0===r?null:r}},exports.useCallback=function(e,r){return D().useCallback(e,r)},exports.useContext=function(e,r){return D().useContext(e,r)},exports.useDebugValue=function(){},exports.useEffect=function(e,r){return D().useEffect(e,r)},exports.useImperativeHandle=function(e,r,t){return D().useImperativeHandle(e,r,t)},exports.useLayoutEffect=function(e,r){return D().useLayoutEffect(e,r)},exports.useMemo=function(e,r){return D().useMemo(e,r)},exports.useReducer=function(e,r,t){return D().useReducer(e,r,t)},exports.useRef=function(e){return D().useRef(e)},exports.useState=function(e){return D().useState(e)},exports.version="16.14.0";
},{"object-assign":"J4Nk"}],"n8MK":[function(require,module,exports) {
"use strict";module.exports=require("./cjs/react.production.min.js");
},{"./cjs/react.production.min.js":"awqi"}],"IvPb":[function(require,module,exports) {
"use strict";var e,n,t,r,o;if("undefined"==typeof window||"function"!=typeof MessageChannel){var a=null,l=null,i=function(){if(null!==a)try{var e=exports.unstable_now();a(!0,e),a=null}catch(n){throw setTimeout(i,0),n}},u=Date.now();exports.unstable_now=function(){return Date.now()-u},e=function(n){null!==a?setTimeout(e,0,n):(a=n,setTimeout(i,0))},n=function(e,n){l=setTimeout(e,n)},t=function(){clearTimeout(l)},r=function(){return!1},o=exports.unstable_forceFrameRate=function(){}}else{var s=window.performance,c=window.Date,f=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var b=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof s&&"function"==typeof s.now)exports.unstable_now=function(){return s.now()};else{var d=c.now();exports.unstable_now=function(){return c.now()-d}}var v=!1,x=null,w=-1,m=5,y=0;r=function(){return exports.unstable_now()>=y},o=function(){},exports.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):m=0<e?Math.floor(1e3/e):5};var _=new MessageChannel,h=_.port2;_.port1.onmessage=function(){if(null!==x){var e=exports.unstable_now();y=e+m;try{x(!0,e)?h.postMessage(null):(v=!1,x=null)}catch(n){throw h.postMessage(null),n}}else v=!1},e=function(e){x=e,v||(v=!0,h.postMessage(null))},n=function(e,n){w=f(function(){e(exports.unstable_now())},n)},t=function(){p(w),w=-1}}function k(e,n){var t=e.length;e.push(n);e:for(;;){var r=t-1>>>1,o=e[r];if(!(void 0!==o&&0<P(o,n)))break e;e[r]=n,e[t]=o,t=r}}function T(e){return void 0===(e=e[0])?null:e}function g(e){var n=e[0];if(void 0!==n){var t=e.pop();if(t!==n){e[0]=t;e:for(var r=0,o=e.length;r<o;){var a=2*(r+1)-1,l=e[a],i=a+1,u=e[i];if(void 0!==l&&0>P(l,t))void 0!==u&&0>P(u,l)?(e[r]=u,e[i]=t,r=i):(e[r]=l,e[a]=t,r=a);else{if(!(void 0!==u&&0>P(u,t)))break e;e[r]=u,e[i]=t,r=i}}}return n}return null}function P(e,n){var t=e.sortIndex-n.sortIndex;return 0!==t?t:e.id-n.id}var F=[],I=[],M=1,C=null,A=3,L=!1,q=!1,D=!1;function R(e){for(var n=T(I);null!==n;){if(null===n.callback)g(I);else{if(!(n.startTime<=e))break;g(I),n.sortIndex=n.expirationTime,k(F,n)}n=T(I)}}function j(t){if(D=!1,R(t),!q)if(null!==T(F))q=!0,e(E);else{var r=T(I);null!==r&&n(j,r.startTime-t)}}function E(e,o){q=!1,D&&(D=!1,t()),L=!0;var a=A;try{for(R(o),C=T(F);null!==C&&(!(C.expirationTime>o)||e&&!r());){var l=C.callback;if(null!==l){C.callback=null,A=C.priorityLevel;var i=l(C.expirationTime<=o);o=exports.unstable_now(),"function"==typeof i?C.callback=i:C===T(F)&&g(F),R(o)}else g(F);C=T(F)}if(null!==C)var u=!0;else{var s=T(I);null!==s&&n(j,s.startTime-o),u=!1}return u}finally{C=null,A=a,L=!1}}function N(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=o;exports.unstable_IdlePriority=5,exports.unstable_ImmediatePriority=1,exports.unstable_LowPriority=4,exports.unstable_NormalPriority=3,exports.unstable_Profiling=null,exports.unstable_UserBlockingPriority=2,exports.unstable_cancelCallback=function(e){e.callback=null},exports.unstable_continueExecution=function(){q||L||(q=!0,e(E))},exports.unstable_getCurrentPriorityLevel=function(){return A},exports.unstable_getFirstCallbackNode=function(){return T(F)},exports.unstable_next=function(e){switch(A){case 1:case 2:case 3:var n=3;break;default:n=A}var t=A;A=n;try{return e()}finally{A=t}},exports.unstable_pauseExecution=function(){},exports.unstable_requestPaint=B,exports.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var t=A;A=e;try{return n()}finally{A=t}},exports.unstable_scheduleCallback=function(r,o,a){var l=exports.unstable_now();if("object"==typeof a&&null!==a){var i=a.delay;i="number"==typeof i&&0<i?l+i:l,a="number"==typeof a.timeout?a.timeout:N(r)}else a=N(r),i=l;return r={id:M++,callback:o,priorityLevel:r,startTime:i,expirationTime:a=i+a,sortIndex:-1},i>l?(r.sortIndex=i,k(I,r),null===T(F)&&r===T(I)&&(D?t():D=!0,n(j,i-l))):(r.sortIndex=a,k(F,r),q||L||(q=!0,e(E))),r},exports.unstable_shouldYield=function(){var e=exports.unstable_now();R(e);var n=T(F);return n!==C&&null!==C&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<C.expirationTime||r()},exports.unstable_wrapCallback=function(e){var n=A;return function(){var t=A;A=n;try{return e.apply(this,arguments)}finally{A=t}}};
},{}],"MDSO":[function(require,module,exports) {
"use strict";module.exports=require("./cjs/scheduler.production.min.js");
},{"./cjs/scheduler.production.min.js":"IvPb"}],"i17t":[function(require,module,exports) {
"use strict";var e=require("react"),t=require("object-assign"),n=require("scheduler");function r(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!e)throw Error(r(227));function l(e,t,n,r,l,i,a,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(s){this.onError(s)}}var i=!1,a=null,o=!1,u=null,c={onError:function(e){i=!0,a=e}};function s(e,t,n,r,o,u,s,f,d){i=!1,a=null,l.apply(c,arguments)}function f(e,t,n,l,c,f,d,p,m){if(s.apply(this,arguments),i){if(!i)throw Error(r(198));var h=a;i=!1,a=null,o||(o=!0,u=h)}}var d=null,p=null,m=null;function h(e,t,n){var r=e.type||"unknown-event";e.currentTarget=m(n),f(r,t,void 0,e),e.currentTarget=null}var g=null,v={};function y(){if(g)for(var e in v){var t=v[e],n=g.indexOf(e);if(!(-1<n))throw Error(r(96,e));if(!w[n]){if(!t.extractEvents)throw Error(r(97,e));for(var l in w[n]=t,n=t.eventTypes){var i=void 0,a=n[l],o=t,u=l;if(k.hasOwnProperty(u))throw Error(r(99,u));k[u]=a;var c=a.phasedRegistrationNames;if(c){for(i in c)c.hasOwnProperty(i)&&b(c[i],o,u);i=!0}else a.registrationName?(b(a.registrationName,o,u),i=!0):i=!1;if(!i)throw Error(r(98,l,e))}}}}function b(e,t,n){if(x[e])throw Error(r(100,e));x[e]=t,T[e]=t.eventTypes[n].dependencies}var w=[],k={},x={},T={};function E(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var l=e[t];if(!v.hasOwnProperty(t)||v[t]!==l){if(v[t])throw Error(r(102,t));v[t]=l,n=!0}}n&&y()}var S=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),C=null,P=null,_=null;function N(e){if(e=p(e)){if("function"!=typeof C)throw Error(r(280));var t=e.stateNode;t&&(t=d(t),C(e.stateNode,e.type,t))}}function z(e){P?_?_.push(e):_=[e]:P=e}function M(){if(P){var e=P,t=_;if(_=P=null,N(e),t)for(e=0;e<t.length;e++)N(t[e])}}function I(e,t){return e(t)}function F(e,t,n,r,l){return e(t,n,r,l)}function O(){}var R=I,D=!1,L=!1;function U(){null===P&&null===_||(O(),M())}function A(e,t,n){if(L)return e(t,n);L=!0;try{return R(e,t,n)}finally{L=!1,U()}}var V=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Q=Object.prototype.hasOwnProperty,W={},H={};function j(e){return!!Q.call(H,e)||!Q.call(W,e)&&(V.test(e)?H[e]=!0:(W[e]=!0,!1))}function B(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}function K(e,t,n,r){if(null==t||B(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $(e,t,n,r,l,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i}var q={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){q[e]=new $(e,0,!1,e,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];q[t]=new $(t,1,!1,e[1],null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){q[e]=new $(e,2,!1,e.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){q[e]=new $(e,2,!1,e,null,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){q[e]=new $(e,3,!1,e.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(e){q[e]=new $(e,3,!0,e,null,!1)}),["capture","download"].forEach(function(e){q[e]=new $(e,4,!1,e,null,!1)}),["cols","rows","size","span"].forEach(function(e){q[e]=new $(e,6,!1,e,null,!1)}),["rowSpan","start"].forEach(function(e){q[e]=new $(e,5,!1,e.toLowerCase(),null,!1)});var Y=/[\-:]([a-z])/g;function X(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Y,X);q[t]=new $(t,1,!1,e,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Y,X);q[t]=new $(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Y,X);q[t]=new $(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(e){q[e]=new $(e,1,!1,e.toLowerCase(),null,!1)}),q.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(e){q[e]=new $(e,1,!1,e.toLowerCase(),null,!0)});var G=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Z(e,t,n,r){var l=q.hasOwnProperty(t)?q[t]:null;(null!==l?0===l.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(K(t,n,l,r)&&(n=null),r||null===l?j(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=null===n?3!==l.type&&"":n:(t=l.attributeName,r=l.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(l=l.type)||4===l&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}G.hasOwnProperty("ReactCurrentDispatcher")||(G.ReactCurrentDispatcher={current:null}),G.hasOwnProperty("ReactCurrentBatchConfig")||(G.ReactCurrentBatchConfig={suspense:null});var J=/^(.*)[\\\/]/,ee="function"==typeof Symbol&&Symbol.for,te=ee?Symbol.for("react.element"):60103,ne=ee?Symbol.for("react.portal"):60106,re=ee?Symbol.for("react.fragment"):60107,le=ee?Symbol.for("react.strict_mode"):60108,ie=ee?Symbol.for("react.profiler"):60114,ae=ee?Symbol.for("react.provider"):60109,oe=ee?Symbol.for("react.context"):60110,ue=ee?Symbol.for("react.concurrent_mode"):60111,ce=ee?Symbol.for("react.forward_ref"):60112,se=ee?Symbol.for("react.suspense"):60113,fe=ee?Symbol.for("react.suspense_list"):60120,de=ee?Symbol.for("react.memo"):60115,pe=ee?Symbol.for("react.lazy"):60116,me=ee?Symbol.for("react.block"):60121,he="function"==typeof Symbol&&Symbol.iterator;function ge(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=he&&e[he]||e["@@iterator"])?e:null}function ve(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)})}}function ye(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case re:return"Fragment";case ne:return"Portal";case ie:return"Profiler";case le:return"StrictMode";case se:return"Suspense";case fe:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case oe:return"Context.Consumer";case ae:return"Context.Provider";case ce:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case de:return ye(e.type);case me:return ye(e.render);case pe:if(e=1===e._status?e._result:null)return ye(e)}return null}function be(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,l=e._debugSource,i=ye(e.type);n=null,r&&(n=ye(r.type)),r=i,i="",l?i=" (at "+l.fileName.replace(J,"")+":"+l.lineNumber+")":n&&(i=" (created by "+n+")"),n="\n    in "+(r||"Unknown")+i}t+=n,e=e.return}while(e);return t}function we(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ke(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function xe(e){var t=ke(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Te(e){e._valueTracker||(e._valueTracker=xe(e))}function Ee(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ke(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Se(e,n){var r=n.checked;return t({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function Ce(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=we(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Pe(e,t){null!=(t=t.checked)&&Z(e,"checked",t,!1)}function _e(e,t){Pe(e,t);var n=we(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ze(e,t.type,n):t.hasOwnProperty("defaultValue")&&ze(e,t.type,we(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Ne(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ze(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Me(t){var n="";return e.Children.forEach(t,function(e){null!=e&&(n+=e)}),n}function Ie(e,n){return e=t({children:void 0},n),(n=Me(n.children))&&(e.children=n),e}function Fe(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+we(n),t=null,l=0;l<e.length;l++){if(e[l].value===n)return e[l].selected=!0,void(r&&(e[l].defaultSelected=!0));null!==t||e[l].disabled||(t=e[l])}null!==t&&(t.selected=!0)}}function Oe(e,n){if(null!=n.dangerouslySetInnerHTML)throw Error(r(91));return t({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Re(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(r(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(r(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:we(n)}}function De(e,t){var n=we(t.value),r=we(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Le(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Ue={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ve(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Qe,We=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==Ue.svg||"innerHTML"in e)e.innerHTML=t;else{for((Qe=Qe||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function He(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function je(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Be={animationend:je("Animation","AnimationEnd"),animationiteration:je("Animation","AnimationIteration"),animationstart:je("Animation","AnimationStart"),transitionend:je("Transition","TransitionEnd")},Ke={},$e={};function qe(e){if(Ke[e])return Ke[e];if(!Be[e])return e;var t,n=Be[e];for(t in n)if(n.hasOwnProperty(t)&&t in $e)return Ke[e]=n[t];return e}S&&($e=document.createElement("div").style,"AnimationEvent"in window||(delete Be.animationend.animation,delete Be.animationiteration.animation,delete Be.animationstart.animation),"TransitionEvent"in window||delete Be.transitionend.transition);var Ye=qe("animationend"),Xe=qe("animationiteration"),Ge=qe("animationstart"),Ze=qe("transitionend"),Je="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),et=new("function"==typeof WeakMap?WeakMap:Map);function tt(e){var t=et.get(e);return void 0===t&&(t=new Map,et.set(e,t)),t}function nt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function rt(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function lt(e){if(nt(e)!==e)throw Error(r(188))}function it(e){var t=e.alternate;if(!t){if(null===(t=nt(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(l=i.return)){n=l;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return lt(i),e;if(a===l)return lt(i),t;a=a.sibling}throw Error(r(188))}if(n.return!==l.return)n=i,l=a;else{for(var o=!1,u=i.child;u;){if(u===n){o=!0,n=i,l=a;break}if(u===l){o=!0,l=i,n=a;break}u=u.sibling}if(!o){for(u=a.child;u;){if(u===n){o=!0,n=a,l=i;break}if(u===l){o=!0,l=a,n=i;break}u=u.sibling}if(!o)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}function at(e){if(!(e=it(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function ot(e,t){if(null==t)throw Error(r(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function ut(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var ct=null;function st(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)h(e,t[r],n[r]);else t&&h(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function ft(e){if(null!==e&&(ct=ot(ct,e)),e=ct,ct=null,e){if(ut(e,st),ct)throw Error(r(95));if(o)throw e=u,o=!1,u=null,e}}function dt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function pt(e){if(!S)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var mt=[];function ht(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>mt.length&&mt.push(e)}function gt(e,t,n,r){if(mt.length){var l=mt.pop();return l.topLevelType=e,l.eventSystemFlags=r,l.nativeEvent=t,l.targetInst=n,l}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function vt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=Un(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var l=dt(e.nativeEvent);r=e.topLevelType;var i=e.nativeEvent,a=e.eventSystemFlags;0===n&&(a|=64);for(var o=null,u=0;u<w.length;u++){var c=w[u];c&&(c=c.extractEvents(r,t,i,l,a))&&(o=ot(o,c))}ft(o)}}function yt(e,t,n){if(!n.has(e)){switch(e){case"scroll":en(t,"scroll",!0);break;case"focus":case"blur":en(t,"focus",!0),en(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":pt(e)&&en(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Je.indexOf(e)&&Jt(e,t)}n.set(e,null)}}var bt,wt,kt,xt=!1,Tt=[],Et=null,St=null,Ct=null,Pt=new Map,_t=new Map,Nt=[],zt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),Mt="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function It(e,t){var n=tt(t);zt.forEach(function(e){yt(e,t,n)}),Mt.forEach(function(e){yt(e,t,n)})}function Ft(e,t,n,r,l){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:l,container:r}}function Ot(e,t){switch(e){case"focus":case"blur":Et=null;break;case"dragenter":case"dragleave":St=null;break;case"mouseover":case"mouseout":Ct=null;break;case"pointerover":case"pointerout":Pt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_t.delete(t.pointerId)}}function Rt(e,t,n,r,l,i){return null===e||e.nativeEvent!==i?(e=Ft(t,n,r,l,i),null!==t&&(null!==(t=An(t))&&wt(t)),e):(e.eventSystemFlags|=r,e)}function Dt(e,t,n,r,l){switch(t){case"focus":return Et=Rt(Et,e,t,n,r,l),!0;case"dragenter":return St=Rt(St,e,t,n,r,l),!0;case"mouseover":return Ct=Rt(Ct,e,t,n,r,l),!0;case"pointerover":var i=l.pointerId;return Pt.set(i,Rt(Pt.get(i)||null,e,t,n,r,l)),!0;case"gotpointercapture":return i=l.pointerId,_t.set(i,Rt(_t.get(i)||null,e,t,n,r,l)),!0}return!1}function Lt(e){var t=Un(e.target);if(null!==t){var r=nt(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=rt(r)))return e.blockedOn=t,void n.unstable_runWithPriority(e.priority,function(){kt(r)})}else if(3===t&&r.stateNode.hydrate)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function Ut(e){if(null!==e.blockedOn)return!1;var t=ln(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=An(t);return null!==n&&wt(n),e.blockedOn=t,!1}return!0}function At(e,t,n){Ut(e)&&n.delete(t)}function Vt(){for(xt=!1;0<Tt.length;){var e=Tt[0];if(null!==e.blockedOn){null!==(e=An(e.blockedOn))&&bt(e);break}var t=ln(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:Tt.shift()}null!==Et&&Ut(Et)&&(Et=null),null!==St&&Ut(St)&&(St=null),null!==Ct&&Ut(Ct)&&(Ct=null),Pt.forEach(At),_t.forEach(At)}function Qt(e,t){e.blockedOn===t&&(e.blockedOn=null,xt||(xt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Vt)))}function Wt(e){function t(t){return Qt(t,e)}if(0<Tt.length){Qt(Tt[0],e);for(var n=1;n<Tt.length;n++){var r=Tt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Et&&Qt(Et,e),null!==St&&Qt(St,e),null!==Ct&&Qt(Ct,e),Pt.forEach(t),_t.forEach(t),n=0;n<Nt.length;n++)(r=Nt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Nt.length&&null===(n=Nt[0]).blockedOn;)Lt(n),null===n.blockedOn&&Nt.shift()}var Ht={},jt=new Map,Bt=new Map,Kt=["abort","abort",Ye,"animationEnd",Xe,"animationIteration",Ge,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ze,"transitionEnd","waiting","waiting"];function $t(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],l=e[n+1],i="on"+(l[0].toUpperCase()+l.slice(1));i={phasedRegistrationNames:{bubbled:i,captured:i+"Capture"},dependencies:[r],eventPriority:t},Bt.set(r,t),jt.set(r,i),Ht[l]=i}}$t("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),$t("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),$t(Kt,2);for(var qt="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Yt=0;Yt<qt.length;Yt++)Bt.set(qt[Yt],0);var Xt=n.unstable_UserBlockingPriority,Gt=n.unstable_runWithPriority,Zt=!0;function Jt(e,t){en(t,e,!1)}function en(e,t,n){var r=Bt.get(t);switch(void 0===r?2:r){case 0:r=tn.bind(null,t,1,e);break;case 1:r=nn.bind(null,t,1,e);break;default:r=rn.bind(null,t,1,e)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function tn(e,t,n,r){D||O();var l=rn,i=D;D=!0;try{F(l,e,t,n,r)}finally{(D=i)||U()}}function nn(e,t,n,r){Gt(Xt,rn.bind(null,e,t,n,r))}function rn(e,t,n,r){if(Zt)if(0<Tt.length&&-1<zt.indexOf(e))e=Ft(null,e,t,n,r),Tt.push(e);else{var l=ln(e,t,n,r);if(null===l)Ot(e,r);else if(-1<zt.indexOf(e))e=Ft(l,e,t,n,r),Tt.push(e);else if(!Dt(l,e,t,n,r)){Ot(e,r),e=gt(e,r,null,t);try{A(vt,e)}finally{ht(e)}}}}function ln(e,t,n,r){if(null!==(n=Un(n=dt(r)))){var l=nt(n);if(null===l)n=null;else{var i=l.tag;if(13===i){if(null!==(n=rt(l)))return n;n=null}else if(3===i){if(l.stateNode.hydrate)return 3===l.tag?l.stateNode.containerInfo:null;n=null}else l!==n&&(n=null)}}e=gt(e,r,n,t);try{A(vt,e)}finally{ht(e)}return null}var an={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},on=["Webkit","ms","Moz","O"];function un(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||an.hasOwnProperty(e)&&an[e]?(""+t).trim():t+"px"}function cn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),l=un(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}Object.keys(an).forEach(function(e){on.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),an[t]=an[e]})});var sn=t({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fn(e,t){if(t){if(sn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(r(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(r(60));if(!("object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML))throw Error(r(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(r(62,""))}}function dn(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pn=Ue.html;function mn(e,t){var n=tt(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=T[t];for(var r=0;r<t.length;r++)yt(t[r],e,n)}function hn(){}function gn(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function vn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yn(e,t){var n,r=vn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vn(r)}}function bn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?bn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function wn(){for(var e=window,t=gn();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=gn((e=t.contentWindow).document)}return t}function kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var xn="$",Tn="/$",En="$?",Sn="$!",Cn=null,Pn=null;function _n(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Nn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var zn="function"==typeof setTimeout?setTimeout:void 0,Mn="function"==typeof clearTimeout?clearTimeout:void 0;function In(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Fn(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if(n===xn||n===Sn||n===En){if(0===t)return e;t--}else n===Tn&&t++}e=e.previousSibling}return null}var On=Math.random().toString(36).slice(2),Rn="__reactInternalInstance$"+On,Dn="__reactEventHandlers$"+On,Ln="__reactContainere$"+On;function Un(e){var t=e[Rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ln]||n[Rn]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Fn(e);null!==e;){if(n=e[Rn])return n;e=Fn(e)}return t}n=(e=n).parentNode}return null}function An(e){return!(e=e[Rn]||e[Ln])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Vn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(r(33))}function Qn(e){return e[Dn]||null}function Wn(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Hn(e,t){var n=e.stateNode;if(!n)return null;var l=d(n);if(!l)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(l=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!l;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}function jn(e,t,n){(t=Hn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=ot(n._dispatchListeners,t),n._dispatchInstances=ot(n._dispatchInstances,e))}function Bn(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=Wn(t);for(t=n.length;0<t--;)jn(n[t],"captured",e);for(t=0;t<n.length;t++)jn(n[t],"bubbled",e)}}function Kn(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=Hn(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=ot(n._dispatchListeners,t),n._dispatchInstances=ot(n._dispatchInstances,e))}function $n(e){e&&e.dispatchConfig.registrationName&&Kn(e._targetInst,null,e)}function qn(e){ut(e,Bn)}var Yn=null,Xn=null,Gn=null;function Zn(){if(Gn)return Gn;var e,t,n=Xn,r=n.length,l="value"in Yn?Yn.value:Yn.textContent,i=l.length;for(e=0;e<r&&n[e]===l[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===l[i-t];t++);return Gn=l.slice(e,1<t?1-t:void 0)}function Jn(){return!0}function er(){return!1}function tr(e,t,n,r){for(var l in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(l)&&((t=e[l])?this[l]=t(n):"target"===l?this.target=r:this[l]=n[l]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Jn:er,this.isPropagationStopped=er,this}function nr(e,t,n,r){if(this.eventPool.length){var l=this.eventPool.pop();return this.call(l,e,t,n,r),l}return new this(e,t,n,r)}function rr(e){if(!(e instanceof this))throw Error(r(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function lr(e){e.eventPool=[],e.getPooled=nr,e.release=rr}t(tr.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Jn)},persist:function(){this.isPersistent=Jn},isPersistent:er,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=er,this._dispatchInstances=this._dispatchListeners=null}}),tr.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},tr.extend=function(e){function n(){}function r(){return l.apply(this,arguments)}var l=this;n.prototype=l.prototype;var i=new n;return t(i,r.prototype),r.prototype=i,r.prototype.constructor=r,r.Interface=t({},l.Interface,e),r.extend=l.extend,lr(r),r},lr(tr);var ir=tr.extend({data:null}),ar=tr.extend({data:null}),or=[9,13,27,32],ur=S&&"CompositionEvent"in window,cr=null;S&&"documentMode"in document&&(cr=document.documentMode);var sr=S&&"TextEvent"in window&&!cr,fr=S&&(!ur||cr&&8<cr&&11>=cr),dr=String.fromCharCode(32),pr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},mr=!1;function hr(e,t){switch(e){case"keyup":return-1!==or.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function gr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var vr=!1;function yr(e,t){switch(e){case"compositionend":return gr(t);case"keypress":return 32!==t.which?null:(mr=!0,dr);case"textInput":return(e=t.data)===dr&&mr?null:e;default:return null}}function br(e,t){if(vr)return"compositionend"===e||!ur&&hr(e,t)?(e=Zn(),Gn=Xn=Yn=null,vr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fr&&"ko"!==t.locale?null:t.data;default:return null}}var wr={eventTypes:pr,extractEvents:function(e,t,n,r){var l;if(ur)e:{switch(e){case"compositionstart":var i=pr.compositionStart;break e;case"compositionend":i=pr.compositionEnd;break e;case"compositionupdate":i=pr.compositionUpdate;break e}i=void 0}else vr?hr(e,n)&&(i=pr.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=pr.compositionStart);return i?(fr&&"ko"!==n.locale&&(vr||i!==pr.compositionStart?i===pr.compositionEnd&&vr&&(l=Zn()):(Xn="value"in(Yn=r)?Yn.value:Yn.textContent,vr=!0)),i=ir.getPooled(i,t,n,r),l?i.data=l:null!==(l=gr(n))&&(i.data=l),qn(i),l=i):l=null,(e=sr?yr(e,n):br(e,n))?((t=ar.getPooled(pr.beforeInput,t,n,r)).data=e,qn(t)):t=null,null===l?t:null===t?l:[l,t]}},kr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!kr[e.type]:"textarea"===t}var Tr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Er(e,t,n){return(e=tr.getPooled(Tr.change,e,t,n)).type="change",z(n),qn(e),e}var Sr=null,Cr=null;function Pr(e){ft(e)}function _r(e){if(Ee(Vn(e)))return e}function Nr(e,t){if("change"===e)return t}var zr=!1;function Mr(){Sr&&(Sr.detachEvent("onpropertychange",Ir),Cr=Sr=null)}function Ir(e){if("value"===e.propertyName&&_r(Cr))if(e=Er(Cr,e,dt(e)),D)ft(e);else{D=!0;try{I(Pr,e)}finally{D=!1,U()}}}function Fr(e,t,n){"focus"===e?(Mr(),Cr=n,(Sr=t).attachEvent("onpropertychange",Ir)):"blur"===e&&Mr()}function Or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return _r(Cr)}function Rr(e,t){if("click"===e)return _r(t)}function Dr(e,t){if("input"===e||"change"===e)return _r(t)}S&&(zr=pt("input")&&(!document.documentMode||9<document.documentMode));var Lr={eventTypes:Tr,_isInputEventSupported:zr,extractEvents:function(e,t,n,r){var l=t?Vn(t):window,i=l.nodeName&&l.nodeName.toLowerCase();if("select"===i||"input"===i&&"file"===l.type)var a=Nr;else if(xr(l))if(zr)a=Dr;else{a=Or;var o=Fr}else(i=l.nodeName)&&"input"===i.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(a=Rr);if(a&&(a=a(e,t)))return Er(a,n,r);o&&o(e,l,t),"blur"===e&&(e=l._wrapperState)&&e.controlled&&"number"===l.type&&ze(l,"number",l.value)}},Ur=tr.extend({view:null,detail:null}),Ar={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Ar[e])&&!!t[e]}function Qr(){return Vr}var Wr=0,Hr=0,jr=!1,Br=!1,Kr=Ur.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Qr,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Wr;return Wr=e.screenX,jr?"mousemove"===e.type?e.screenX-t:0:(jr=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Hr;return Hr=e.screenY,Br?"mousemove"===e.type?e.screenY-t:0:(Br=!0,0)}}),$r=Kr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),qr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Yr={eventTypes:qr,extractEvents:function(e,t,n,r,l){var i="mouseover"===e||"pointerover"===e,a="mouseout"===e||"pointerout"===e;if(i&&0==(32&l)&&(n.relatedTarget||n.fromElement)||!a&&!i)return null;(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,a)?(a=t,null!==(t=(t=n.relatedTarget||n.toElement)?Un(t):null)&&(t!==nt(t)||5!==t.tag&&6!==t.tag)&&(t=null)):a=null;if(a===t)return null;if("mouseout"===e||"mouseover"===e)var o=Kr,u=qr.mouseLeave,c=qr.mouseEnter,s="mouse";else"pointerout"!==e&&"pointerover"!==e||(o=$r,u=qr.pointerLeave,c=qr.pointerEnter,s="pointer");if(e=null==a?i:Vn(a),i=null==t?i:Vn(t),(u=o.getPooled(u,a,n,r)).type=s+"leave",u.target=e,u.relatedTarget=i,(n=o.getPooled(c,t,n,r)).type=s+"enter",n.target=i,n.relatedTarget=e,s=t,(r=a)&&s)e:{for(c=s,a=0,e=o=r;e;e=Wn(e))a++;for(e=0,t=c;t;t=Wn(t))e++;for(;0<a-e;)o=Wn(o),a--;for(;0<e-a;)c=Wn(c),e--;for(;a--;){if(o===c||o===c.alternate)break e;o=Wn(o),c=Wn(c)}o=null}else o=null;for(c=o,o=[];r&&r!==c&&(null===(a=r.alternate)||a!==c);)o.push(r),r=Wn(r);for(r=[];s&&s!==c&&(null===(a=s.alternate)||a!==c);)r.push(s),s=Wn(s);for(s=0;s<o.length;s++)Kn(o[s],"bubbled",u);for(s=r.length;0<s--;)Kn(r[s],"captured",n);return 0==(64&l)?[u]:[u,n]}};function Xr(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}var Gr="function"==typeof Object.is?Object.is:Xr,Zr=Object.prototype.hasOwnProperty;function Jr(e,t){if(Gr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Zr.call(t,n[r])||!Gr(e[n[r]],t[n[r]]))return!1;return!0}var el=S&&"documentMode"in document&&11>=document.documentMode,tl={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},nl=null,rl=null,ll=null,il=!1;function al(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return il||null==nl||nl!==gn(n)?null:("selectionStart"in(n=nl)&&kn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},ll&&Jr(ll,n)?null:(ll=n,(e=tr.getPooled(tl.select,rl,e,t)).type="select",e.target=nl,qn(e),e))}var ol={eventTypes:tl,extractEvents:function(e,t,n,r,l,i){if(!(i=!(l=i||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{l=tt(l),i=T.onSelect;for(var a=0;a<i.length;a++)if(!l.has(i[a])){l=!1;break e}l=!0}i=!l}if(i)return null;switch(l=t?Vn(t):window,e){case"focus":(xr(l)||"true"===l.contentEditable)&&(nl=l,rl=t,ll=null);break;case"blur":ll=rl=nl=null;break;case"mousedown":il=!0;break;case"contextmenu":case"mouseup":case"dragend":return il=!1,al(n,r);case"selectionchange":if(el)break;case"keydown":case"keyup":return al(n,r)}return null}},ul=tr.extend({animationName:null,elapsedTime:null,pseudoElement:null}),cl=tr.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sl=Ur.extend({relatedTarget:null});function fl(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var dl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pl={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ml=Ur.extend({key:function(e){if(e.key){var t=dl[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=fl(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?pl[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Qr,charCode:function(e){return"keypress"===e.type?fl(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?fl(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),hl=Kr.extend({dataTransfer:null}),gl=Ur.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Qr}),vl=tr.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),yl=Kr.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),bl={eventTypes:Ht,extractEvents:function(e,t,n,r){var l=jt.get(e);if(!l)return null;switch(e){case"keypress":if(0===fl(n))return null;case"keydown":case"keyup":e=ml;break;case"blur":case"focus":e=sl;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Kr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=hl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=gl;break;case Ye:case Xe:case Ge:e=ul;break;case Ze:e=vl;break;case"scroll":e=Ur;break;case"wheel":e=yl;break;case"copy":case"cut":case"paste":e=cl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=$r;break;default:e=tr}return qn(t=e.getPooled(l,t,n,r)),t}};if(g)throw Error(r(101));g=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),y();var wl=An;d=Qn,p=wl,m=Vn,E({SimpleEventPlugin:bl,EnterLeaveEventPlugin:Yr,ChangeEventPlugin:Lr,SelectEventPlugin:ol,BeforeInputEventPlugin:wr});var kl=[],xl=-1;function Tl(e){0>xl||(e.current=kl[xl],kl[xl]=null,xl--)}function El(e,t){kl[++xl]=e.current,e.current=t}var Sl={},Cl={current:Sl},Pl={current:!1},_l=Sl;function Nl(e,t){var n=e.type.contextTypes;if(!n)return Sl;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l,i={};for(l in n)i[l]=t[l];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function zl(e){return null!=(e=e.childContextTypes)}function Ml(){Tl(Pl),Tl(Cl)}function Il(e,t,n){if(Cl.current!==Sl)throw Error(r(168));El(Cl,t),El(Pl,n)}function Fl(e,n,l){var i=e.stateNode;if(e=n.childContextTypes,"function"!=typeof i.getChildContext)return l;for(var a in i=i.getChildContext())if(!(a in e))throw Error(r(108,ye(n)||"Unknown",a));return t({},l,{},i)}function Ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Sl,_l=Cl.current,El(Cl,e),El(Pl,Pl.current),!0}function Rl(e,t,n){var l=e.stateNode;if(!l)throw Error(r(169));n?(e=Fl(e,t,_l),l.__reactInternalMemoizedMergedChildContext=e,Tl(Pl),Tl(Cl),El(Cl,e)):Tl(Pl),El(Pl,n)}var Dl=n.unstable_runWithPriority,Ll=n.unstable_scheduleCallback,Ul=n.unstable_cancelCallback,Al=n.unstable_requestPaint,Vl=n.unstable_now,Ql=n.unstable_getCurrentPriorityLevel,Wl=n.unstable_ImmediatePriority,Hl=n.unstable_UserBlockingPriority,jl=n.unstable_NormalPriority,Bl=n.unstable_LowPriority,Kl=n.unstable_IdlePriority,$l={},ql=n.unstable_shouldYield,Yl=void 0!==Al?Al:function(){},Xl=null,Gl=null,Zl=!1,Jl=Vl(),ei=1e4>Jl?Vl:function(){return Vl()-Jl};function ti(){switch(Ql()){case Wl:return 99;case Hl:return 98;case jl:return 97;case Bl:return 96;case Kl:return 95;default:throw Error(r(332))}}function ni(e){switch(e){case 99:return Wl;case 98:return Hl;case 97:return jl;case 96:return Bl;case 95:return Kl;default:throw Error(r(332))}}function ri(e,t){return e=ni(e),Dl(e,t)}function li(e,t,n){return e=ni(e),Ll(e,t,n)}function ii(e){return null===Xl?(Xl=[e],Gl=Ll(Wl,oi)):Xl.push(e),$l}function ai(){if(null!==Gl){var e=Gl;Gl=null,Ul(e)}oi()}function oi(){if(!Zl&&null!==Xl){Zl=!0;var e=0;try{var t=Xl;ri(99,function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}}),Xl=null}catch(n){throw null!==Xl&&(Xl=Xl.slice(e+1)),Ll(Wl,ai),n}finally{Zl=!1}}}function ui(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function ci(e,n){if(e&&e.defaultProps)for(var r in n=t({},n),e=e.defaultProps)void 0===n[r]&&(n[r]=e[r]);return n}var si={current:null},fi=null,di=null,pi=null;function mi(){pi=di=fi=null}function hi(e){var t=si.current;Tl(si),e.type._context._currentValue=t}function gi(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function vi(e,t){fi=e,pi=di=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(ja=!0),e.firstContext=null)}function yi(e,t){if(pi!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(pi=e,t=1073741823),t={context:e,observedBits:t,next:null},null===di){if(null===fi)throw Error(r(308));di=t,fi.dependencies={expirationTime:0,firstContext:t,responders:null}}else di=di.next=t;return e._currentValue}var bi=!1;function wi(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function ki(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function xi(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function Ti(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function Ei(e,t){var n=e.alternate;null!==n&&ki(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function Si(e,n,r,l){var i=e.updateQueue;bi=!1;var a=i.baseQueue,o=i.shared.pending;if(null!==o){if(null!==a){var u=a.next;a.next=o.next,o.next=u}a=o,i.shared.pending=null,null!==(u=e.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=o))}if(null!==a){u=a.next;var c=i.baseState,s=0,f=null,d=null,p=null;if(null!==u)for(var m=u;;){if((o=m.expirationTime)<l){var h={expirationTime:m.expirationTime,suspenseConfig:m.suspenseConfig,tag:m.tag,payload:m.payload,callback:m.callback,next:null};null===p?(d=p=h,f=c):p=p.next=h,o>s&&(s=o)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:m.suspenseConfig,tag:m.tag,payload:m.payload,callback:m.callback,next:null}),Fu(o,m.suspenseConfig);e:{var g=e,v=m;switch(o=n,h=r,v.tag){case 1:if("function"==typeof(g=v.payload)){c=g.call(h,c,o);break e}c=g;break e;case 3:g.effectTag=-4097&g.effectTag|64;case 0:if(null==(o="function"==typeof(g=v.payload)?g.call(h,c,o):g))break e;c=t({},c,o);break e;case 2:bi=!0}}null!==m.callback&&(e.effectTag|=32,null===(o=i.effects)?i.effects=[m]:o.push(m))}if(null===(m=m.next)||m===u){if(null===(o=i.shared.pending))break;m=a.next=o.next,o.next=u,i.baseQueue=a=o,i.shared.pending=null}}null===p?f=c:p.next=d,i.baseState=f,i.baseQueue=p,Ou(s),e.expirationTime=s,e.memoizedState=c}}function Ci(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var l=e[t],i=l.callback;if(null!==i){if(l.callback=null,l=i,i=n,"function"!=typeof l)throw Error(r(191,l));l.call(i)}}}var Pi=G.ReactCurrentBatchConfig,_i=(new e.Component).refs;function Ni(e,n,r,l){r=null==(r=r(l,n=e.memoizedState))?n:t({},n,r),e.memoizedState=r,0===e.expirationTime&&(e.updateQueue.baseState=r)}var zi={isMounted:function(e){return!!(e=e._reactInternalFiber)&&nt(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=bu(),l=Pi.suspense;(l=xi(r=wu(r,e,l),l)).payload=t,null!=n&&(l.callback=n),Ti(e,l),ku(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=bu(),l=Pi.suspense;(l=xi(r=wu(r,e,l),l)).tag=1,l.payload=t,null!=n&&(l.callback=n),Ti(e,l),ku(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=bu(),r=Pi.suspense;(r=xi(n=wu(n,e,r),r)).tag=2,null!=t&&(r.callback=t),Ti(e,r),ku(e,n)}};function Mi(e,t,n,r,l,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!Jr(n,r)||!Jr(l,i))}function Ii(e,t,n){var r=!1,l=Sl,i=t.contextType;return"object"==typeof i&&null!==i?i=yi(i):(l=zl(t)?_l:Cl.current,i=(r=null!=(r=t.contextTypes))?Nl(e,l):Sl),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=zi,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=i),t}function Fi(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zi.enqueueReplaceState(t,t.state,null)}function Oi(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs=_i,wi(e);var i=t.contextType;"object"==typeof i&&null!==i?l.context=yi(i):(i=zl(t)?_l:Cl.current,l.context=Nl(e,i)),Si(e,n,l,r),l.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(Ni(e,t,i,n),l.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof l.getSnapshotBeforeUpdate||"function"!=typeof l.UNSAFE_componentWillMount&&"function"!=typeof l.componentWillMount||(t=l.state,"function"==typeof l.componentWillMount&&l.componentWillMount(),"function"==typeof l.UNSAFE_componentWillMount&&l.UNSAFE_componentWillMount(),t!==l.state&&zi.enqueueReplaceState(l,l.state,null),Si(e,n,l,r),l.state=e.memoizedState),"function"==typeof l.componentDidMount&&(e.effectTag|=4)}var Ri=Array.isArray;function Di(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(r(309));var l=n.stateNode}if(!l)throw Error(r(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=l.refs;t===_i&&(t=l.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Li(e,t){if("textarea"!==e.type)throw Error(r(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function Ui(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function l(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=nc(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function o(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=ic(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=Di(e,t,n),r.return=e,r):((r=rc(n.type,n.key,n.props,null,e.mode,r)).ref=Di(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=ac(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,l){return null===t||7!==t.tag?((t=lc(n,e.mode,r,l)).return=e,t):((t=i(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=ic(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case te:return(n=rc(t.type,t.key,t.props,null,e.mode,n)).ref=Di(e,null,t),n.return=e,n;case ne:return(t=ac(t,e.mode,n)).return=e,t}if(Ri(t)||ge(t))return(t=lc(t,e.mode,n,null)).return=e,t;Li(e,t)}return null}function p(e,t,n,r){var l=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==l?null:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case te:return n.key===l?n.type===re?f(e,t,n.props.children,r,l):c(e,t,n,r):null;case ne:return n.key===l?s(e,t,n,r):null}if(Ri(n)||ge(n))return null!==l?null:f(e,t,n,r,null);Li(e,n)}return null}function m(e,t,n,r,l){if("string"==typeof r||"number"==typeof r)return u(t,e=e.get(n)||null,""+r,l);if("object"==typeof r&&null!==r){switch(r.$$typeof){case te:return e=e.get(null===r.key?n:r.key)||null,r.type===re?f(t,e,r.props.children,l,r.key):c(t,e,r,l);case ne:return s(t,e=e.get(null===r.key?n:r.key)||null,r,l)}if(Ri(r)||ge(r))return f(t,e=e.get(n)||null,r,l,null);Li(t,r)}return null}function h(r,i,o,u){for(var c=null,s=null,f=i,h=i=0,g=null;null!==f&&h<o.length;h++){f.index>h?(g=f,f=null):g=f.sibling;var v=p(r,f,o[h],u);if(null===v){null===f&&(f=g);break}e&&f&&null===v.alternate&&t(r,f),i=a(v,i,h),null===s?c=v:s.sibling=v,s=v,f=g}if(h===o.length)return n(r,f),c;if(null===f){for(;h<o.length;h++)null!==(f=d(r,o[h],u))&&(i=a(f,i,h),null===s?c=f:s.sibling=f,s=f);return c}for(f=l(r,f);h<o.length;h++)null!==(g=m(f,r,h,o[h],u))&&(e&&null!==g.alternate&&f.delete(null===g.key?h:g.key),i=a(g,i,h),null===s?c=g:s.sibling=g,s=g);return e&&f.forEach(function(e){return t(r,e)}),c}function g(i,o,u,c){var s=ge(u);if("function"!=typeof s)throw Error(r(150));if(null==(u=s.call(u)))throw Error(r(151));for(var f=s=null,h=o,g=o=0,v=null,y=u.next();null!==h&&!y.done;g++,y=u.next()){h.index>g?(v=h,h=null):v=h.sibling;var b=p(i,h,y.value,c);if(null===b){null===h&&(h=v);break}e&&h&&null===b.alternate&&t(i,h),o=a(b,o,g),null===f?s=b:f.sibling=b,f=b,h=v}if(y.done)return n(i,h),s;if(null===h){for(;!y.done;g++,y=u.next())null!==(y=d(i,y.value,c))&&(o=a(y,o,g),null===f?s=y:f.sibling=y,f=y);return s}for(h=l(i,h);!y.done;g++,y=u.next())null!==(y=m(h,i,g,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?g:y.key),o=a(y,o,g),null===f?s=y:f.sibling=y,f=y);return e&&h.forEach(function(e){return t(i,e)}),s}return function(e,l,a,u){var c="object"==typeof a&&null!==a&&a.type===re&&null===a.key;c&&(a=a.props.children);var s="object"==typeof a&&null!==a;if(s)switch(a.$$typeof){case te:e:{for(s=a.key,c=l;null!==c;){if(c.key===s){switch(c.tag){case 7:if(a.type===re){n(e,c.sibling),(l=i(c,a.props.children)).return=e,e=l;break e}break;default:if(c.elementType===a.type){n(e,c.sibling),(l=i(c,a.props)).ref=Di(e,c,a),l.return=e,e=l;break e}}n(e,c);break}t(e,c),c=c.sibling}a.type===re?((l=lc(a.props.children,e.mode,u,a.key)).return=e,e=l):((u=rc(a.type,a.key,a.props,null,e.mode,u)).ref=Di(e,l,a),u.return=e,e=u)}return o(e);case ne:e:{for(c=a.key;null!==l;){if(l.key===c){if(4===l.tag&&l.stateNode.containerInfo===a.containerInfo&&l.stateNode.implementation===a.implementation){n(e,l.sibling),(l=i(l,a.children||[])).return=e,e=l;break e}n(e,l);break}t(e,l),l=l.sibling}(l=ac(a,e.mode,u)).return=e,e=l}return o(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==l&&6===l.tag?(n(e,l.sibling),(l=i(l,a)).return=e,e=l):(n(e,l),(l=ic(a,e.mode,u)).return=e,e=l),o(e);if(Ri(a))return h(e,l,a,u);if(ge(a))return g(e,l,a,u);if(s&&Li(e,a),void 0===a&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(r(152,e.displayName||e.name||"Component"))}return n(e,l)}}var Ai=Ui(!0),Vi=Ui(!1),Qi={},Wi={current:Qi},Hi={current:Qi},ji={current:Qi};function Bi(e){if(e===Qi)throw Error(r(174));return e}function Ki(e,t){switch(El(ji,t),El(Hi,e),El(Wi,Qi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ve(null,"");break;default:t=Ve(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Tl(Wi),El(Wi,t)}function $i(){Tl(Wi),Tl(Hi),Tl(ji)}function qi(e){Bi(ji.current);var t=Bi(Wi.current),n=Ve(t,e.type);t!==n&&(El(Hi,e),El(Wi,n))}function Yi(e){Hi.current===e&&(Tl(Wi),Tl(Hi))}var Xi={current:0};function Gi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===En||n.data===Sn))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Zi(e,t){return{responder:e,props:t}}var Ji=G.ReactCurrentDispatcher,ea=G.ReactCurrentBatchConfig,ta=0,na=null,ra=null,la=null,ia=!1;function aa(){throw Error(r(321))}function oa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gr(e[n],t[n]))return!1;return!0}function ua(e,t,n,l,i,a){if(ta=a,na=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,Ji.current=null===e||null===e.memoizedState?Ma:Ia,e=n(l,i),t.expirationTime===ta){a=0;do{if(t.expirationTime=0,!(25>a))throw Error(r(301));a+=1,la=ra=null,t.updateQueue=null,Ji.current=Fa,e=n(l,i)}while(t.expirationTime===ta)}if(Ji.current=za,t=null!==ra&&null!==ra.next,ta=0,la=ra=na=null,ia=!1,t)throw Error(r(300));return e}function ca(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===la?na.memoizedState=la=e:la=la.next=e,la}function sa(){if(null===ra){var e=na.alternate;e=null!==e?e.memoizedState:null}else e=ra.next;var t=null===la?na.memoizedState:la.next;if(null!==t)la=t,ra=e;else{if(null===e)throw Error(r(310));e={memoizedState:(ra=e).memoizedState,baseState:ra.baseState,baseQueue:ra.baseQueue,queue:ra.queue,next:null},null===la?na.memoizedState=la=e:la=la.next=e}return la}function fa(e,t){return"function"==typeof t?t(e):t}function da(e){var t=sa(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var l=ra,i=l.baseQueue,a=n.pending;if(null!==a){if(null!==i){var o=i.next;i.next=a.next,a.next=o}l.baseQueue=i=a,n.pending=null}if(null!==i){i=i.next,l=l.baseState;var u=o=a=null,c=i;do{var s=c.expirationTime;if(s<ta){var f={expirationTime:c.expirationTime,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(o=u=f,a=l):u=u.next=f,s>na.expirationTime&&(na.expirationTime=s,Ou(s))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),Fu(s,c.suspenseConfig),l=c.eagerReducer===e?c.eagerState:e(l,c.action);c=c.next}while(null!==c&&c!==i);null===u?a=l:u.next=o,Gr(l,t.memoizedState)||(ja=!0),t.memoizedState=l,t.baseState=a,t.baseQueue=u,n.lastRenderedState=l}return[t.memoizedState,n.dispatch]}function pa(e){var t=sa(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var o=i=i.next;do{a=e(a,o.action),o=o.next}while(o!==i);Gr(a,t.memoizedState)||(ja=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,l]}function ma(e){var t=ca();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:fa,lastRenderedState:e}).dispatch=Na.bind(null,na,e),[t.memoizedState,e]}function ha(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=na.updateQueue)?(t={lastEffect:null},na.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ga(){return sa().memoizedState}function va(e,t,n,r){var l=ca();na.effectTag|=e,l.memoizedState=ha(1|t,n,void 0,void 0===r?null:r)}function ya(e,t,n,r){var l=sa();r=void 0===r?null:r;var i=void 0;if(null!==ra){var a=ra.memoizedState;if(i=a.destroy,null!==r&&oa(r,a.deps))return void ha(t,n,i,r)}na.effectTag|=e,l.memoizedState=ha(1|t,n,i,r)}function ba(e,t){return va(516,4,e,t)}function wa(e,t){return ya(516,4,e,t)}function ka(e,t){return ya(4,2,e,t)}function xa(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ta(e,t,n){return n=null!=n?n.concat([e]):null,ya(4,2,xa.bind(null,t,e),n)}function Ea(){}function Sa(e,t){return ca().memoizedState=[e,void 0===t?null:t],e}function Ca(e,t){var n=sa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&oa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Pa(e,t){var n=sa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&oa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function _a(e,t,n){var r=ti();ri(98>r?98:r,function(){e(!0)}),ri(97<r?97:r,function(){var r=ea.suspense;ea.suspense=void 0===t?null:t;try{e(!1),n()}finally{ea.suspense=r}})}function Na(e,t,n){var r=bu(),l=Pi.suspense;l={expirationTime:r=wu(r,e,l),suspenseConfig:l,action:n,eagerReducer:null,eagerState:null,next:null};var i=t.pending;if(null===i?l.next=l:(l.next=i.next,i.next=l),t.pending=l,i=e.alternate,e===na||null!==i&&i===na)ia=!0,l.expirationTime=ta,na.expirationTime=ta;else{if(0===e.expirationTime&&(null===i||0===i.expirationTime)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,o=i(a,n);if(l.eagerReducer=i,l.eagerState=o,Gr(o,a))return}catch(u){}ku(e,r)}}var za={readContext:yi,useCallback:aa,useContext:aa,useEffect:aa,useImperativeHandle:aa,useLayoutEffect:aa,useMemo:aa,useReducer:aa,useRef:aa,useState:aa,useDebugValue:aa,useResponder:aa,useDeferredValue:aa,useTransition:aa},Ma={readContext:yi,useCallback:Sa,useContext:yi,useEffect:ba,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,va(4,2,xa.bind(null,t,e),n)},useLayoutEffect:function(e,t){return va(4,2,e,t)},useMemo:function(e,t){var n=ca();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ca();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Na.bind(null,na,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ca().memoizedState=e},useState:ma,useDebugValue:Ea,useResponder:Zi,useDeferredValue:function(e,t){var n=ma(e),r=n[0],l=n[1];return ba(function(){var n=ea.suspense;ea.suspense=void 0===t?null:t;try{l(e)}finally{ea.suspense=n}},[e,t]),r},useTransition:function(e){var t=ma(!1),n=t[0];return t=t[1],[Sa(_a.bind(null,t,e),[t,e]),n]}},Ia={readContext:yi,useCallback:Ca,useContext:yi,useEffect:wa,useImperativeHandle:Ta,useLayoutEffect:ka,useMemo:Pa,useReducer:da,useRef:ga,useState:function(){return da(fa)},useDebugValue:Ea,useResponder:Zi,useDeferredValue:function(e,t){var n=da(fa),r=n[0],l=n[1];return wa(function(){var n=ea.suspense;ea.suspense=void 0===t?null:t;try{l(e)}finally{ea.suspense=n}},[e,t]),r},useTransition:function(e){var t=da(fa),n=t[0];return t=t[1],[Ca(_a.bind(null,t,e),[t,e]),n]}},Fa={readContext:yi,useCallback:Ca,useContext:yi,useEffect:wa,useImperativeHandle:Ta,useLayoutEffect:ka,useMemo:Pa,useReducer:pa,useRef:ga,useState:function(){return pa(fa)},useDebugValue:Ea,useResponder:Zi,useDeferredValue:function(e,t){var n=pa(fa),r=n[0],l=n[1];return wa(function(){var n=ea.suspense;ea.suspense=void 0===t?null:t;try{l(e)}finally{ea.suspense=n}},[e,t]),r},useTransition:function(e){var t=pa(fa),n=t[0];return t=t[1],[Ca(_a.bind(null,t,e),[t,e]),n]}},Oa=null,Ra=null,Da=!1;function La(e,t){var n=Ju(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Ua(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Aa(e){if(Da){var t=Ra;if(t){var n=t;if(!Ua(e,t)){if(!(t=In(n.nextSibling))||!Ua(e,t))return e.effectTag=-1025&e.effectTag|2,Da=!1,void(Oa=e);La(Oa,n)}Oa=e,Ra=In(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,Da=!1,Oa=e}}function Va(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Oa=e}function Qa(e){if(e!==Oa)return!1;if(!Da)return Va(e),Da=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Nn(t,e.memoizedProps))for(t=Ra;t;)La(e,t),t=In(t.nextSibling);if(Va(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if(n===Tn){if(0===t){Ra=In(e.nextSibling);break e}t--}else n!==xn&&n!==Sn&&n!==En||t++}e=e.nextSibling}Ra=null}}else Ra=Oa?In(e.stateNode.nextSibling):null;return!0}function Wa(){Ra=Oa=null,Da=!1}var Ha=G.ReactCurrentOwner,ja=!1;function Ba(e,t,n,r){t.child=null===e?Vi(t,null,n,r):Ai(t,e.child,n,r)}function Ka(e,t,n,r,l){n=n.render;var i=t.ref;return vi(t,l),r=ua(e,t,n,r,i,l),null===e||ja?(t.effectTag|=1,Ba(e,t,r,l),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=l&&(e.expirationTime=0),co(e,t,l))}function $a(e,t,n,r,l,i){if(null===e){var a=n.type;return"function"!=typeof a||ec(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=rc(n.type,null,r,null,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,qa(e,t,a,r,l,i))}return a=e.child,l<i&&(l=a.memoizedProps,(n=null!==(n=n.compare)?n:Jr)(l,r)&&e.ref===t.ref)?co(e,t,i):(t.effectTag|=1,(e=nc(a,r)).ref=t.ref,e.return=t,t.child=e)}function qa(e,t,n,r,l,i){return null!==e&&Jr(e.memoizedProps,r)&&e.ref===t.ref&&(ja=!1,l<i)?(t.expirationTime=e.expirationTime,co(e,t,i)):Xa(e,t,n,r,i)}function Ya(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Xa(e,t,n,r,l){var i=zl(n)?_l:Cl.current;return i=Nl(t,i),vi(t,l),n=ua(e,t,n,r,i,l),null===e||ja?(t.effectTag|=1,Ba(e,t,n,l),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=l&&(e.expirationTime=0),co(e,t,l))}function Ga(e,t,n,r,l){if(zl(n)){var i=!0;Ol(t)}else i=!1;if(vi(t,l),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),Ii(t,n,r),Oi(t,n,r,l),r=!0;else if(null===e){var a=t.stateNode,o=t.memoizedProps;a.props=o;var u=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=yi(c):c=Nl(t,c=zl(n)?_l:Cl.current);var s=n.getDerivedStateFromProps,f="function"==typeof s||"function"==typeof a.getSnapshotBeforeUpdate;f||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==r||u!==c)&&Fi(t,a,r,c),bi=!1;var d=t.memoizedState;a.state=d,Si(t,r,a,l),u=t.memoizedState,o!==r||d!==u||Pl.current||bi?("function"==typeof s&&(Ni(t,n,s,r),u=t.memoizedState),(o=bi||Mi(t,n,o,r,d,u,c))?(f||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.effectTag|=4)):("function"==typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=o):("function"==typeof a.componentDidMount&&(t.effectTag|=4),r=!1)}else a=t.stateNode,ki(e,t),o=t.memoizedProps,a.props=t.type===t.elementType?o:ci(t.type,o),u=a.context,"object"==typeof(c=n.contextType)&&null!==c?c=yi(c):c=Nl(t,c=zl(n)?_l:Cl.current),(f="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==r||u!==c)&&Fi(t,a,r,c),bi=!1,u=t.memoizedState,a.state=u,Si(t,r,a,l),d=t.memoizedState,o!==r||u!==d||Pl.current||bi?("function"==typeof s&&(Ni(t,n,s,r),d=t.memoizedState),(s=bi||Mi(t,n,o,r,u,d,c))?(f||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,d,c),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,d,c)),"function"==typeof a.componentDidUpdate&&(t.effectTag|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=d),a.props=r,a.state=d,a.context=c,r=s):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return Za(e,t,n,r,i,l)}function Za(e,t,n,r,l,i){Ya(e,t);var a=0!=(64&t.effectTag);if(!r&&!a)return l&&Rl(t,n,!1),co(e,t,i);r=t.stateNode,Ha.current=t;var o=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&a?(t.child=Ai(t,e.child,null,i),t.child=Ai(t,null,o,i)):Ba(e,t,o,i),t.memoizedState=r.state,l&&Rl(t,n,!0),t.child}function Ja(e){var t=e.stateNode;t.pendingContext?Il(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Il(e,t.context,!1),Ki(e,t.containerInfo)}var eo,to,no,ro,lo={dehydrated:null,retryTime:0};function io(e,t,n){var r,l=t.mode,i=t.pendingProps,a=Xi.current,o=!1;if((r=0!=(64&t.effectTag))||(r=0!=(2&a)&&(null===e||null!==e.memoizedState)),r?(o=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),El(Xi,1&a),null===e){if(void 0!==i.fallback&&Aa(t),o){if(o=i.fallback,(i=lc(null,l,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=lc(o,l,n,null)).return=t,i.sibling=n,t.memoizedState=lo,t.child=i,n}return l=i.children,t.memoizedState=null,t.child=Vi(t,null,l,n)}if(null!==e.memoizedState){if(l=(e=e.child).sibling,o){if(i=i.fallback,(n=nc(e,e.pendingProps)).return=t,0==(2&t.mode)&&(o=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=o;null!==o;)o.return=n,o=o.sibling;return(l=nc(l,i)).return=t,n.sibling=l,n.childExpirationTime=0,t.memoizedState=lo,t.child=n,l}return n=Ai(t,e.child,i.children,n),t.memoizedState=null,t.child=n}if(e=e.child,o){if(o=i.fallback,(i=lc(null,l,0,null)).return=t,i.child=e,null!==e&&(e.return=i),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=lc(o,l,n,null)).return=t,i.sibling=n,n.effectTag|=2,i.childExpirationTime=0,t.memoizedState=lo,t.child=i,n}return t.memoizedState=null,t.child=Ai(t,e,i.children,n)}function ao(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),gi(e.return,t)}function oo(e,t,n,r,l,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:l,lastEffect:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailExpiration=0,a.tailMode=l,a.lastEffect=i)}function uo(e,t,n){var r=t.pendingProps,l=r.revealOrder,i=r.tail;if(Ba(e,t,r.children,n),0!=(2&(r=Xi.current)))r=1&r|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ao(e,n);else if(19===e.tag)ao(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(El(Xi,r),0==(2&t.mode))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;null!==n;)null!==(e=n.alternate)&&null===Gi(e)&&(l=n),n=n.sibling;null===(n=l)?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),oo(t,!1,l,n,i,t.lastEffect);break;case"backwards":for(n=null,l=t.child,t.child=null;null!==l;){if(null!==(e=l.alternate)&&null===Gi(e)){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}oo(t,!0,n,null,i,t.lastEffect);break;case"together":oo(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function co(e,t,n){null!==e&&(t.dependencies=e.dependencies);var l=t.expirationTime;if(0!==l&&Ou(l),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=nc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=nc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function so(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fo(e,n,l){var i=n.pendingProps;switch(n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return zl(n.type)&&Ml(),null;case 3:return $i(),Tl(Pl),Tl(Cl),(l=n.stateNode).pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),null!==e&&null!==e.child||!Qa(n)||(n.effectTag|=4),to(n),null;case 5:Yi(n),l=Bi(ji.current);var a=n.type;if(null!==e&&null!=n.stateNode)no(e,n,a,i,l),e.ref!==n.ref&&(n.effectTag|=128);else{if(!i){if(null===n.stateNode)throw Error(r(166));return null}if(e=Bi(Wi.current),Qa(n)){i=n.stateNode,a=n.type;var o=n.memoizedProps;switch(i[Rn]=n,i[Dn]=o,a){case"iframe":case"object":case"embed":Jt("load",i);break;case"video":case"audio":for(e=0;e<Je.length;e++)Jt(Je[e],i);break;case"source":Jt("error",i);break;case"img":case"image":case"link":Jt("error",i),Jt("load",i);break;case"form":Jt("reset",i),Jt("submit",i);break;case"details":Jt("toggle",i);break;case"input":Ce(i,o),Jt("invalid",i),mn(l,"onChange");break;case"select":i._wrapperState={wasMultiple:!!o.multiple},Jt("invalid",i),mn(l,"onChange");break;case"textarea":Re(i,o),Jt("invalid",i),mn(l,"onChange")}for(var u in fn(a,o),e=null,o)if(o.hasOwnProperty(u)){var c=o[u];"children"===u?"string"==typeof c?i.textContent!==c&&(e=["children",c]):"number"==typeof c&&i.textContent!==""+c&&(e=["children",""+c]):x.hasOwnProperty(u)&&null!=c&&mn(l,u)}switch(a){case"input":Te(i),Ne(i,o,!0);break;case"textarea":Te(i),Le(i);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(i.onclick=hn)}l=e,n.updateQueue=l,null!==l&&(n.effectTag|=4)}else{switch(u=9===l.nodeType?l:l.ownerDocument,e===pn&&(e=Ae(a)),e===pn?"script"===a?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=u.createElement(a,{is:i.is}):(e=u.createElement(a),"select"===a&&(u=e,i.multiple?u.multiple=!0:i.size&&(u.size=i.size))):e=u.createElementNS(e,a),e[Rn]=n,e[Dn]=i,eo(e,n,!1,!1),n.stateNode=e,u=dn(a,i),a){case"iframe":case"object":case"embed":Jt("load",e),c=i;break;case"video":case"audio":for(c=0;c<Je.length;c++)Jt(Je[c],e);c=i;break;case"source":Jt("error",e),c=i;break;case"img":case"image":case"link":Jt("error",e),Jt("load",e),c=i;break;case"form":Jt("reset",e),Jt("submit",e),c=i;break;case"details":Jt("toggle",e),c=i;break;case"input":Ce(e,i),c=Se(e,i),Jt("invalid",e),mn(l,"onChange");break;case"option":c=Ie(e,i);break;case"select":e._wrapperState={wasMultiple:!!i.multiple},c=t({},i,{value:void 0}),Jt("invalid",e),mn(l,"onChange");break;case"textarea":Re(e,i),c=Oe(e,i),Jt("invalid",e),mn(l,"onChange");break;default:c=i}fn(a,c);var s=c;for(o in s)if(s.hasOwnProperty(o)){var f=s[o];"style"===o?cn(e,f):"dangerouslySetInnerHTML"===o?null!=(f=f?f.__html:void 0)&&We(e,f):"children"===o?"string"==typeof f?("textarea"!==a||""!==f)&&He(e,f):"number"==typeof f&&He(e,""+f):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(x.hasOwnProperty(o)?null!=f&&mn(l,o):null!=f&&Z(e,o,f,u))}switch(a){case"input":Te(e),Ne(e,i,!1);break;case"textarea":Te(e),Le(e);break;case"option":null!=i.value&&e.setAttribute("value",""+we(i.value));break;case"select":e.multiple=!!i.multiple,null!=(l=i.value)?Fe(e,!!i.multiple,l,!1):null!=i.defaultValue&&Fe(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof c.onClick&&(e.onclick=hn)}_n(a,i)&&(n.effectTag|=4)}null!==n.ref&&(n.effectTag|=128)}return null;case 6:if(e&&null!=n.stateNode)ro(e,n,e.memoizedProps,i);else{if("string"!=typeof i&&null===n.stateNode)throw Error(r(166));l=Bi(ji.current),Bi(Wi.current),Qa(n)?(l=n.stateNode,i=n.memoizedProps,l[Rn]=n,l.nodeValue!==i&&(n.effectTag|=4)):((l=(9===l.nodeType?l:l.ownerDocument).createTextNode(i))[Rn]=n,n.stateNode=l)}return null;case 13:return Tl(Xi),i=n.memoizedState,0!=(64&n.effectTag)?(n.expirationTime=l,n):(l=null!==i,i=!1,null===e?void 0!==n.memoizedProps.fallback&&Qa(n):(i=null!==(a=e.memoizedState),l||null===a||null!==(a=e.child.sibling)&&(null!==(o=n.firstEffect)?(n.firstEffect=a,a.nextEffect=o):(n.firstEffect=n.lastEffect=a,a.nextEffect=null),a.effectTag=8)),l&&!i&&0!=(2&n.mode)&&(null===e&&!0!==n.memoizedProps.unstable_avoidThisFallback||0!=(1&Xi.current)?Jo===Ho&&(Jo=Ko):(Jo!==Ho&&Jo!==Ko||(Jo=$o),0!==lu&&null!==Xo&&(cc(Xo,Zo),sc(Xo,lu)))),(l||i)&&(n.effectTag|=4),null);case 4:return $i(),to(n),null;case 10:return hi(n),null;case 17:return zl(n.type)&&Ml(),null;case 19:if(Tl(Xi),null===(i=n.memoizedState))return null;if(a=0!=(64&n.effectTag),null===(o=i.rendering)){if(a)so(i,!1);else if(Jo!==Ho||null!==e&&0!=(64&e.effectTag))for(o=n.child;null!==o;){if(null!==(e=Gi(o))){for(n.effectTag|=64,so(i,!1),null!==(a=e.updateQueue)&&(n.updateQueue=a,n.effectTag|=4),null===i.lastEffect&&(n.firstEffect=null),n.lastEffect=i.lastEffect,i=n.child;null!==i;)o=l,(a=i).effectTag&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(e=a.alternate)?(a.childExpirationTime=0,a.expirationTime=o,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null):(a.childExpirationTime=e.childExpirationTime,a.expirationTime=e.expirationTime,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,o=e.dependencies,a.dependencies=null===o?null:{expirationTime:o.expirationTime,firstContext:o.firstContext,responders:o.responders}),i=i.sibling;return El(Xi,1&Xi.current|2),n.child}o=o.sibling}}else{if(!a)if(null!==(e=Gi(o))){if(n.effectTag|=64,a=!0,null!==(l=e.updateQueue)&&(n.updateQueue=l,n.effectTag|=4),so(i,!0),null===i.tail&&"hidden"===i.tailMode&&!o.alternate)return null!==(n=n.lastEffect=i.lastEffect)&&(n.nextEffect=null),null}else 2*ei()-i.renderingStartTime>i.tailExpiration&&1<l&&(n.effectTag|=64,a=!0,so(i,!1),n.expirationTime=n.childExpirationTime=l-1);i.isBackwards?(o.sibling=n.child,n.child=o):(null!==(l=i.last)?l.sibling=o:n.child=o,i.last=o)}return null!==i.tail?(0===i.tailExpiration&&(i.tailExpiration=ei()+500),l=i.tail,i.rendering=l,i.tail=l.sibling,i.lastEffect=n.lastEffect,i.renderingStartTime=ei(),l.sibling=null,n=Xi.current,El(Xi,a?1&n|2:1&n),l):null}throw Error(r(156,n.tag))}function po(e){switch(e.tag){case 1:zl(e.type)&&Ml();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if($i(),Tl(Pl),Tl(Cl),0!=(64&(t=e.effectTag)))throw Error(r(285));return e.effectTag=-4097&t|64,e;case 5:return Yi(e),null;case 13:return Tl(Xi),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return Tl(Xi),null;case 4:return $i(),null;case 10:return hi(e),null;default:return null}}function mo(e,t){return{value:e,source:t,stack:be(t)}}eo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},to=function(){},no=function(e,n,r,l,i){var a=e.memoizedProps;if(a!==l){var o,u,c=n.stateNode;switch(Bi(Wi.current),e=null,r){case"input":a=Se(c,a),l=Se(c,l),e=[];break;case"option":a=Ie(c,a),l=Ie(c,l),e=[];break;case"select":a=t({},a,{value:void 0}),l=t({},l,{value:void 0}),e=[];break;case"textarea":a=Oe(c,a),l=Oe(c,l),e=[];break;default:"function"!=typeof a.onClick&&"function"==typeof l.onClick&&(c.onclick=hn)}for(o in fn(r,l),r=null,a)if(!l.hasOwnProperty(o)&&a.hasOwnProperty(o)&&null!=a[o])if("style"===o)for(u in c=a[o])c.hasOwnProperty(u)&&(r||(r={}),r[u]="");else"dangerouslySetInnerHTML"!==o&&"children"!==o&&"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(x.hasOwnProperty(o)?e||(e=[]):(e=e||[]).push(o,null));for(o in l){var s=l[o];if(c=null!=a?a[o]:void 0,l.hasOwnProperty(o)&&s!==c&&(null!=s||null!=c))if("style"===o)if(c){for(u in c)!c.hasOwnProperty(u)||s&&s.hasOwnProperty(u)||(r||(r={}),r[u]="");for(u in s)s.hasOwnProperty(u)&&c[u]!==s[u]&&(r||(r={}),r[u]=s[u])}else r||(e||(e=[]),e.push(o,r)),r=s;else"dangerouslySetInnerHTML"===o?(s=s?s.__html:void 0,c=c?c.__html:void 0,null!=s&&c!==s&&(e=e||[]).push(o,s)):"children"===o?c===s||"string"!=typeof s&&"number"!=typeof s||(e=e||[]).push(o,""+s):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&(x.hasOwnProperty(o)?(null!=s&&mn(i,o),e||c===s||(e=[])):(e=e||[]).push(o,s))}r&&(e=e||[]).push("style",r),i=e,(n.updateQueue=i)&&(n.effectTag|=4)}},ro=function(e,t,n,r){n!==r&&(t.effectTag|=4)};var ho="function"==typeof WeakSet?WeakSet:Set;function go(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=be(n)),null!==n&&ye(n.type),t=t.value,null!==e&&1===e.tag&&ye(e.type);try{console.error(t)}catch(l){setTimeout(function(){throw l})}}function vo(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){Ku(e,n)}}function yo(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){Ku(e,n)}else t.current=null}function bo(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,l=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:ci(t.type,n),l),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(r(163))}function wo(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function ko(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xo(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void ko(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var l=n.elementType===n.type?t.memoizedProps:ci(n.type,t.memoizedProps);e.componentDidUpdate(l,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&Ci(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}Ci(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&_n(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Wt(n)))));case 19:case 17:case 20:case 21:return}throw Error(r(163))}function To(e,t,n){switch("function"==typeof Xu&&Xu(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e.next;ri(97<n?97:n,function(){var e=r;do{var n=e.destroy;if(void 0!==n){var l=t;try{n()}catch(i){Ku(l,i)}}e=e.next}while(e!==r)})}break;case 1:yo(t),"function"==typeof(n=t.stateNode).componentWillUnmount&&vo(t,n);break;case 5:yo(t);break;case 4:No(e,t,n)}}function Eo(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&Eo(t)}function So(e){return 5===e.tag||3===e.tag||4===e.tag}function Co(e){e:{for(var t=e.return;null!==t;){if(So(t)){var n=t;break e}t=t.return}throw Error(r(160))}switch(t=n.stateNode,n.tag){case 5:var l=!1;break;case 3:case 4:t=t.containerInfo,l=!0;break;default:throw Error(r(161))}16&n.effectTag&&(He(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||So(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}l?Po(e,n,t):_o(e,n,t)}function Po(e,t,n){var r=e.tag,l=5===r||6===r;if(l)e=l?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=hn));else if(4!==r&&null!==(e=e.child))for(Po(e,t,n),e=e.sibling;null!==e;)Po(e,t,n),e=e.sibling}function _o(e,t,n){var r=e.tag,l=5===r||6===r;if(l)e=l?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(_o(e,t,n),e=e.sibling;null!==e;)_o(e,t,n),e=e.sibling}function No(e,t,n){for(var l,i,a=t,o=!1;;){if(!o){o=a.return;e:for(;;){if(null===o)throw Error(r(160));switch(l=o.stateNode,o.tag){case 5:i=!1;break e;case 3:case 4:l=l.containerInfo,i=!0;break e}o=o.return}o=!0}if(5===a.tag||6===a.tag){e:for(var u=e,c=a,s=n,f=c;;)if(To(u,f,s),null!==f.child&&4!==f.tag)f.child.return=f,f=f.child;else{if(f===c)break e;for(;null===f.sibling;){if(null===f.return||f.return===c)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}i?(u=l,c=a.stateNode,8===u.nodeType?u.parentNode.removeChild(c):u.removeChild(c)):l.removeChild(a.stateNode)}else if(4===a.tag){if(null!==a.child){l=a.stateNode.containerInfo,i=!0,a.child.return=a,a=a.child;continue}}else if(To(e,a,n),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(o=!1)}a.sibling.return=a.return,a=a.sibling}}function zo(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void wo(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var l=t.memoizedProps,i=null!==e?e.memoizedProps:l;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(n[Dn]=l,"input"===e&&"radio"===l.type&&null!=l.name&&Pe(n,l),dn(e,i),t=dn(e,l),i=0;i<a.length;i+=2){var o=a[i],u=a[i+1];"style"===o?cn(n,u):"dangerouslySetInnerHTML"===o?We(n,u):"children"===o?He(n,u):Z(n,o,u,t)}switch(e){case"input":_e(n,l);break;case"textarea":De(n,l);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!l.multiple,null!=(e=l.value)?Fe(n,!!l.multiple,e,!1):t!==!!l.multiple&&(null!=l.defaultValue?Fe(n,!!l.multiple,l.defaultValue,!0):Fe(n,!!l.multiple,l.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(r(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Wt(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?l=!1:(l=!0,n=t.child,au=ei()),null!==n)e:for(e=n;;){if(5===e.tag)a=e.stateNode,l?"function"==typeof(a=a.style).setProperty?a.setProperty("display","none","important"):a.display="none":(a=e.stateNode,i=null!=(i=e.memoizedProps.style)&&i.hasOwnProperty("display")?i.display:null,a.style.display=un("display",i));else if(6===e.tag)e.stateNode.nodeValue=l?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(a=e.child.sibling).return=e,e=a;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void Mo(t);case 19:return void Mo(t);case 17:return}throw Error(r(163))}function Mo(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new ho),t.forEach(function(t){var r=qu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}var Io="function"==typeof WeakMap?WeakMap:Map;function Fo(e,t,n){(n=xi(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){cu||(cu=!0,su=r),go(e,t)},n}function Oo(e,t,n){(n=xi(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var l=t.value;n.payload=function(){return go(e,t),r(l)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===fu?fu=new Set([this]):fu.add(this),go(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var Ro,Do=Math.ceil,Lo=G.ReactCurrentDispatcher,Uo=G.ReactCurrentOwner,Ao=0,Vo=8,Qo=16,Wo=32,Ho=0,jo=1,Bo=2,Ko=3,$o=4,qo=5,Yo=Ao,Xo=null,Go=null,Zo=0,Jo=Ho,eu=null,tu=1073741823,nu=1073741823,ru=null,lu=0,iu=!1,au=0,ou=500,uu=null,cu=!1,su=null,fu=null,du=!1,pu=null,mu=90,hu=null,gu=0,vu=null,yu=0;function bu(){return(Yo&(Qo|Wo))!==Ao?1073741821-(ei()/10|0):0!==yu?yu:yu=1073741821-(ei()/10|0)}function wu(e,t,n){if(0==(2&(t=t.mode)))return 1073741823;var l=ti();if(0==(4&t))return 99===l?1073741823:1073741822;if((Yo&Qo)!==Ao)return Zo;if(null!==n)e=ui(e,0|n.timeoutMs||5e3,250);else switch(l){case 99:e=1073741823;break;case 98:e=ui(e,150,100);break;case 97:case 96:e=ui(e,5e3,250);break;case 95:e=2;break;default:throw Error(r(326))}return null!==Xo&&e===Zo&&--e,e}function ku(e,t){if(50<gu)throw gu=0,vu=null,Error(r(185));if(null!==(e=xu(e,t))){var n=ti();1073741823===t?(Yo&Vo)!==Ao&&(Yo&(Qo|Wo))===Ao?Cu(e):(Eu(e),Yo===Ao&&ai()):Eu(e),(4&Yo)===Ao||98!==n&&99!==n||(null===hu?hu=new Map([[e,t]]):(void 0===(n=hu.get(e))||n>t)&&hu.set(e,t))}}function xu(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,l=null;if(null===r&&3===e.tag)l=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){l=r.stateNode;break}r=r.return}return null!==l&&(Xo===l&&(Ou(t),Jo===$o&&cc(l,Zo)),sc(l,t)),l}function Tu(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!uc(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Eu(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=ii(Cu.bind(null,e));else{var t=Tu(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=bu();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var l=e.callbackPriority;if(e.callbackExpirationTime===t&&l>=r)return;n!==$l&&Ul(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?ii(Cu.bind(null,e)):li(r,Su.bind(null,e),{timeout:10*(1073741821-t)-ei()}),e.callbackNode=t}}}function Su(e,t){if(yu=0,t)return fc(e,t=bu()),Eu(e),null;var n=Tu(e);if(0!==n){if(t=e.callbackNode,(Yo&(Qo|Wo))!==Ao)throw Error(r(327));if(Hu(),e===Xo&&n===Zo||zu(e,n),null!==Go){var l=Yo;Yo|=Qo;for(var i=Iu();;)try{Du();break}catch(u){Mu(e,u)}if(mi(),Yo=l,Lo.current=i,Jo===jo)throw t=eu,zu(e,n),cc(e,n),Eu(e),t;if(null===Go)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,l=Jo,Xo=null,l){case Ho:case jo:throw Error(r(345));case Bo:fc(e,2<n?2:n);break;case Ko:if(cc(e,n),n===(l=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Au(i)),1073741823===tu&&10<(i=au+ou-ei())){if(iu){var a=e.lastPingedTime;if(0===a||a>=n){e.lastPingedTime=n,zu(e,n);break}}if(0!==(a=Tu(e))&&a!==n)break;if(0!==l&&l!==n){e.lastPingedTime=l;break}e.timeoutHandle=zn(Vu.bind(null,e),i);break}Vu(e);break;case $o:if(cc(e,n),n===(l=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Au(i)),iu&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,zu(e,n);break}if(0!==(i=Tu(e))&&i!==n)break;if(0!==l&&l!==n){e.lastPingedTime=l;break}if(1073741823!==nu?l=10*(1073741821-nu)-ei():1073741823===tu?l=0:(l=10*(1073741821-tu)-5e3,0>(l=(i=ei())-l)&&(l=0),(n=10*(1073741821-n)-i)<(l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Do(l/1960))-l)&&(l=n)),10<l){e.timeoutHandle=zn(Vu.bind(null,e),l);break}Vu(e);break;case qo:if(1073741823!==tu&&null!==ru){a=tu;var o=ru;if(0>=(l=0|o.busyMinDurationMs)?l=0:(i=0|o.busyDelayMs,l=(a=ei()-(10*(1073741821-a)-(0|o.timeoutMs||5e3)))<=i?0:i+l-a),10<l){cc(e,n),e.timeoutHandle=zn(Vu.bind(null,e),l);break}}Vu(e);break;default:throw Error(r(329))}if(Eu(e),e.callbackNode===t)return Su.bind(null,e)}}return null}function Cu(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,(Yo&(Qo|Wo))!==Ao)throw Error(r(327));if(Hu(),e===Xo&&t===Zo||zu(e,t),null!==Go){var n=Yo;Yo|=Qo;for(var l=Iu();;)try{Ru();break}catch(i){Mu(e,i)}if(mi(),Yo=n,Lo.current=l,Jo===jo)throw n=eu,zu(e,t),cc(e,t),Eu(e),n;if(null!==Go)throw Error(r(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Xo=null,Vu(e),Eu(e)}return null}function Pu(){if(null!==hu){var e=hu;hu=null,e.forEach(function(e,t){fc(t,e),Eu(t)}),ai()}}function _u(e,t){var n=Yo;Yo|=1;try{return e(t)}finally{(Yo=n)===Ao&&ai()}}function Nu(e,t){var n=Yo;Yo&=-2,Yo|=Vo;try{return e(t)}finally{(Yo=n)===Ao&&ai()}}function zu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Mn(n)),null!==Go)for(n=Go.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&Ml();break;case 3:$i(),Tl(Pl),Tl(Cl);break;case 5:Yi(r);break;case 4:$i();break;case 13:case 19:Tl(Xi);break;case 10:hi(r)}n=n.return}Xo=e,Go=nc(e.current,null),Zo=t,Jo=Ho,eu=null,nu=tu=1073741823,ru=null,lu=0,iu=!1}function Mu(e,t){for(;;){try{if(mi(),Ji.current=za,ia)for(var n=na.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(ta=0,la=ra=na=null,ia=!1,null===Go||null===Go.return)return Jo=jo,eu=t,Go=null;e:{var l=e,i=Go.return,a=Go,o=t;if(t=Zo,a.effectTag|=2048,a.firstEffect=a.lastEffect=null,null!==o&&"object"==typeof o&&"function"==typeof o.then){var u=o;if(0==(2&a.mode)){var c=a.alternate;c?(a.updateQueue=c.updateQueue,a.memoizedState=c.memoizedState,a.expirationTime=c.expirationTime):(a.updateQueue=null,a.memoizedState=null)}var s=0!=(1&Xi.current),f=i;do{var d;if(d=13===f.tag){var p=f.memoizedState;if(null!==p)d=null!==p.dehydrated;else{var m=f.memoizedProps;d=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!s)}}if(d){var h=f.updateQueue;if(null===h){var g=new Set;g.add(u),f.updateQueue=g}else h.add(u);if(0==(2&f.mode)){if(f.effectTag|=64,a.effectTag&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var v=xi(1073741823,null);v.tag=2,Ti(a,v)}a.expirationTime=1073741823;break e}o=void 0,a=t;var y=l.pingCache;if(null===y?(y=l.pingCache=new Io,o=new Set,y.set(u,o)):void 0===(o=y.get(u))&&(o=new Set,y.set(u,o)),!o.has(a)){o.add(a);var b=$u.bind(null,l,u,a);u.then(b,b)}f.effectTag|=4096,f.expirationTime=t;break e}f=f.return}while(null!==f);o=Error((ye(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+be(a))}Jo!==qo&&(Jo=Bo),o=mo(o,a),f=i;do{switch(f.tag){case 3:u=o,f.effectTag|=4096,f.expirationTime=t,Ei(f,Fo(f,u,t));break e;case 1:u=o;var w=f.type,k=f.stateNode;if(0==(64&f.effectTag)&&("function"==typeof w.getDerivedStateFromError||null!==k&&"function"==typeof k.componentDidCatch&&(null===fu||!fu.has(k)))){f.effectTag|=4096,f.expirationTime=t,Ei(f,Oo(f,u,t));break e}}f=f.return}while(null!==f)}Go=Uu(Go)}catch(x){t=x;continue}break}}function Iu(){var e=Lo.current;return Lo.current=za,null===e?za:e}function Fu(e,t){e<tu&&2<e&&(tu=e),null!==t&&e<nu&&2<e&&(nu=e,ru=t)}function Ou(e){e>lu&&(lu=e)}function Ru(){for(;null!==Go;)Go=Lu(Go)}function Du(){for(;null!==Go&&!ql();)Go=Lu(Go)}function Lu(e){var t=Ro(e.alternate,e,Zo);return e.memoizedProps=e.pendingProps,null===t&&(t=Uu(e)),Uo.current=null,t}function Uu(e){Go=e;do{var t=Go.alternate;if(e=Go.return,0==(2048&Go.effectTag)){if(t=fo(t,Go,Zo),1===Zo||1!==Go.childExpirationTime){for(var n=0,r=Go.child;null!==r;){var l=r.expirationTime,i=r.childExpirationTime;l>n&&(n=l),i>n&&(n=i),r=r.sibling}Go.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Go.firstEffect),null!==Go.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Go.firstEffect),e.lastEffect=Go.lastEffect),1<Go.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Go:e.firstEffect=Go,e.lastEffect=Go))}else{if(null!==(t=po(Go)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=Go.sibling))return t;Go=e}while(null!==Go);return Jo===Ho&&(Jo=qo),null}function Au(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function Vu(e){var t=ti();return ri(99,Qu.bind(null,e,t)),null}function Qu(e,t){do{Hu()}while(null!==pu);if((Yo&(Qo|Wo))!==Ao)throw Error(r(327));var n=e.finishedWork,l=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Au(n);if(e.firstPendingTime=i,l<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:l<=e.firstSuspendedTime&&(e.firstSuspendedTime=l-1),l<=e.lastPingedTime&&(e.lastPingedTime=0),l<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Xo&&(Go=Xo=null,Zo=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,i=n.firstEffect):i=n:i=n.firstEffect,null!==i){var a=Yo;Yo|=Wo,Uo.current=null,Cn=Zt;var o=wn();if(kn(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{var c=(u=(u=o.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(c&&0!==c.rangeCount){u=c.anchorNode;var s=c.anchorOffset,f=c.focusNode;c=c.focusOffset;try{u.nodeType,f.nodeType}catch(C){u=null;break e}var d=0,p=-1,m=-1,h=0,g=0,v=o,y=null;t:for(;;){for(var b;v!==u||0!==s&&3!==v.nodeType||(p=d+s),v!==f||0!==c&&3!==v.nodeType||(m=d+c),3===v.nodeType&&(d+=v.nodeValue.length),null!==(b=v.firstChild);)y=v,v=b;for(;;){if(v===o)break t;if(y===u&&++h===s&&(p=d),y===f&&++g===c&&(m=d),null!==(b=v.nextSibling))break;y=(v=y).parentNode}v=b}u=-1===p||-1===m?null:{start:p,end:m}}else u=null}u=u||{start:0,end:0}}else u=null;Pn={activeElementDetached:null,focusedElem:o,selectionRange:u},Zt=!1,uu=i;do{try{Wu()}catch(C){if(null===uu)throw Error(r(330));Ku(uu,C),uu=uu.nextEffect}}while(null!==uu);uu=i;do{try{for(o=e,u=t;null!==uu;){var w=uu.effectTag;if(16&w&&He(uu.stateNode,""),128&w){var k=uu.alternate;if(null!==k){var x=k.ref;null!==x&&("function"==typeof x?x(null):x.current=null)}}switch(1038&w){case 2:Co(uu),uu.effectTag&=-3;break;case 6:Co(uu),uu.effectTag&=-3,zo(uu.alternate,uu);break;case 1024:uu.effectTag&=-1025;break;case 1028:uu.effectTag&=-1025,zo(uu.alternate,uu);break;case 4:zo(uu.alternate,uu);break;case 8:No(o,s=uu,u),Eo(s)}uu=uu.nextEffect}}catch(C){if(null===uu)throw Error(r(330));Ku(uu,C),uu=uu.nextEffect}}while(null!==uu);if(x=Pn,k=wn(),w=x.focusedElem,u=x.selectionRange,k!==w&&w&&w.ownerDocument&&bn(w.ownerDocument.documentElement,w)){null!==u&&kn(w)&&(k=u.start,void 0===(x=u.end)&&(x=k),"selectionStart"in w?(w.selectionStart=k,w.selectionEnd=Math.min(x,w.value.length)):(x=(k=w.ownerDocument||document)&&k.defaultView||window).getSelection&&(x=x.getSelection(),s=w.textContent.length,o=Math.min(u.start,s),u=void 0===u.end?o:Math.min(u.end,s),!x.extend&&o>u&&(s=u,u=o,o=s),s=yn(w,o),f=yn(w,u),s&&f&&(1!==x.rangeCount||x.anchorNode!==s.node||x.anchorOffset!==s.offset||x.focusNode!==f.node||x.focusOffset!==f.offset)&&((k=k.createRange()).setStart(s.node,s.offset),x.removeAllRanges(),o>u?(x.addRange(k),x.extend(f.node,f.offset)):(k.setEnd(f.node,f.offset),x.addRange(k))))),k=[];for(x=w;x=x.parentNode;)1===x.nodeType&&k.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w<k.length;w++)(x=k[w]).element.scrollLeft=x.left,x.element.scrollTop=x.top}Zt=!!Cn,Pn=Cn=null,e.current=n,uu=i;do{try{for(w=e;null!==uu;){var T=uu.effectTag;if(36&T&&xo(w,uu.alternate,uu),128&T){k=void 0;var E=uu.ref;if(null!==E){var S=uu.stateNode;switch(uu.tag){case 5:k=S;break;default:k=S}"function"==typeof E?E(k):E.current=k}}uu=uu.nextEffect}}catch(C){if(null===uu)throw Error(r(330));Ku(uu,C),uu=uu.nextEffect}}while(null!==uu);uu=null,Yl(),Yo=a}else e.current=n;if(du)du=!1,pu=e,mu=t;else for(uu=i;null!==uu;)t=uu.nextEffect,uu.nextEffect=null,uu=t;if(0===(t=e.firstPendingTime)&&(fu=null),1073741823===t?e===vu?gu++:(gu=0,vu=e):gu=0,"function"==typeof Yu&&Yu(n.stateNode,l),Eu(e),cu)throw cu=!1,e=su,su=null,e;return(Yo&Vo)!==Ao?null:(ai(),null)}function Wu(){for(;null!==uu;){var e=uu.effectTag;0!=(256&e)&&bo(uu.alternate,uu),0==(512&e)||du||(du=!0,li(97,function(){return Hu(),null})),uu=uu.nextEffect}}function Hu(){if(90!==mu){var e=97<mu?97:mu;return mu=90,ri(e,ju)}}function ju(){if(null===pu)return!1;var e=pu;if(pu=null,(Yo&(Qo|Wo))!==Ao)throw Error(r(331));var t=Yo;for(Yo|=Wo,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!=(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:wo(5,n),ko(5,n)}}catch(l){if(null===e)throw Error(r(330));Ku(e,l)}n=e.nextEffect,e.nextEffect=null,e=n}return Yo=t,ai(),!0}function Bu(e,t,n){Ti(e,t=Fo(e,t=mo(n,t),1073741823)),null!==(e=xu(e,1073741823))&&Eu(e)}function Ku(e,t){if(3===e.tag)Bu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Bu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===fu||!fu.has(r))){Ti(n,e=Oo(n,e=mo(t,e),1073741823)),null!==(n=xu(n,1073741823))&&Eu(n);break}}n=n.return}}function $u(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),Xo===e&&Zo===n?Jo===$o||Jo===Ko&&1073741823===tu&&ei()-au<ou?zu(e,Zo):iu=!0:uc(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Eu(e)))}function qu(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=wu(t=bu(),e,null)),null!==(e=xu(e,t))&&Eu(e)}Ro=function(e,t,n){var l=t.expirationTime;if(null!==e){var i=t.pendingProps;if(e.memoizedProps!==i||Pl.current)ja=!0;else{if(l<n){switch(ja=!1,t.tag){case 3:Ja(t),Wa();break;case 5:if(qi(t),4&t.mode&&1!==n&&i.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:zl(t.type)&&Ol(t);break;case 4:Ki(t,t.stateNode.containerInfo);break;case 10:l=t.memoizedProps.value,i=t.type._context,El(si,i._currentValue),i._currentValue=l;break;case 13:if(null!==t.memoizedState)return 0!==(l=t.child.childExpirationTime)&&l>=n?io(e,t,n):(El(Xi,1&Xi.current),null!==(t=co(e,t,n))?t.sibling:null);El(Xi,1&Xi.current);break;case 19:if(l=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(l)return uo(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),El(Xi,Xi.current),!l)return null}return co(e,t,n)}ja=!1}}else ja=!1;switch(t.expirationTime=0,t.tag){case 2:if(l=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=Nl(t,Cl.current),vi(t,n),i=ua(null,t,l,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,zl(l)){var a=!0;Ol(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,wi(t);var o=l.getDerivedStateFromProps;"function"==typeof o&&Ni(t,l,o,e),i.updater=zi,t.stateNode=i,i._reactInternalFiber=t,Oi(t,l,e,n),t=Za(null,t,l,!0,a,n)}else t.tag=0,Ba(null,t,i,n),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,ve(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,a=t.tag=tc(i),e=ci(i,e),a){case 0:t=Xa(null,t,i,e,n);break e;case 1:t=Ga(null,t,i,e,n);break e;case 11:t=Ka(null,t,i,e,n);break e;case 14:t=$a(null,t,i,ci(i.type,e),l,n);break e}throw Error(r(306,i,""))}return t;case 0:return l=t.type,i=t.pendingProps,Xa(e,t,l,i=t.elementType===l?i:ci(l,i),n);case 1:return l=t.type,i=t.pendingProps,Ga(e,t,l,i=t.elementType===l?i:ci(l,i),n);case 3:if(Ja(t),l=t.updateQueue,null===e||null===l)throw Error(r(282));if(l=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ki(e,t),Si(t,l,null,n),(l=t.memoizedState.element)===i)Wa(),t=co(e,t,n);else{if((i=t.stateNode.hydrate)&&(Ra=In(t.stateNode.containerInfo.firstChild),Oa=t,i=Da=!0),i)for(n=Vi(t,null,l,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Ba(e,t,l,n),Wa();t=t.child}return t;case 5:return qi(t),null===e&&Aa(t),l=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,Nn(l,i)?o=null:null!==a&&Nn(l,a)&&(t.effectTag|=16),Ya(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Ba(e,t,o,n),t=t.child),t;case 6:return null===e&&Aa(t),null;case 13:return io(e,t,n);case 4:return Ki(t,t.stateNode.containerInfo),l=t.pendingProps,null===e?t.child=Ai(t,null,l,n):Ba(e,t,l,n),t.child;case 11:return l=t.type,i=t.pendingProps,Ka(e,t,l,i=t.elementType===l?i:ci(l,i),n);case 7:return Ba(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ba(e,t,t.pendingProps.children,n),t.child;case 10:e:{l=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value;var u=t.type._context;if(El(si,u._currentValue),u._currentValue=a,null!==o)if(u=o.value,0===(a=Gr(u,a)?0:0|("function"==typeof l._calculateChangedBits?l._calculateChangedBits(u,a):1073741823))){if(o.children===i.children&&!Pl.current){t=co(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){o=u.child;for(var s=c.firstContext;null!==s;){if(s.context===l&&0!=(s.observedBits&a)){1===u.tag&&((s=xi(n,null)).tag=2,Ti(u,s)),u.expirationTime<n&&(u.expirationTime=n),null!==(s=u.alternate)&&s.expirationTime<n&&(s.expirationTime=n),gi(u.return,n),c.expirationTime<n&&(c.expirationTime=n);break}s=s.next}}else o=10===u.tag&&u.type===t.type?null:u.child;if(null!==o)o.return=u;else for(o=u;null!==o;){if(o===t){o=null;break}if(null!==(u=o.sibling)){u.return=o.return,o=u;break}o=o.return}u=o}Ba(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,l=(a=t.pendingProps).children,vi(t,n),l=l(i=yi(i,a.unstable_observedBits)),t.effectTag|=1,Ba(e,t,l,n),t.child;case 14:return a=ci(i=t.type,t.pendingProps),$a(e,t,i,a=ci(i.type,a),l,n);case 15:return qa(e,t,t.type,t.pendingProps,l,n);case 17:return l=t.type,i=t.pendingProps,i=t.elementType===l?i:ci(l,i),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,zl(l)?(e=!0,Ol(t)):e=!1,vi(t,n),Ii(t,l,i),Oi(t,l,i,n),Za(null,t,l,!0,e,n);case 19:return uo(e,t,n)}throw Error(r(156,t.tag))};var Yu=null,Xu=null;function Gu(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Yu=function(e){try{t.onCommitFiberRoot(n,e,void 0,64==(64&e.current.effectTag))}catch(r){}},Xu=function(e){try{t.onCommitFiberUnmount(n,e)}catch(r){}}}catch(r){}return!0}function Zu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Ju(e,t,n,r){return new Zu(e,t,n,r)}function ec(e){return!(!(e=e.prototype)||!e.isReactComponent)}function tc(e){if("function"==typeof e)return ec(e)?1:0;if(null!=e){if((e=e.$$typeof)===ce)return 11;if(e===de)return 14}return 2}function nc(e,t){var n=e.alternate;return null===n?((n=Ju(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function rc(e,t,n,l,i,a){var o=2;if(l=e,"function"==typeof e)ec(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case re:return lc(n.children,i,a,t);case ue:o=8,i|=7;break;case le:o=8,i|=1;break;case ie:return(e=Ju(12,n,t,8|i)).elementType=ie,e.type=ie,e.expirationTime=a,e;case se:return(e=Ju(13,n,t,i)).type=se,e.elementType=se,e.expirationTime=a,e;case fe:return(e=Ju(19,n,t,i)).elementType=fe,e.expirationTime=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case ae:o=10;break e;case oe:o=9;break e;case ce:o=11;break e;case de:o=14;break e;case pe:o=16,l=null;break e;case me:o=22;break e}throw Error(r(130,null==e?e:typeof e,""))}return(t=Ju(o,n,t,i)).elementType=e,t.type=l,t.expirationTime=a,t}function lc(e,t,n,r){return(e=Ju(7,e,r,t)).expirationTime=n,e}function ic(e,t,n){return(e=Ju(6,e,null,t)).expirationTime=n,e}function ac(e,t,n){return(t=Ju(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oc(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function uc(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function cc(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(r>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function sc(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function fc(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function dc(e,t,n,l){var i=t.current,a=bu(),o=Pi.suspense;a=wu(a,i,o);e:if(n){t:{if(nt(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(r(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(zl(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(r(171))}if(1===n.tag){var c=n.type;if(zl(c)){n=Fl(n,c,u);break e}}n=u}else n=Sl;return null===t.context?t.context=n:t.pendingContext=n,(t=xi(a,o)).payload={element:e},null!==(l=void 0===l?null:l)&&(t.callback=l),Ti(i,t),ku(i,a),a}function pc(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function mc(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function hc(e,t){mc(e,t),(e=e.alternate)&&mc(e,t)}function gc(e,t,n){var r=new oc(e,t,n=null!=n&&!0===n.hydrate),l=Ju(3,null,null,2===t?7:1===t?3:0);r.current=l,l.stateNode=r,wi(l),e[Ln]=r.current,n&&0!==t&&It(e,9===e.nodeType?e:e.ownerDocument),this._internalRoot=r}function vc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function yc(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new gc(e,0,t?{hydrate:!0}:void 0)}function bc(e,t,n,r,l){var i=n._reactRootContainer;if(i){var a=i._internalRoot;if("function"==typeof l){var o=l;l=function(){var e=pc(a);o.call(e)}}dc(t,a,e,l)}else{if(i=n._reactRootContainer=yc(n,r),a=i._internalRoot,"function"==typeof l){var u=l;l=function(){var e=pc(a);u.call(e)}}Nu(function(){dc(t,a,e,l)})}return pc(a)}function wc(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:ne,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function kc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!vc(t))throw Error(r(200));return wc(e,t,null,n)}gc.prototype.render=function(e){dc(e,this._internalRoot,null,null)},gc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;dc(null,e,null,function(){t[Ln]=null})},bt=function(e){if(13===e.tag){var t=ui(bu(),150,100);ku(e,t),hc(e,t)}},wt=function(e){13===e.tag&&(ku(e,3),hc(e,3))},kt=function(e){if(13===e.tag){var t=bu();ku(e,t=wu(t,e,null)),hc(e,t)}},C=function(e,t,n){switch(t){case"input":if(_e(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=Qn(l);if(!i)throw Error(r(90));Ee(l),_e(l,i)}}}break;case"textarea":De(e,n);break;case"select":null!=(t=n.value)&&Fe(e,!!n.multiple,t,!1)}},I=_u,F=function(e,t,n,r,l){var i=Yo;Yo|=4;try{return ri(98,e.bind(null,t,n,r,l))}finally{(Yo=i)===Ao&&ai()}},O=function(){(Yo&(1|Qo|Wo))===Ao&&(Pu(),Hu())},R=function(e,t){var n=Yo;Yo|=2;try{return e(t)}finally{(Yo=n)===Ao&&ai()}};var xc={Events:[An,Vn,Qn,E,k,qn,function(e){ut(e,$n)},z,M,rn,ft,Hu,{current:!1}]};!function(e){var n=e.findFiberByHostInstance;Gu(t({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:G.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=at(e))?null:e.stateNode},findFiberByHostInstance:function(e){return n?n(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:Un,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"}),exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xc,exports.createPortal=kc,exports.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw Error(r(268,Object.keys(e)))}return e=null===(e=at(t))?null:e.stateNode},exports.flushSync=function(e,t){if((Yo&(Qo|Wo))!==Ao)throw Error(r(187));var n=Yo;Yo|=1;try{return ri(99,e.bind(null,t))}finally{Yo=n,ai()}},exports.hydrate=function(e,t,n){if(!vc(t))throw Error(r(200));return bc(null,e,t,!0,n)},exports.render=function(e,t,n){if(!vc(t))throw Error(r(200));return bc(null,e,t,!1,n)},exports.unmountComponentAtNode=function(e){if(!vc(e))throw Error(r(40));return!!e._reactRootContainer&&(Nu(function(){bc(null,null,e,!1,function(){e._reactRootContainer=null,e[Ln]=null})}),!0)},exports.unstable_batchedUpdates=_u,exports.unstable_createPortal=function(e,t){return kc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},exports.unstable_renderSubtreeIntoContainer=function(e,t,n,l){if(!vc(n))throw Error(r(200));if(null==e||void 0===e._reactInternalFiber)throw Error(r(38));return bc(e,t,n,!1,l)},exports.version="16.14.0";
},{"react":"n8MK","object-assign":"J4Nk","scheduler":"MDSO"}],"NKHc":[function(require,module,exports) {
"use strict";function _(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(O){console.error(O)}}}_(),module.exports=require("./cjs/react-dom.production.min.js");
},{"./cjs/react-dom.production.min.js":"i17t"}],"FryP":[function(require,module,exports) {
var define;
var t;!function(){function n(t,n,i){return t.call.apply(t.bind,arguments)}function i(t,n,i){if(!t)throw Error();if(2<arguments.length){var e=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,e),t.apply(n,i)}}return function(){return t.apply(n,arguments)}}function e(t,o,a){return(e=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?n:i).apply(null,arguments)}var o=Date.now||function(){return+new Date};function a(t,n){this.a=t,this.o=n||t,this.c=this.o.document}var s=!!window.FontFace;function r(t,n,i,e){if(n=t.c.createElement(n),i)for(var o in i)i.hasOwnProperty(o)&&("style"==o?n.style.cssText=i[o]:n.setAttribute(o,i[o]));return e&&n.appendChild(t.c.createTextNode(e)),n}function f(t,n,i){(t=t.c.getElementsByTagName(n)[0])||(t=document.documentElement),t.insertBefore(i,t.lastChild)}function c(t){t.parentNode&&t.parentNode.removeChild(t)}function h(t,n,i){n=n||[],i=i||[];for(var e=t.className.split(/\s+/),o=0;o<n.length;o+=1){for(var a=!1,s=0;s<e.length;s+=1)if(n[o]===e[s]){a=!0;break}a||e.push(n[o])}for(n=[],o=0;o<e.length;o+=1){for(a=!1,s=0;s<i.length;s+=1)if(e[o]===i[s]){a=!0;break}a||n.push(e[o])}t.className=n.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function l(t,n){for(var i=t.className.split(/\s+/),e=0,o=i.length;e<o;e++)if(i[e]==n)return!0;return!1}function u(t,n,i){function e(){h&&o&&a&&(h(c),h=null)}n=r(t,"link",{rel:"stylesheet",href:n,media:"all"});var o=!1,a=!0,c=null,h=i||null;s?(n.onload=function(){o=!0,e()},n.onerror=function(){o=!0,c=Error("Stylesheet failed to load"),e()}):setTimeout(function(){o=!0,e()},0),f(t,"head",n)}function p(t,n,i,e){var o=t.c.getElementsByTagName("head")[0];if(o){var a=r(t,"script",{src:n}),s=!1;return a.onload=a.onreadystatechange=function(){s||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(s=!0,i&&i(null),a.onload=a.onreadystatechange=null,"HEAD"==a.parentNode.tagName&&o.removeChild(a))},o.appendChild(a),setTimeout(function(){s||(s=!0,i&&i(Error("Script load timeout")))},e||5e3),a}return null}function g(){this.a=0,this.c=null}function d(t){return t.a++,function(){t.a--,w(t)}}function v(t,n){t.c=n,w(t)}function w(t){0==t.a&&t.c&&(t.c(),t.c=null)}function m(t){this.a=t||"-"}function y(t,n){this.c=t,this.f=4,this.a="n";var i=(n||"n4").match(/^([nio])([1-9])$/i);i&&(this.a=i[1],this.f=parseInt(i[2],10))}function b(t){var n=[];t=t.split(/,\s*/);for(var i=0;i<t.length;i++){var e=t[i].replace(/['"]/g,"");-1!=e.indexOf(" ")||/^\d/.test(e)?n.push("'"+e+"'"):n.push(e)}return n.join(",")}function x(t){return t.a+t.f}function j(t){var n="normal";return"o"===t.a?n="oblique":"i"===t.a&&(n="italic"),n}function _(t){var n=4,i="n",e=null;return t&&((e=t.match(/(normal|oblique|italic)/i))&&e[1]&&(i=e[1].substr(0,1).toLowerCase()),(e=t.match(/([1-9]00|normal|bold)/i))&&e[1]&&(/bold/i.test(e[1])?n=7:/[1-9]00/.test(e[1])&&(n=parseInt(e[1].substr(0,1),10)))),i+n}function k(t,n){this.c=t,this.f=t.o.document.documentElement,this.h=n,this.a=new m("-"),this.j=!1!==n.events,this.g=!1!==n.classes}function T(t){if(t.g){var n=l(t.f,t.a.c("wf","active")),i=[],e=[t.a.c("wf","loading")];n||i.push(t.a.c("wf","inactive")),h(t.f,i,e)}S(t,"inactive")}function S(t,n,i){t.j&&t.h[n]&&(i?t.h[n](i.c,x(i)):t.h[n]())}function C(){this.c={}}function A(t,n){this.c=t,this.f=n,this.a=r(this.c,"span",{"aria-hidden":"true"},this.f)}function N(t){f(t.c,"body",t.a)}function E(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+b(t.c)+";font-style:"+j(t)+";font-weight:"+t.f+"00;"}function W(t,n,i,e,o,a){this.g=t,this.j=n,this.a=e,this.c=i,this.f=o||3e3,this.h=a||void 0}function F(t,n,i,e,o,a,s){this.v=t,this.B=n,this.c=i,this.a=e,this.s=s||"BESbswy",this.f={},this.w=o||3e3,this.u=a||null,this.m=this.j=this.h=this.g=null,this.g=new A(this.c,this.s),this.h=new A(this.c,this.s),this.j=new A(this.c,this.s),this.m=new A(this.c,this.s),t=E(t=new y(this.a.c+",serif",x(this.a))),this.g.a.style.cssText=t,t=E(t=new y(this.a.c+",sans-serif",x(this.a))),this.h.a.style.cssText=t,t=E(t=new y("serif",x(this.a))),this.j.a.style.cssText=t,t=E(t=new y("sans-serif",x(this.a))),this.m.a.style.cssText=t,N(this.g),N(this.h),N(this.j),N(this.m)}m.prototype.c=function(t){for(var n=[],i=0;i<arguments.length;i++)n.push(arguments[i].replace(/[\W_]+/g,"").toLowerCase());return n.join(this.a)},W.prototype.start=function(){var t=this.c.o.document,n=this,i=o(),e=new Promise(function(e,a){!function s(){o()-i>=n.f?a():t.fonts.load(function(t){return j(t)+" "+t.f+"00 300px "+b(t.c)}(n.a),n.h).then(function(t){1<=t.length?e():setTimeout(s,25)},function(){a()})}()}),a=null,s=new Promise(function(t,i){a=setTimeout(i,n.f)});Promise.race([s,e]).then(function(){a&&(clearTimeout(a),a=null),n.g(n.a)},function(){n.j(n.a)})};var I={D:"serif",C:"sans-serif"},O=null;function P(){if(null===O){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);O=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return O}function B(t,n,i){for(var e in I)if(I.hasOwnProperty(e)&&n===t.f[I[e]]&&i===t.f[I[e]])return!0;return!1}function L(t){var n,i=t.g.a.offsetWidth,a=t.h.a.offsetWidth;(n=i===t.f.serif&&a===t.f["sans-serif"])||(n=P()&&B(t,i,a)),n?o()-t.A>=t.w?P()&&B(t,i,a)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?D(t,t.v):D(t,t.B):function(t){setTimeout(e(function(){L(this)},t),50)}(t):D(t,t.v)}function D(t,n){setTimeout(e(function(){c(this.g.a),c(this.h.a),c(this.j.a),c(this.m.a),n(this.a)},t),0)}function $(t,n,i){this.c=t,this.a=n,this.f=0,this.m=this.j=!1,this.s=i}F.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),L(this)};var q=null;function H(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&h(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),S(t,"active")):T(t.a))}function M(t){this.j=t,this.a=new C,this.h=0,this.f=this.g=!0}function z(t,n,i,o,a){var s=0==--t.h;(t.f||t.g)&&setTimeout(function(){var t=a||null,r=o||{};if(0===i.length&&s)T(n.a);else{n.f+=i.length,s&&(n.j=s);var f,c=[];for(f=0;f<i.length;f++){var l=i[f],u=r[l.c],p=n.a,g=l;if(p.g&&h(p.f,[p.a.c("wf",g.c,x(g).toString(),"loading")]),S(p,"fontloading",g),p=null,null===q)if(window.FontFace){g=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var d=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);q=g?42<parseInt(g[1],10):!d}else q=!1;p=q?new W(e(n.g,n),e(n.h,n),n.c,l,n.s,u):new F(e(n.g,n),e(n.h,n),n.c,l,n.s,t,u),c.push(p)}for(f=0;f<c.length;f++)c[f].start()}},0)}function G(t,n){this.c=t,this.a=n}function K(t,n){this.c=t,this.a=n}function R(t,n){this.c=t||U,this.a=[],this.f=[],this.g=n||""}$.prototype.g=function(t){var n=this.a;n.g&&h(n.f,[n.a.c("wf",t.c,x(t).toString(),"active")],[n.a.c("wf",t.c,x(t).toString(),"loading"),n.a.c("wf",t.c,x(t).toString(),"inactive")]),S(n,"fontactive",t),this.m=!0,H(this)},$.prototype.h=function(t){var n=this.a;if(n.g){var i=l(n.f,n.a.c("wf",t.c,x(t).toString(),"active")),e=[],o=[n.a.c("wf",t.c,x(t).toString(),"loading")];i||e.push(n.a.c("wf",t.c,x(t).toString(),"inactive")),h(n.f,e,o)}S(n,"fontinactive",t),H(this)},M.prototype.load=function(t){this.c=new a(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,function(t,n,i){var e=[],o=i.timeout;!function(t){t.g&&h(t.f,[t.a.c("wf","loading")]),S(t,"loading")}(n);var e=function(t,n,i){var e,o=[];for(e in n)if(n.hasOwnProperty(e)){var a=t.c[e];a&&o.push(a(n[e],i))}return o}(t.a,i,t.c),a=new $(t.c,n,o);for(t.h=e.length,n=0,i=e.length;n<i;n++)e[n].load(function(n,i,e){z(t,a,n,i,e)})}(this,new k(this.c,t),t)},G.prototype.load=function(t){var n=this,i=n.a.projectId,e=n.a.version;if(i){var o=n.c.o;p(this.c,(n.a.api||"https://fast.fonts.net/jsapi")+"/"+i+".js"+(e?"?v="+e:""),function(e){e?t([]):(o["__MonotypeConfiguration__"+i]=function(){return n.a},function n(){if(o["__mti_fntLst"+i]){var e,a=o["__mti_fntLst"+i](),s=[];if(a)for(var r=0;r<a.length;r++){var f=a[r].fontfamily;null!=a[r].fontStyle&&null!=a[r].fontWeight?(e=a[r].fontStyle+a[r].fontWeight,s.push(new y(f,e))):s.push(new y(f))}t(s)}else setTimeout(function(){n()},50)}())}).id="__MonotypeAPIScript__"+i}else t([])},K.prototype.load=function(t){var n,i,e=this.a.urls||[],o=this.a.families||[],a=this.a.testStrings||{},s=new g;for(n=0,i=e.length;n<i;n++)u(this.c,e[n],d(s));var r=[];for(n=0,i=o.length;n<i;n++)if((e=o[n].split(":"))[1])for(var f=e[1].split(","),c=0;c<f.length;c+=1)r.push(new y(e[0],f[c]));else r.push(new y(e[0]));v(s,function(){t(r,a)})};var U="https://fonts.googleapis.com/css";function V(t){this.f=t,this.a=[],this.c={}}var X={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},J={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},Q={i:"i",italic:"i",n:"n",normal:"n"},Y=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function Z(t,n){this.c=t,this.a=n}var tt={Arimo:!0,Cousine:!0,Tinos:!0};function nt(t,n){this.c=t,this.a=n}function it(t,n){this.c=t,this.f=n,this.a=[]}Z.prototype.load=function(t){var n=new g,i=this.c,e=new R(this.a.api,this.a.text),o=this.a.families;!function(t,n){for(var i=n.length,e=0;e<i;e++){var o=n[e].split(":");3==o.length&&t.f.push(o.pop());var a="";2==o.length&&""!=o[1]&&(a=":"),t.a.push(o.join(a))}}(e,o);var a=new V(o);!function(t){for(var n=t.f.length,i=0;i<n;i++){var e=t.f[i].split(":"),o=e[0].replace(/\+/g," "),a=["n4"];if(2<=e.length){var s;if(s=[],r=e[1])for(var r,f=(r=r.split(",")).length,c=0;c<f;c++){var h;if((h=r[c]).match(/^[\w-]+$/))if(null==(u=Y.exec(h.toLowerCase())))h="";else{if(h=null==(h=u[2])||""==h?"n":Q[h],null==(u=u[1])||""==u)u="4";else var l=J[u],u=l||(isNaN(u)?"4":u.substr(0,1));h=[h,u].join("")}else h="";h&&s.push(h)}0<s.length&&(a=s),3==e.length&&(s=[],0<(e=(e=e[2])?e.split(","):s).length&&(e=X[e[0]])&&(t.c[o]=e))}for(t.c[o]||(e=X[o])&&(t.c[o]=e),e=0;e<a.length;e+=1)t.a.push(new y(o,a[e]))}}(a),u(i,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var n=t.a.length,i=[],e=0;e<n;e++)i.push(t.a[e].replace(/ /g,"+"));return n=t.c+"?family="+i.join("%7C"),0<t.f.length&&(n+="&subset="+t.f.join(",")),0<t.g.length&&(n+="&text="+encodeURIComponent(t.g)),n}(e),d(n)),v(n,function(){t(a.a,a.c,tt)})},nt.prototype.load=function(t){var n=this.a.id,i=this.c.o;n?p(this.c,(this.a.api||"https://use.typekit.net")+"/"+n+".js",function(n){if(n)t([]);else if(i.Typekit&&i.Typekit.config&&i.Typekit.config.fn){n=i.Typekit.config.fn;for(var e=[],o=0;o<n.length;o+=2)for(var a=n[o],s=n[o+1],r=0;r<s.length;r++)e.push(new y(a,s[r]));try{i.Typekit.load({events:!1,classes:!1,async:!0})}catch(f){}t(e)}},2e3):t([])},it.prototype.load=function(t){var n=this.f.id,i=this.c.o,e=this;n?(i.__webfontfontdeckmodule__||(i.__webfontfontdeckmodule__={}),i.__webfontfontdeckmodule__[n]=function(n,i){for(var o=0,a=i.fonts.length;o<a;++o){var s=i.fonts[o];e.a.push(new y(s.name,_("font-weight:"+s.weight+";font-style:"+s.style)))}t(e.a)},p(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(t){return t.o.location.hostname||t.a.location.hostname}(this.c)+"/"+n+".js",function(n){n&&t([])})):t([])};var et=new M(window);et.a.c.custom=function(t,n){return new K(n,t)},et.a.c.fontdeck=function(t,n){return new it(n,t)},et.a.c.monotype=function(t,n){return new G(n,t)},et.a.c.typekit=function(t,n){return new nt(n,t)},et.a.c.google=function(t,n){return new Z(n,t)};var ot={load:e(et.load,et)};"function"==typeof t&&t.amd?t(function(){return ot}):"undefined"!=typeof module&&module.exports?module.exports=ot:(window.WebFont=ot,window.WebFontConfig&&et.load(window.WebFontConfig))}();
},{}],"cGcv":[function(require,module,exports) {
"use strict";function e(e,t){return function(){return null}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"SpjQ":[function(require,module,exports) {
"use strict";function e(){return exports.default=e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},e.apply(this,arguments)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"xLw6":[function(require,module,exports) {
"use strict";function t(o){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?exports.default=t=function(t){return typeof t}:exports.default=t=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(o)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;
},{}],"YpPD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPlainObject=n,exports.default=o;var e=r(require("@babel/runtime/helpers/esm/extends")),t=r(require("@babel/runtime/helpers/esm/typeof"));function r(e){return e&&e.__esModule?e:{default:e}}function n(e){return e&&"object"===(0,t.default)(e)&&e.constructor===Object}function o(t,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},c=u.clone?(0,e.default)({},t):t;return n(t)&&n(r)&&Object.keys(r).forEach(function(e){"__proto__"!==e&&(n(r[e])&&e in t?c[e]=o(t[e],r[e],u):c[e]=r[e])}),c}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/typeof":"xLw6"}],"Asjh":[function(require,module,exports) {
"use strict";var _="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";module.exports=_;
},{}],"wVGV":[function(require,module,exports) {
"use strict";var e=require("./lib/ReactPropTypesSecret");function r(){}function t(){}t.resetWarningCache=r,module.exports=function(){function n(r,t,n,o,a,p){if(p!==e){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function o(){return n}n.isRequired=n;var a={array:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:t,resetWarningCache:r};return a.PropTypes=a,a};
},{"./lib/ReactPropTypesSecret":"Asjh"}],"D9Od":[function(require,module,exports) {
var r,e;module.exports=require("./factoryWithThrowingShims")();
},{"./factoryWithThrowingShims":"wVGV"}],"klap":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("prop-types")),t=n(require("./chainPropTypes"));function n(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=e.prototype;return Boolean((void 0===t?{}:t).isReactComponent)}function o(e,t,n,o,a){var u,i=e[t],l=a||t;if(null==i)return null;var c=i.type;return"function"!=typeof c||r(c)||(u="Did you accidentally use a plain function component for an element instead?"),void 0!==u?new Error("Invalid ".concat(o," `").concat(l,"` supplied to `").concat(n,"`. ")+"Expected an element that can hold a ref. ".concat(u," ")+"For more information see https://material-ui.com/r/caveat-with-refs-guide"):null}var a=(0,t.default)(e.default.element,o);a.isRequired=(0,t.default)(e.default.element.isRequired,o);var u=a;exports.default=u;
},{"prop-types":"D9Od","./chainPropTypes":"cGcv"}],"NXkN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("prop-types")),t=r(require("./chainPropTypes"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var u=o?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(r,a,u):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function a(e){var t=e.prototype;return Boolean((void 0===t?{}:t).isReactComponent)}function u(e,t,r,n,o){var u,i=e[t],c=o||t;return null==i?null:("function"!=typeof i||a(i)||(u="Did you accidentally provide a plain function component instead?"),void 0!==u?new Error("Invalid ".concat(n," `").concat(c,"` supplied to `").concat(r,"`. ")+"Expected an element type that can hold a ref. ".concat(u," ")+"For more information see https://material-ui.com/r/caveat-with-refs-guide"):null)}var i=(0,t.default)(e.elementType,u);exports.default=i;
},{"prop-types":"D9Od","./chainPropTypes":"cGcv"}],"gpd2":[function(require,module,exports) {
"use strict";function e(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"yjqW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=o,exports.specialProperty=void 0;var e=t(require("@babel/runtime/helpers/esm/defineProperty")),r=t(require("@babel/runtime/helpers/esm/extends"));function t(e){return e&&e.__esModule?e:{default:e}}var s="exact-prop: ​";function o(e){return e}exports.specialProperty=s;
},{"@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/extends":"SpjQ"}],"mfe4":[function(require,module,exports) {
"use strict";function e(e){for(var r="https://material-ui.com/production-error/?code="+e,t=1;t<arguments.length;t+=1)r+="&args[]="+encodeURIComponent(arguments[t]);return"Minified Material-UI error #"+e+"; visit "+r+" for the full message."}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"KknP":[function(require,module,exports) {
"use strict";var e=60103,t=60106,r=60107,o=60108,n=60114,s=60109,c=60110,a=60112,p=60113,i=60120,u=60115,f=60116,x=60121,l=60122,y=60117,$=60129,d=60131;if("function"==typeof Symbol&&Symbol.for){var m=Symbol.for;e=m("react.element"),t=m("react.portal"),r=m("react.fragment"),o=m("react.strict_mode"),n=m("react.profiler"),s=m("react.provider"),c=m("react.context"),a=m("react.forward_ref"),p=m("react.suspense"),i=m("react.suspense_list"),u=m("react.memo"),f=m("react.lazy"),x=m("react.block"),l=m("react.server.block"),y=m("react.fundamental"),$=m("react.debug_trace_mode"),d=m("react.legacy_hidden")}function b(x){if("object"==typeof x&&null!==x){var l=x.$$typeof;switch(l){case e:switch(x=x.type){case r:case n:case o:case p:case i:return x;default:switch(x=x&&x.$$typeof){case c:case a:case f:case u:case s:return x;default:return l}}case t:return l}}}var v=s,C=e,S=a,g=r,w=f,M=u,P=t,_=n,h=o,F=p;exports.ContextConsumer=c,exports.ContextProvider=v,exports.Element=C,exports.ForwardRef=S,exports.Fragment=g,exports.Lazy=w,exports.Memo=M,exports.Portal=P,exports.Profiler=_,exports.StrictMode=h,exports.Suspense=F,exports.isAsyncMode=function(){return!1},exports.isConcurrentMode=function(){return!1},exports.isContextConsumer=function(e){return b(e)===c},exports.isContextProvider=function(e){return b(e)===s},exports.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},exports.isForwardRef=function(e){return b(e)===a},exports.isFragment=function(e){return b(e)===r},exports.isLazy=function(e){return b(e)===f},exports.isMemo=function(e){return b(e)===u},exports.isPortal=function(e){return b(e)===t},exports.isProfiler=function(e){return b(e)===n},exports.isStrictMode=function(e){return b(e)===o},exports.isSuspense=function(e){return b(e)===p},exports.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===n||e===$||e===o||e===p||e===i||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===u||e.$$typeof===s||e.$$typeof===c||e.$$typeof===a||e.$$typeof===y||e.$$typeof===x||e[0]===l)},exports.typeOf=b;
},{}],"dr05":[function(require,module,exports) {
"use strict";module.exports=require("./cjs/react-is.production.min.js");
},{"./cjs/react-is.production.min.js":"KknP"}],"fBUN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFunctionName=o,exports.default=i;var e=r(require("@babel/runtime/helpers/esm/typeof")),t=require("react-is");function r(e){return e&&e.__esModule?e:{default:e}}var n=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function o(e){var t="".concat(e).match(n);return t&&t[1]||""}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||o(e)||t}function a(e,t,r){var n=u(t);return e.displayName||(""!==n?"".concat(r,"(").concat(n,")"):r)}function i(r){if(null!=r){if("string"==typeof r)return r;if("function"==typeof r)return u(r,"Component");if("object"===(0,e.default)(r))switch(r.$$typeof){case t.ForwardRef:return a(r,r.render,"ForwardRef");case t.Memo:return a(r,r.type,"memo");default:return}}}
},{"@babel/runtime/helpers/esm/typeof":"xLw6","react-is":"dr05"}],"PmB2":[function(require,module,exports) {
"use strict";function e(e,t,r,u,l){return null}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"UbX4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();exports.default=e;
},{}],"AzT9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("prop-types"));function t(e){return e&&e.__esModule?e:{default:e}}var u=e.default.oneOfType([e.default.func,e.default.object]),r=u;exports.default=r;
},{"prop-types":"D9Od"}],"gEhD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"chainPropTypes",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"deepmerge",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"elementAcceptingRef",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"elementTypeAcceptingRef",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"exactProp",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"formatMuiErrorMessage",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"getDisplayName",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"HTMLElementType",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"ponyfillGlobal",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"refType",{enumerable:!0,get:function(){return l.default}});var e=a(require("./chainPropTypes")),r=a(require("./deepmerge")),t=a(require("./elementAcceptingRef")),n=a(require("./elementTypeAcceptingRef")),u=a(require("./exactProp")),o=a(require("./formatMuiErrorMessage")),i=a(require("./getDisplayName")),p=a(require("./HTMLElementType")),f=a(require("./ponyfillGlobal")),l=a(require("./refType"));function a(e){return e&&e.__esModule?e:{default:e}}
},{"./chainPropTypes":"cGcv","./deepmerge":"YpPD","./elementAcceptingRef":"klap","./elementTypeAcceptingRef":"NXkN","./exactProp":"yjqW","./formatMuiErrorMessage":"mfe4","./getDisplayName":"fBUN","./HTMLElementType":"PmB2","./ponyfillGlobal":"UbX4","./refType":"AzT9"}],"aguB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.hexToRgb=r,exports.rgbToHex=a,exports.hslToRgb=o,exports.decomposeColor=u,exports.recomposeColor=i,exports.getContrastRatio=s,exports.getLuminance=c,exports.emphasize=l,exports.fade=p,exports.darken=f,exports.lighten=h;var t=require("@material-ui/utils");function e(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(e,t),r)}function r(t){t=t.substr(1);var e=new RegExp(".{1,".concat(t.length>=6?2:1,"}"),"g"),r=t.match(e);return r&&1===r[0].length&&(r=r.map(function(t){return t+t})),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map(function(t,e){return e<3?parseInt(t,16):Math.round(parseInt(t,16)/255*1e3)/1e3}).join(", "),")"):""}function n(t){var e=t.toString(16);return 1===e.length?"0".concat(e):e}function a(t){if(0===t.indexOf("#"))return t;var e=u(t).values;return"#".concat(e.map(function(t){return n(t)}).join(""))}function o(t){var e=(t=u(t)).values,r=e[0],n=e[1]/100,a=e[2]/100,o=n*Math.min(a,1-a),s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+r/30)%12;return a-o*Math.max(Math.min(e-3,9-e,1),-1)},c="rgb",l=[Math.round(255*s(0)),Math.round(255*s(8)),Math.round(255*s(4))];return"hsla"===t.type&&(c+="a",l.push(e[3])),i({type:c,values:l})}function u(e){if(e.type)return e;if("#"===e.charAt(0))return u(r(e));var n=e.indexOf("("),a=e.substring(0,n);if(-1===["rgb","rgba","hsl","hsla"].indexOf(a))throw new Error((0,t.formatMuiErrorMessage)(3,e));var o=e.substring(n+1,e.length-1).split(",");return{type:a,values:o=o.map(function(t){return parseFloat(t)})}}function i(t){var e=t.type,r=t.values;return-1!==e.indexOf("rgb")?r=r.map(function(t,e){return e<3?parseInt(t,10):t}):-1!==e.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),"".concat(e,"(").concat(r.join(", "),")")}function s(t,e){var r=c(t),n=c(e);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function c(t){var e="hsl"===(t=u(t)).type?u(o(t)).values:t.values;return e=e.map(function(t){return(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return c(t)>.5?f(t,e):h(t,e)}function p(t,r){return t=u(t),r=e(r),"rgb"!==t.type&&"hsl"!==t.type||(t.type+="a"),t.values[3]=r,i(t)}function f(t,r){if(t=u(t),r=e(r),-1!==t.type.indexOf("hsl"))t.values[2]*=1-r;else if(-1!==t.type.indexOf("rgb"))for(var n=0;n<3;n+=1)t.values[n]*=1-r;return i(t)}function h(t,r){if(t=u(t),r=e(r),-1!==t.type.indexOf("hsl"))t.values[2]+=(100-t.values[2])*r;else if(-1!==t.type.indexOf("rgb"))for(var n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*r;return i(t)}
},{"@material-ui/utils":"gEhD"}],"Vabl":[function(require,module,exports) {
"use strict";function e(e,t){if(null==e)return{};var r,n,u={},f=Object.keys(e);for(n=0;n<f.length;n++)r=f[n],t.indexOf(r)>=0||(u[r]=e[r]);return u}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"tuNH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=r;var e=t(require("./objectWithoutPropertiesLoose.js"));function t(e){return e&&e.__esModule?e:{default:e}}function r(t,r){if(null==t)return{};var o,u,l=(0,e.default)(t,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(u=0;u<n.length;u++)o=n[u],r.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(t,o)&&(l[o]=t[o])}return l}
},{"./objectWithoutPropertiesLoose.js":"Vabl"}],"GWqs":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u,exports.keys=void 0;var e=n(require("@babel/runtime/helpers/esm/extends")),t=n(require("@babel/runtime/helpers/esm/objectWithoutProperties"));function n(e){return e&&e.__esModule?e:{default:e}}var r=["xs","sm","md","lg","xl"];function u(n){var u=n.values,o=void 0===u?{xs:0,sm:600,md:960,lg:1280,xl:1920}:u,i=n.unit,a=void 0===i?"px":i,s=n.step,c=void 0===s?5:s,d=(0,t.default)(n,["values","unit","step"]);function l(e){var t="number"==typeof o[e]?o[e]:e;return"@media (min-width:".concat(t).concat(a,")")}function m(e,t){var n=r.indexOf(t);return n===r.length-1?l(e):"@media (min-width:".concat("number"==typeof o[e]?o[e]:e).concat(a,") and ")+"(max-width:".concat((-1!==n&&"number"==typeof o[r[n+1]]?o[r[n+1]]:t)-c/100).concat(a,")")}return(0,e.default)({keys:r,values:o,up:l,down:function(e){var t=r.indexOf(e)+1,n=o[r[t]];return t===r.length?l("xs"):"@media (max-width:".concat(("number"==typeof n&&t>0?n:e)-c/100).concat(a,")")},between:m,only:function(e){return m(e,e)},width:function(e){return o[e]}},d)}exports.keys=r;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH"}],"OYhe":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=r;var e=n(require("@babel/runtime/helpers/esm/defineProperty")),t=n(require("@babel/runtime/helpers/esm/extends"));function n(e){return e&&e.__esModule?e:{default:e}}function r(n,r,u){var i;return(0,t.default)({gutters:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,t.default)({paddingLeft:r(2),paddingRight:r(2)},u,(0,e.default)({},n.up("sm"),(0,t.default)({paddingLeft:r(3),paddingRight:r(3)},u[n.up("sm")])))},toolbar:(i={minHeight:56},(0,e.default)(i,"".concat(n.up("xs")," and (orientation: landscape)"),{minHeight:48}),(0,e.default)(i,n.up("sm"),{minHeight:64}),i)},u)}
},{"@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/extends":"SpjQ"}],"DyYm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={black:"#000",white:"#fff"},t=e;exports.default=t;
},{}],"jh9N":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},a=e;exports.default=a;
},{}],"S7CI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},f=e;exports.default=f;
},{}],"orzA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},f=e;exports.default=f;
},{}],"kzD0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},f=e;exports.default=f;
},{}],"VeQ7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var f={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},e=f;exports.default=e;
},{}],"qweW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var f={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},e=f;exports.default=e;
},{}],"fqHu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},a=e;exports.default=a;
},{}],"LGnM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=b,exports.dark=exports.light=void 0;var r=g(require("@babel/runtime/helpers/esm/extends")),e=g(require("@babel/runtime/helpers/esm/objectWithoutProperties")),a=require("@material-ui/utils"),t=g(require("../colors/common")),i=g(require("../colors/grey")),o=g(require("../colors/indigo")),d=g(require("../colors/pink")),l=g(require("../colors/red")),n=g(require("../colors/orange")),u=g(require("../colors/blue")),s=g(require("../colors/green")),c=require("./colorManipulator");function g(r){return r&&r.__esModule?r:{default:r}}var f={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:t.default.white,default:i.default[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}};exports.light=f;var p={text:{primary:t.default.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:i.default[800],default:"#303030"},action:{active:t.default.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function h(r,e,a,t){var i=t.light||t,o=t.dark||1.5*t;r[e]||(r.hasOwnProperty(a)?r[e]=r[a]:"light"===e?r.light=(0,c.lighten)(r.main,i):"dark"===e&&(r.dark=(0,c.darken)(r.main,o)))}function b(g){var b=g.primary,m=void 0===b?{light:o.default[300],main:o.default[500],dark:o.default[700]}:b,v=g.secondary,y=void 0===v?{light:d.default.A200,main:d.default.A400,dark:d.default.A700}:v,k=g.error,O=void 0===k?{light:l.default[300],main:l.default[500],dark:l.default[700]}:k,x=g.warning,q=void 0===x?{light:n.default[300],main:n.default[500],dark:n.default[700]}:x,w=g.info,M=void 0===w?{light:u.default[300],main:u.default[500],dark:u.default[700]}:w,A=g.success,T=void 0===A?{light:s.default[300],main:s.default[500],dark:s.default[700]}:A,E=g.type,_=void 0===E?"light":E,C=g.contrastThreshold,P=void 0===C?3:C,j=g.tonalOffset,B=void 0===j?.2:j,J=(0,e.default)(g,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function N(r){var e=(0,c.getContrastRatio)(r,p.text.primary)>=P?p.text.primary:f.text.primary;return e}var R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=(0,r.default)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error((0,a.formatMuiErrorMessage)(4,t));if("string"!=typeof e.main)throw new Error((0,a.formatMuiErrorMessage)(5,JSON.stringify(e.main)));return h(e,"light",i,B),h(e,"dark",o,B),e.contrastText||(e.contrastText=N(e.main)),e},S={dark:p,light:f};return(0,a.deepmerge)((0,r.default)({common:t.default,type:_,primary:R(m),secondary:R(y,"A400","A200","A700"),error:R(O),warning:R(q),info:R(M),success:R(T),grey:i.default,contrastThreshold:P,getContrastText:N,augmentColor:R,tonalOffset:B},S[_]),J)}exports.dark=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@material-ui/utils":"gEhD","../colors/common":"DyYm","../colors/grey":"jh9N","../colors/indigo":"S7CI","../colors/pink":"orzA","../colors/red":"kzD0","../colors/orange":"VeQ7","../colors/blue":"qweW","../colors/green":"fqHu","./colorManipulator":"aguB"}],"yzx2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=l;var e=o(require("@babel/runtime/helpers/esm/extends")),t=o(require("@babel/runtime/helpers/esm/objectWithoutProperties")),i=require("@material-ui/utils");function o(e){return e&&e.__esModule?e:{default:e}}function n(e){return Math.round(1e5*e)/1e5}var r={textTransform:"uppercase"},u='"Roboto", "Helvetica", "Arial", sans-serif';function l(o,l){var a="function"==typeof l?l(o):l,f=a.fontFamily,h=void 0===f?u:f,d=a.fontSize,g=void 0===d?14:d,m=a.fontWeightLight,s=void 0===m?300:m,c=a.fontWeightRegular,p=void 0===c?400:c,v=a.fontWeightMedium,W=void 0===v?500:v,b=a.fontWeightBold,y=void 0===b?700:b,S=a.htmlFontSize,x=void 0===S?16:S,z=a.allVariants,F=a.pxToRem,R=(0,t.default)(a,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var M=g/14,T=F||function(e){return"".concat(e/x*M,"rem")},_=function(t,i,o,r,l){return(0,e.default)({fontFamily:h,fontWeight:t,fontSize:T(i),lineHeight:o},h===u?{letterSpacing:"".concat(n(r/i),"em")}:{},l,z)},q={h1:_(s,96,1.167,-1.5),h2:_(s,60,1.2,-.5),h3:_(p,48,1.167,0),h4:_(p,34,1.235,.25),h5:_(p,24,1.334,0),h6:_(W,20,1.6,.15),subtitle1:_(p,16,1.75,.15),subtitle2:_(W,14,1.57,.1),body1:_(p,16,1.5,.15),body2:_(p,14,1.43,.15),button:_(W,14,1.75,.4,r),caption:_(p,12,1.66,.4),overline:_(p,12,2.66,1,r)};return(0,i.deepmerge)((0,e.default)({htmlFontSize:x,pxToRem:T,round:n,fontFamily:h,fontSize:g,fontWeightLight:s,fontWeightRegular:p,fontWeightMedium:W,fontWeightBold:y},q),R,{clone:!1})}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@material-ui/utils":"gEhD"}],"GVmz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=.2,o=.14,n=.12;function c(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(t,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(o,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(n,")")].join(",")}var e=["none",c(0,2,1,-1,0,1,1,0,0,1,3,0),c(0,3,1,-2,0,2,2,0,0,1,5,0),c(0,3,3,-2,0,3,4,0,0,1,8,0),c(0,2,4,-1,0,4,5,0,0,1,10,0),c(0,3,5,-1,0,5,8,0,0,1,14,0),c(0,3,5,-1,0,6,10,0,0,1,18,0),c(0,4,5,-2,0,7,10,1,0,2,16,1),c(0,5,5,-3,0,8,10,1,0,3,14,2),c(0,5,6,-3,0,9,12,1,0,3,16,2),c(0,6,6,-3,0,10,14,1,0,4,18,3),c(0,6,7,-4,0,11,15,1,0,4,20,3),c(0,7,8,-4,0,12,17,2,0,5,22,4),c(0,7,8,-4,0,13,19,2,0,5,24,4),c(0,7,9,-4,0,14,21,2,0,5,26,4),c(0,8,9,-5,0,15,22,2,0,6,28,5),c(0,8,10,-5,0,16,24,2,0,6,30,5),c(0,8,11,-5,0,17,26,2,0,6,32,5),c(0,9,11,-5,0,18,28,2,0,7,34,6),c(0,9,12,-6,0,19,29,2,0,7,36,6),c(0,10,13,-6,0,20,31,3,0,8,38,7),c(0,10,13,-6,0,21,33,3,0,8,40,7),c(0,10,14,-6,0,22,35,3,0,8,42,7),c(0,11,14,-7,0,23,36,3,0,9,44,8),c(0,11,15,-7,0,24,38,3,0,9,46,8)],a=e;exports.default=a;
},{}],"PrAq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={borderRadius:4},r=e;exports.default=r;
},{}],"JaBn":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("prop-types"));function r(e){return e&&e.__esModule?e:{default:e}}var t={},u=t;exports.default=u;
},{"prop-types":"D9Od"}],"rI22":[function(require,module,exports) {
"use strict";function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"vw6u":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;var e=r(require("./arrayLikeToArray.js"));function r(e){return e&&e.__esModule?e:{default:e}}function t(r){if(Array.isArray(r))return(0,e.default)(r)}
},{"./arrayLikeToArray.js":"rI22"}],"bG0g":[function(require,module,exports) {
"use strict";function e(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"AOxl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;var e=r(require("./arrayLikeToArray.js"));function r(e){return e&&e.__esModule?e:{default:e}}function t(r,t){if(r){if("string"==typeof r)return(0,e.default)(r,t);var o=Object.prototype.toString.call(r).slice(8,-1);return"Object"===o&&r.constructor&&(o=r.constructor.name),"Map"===o||"Set"===o?Array.from(r):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?(0,e.default)(r,t):void 0}}
},{"./arrayLikeToArray.js":"rI22"}],"gdEH":[function(require,module,exports) {
"use strict";function e(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"Qv3s":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=l;var e=a(require("./arrayWithoutHoles.js")),r=a(require("./iterableToArray.js")),t=a(require("./unsupportedIterableToArray.js")),u=a(require("./nonIterableSpread.js"));function a(e){return e&&e.__esModule?e:{default:e}}function l(a){return(0,e.default)(a)||(0,r.default)(a)||(0,t.default)(a)||(0,u.default)()}
},{"./arrayWithoutHoles.js":"vw6u","./iterableToArray.js":"bG0g","./unsupportedIterableToArray.js":"AOxl","./nonIterableSpread.js":"gdEH"}],"dSnu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@material-ui/utils");function r(r,t){return t?(0,e.deepmerge)(r,t,{clone:!1}):r}var t=r;exports.default=t;
},{"@material-ui/utils":"gEhD"}],"kSXV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.handleBreakpoints=o,exports.default=void 0;var e=s(require("@babel/runtime/helpers/esm/toConsumableArray")),r=s(require("@babel/runtime/helpers/esm/extends")),t=s(require("@babel/runtime/helpers/esm/typeof")),u=s(require("prop-types")),n=s(require("./merge"));function s(e){return e&&e.__esModule?e:{default:e}}var i={xs:0,sm:600,md:960,lg:1280,xl:1920},a={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(i[e],"px)")}};function o(e,r,u){if(Array.isArray(r)){var n=e.theme.breakpoints||a;return r.reduce(function(e,t,s){return e[n.up(n.keys[s])]=u(r[s]),e},{})}if("object"===(0,t.default)(r)){var s=e.theme.breakpoints||a;return Object.keys(r).reduce(function(e,t){return e[s.up(t)]=u(r[t]),e},{})}return u(r)}function l(t){var u=function(e){var u=t(e),s=e.theme.breakpoints||a,i=s.keys.reduce(function(u,n){return e[n]&&((u=u||{})[s.up(n)]=t((0,r.default)({theme:e.theme},e[n]))),u},null);return(0,n.default)(u,i)};return u.propTypes={},u.filterProps=["xs","sm","md","lg","xl"].concat((0,e.default)(t.filterProps)),u}var p=l;exports.default=p;
},{"@babel/runtime/helpers/esm/toConsumableArray":"Qv3s","@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/typeof":"xLw6","prop-types":"D9Od","./merge":"dSnu"}],"iFb1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("@babel/runtime/helpers/esm/defineProperty")),r=n(require("./responsivePropType")),t=require("./breakpoints");function n(e){return e&&e.__esModule?e:{default:e}}function u(e,r){return r&&"string"==typeof r?r.split(".").reduce(function(e,r){return e&&e[r]?e[r]:null},e):null}function o(r){var n=r.prop,o=r.cssProperty,i=void 0===o?r.prop:o,p=r.themeKey,s=r.transform,l=function(r){if(null==r[n])return null;var o=r[n],l=u(r.theme,p)||{};return(0,t.handleBreakpoints)(r,o,function(r){var t;return"function"==typeof l?t=l(r):Array.isArray(l)?t=l[r]||r:(t=u(l,r)||r,s&&(t=s(t))),!1===i?t:(0,e.default)({},i,t)})};return l.propTypes={},l.filterProps=[n],l}var i=o;exports.default=i;
},{"@babel/runtime/helpers/esm/defineProperty":"gpd2","./responsivePropType":"JaBn","./breakpoints":"kSXV"}],"pkNw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("@babel/runtime/helpers/esm/extends")),r=t(require("./merge"));function t(e){return e&&e.__esModule?e:{default:e}}function u(){for(var e=arguments.length,t=new Array(e),u=0;u<e;u++)t[u]=arguments[u];var n=function(e){return t.reduce(function(t,u){var n=u(e);return n?(0,r.default)(t,n):t},{})};return n.propTypes={},n.filterProps=t.reduce(function(e,r){return e.concat(r.filterProps)},[]),n}var n=u;exports.default=n;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","./merge":"dSnu"}],"E7AN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.borderRadius=exports.borderColor=exports.borderLeft=exports.borderBottom=exports.borderRight=exports.borderTop=exports.border=void 0;var r=o(require("./style")),e=o(require("./compose"));function o(r){return r&&r.__esModule?r:{default:r}}function t(r){return"number"!=typeof r?r:"".concat(r,"px solid")}var d=(0,r.default)({prop:"border",themeKey:"borders",transform:t});exports.border=d;var p=(0,r.default)({prop:"borderTop",themeKey:"borders",transform:t});exports.borderTop=p;var s=(0,r.default)({prop:"borderRight",themeKey:"borders",transform:t});exports.borderRight=s;var a=(0,r.default)({prop:"borderBottom",themeKey:"borders",transform:t});exports.borderBottom=a;var b=(0,r.default)({prop:"borderLeft",themeKey:"borders",transform:t});exports.borderLeft=b;var u=(0,r.default)({prop:"borderColor",themeKey:"palette"});exports.borderColor=u;var f=(0,r.default)({prop:"borderRadius",themeKey:"shape"});exports.borderRadius=f;var l=(0,e.default)(d,p,s,a,b,u,f),x=l;exports.default=x;
},{"./style":"iFb1","./compose":"pkNw"}],"i9py":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("@babel/runtime/helpers/esm/toConsumableArray")),r=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("prop-types")),s=u(require("./merge"));function u(e){return e&&e.__esModule?e:{default:e}}function n(e,r){var t={};return Object.keys(e).forEach(function(s){-1===r.indexOf(s)&&(t[s]=e[s])}),t}function o(t){var u=function(e){var u=t(e);return e.css?(0,r.default)({},(0,s.default)(u,t((0,r.default)({theme:e.theme},e.css))),n(e.css,[t.filterProps])):u};return u.propTypes={},u.filterProps=["css"].concat((0,e.default)(t.filterProps)),u}var a=o;exports.default=a;
},{"@babel/runtime/helpers/esm/toConsumableArray":"Qv3s","@babel/runtime/helpers/esm/extends":"SpjQ","prop-types":"D9Od","./merge":"dSnu"}],"j394":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.whiteSpace=exports.visibility=exports.textOverflow=exports.overflow=exports.displayRaw=exports.displayPrint=void 0;var e=t(require("./style")),r=t(require("./compose"));function t(e){return e&&e.__esModule?e:{default:e}}var p=(0,e.default)({prop:"displayPrint",cssProperty:!1,transform:function(e){return{"@media print":{display:e}}}});exports.displayPrint=p;var o=(0,e.default)({prop:"display"});exports.displayRaw=o;var i=(0,e.default)({prop:"overflow"});exports.overflow=i;var s=(0,e.default)({prop:"textOverflow"});exports.textOverflow=s;var a=(0,e.default)({prop:"visibility"});exports.visibility=a;var l=(0,e.default)({prop:"whiteSpace"});exports.whiteSpace=l;var d=(0,r.default)(p,o,i,s,a,l);exports.default=d;
},{"./style":"iFb1","./compose":"pkNw"}],"VMZZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.justifySelf=exports.justifyItems=exports.alignSelf=exports.flexShrink=exports.flexGrow=exports.flex=exports.order=exports.alignContent=exports.alignItems=exports.justifyContent=exports.flexWrap=exports.flexDirection=exports.flexBasis=void 0;var e=t(require("./style")),r=t(require("./compose"));function t(e){return e&&e.__esModule?e:{default:e}}var o=(0,e.default)({prop:"flexBasis"});exports.flexBasis=o;var p=(0,e.default)({prop:"flexDirection"});exports.flexDirection=p;var s=(0,e.default)({prop:"flexWrap"});exports.flexWrap=s;var l=(0,e.default)({prop:"justifyContent"});exports.justifyContent=l;var f=(0,e.default)({prop:"alignItems"});exports.alignItems=f;var a=(0,e.default)({prop:"alignContent"});exports.alignContent=a;var x=(0,e.default)({prop:"order"});exports.order=x;var i=(0,e.default)({prop:"flex"});exports.flex=i;var u=(0,e.default)({prop:"flexGrow"});exports.flexGrow=u;var n=(0,e.default)({prop:"flexShrink"});exports.flexShrink=n;var d=(0,e.default)({prop:"alignSelf"});exports.alignSelf=d;var v=(0,e.default)({prop:"justifyItems"});exports.justifyItems=v;var y=(0,e.default)({prop:"justifySelf"});exports.justifySelf=y;var j=(0,r.default)(o,p,s,l,f,a,x,i,u,n,d,v,y),g=j;exports.default=g;
},{"./style":"iFb1","./compose":"pkNw"}],"jNmX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.gridArea=exports.gridTemplateAreas=exports.gridTemplateRows=exports.gridTemplateColumns=exports.gridAutoRows=exports.gridAutoColumns=exports.gridAutoFlow=exports.gridRow=exports.gridColumn=exports.gridRowGap=exports.gridColumnGap=exports.gridGap=void 0;var r=o(require("./style")),e=o(require("./compose"));function o(r){return r&&r.__esModule?r:{default:r}}var p=(0,r.default)({prop:"gridGap"});exports.gridGap=p;var t=(0,r.default)({prop:"gridColumnGap"});exports.gridColumnGap=t;var d=(0,r.default)({prop:"gridRowGap"});exports.gridRowGap=d;var a=(0,r.default)({prop:"gridColumn"});exports.gridColumn=a;var s=(0,r.default)({prop:"gridRow"});exports.gridRow=s;var u=(0,r.default)({prop:"gridAutoFlow"});exports.gridAutoFlow=u;var l=(0,r.default)({prop:"gridAutoColumns"});exports.gridAutoColumns=l;var i=(0,r.default)({prop:"gridAutoRows"});exports.gridAutoRows=i;var g=(0,r.default)({prop:"gridTemplateColumns"});exports.gridTemplateColumns=g;var x=(0,r.default)({prop:"gridTemplateRows"});exports.gridTemplateRows=x;var m=(0,r.default)({prop:"gridTemplateAreas"});exports.gridTemplateAreas=m;var f=(0,r.default)({prop:"gridArea"});exports.gridArea=f;var n=(0,e.default)(p,t,d,a,s,u,l,i,g,x,m,f),v=n;exports.default=v;
},{"./style":"iFb1","./compose":"pkNw"}],"jxxN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.bgcolor=exports.color=void 0;var e=r(require("./style")),o=r(require("./compose"));function r(e){return e&&e.__esModule?e:{default:e}}var t=(0,e.default)({prop:"color",themeKey:"palette"});exports.color=t;var l=(0,e.default)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"});exports.bgcolor=l;var p=(0,o.default)(t,l),s=p;exports.default=s;
},{"./style":"iFb1","./compose":"pkNw"}],"FocN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.left=exports.bottom=exports.right=exports.top=exports.zIndex=exports.position=void 0;var e=o(require("./style")),t=o(require("./compose"));function o(e){return e&&e.__esModule?e:{default:e}}var r=(0,e.default)({prop:"position"});exports.position=r;var p=(0,e.default)({prop:"zIndex",themeKey:"zIndex"});exports.zIndex=p;var s=(0,e.default)({prop:"top"});exports.top=s;var a=(0,e.default)({prop:"right"});exports.right=a;var x=(0,e.default)({prop:"bottom"});exports.bottom=x;var d=(0,e.default)({prop:"left"});exports.left=d;var u=(0,t.default)(r,p,s,a,x,d);exports.default=u;
},{"./style":"iFb1","./compose":"pkNw"}],"MG42":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./style"));function t(e){return e&&e.__esModule?e:{default:e}}var r=(0,e.default)({prop:"boxShadow",themeKey:"shadows"}),o=r;exports.default=o;
},{"./style":"iFb1"}],"hLv4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.boxSizing=exports.sizeHeight=exports.sizeWidth=exports.minHeight=exports.maxHeight=exports.height=exports.minWidth=exports.maxWidth=exports.width=void 0;var t=r(require("./style")),e=r(require("./compose"));function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return t<=1?"".concat(100*t,"%"):t}var i=(0,t.default)({prop:"width",transform:o});exports.width=i;var s=(0,t.default)({prop:"maxWidth",transform:o});exports.maxWidth=s;var p=(0,t.default)({prop:"minWidth",transform:o});exports.minWidth=p;var a=(0,t.default)({prop:"height",transform:o});exports.height=a;var x=(0,t.default)({prop:"maxHeight",transform:o});exports.maxHeight=x;var d=(0,t.default)({prop:"minHeight",transform:o});exports.minHeight=d;var h=(0,t.default)({prop:"size",cssProperty:"width",transform:o});exports.sizeWidth=h;var n=(0,t.default)({prop:"size",cssProperty:"height",transform:o});exports.sizeHeight=n;var f=(0,t.default)({prop:"boxSizing"});exports.boxSizing=f;var u=(0,e.default)(i,s,p,a,x,d,f),m=u;exports.default=m;
},{"./style":"iFb1","./compose":"pkNw"}],"EbiA":[function(require,module,exports) {
"use strict";function e(e){if(Array.isArray(e))return e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"GS78":[function(require,module,exports) {
"use strict";function e(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,l=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(a){o=!0,l=a}finally{try{n||null==u.return||u.return()}finally{if(o)throw l}}return r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"Kh3j":[function(require,module,exports) {
"use strict";function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"T12H":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=l;var e=a(require("./arrayWithHoles.js")),r=a(require("./iterableToArrayLimit.js")),t=a(require("./unsupportedIterableToArray.js")),u=a(require("./nonIterableRest.js"));function a(e){return e&&e.__esModule?e:{default:e}}function l(a,l){return(0,e.default)(a)||(0,r.default)(a,l)||(0,t.default)(a,l)||(0,u.default)()}
},{"./arrayWithHoles.js":"EbiA","./iterableToArrayLimit.js":"GS78","./unsupportedIterableToArray.js":"AOxl","./nonIterableRest.js":"Kh3j"}],"O7l5":[function(require,module,exports) {
"use strict";function e(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"dhWo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createUnarySpacing=m,exports.default=void 0;var r=a(require("@babel/runtime/helpers/esm/slicedToArray")),e=a(require("./responsivePropType")),n=require("./breakpoints"),t=a(require("./merge")),i=a(require("./memoize"));function a(r){return r&&r.__esModule?r:{default:r}}var u={m:"margin",p:"padding"},p={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},o={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},d=(0,i.default)(function(e){if(e.length>2){if(!o[e])return[e];e=o[e]}var n=e.split(""),t=(0,r.default)(n,2),i=t[0],a=t[1],d=u[i],f=p[a]||"";return Array.isArray(f)?f.map(function(r){return d+r}):[d+f]}),f=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function m(r){var e=r.spacing||8;return"number"==typeof e?function(r){return e*r}:Array.isArray(e)?function(r){return e[r]}:"function"==typeof e?e:function(){}}function g(r,e){if("string"==typeof e||null==e)return e;var n=r(Math.abs(e));return e>=0?n:"number"==typeof n?-n:"-".concat(n)}function c(r,e){return function(n){return r.reduce(function(r,t){return r[t]=g(e,n),r},{})}}function s(r){var e=m(r.theme);return Object.keys(r).map(function(t){if(-1===f.indexOf(t))return null;var i=c(d(t),e),a=r[t];return(0,n.handleBreakpoints)(r,a,i)}).reduce(t.default,{})}s.propTypes={},s.filterProps=f;var l=s;exports.default=l;
},{"@babel/runtime/helpers/esm/slicedToArray":"T12H","./responsivePropType":"JaBn","./breakpoints":"kSXV","./merge":"dSnu","./memoize":"O7l5"}],"sdXr":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.textAlign=exports.lineHeight=exports.letterSpacing=exports.fontWeight=exports.fontStyle=exports.fontSize=exports.fontFamily=void 0;var e=r(require("./style")),t=r(require("./compose"));function r(e){return e&&e.__esModule?e:{default:e}}var o=(0,e.default)({prop:"fontFamily",themeKey:"typography"});exports.fontFamily=o;var p=(0,e.default)({prop:"fontSize",themeKey:"typography"});exports.fontSize=p;var a=(0,e.default)({prop:"fontStyle",themeKey:"typography"});exports.fontStyle=a;var l=(0,e.default)({prop:"fontWeight",themeKey:"typography"});exports.fontWeight=l;var i=(0,e.default)({prop:"letterSpacing"});exports.letterSpacing=i;var f=(0,e.default)({prop:"lineHeight"});exports.lineHeight=f;var n=(0,e.default)({prop:"textAlign"});exports.textAlign=n;var s=(0,t.default)(o,p,a,l,i,f,n),x=s;exports.default=x;
},{"./style":"iFb1","./compose":"pkNw"}],"rbKt":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={borders:!0,breakpoints:!0,compose:!0,css:!0,display:!0,flexbox:!0,grid:!0,palette:!0,positions:!0,shadows:!0,sizing:!0,spacing:!0,style:!0,typography:!0};Object.defineProperty(exports,"borders",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"breakpoints",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"compose",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"css",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"display",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"flexbox",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"grid",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"palette",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"positions",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"shadows",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"sizing",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"spacing",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"style",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(exports,"typography",{enumerable:!0,get:function(){return d.default}});var t=j(require("./borders"));Object.keys(t).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||r in exports&&exports[r]===t[r]||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return t[r]}}))});var r=y(require("./breakpoints")),n=y(require("./compose")),o=y(require("./css")),u=y(require("./display")),p=j(require("./flexbox"));Object.keys(p).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===p[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return p[t]}}))});var i=j(require("./grid"));Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===i[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return i[t]}}))});var s=j(require("./palette"));Object.keys(s).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===s[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return s[t]}}))});var a=j(require("./positions"));Object.keys(a).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===a[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return a[t]}}))});var c=y(require("./shadows")),f=j(require("./sizing"));Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===f[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return f[t]}}))});var l=j(require("./spacing"));Object.keys(l).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===l[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return l[t]}}))});var b=y(require("./style")),d=j(require("./typography"));function y(e){return e&&e.__esModule?e:{default:e}}function O(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return O=function(){return e},e}function j(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=O();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}Object.keys(d).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===d[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return d[t]}}))});
},{"./borders":"E7AN","./breakpoints":"kSXV","./compose":"pkNw","./css":"i9py","./display":"j394","./flexbox":"VMZZ","./grid":"jNmX","./palette":"jxxN","./positions":"FocN","./shadows":"MG42","./sizing":"hLv4","./spacing":"dhWo","./style":"iFb1","./typography":"sdXr"}],"njM4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;var e,r=require("@material-ui/system");function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=(0,r.createUnarySpacing)({spacing:e}),n=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return 0===r.length?t(1):1===r.length?t(r[0]):r.map(function(e){if("string"==typeof e)return e;var r=t(e);return"number"==typeof r?"".concat(r,"px"):r}).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}
},{"@material-ui/system":"rbKt"}],"geVf":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.duration=exports.easing=void 0;var e=t(require("@babel/runtime/helpers/esm/objectWithoutProperties"));function t(e){return e&&e.__esModule?e:{default:e}}var r={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"};exports.easing=r;var n={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(e){return"".concat(Math.round(e),"ms")}exports.duration=n;var o={easing:r,duration:n,create:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.duration,u=void 0===i?n.standard:i,s=o.easing,c=void 0===s?r.easeInOut:s,d=o.delay,l=void 0===d?0:d;(0,e.default)(o,["duration","easing","delay"]);return(Array.isArray(t)?t:[t]).map(function(e){return"".concat(e," ").concat("string"==typeof u?u:a(u)," ").concat(c," ").concat("string"==typeof l?l:a(l))}).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}};exports.default=o;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH"}],"ROtz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},r=e;exports.default=r;
},{}],"p8oh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=f(require("@babel/runtime/helpers/esm/defineProperty")),r=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=require("@material-ui/utils"),i=f(require("./createBreakpoints")),a=f(require("./createMixins")),u=f(require("./createPalette")),s=f(require("./createTypography")),n=f(require("./shadows")),o=f(require("./shape")),p=f(require("./createSpacing")),d=f(require("./transitions")),l=f(require("./zIndex"));function f(e){return e&&e.__esModule?e:{default:e}}function c(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},f=e.breakpoints,c=void 0===f?{}:f,h=e.mixins,g=void 0===h?{}:h,q=e.palette,v=void 0===q?{}:q,y=e.spacing,m=e.typography,b=void 0===m?{}:m,x=(0,r.default)(e,["breakpoints","mixins","palette","spacing","typography"]),k=(0,u.default)(v),P=(0,i.default)(c),_=(0,p.default)(y),w=(0,t.deepmerge)({breakpoints:P,direction:"ltr",mixins:(0,a.default)(P,_,g),overrides:{},palette:k,props:{},shadows:n.default,typography:(0,s.default)(k,b),spacing:_,shape:o.default,transitions:d.default,zIndex:l.default},x),M=arguments.length,j=new Array(M>1?M-1:0),z=1;z<M;z++)j[z-1]=arguments[z];return w=j.reduce(function(e,r){return(0,t.deepmerge)(e,r)},w)}var h=c;exports.default=h;
},{"@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@material-ui/utils":"gEhD","./createBreakpoints":"GWqs","./createMixins":"OYhe","./createPalette":"LGnM","./createTypography":"yzx2","./shadows":"GVmz","./shape":"PrAq","./createSpacing":"njM4","./transitions":"geVf","./zIndex":"ROtz"}],"U5fh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=require("@material-ui/utils"),r=t(require("./createMuiTheme"));function t(e){return e&&e.__esModule?e:{default:e}}function u(t){for(var u=arguments.length,a=new Array(u>1?u-1:0),i=1;i<u;i++)a[i-1]=arguments[i];return r.default.apply(void 0,[(0,e.deepmerge)({unstable_strictMode:!0},t)].concat(a))}
},{"@material-ui/utils":"gEhD","./createMuiTheme":"p8oh"}],"jllt":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e="function"==typeof Symbol&&Symbol.for,o=e?Symbol.for("mui.nested"):"__THEME_NESTED__";exports.default=o;
},{}],"HhHq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=o;var e=t(require("../ThemeProvider/nested"));function t(e){return e&&e.__esModule?e:{default:e}}var n=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.disableGlobal,r=void 0!==o&&o,c=t.productionPrefix,i=void 0===c?"jss":c,d=t.seed,a=void 0===d?"":d,u=""===a?"":"".concat(a,"-"),s=0,f=function(){return s+=1};return function(t,o){var c=o.options.name;if(c&&0===c.indexOf("Mui")&&!o.options.link&&!r){if(-1!==n.indexOf(t.key))return"Mui-".concat(t.key);var d="".concat(u).concat(c,"-").concat(t.key);return o.options.theme[e.default]&&""===a?"".concat(d,"-").concat(f()):d}return"".concat(u).concat(i).concat(f())}}
},{"../ThemeProvider/nested":"jllt"}],"SeWB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./createGenerateClassName"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./createGenerateClassName":"HhHq"}],"ZzVx":[function(require,module,exports) {
"use strict";function e(e){return e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"jLuc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./createStyles"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./createStyles":"ZzVx"}],"HZrr":[function(require,module,exports) {
"use strict";function e(e){var r=e.theme,o=e.name,p=e.props;if(!r||!r.props||!r.props[o])return p;var t,s=r.props[o];for(t in s)void 0===p[t]&&(p[t]=s[t]);return p}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"D8yE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./getThemeProps"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./getThemeProps":"HZrr"}],"sIbj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=!0;function r(r,t){if(!e){if(r)return;var o="Warning: "+t;"undefined"!=typeof console&&console.warn(o);try{throw Error(o)}catch(n){}}}var t=r;exports.default=t;
},{}],"QDke":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.isBrowser=void 0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o="object"===("undefined"==typeof window?"undefined":e(window))&&"object"===("undefined"==typeof document?"undefined":e(document))&&9===document.nodeType;exports.isBrowser=o;var t=o;exports.default=t;
},{}],"l5p4":[function(require,module,exports) {
"use strict";function e(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(r,t,n){return t&&e(r.prototype,t),n&&e(r,n),r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=r;
},{}],"hewo":[function(require,module,exports) {
"use strict";function e(t,r){return exports.default=e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e(t,r)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"S11h":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=o;var e=t(require("./setPrototypeOf.js"));function t(e){return e&&e.__esModule?e:{default:e}}function o(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,(0,e.default)(t,o)}
},{"./setPrototypeOf.js":"hewo"}],"bk0i":[function(require,module,exports) {
"use strict";function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"buqW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createRule=l,exports.getDynamicStyles=Se,exports.toCssValue=exports.sheets=exports.hasCSSTOMSupport=exports.createGenerateId=exports.create=exports.SheetsRegistry=exports.SheetsManager=exports.RuleList=exports.default=void 0;var e=a(require("@babel/runtime/helpers/esm/extends")),t=a(require("is-in-browser")),r=a(require("tiny-warning")),n=a(require("@babel/runtime/helpers/esm/createClass")),i=a(require("@babel/runtime/helpers/esm/inheritsLoose")),s=a(require("@babel/runtime/helpers/esm/assertThisInitialized")),o=a(require("@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"));function a(e){return e&&e.__esModule?e:{default:e}}var u={}.constructor;function h(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(h);if(e.constructor!==u)return e;var t={};for(var r in e)t[r]=h(e[r]);return t}function l(e,t,r){void 0===e&&(e="unnamed");var n=r.jss,i=h(t),s=n.plugins.onCreateRule(e,i,r);return s||(e[0],null)}var d=function(e,t){for(var r="",n=0;n<e.length&&"!important"!==e[n];n++)r&&(r+=t),r+=e[n];return r},c=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))return e;var r="";if(Array.isArray(e[0]))for(var n=0;n<e.length&&"!important"!==e[n];n++)r&&(r+=", "),r+=d(e[n]," ");else r=d(e,", ");return t||"!important"!==e[e.length-1]||(r+=" !important"),r};function f(e,t){for(var r="",n=0;n<t;n++)r+="  ";return r+e}function p(e,t,r){void 0===r&&(r={});var n="";if(!t)return n;var i=r.indent,s=void 0===i?0:i,o=t.fallbacks;if(e&&s++,o)if(Array.isArray(o))for(var a=0;a<o.length;a++){var u=o[a];for(var h in u){var l=u[h];null!=l&&(n&&(n+="\n"),n+=""+f(h+": "+c(l)+";",s))}}else for(var d in o){var p=o[d];null!=p&&(n&&(n+="\n"),n+=""+f(d+": "+c(p)+";",s))}for(var v in t){var y=t[v];null!=y&&"fallbacks"!==v&&(n&&(n+="\n"),n+=""+f(v+": "+c(y)+";",s))}return(n||r.allowEmpty)&&e?(n&&(n="\n"+n+"\n"),f(e+" {"+n,--s)+f("}",s)):n}exports.toCssValue=c;var v=/([[\].#*$><+~=|^:(),"'`\s])/g,y="undefined"!=typeof CSS&&CSS.escape,g=function(e){return y?y(e):e.replace(v,"\\$1")},m=function(){function e(e,t,r){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var n=r.sheet,i=r.Renderer;this.key=e,this.options=r,this.style=t,n?this.renderer=n.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,r){if(void 0===t)return this.style[e];var n=!!r&&r.force;if(!n&&this.style[e]===t)return this;var i=t;r&&!1===r.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var s=null==i||!1===i,o=e in this.style;if(s&&!o&&!n)return this;var a=s&&o;if(a?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return a?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var u=this.options.sheet;return u&&u.attached,this},e}(),R=function(t){function r(e,r,n){var i;(i=t.call(this,e,r,n)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var o=n.selector,a=n.scoped,u=n.sheet,h=n.generateId;return o?i.selectorText=o:!1!==a&&(i.id=h((0,s.default)((0,s.default)(i)),u),i.selectorText="."+g(i.id)),i}(0,i.default)(r,t);var o=r.prototype;return o.applyTo=function(e){var t=this.renderer;if(t){var r=this.toJSON();for(var n in r)t.setProperty(e,n,r[n])}return this},o.toJSON=function(){var e={};for(var t in this.style){var r=this.style[t];"object"!=typeof r?e[t]=r:Array.isArray(r)&&(e[t]=c(r))}return e},o.toString=function(t){var r=this.options.sheet,n=!!r&&r.options.link?(0,e.default)({},t,{allowEmpty:!0}):t;return p(this.selectorText,this.style,n)},(0,n.default)(r,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,r=this.renderable;if(r&&t)t.setSelector(r,e)||t.replaceRule(r,this)}},get:function(){return this.selectorText}}]),r}(m),x={onCreateRule:function(e,t,r){return"@"===e[0]||r.parent&&"keyframes"===r.parent.type?null:new R(e,t,r)}},S={indent:1,children:!0},b=/@([\w-]+)/,k=function(){function t(t,r,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t;var i=t.match(b);for(var s in this.at=i?i[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new F((0,e.default)({},n,{parent:this})),r)this.rules.add(s,r[s]);this.rules.process()}var r=t.prototype;return r.getRule=function(e){return this.rules.get(e)},r.indexOf=function(e){return this.rules.indexOf(e)},r.addRule=function(e,t,r){var n=this.rules.add(e,t,r);return n?(this.options.jss.plugins.onProcessRule(n),n):null},r.toString=function(e){if(void 0===e&&(e=S),null==e.indent&&(e.indent=S.indent),null==e.children&&(e.children=S.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},t}(),P=/@media|@supports\s+/,w={onCreateRule:function(e,t,r){return P.test(e)?new k(e,t,r):null}},C={indent:1,children:!0},A=/@keyframes\s+([\w-]+)/,I=function(){function t(t,r,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=t.match(A);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var s=n.scoped,o=n.sheet,a=n.generateId;for(var u in this.id=!1===s?this.name:g(a(this,o)),this.rules=new F((0,e.default)({},n,{parent:this})),r)this.rules.add(u,r[u],(0,e.default)({},n,{parent:this}));this.rules.process()}return t.prototype.toString=function(e){if(void 0===e&&(e=C),null==e.indent&&(e.indent=C.indent),null==e.children&&(e.children=C.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},t}(),O=/@keyframes\s+/,q=/\$([\w-]+)/g,j=function(e,t){return"string"==typeof e?e.replace(q,function(e,r){return r in t?t[r]:e}):e},M=function(e,t,r){var n=e[t],i=j(n,r);i!==n&&(e[t]=i)},T={onCreateRule:function(e,t,r){return"string"==typeof e&&O.test(e)?new I(e,t,r):null},onProcessStyle:function(e,t,r){return"style"===t.type&&r?("animation-name"in e&&M(e,"animation-name",r.keyframes),"animation"in e&&M(e,"animation",r.keyframes),e):e},onChangeValue:function(e,t,r){var n=r.options.sheet;if(!n)return e;switch(t){case"animation":case"animation-name":return j(e,n.keyframes);default:return e}}},N=function(t){function r(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).renderable=void 0,e}return(0,i.default)(r,t),r.prototype.toString=function(t){var r=this.options.sheet,n=!!r&&r.options.link?(0,e.default)({},t,{allowEmpty:!0}):t;return p(this.key,this.style,n)},r}(m),V={onCreateRule:function(e,t,r){return r.parent&&"keyframes"===r.parent.type?new N(e,t,r):null}},G=function(){function e(e,t,r){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=r}return e.prototype.toString=function(e){if(Array.isArray(this.style)){for(var t="",r=0;r<this.style.length;r++)t+=p(this.at,this.style[r]),this.style[r+1]&&(t+="\n");return t}return p(this.at,this.style,e)},e}(),E=/@font-face/,U={onCreateRule:function(e,t,r){return E.test(e)?new G(e,t,r):null}},L=function(){function e(e,t,r){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=r}return e.prototype.toString=function(e){return p(this.key,this.style,e)},e}(),_={onCreateRule:function(e,t,r){return"@viewport"===e||"@-ms-viewport"===e?new L(e,t,r):null}},B=function(){function e(e,t,r){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.value=t,this.options=r}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",r=0;r<this.value.length;r++)t+=this.key+" "+this.value[r]+";",this.value[r+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),J={"@charset":!0,"@import":!0,"@namespace":!0},$={onCreateRule:function(e,t,r){return e in J?new B(e,t,r):null}},z=[x,w,T,V,U,_,$],W={process:!0},D={force:!0,process:!0},F=function(){function t(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var r=t.prototype;return r.add=function(t,r,n){var i=this.options,s=i.parent,o=i.sheet,a=i.jss,u=i.Renderer,h=i.generateId,d=i.scoped,c=(0,e.default)({classes:this.classes,parent:s,sheet:o,jss:a,Renderer:u,generateId:h,scoped:d,name:t,keyframes:this.keyframes,selector:void 0},n),f=t;t in this.raw&&(f=t+"-d"+this.counter++),this.raw[f]=r,f in this.classes&&(c.selector="."+g(this.classes[f]));var p=l(f,r,c);if(!p)return null;this.register(p);var v=void 0===c.index?this.index.length:c.index;return this.index.splice(v,0,p),p},r.get=function(e){return this.map[e]},r.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},r.indexOf=function(e){return this.index.indexOf(e)},r.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},r.register=function(e){this.map[e.key]=e,e instanceof R?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof I&&this.keyframes&&(this.keyframes[e.name]=e.id)},r.unregister=function(e){delete this.map[e.key],e instanceof R?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof I&&delete this.keyframes[e.name]},r.update=function(){var e,t,r;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.map[e],t,r);else for(var n=0;n<this.index.length;n++)this.updateOne(this.index[n],t,r)},r.updateOne=function(e,r,n){void 0===n&&(n=W);var i=this.options,s=i.jss.plugins,o=i.sheet;if(e.rules instanceof t)e.rules.update(r,n);else{var a=e,u=a.style;if(s.onUpdate(r,e,o,n),n.process&&u&&u!==a.style){for(var h in s.onProcessStyle(a.style,a,o),a.style){var l=a.style[h];l!==u[h]&&a.prop(h,l,D)}for(var d in u){var c=a.style[d],f=u[d];null==c&&c!==f&&a.prop(d,null,D)}}}},r.toString=function(e){for(var t="",r=this.options.sheet,n=!!r&&r.options.link,i=0;i<this.index.length;i++){var s=this.index[i].toString(e);(s||n)&&(t&&(t+="\n"),t+=s)}return t},t}();exports.RuleList=F;var H=function(){function t(t,r){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=(0,e.default)({},r,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),r.Renderer&&(this.renderer=new r.Renderer(this)),this.rules=new F(this.options),t)this.rules.add(n,t[n]);this.rules.process()}var r=t.prototype;return r.attach=function(){return this.attached?this:(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy(),this)},r.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},r.addRule=function(e,t,r){var n=this.queue;this.attached&&!n&&(this.queue=[]);var i=this.rules.add(e,t,r);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(n?n.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),i):i:(this.deployed=!1,i)):null},r.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},r.addRules=function(e,t){var r=[];for(var n in e){var i=this.addRule(n,e[n],t);i&&r.push(i)}return r},r.getRule=function(e){return this.rules.get(e)},r.deleteRule=function(e){var t="object"==typeof e?e:this.rules.get(e);return!(!t||this.attached&&!t.renderable)&&(this.rules.remove(t),!(this.attached&&t.renderable&&this.renderer)||this.renderer.deleteRule(t.renderable))},r.indexOf=function(e){return this.rules.indexOf(e)},r.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},r.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},r.updateOne=function(e,t,r){return this.rules.updateOne(e,t,r),this},r.toString=function(e){return this.rules.toString(e)},t}(),K=function(){function e(){this.plugins={internal:[],external:[]},this.registry=void 0}var t=e.prototype;return t.onCreateRule=function(e,t,r){for(var n=0;n<this.registry.onCreateRule.length;n++){var i=this.registry.onCreateRule[n](e,t,r);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,r=0;r<this.registry.onProcessRule.length;r++)this.registry.onProcessRule[r](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,r){for(var n=0;n<this.registry.onProcessStyle.length;n++)t.style=this.registry.onProcessStyle[n](t.style,t,r)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,r,n){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,r,n)},t.onChangeValue=function(e,t,r){for(var n=e,i=0;i<this.registry.onChangeValue.length;i++)n=this.registry.onChangeValue[i](n,t,r);return n},t.use=function(e,t){void 0===t&&(t={queue:"external"});var r=this.plugins[t.queue];-1===r.indexOf(e)&&(r.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce(function(e,t){for(var r in t)r in e&&e[r].push(t[r]);return e},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),Q=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,r=e.options.index;if(-1===t.indexOf(e))if(0===t.length||r>=this.index)t.push(e);else for(var n=0;n<t.length;n++)if(t[n].options.index>r)return void t.splice(n,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,r=t.attached,n=(0,o.default)(t,["attached"]),i="",s=0;s<this.registry.length;s++){var a=this.registry[s];null!=r&&a.attached!==r||(i&&(i+="\n"),i+=a.toString(n))}return i},(0,n.default)(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}();exports.SheetsRegistry=Q;var X=new Q;exports.sheets=X;var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),Z="2f1acc6c3a606b082e5eef5e54414ffb";null==Y[Z]&&(Y[Z]=0);var ee=Y[Z]++,te=1e10,re=function(e){void 0===e&&(e={});var t=0;return function(r,n){t+=1;var i="",s="";return n&&(n.options.classNamePrefix&&(s=n.options.classNamePrefix),null!=n.options.jss.id&&(i=String(n.options.jss.id))),e.minify?""+(s||"c")+ee+i+t:s+r.key+"-"+ee+(i?"-"+i:"")+"-"+t}};exports.createGenerateId=re;var ne=function(e){var t;return function(){return t||(t=e()),t}},ie=function(e,t){try{return e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(r){return""}},se=function(e,t,r){try{var n=r;if(Array.isArray(r)&&(n=c(r,!0),"!important"===r[r.length-1]))return e.style.setProperty(t,n,"important"),!0;e.attributeStyleMap?e.attributeStyleMap.set(t,n):e.style.setProperty(t,n)}catch(i){return!1}return!0},oe=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(r){}},ae=function(e,t){return e.selectorText=t,e.selectorText===t},ue=ne(function(){return document.querySelector("head")});function he(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.attached&&n.options.index>t.index&&n.options.insertionPoint===t.insertionPoint)return n}return null}function le(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.attached&&n.options.insertionPoint===t.insertionPoint)return n}return null}function de(e){for(var t=ue(),r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];if(8===n.nodeType&&n.nodeValue.trim()===e)return n}return null}function ce(e){var t=X.registry;if(t.length>0){var r=he(t,e);if(r&&r.renderer)return{parent:r.renderer.element.parentNode,node:r.renderer.element};if((r=le(t,e))&&r.renderer)return{parent:r.renderer.element.parentNode,node:r.renderer.element.nextSibling}}var n=e.insertionPoint;if(n&&"string"==typeof n){var i=de(n);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function fe(e,t){var r=t.insertionPoint,n=ce(t);if(!1!==n&&n.parent)n.parent.insertBefore(e,n.node);else if(r&&"number"==typeof r.nodeType){var i=r,s=i.parentNode;s&&s.insertBefore(e,i.nextSibling)}else ue().appendChild(e)}var pe=ne(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),ve=function(e,t,r){try{if("insertRule"in e)e.insertRule(t,r);else if("appendRule"in e){e.appendRule(t)}}catch(n){return!1}return e.cssRules[r]},ye=function(e,t){var r=e.cssRules.length;return void 0===t||t>r?r:t},ge=function(){var e=document.createElement("style");return e.textContent="\n",e},me=function(){function e(e){this.getPropertyValue=ie,this.setProperty=se,this.removeProperty=oe,this.setSelector=ae,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,this.cssRules=[],e&&X.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},r=t.media,n=t.meta,i=t.element;this.element=i||ge(),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),n&&this.element.setAttribute("data-meta",n);var s=pe();s&&this.element.setAttribute("nonce",s)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){fe(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var r=0;r<e.index.length;r++)this.insertRule(e.index[r],r,t)},t.insertRule=function(e,t,r){if(void 0===r&&(r=this.element.sheet),e.rules){var n=e,i=r;if("conditional"===e.type||"keyframes"===e.type){var s=ye(r,t);if(!1===(i=ve(r,n.toString({children:!1}),s)))return!1;this.refCssRule(e,s,i)}return this.insertRules(n.rules,i),i}var o=e.toString();if(!o)return!1;var a=ye(r,t),u=ve(r,o,a);return!1!==u&&(this.hasInsertedRules=!0,this.refCssRule(e,a,u),u)},t.refCssRule=function(e,t,r){e.renderable=r,e.options.parent instanceof H&&(this.cssRules[t]=r)},t.deleteRule=function(e){var t=this.element.sheet,r=this.indexOf(e);return-1!==r&&(t.deleteRule(r),this.cssRules.splice(r,1),!0)},t.indexOf=function(e){return this.cssRules.indexOf(e)},t.replaceRule=function(e,t){var r=this.indexOf(e);return-1!==r&&(this.element.sheet.deleteRule(r),this.cssRules.splice(r,1),this.insertRule(t,r))},t.getRules=function(){return this.element.sheet.cssRules},e}(),Re=0,xe=function(){function r(e){this.id=Re++,this.version="10.6.0",this.plugins=new K,this.options={id:{minify:!1},createGenerateId:re,Renderer:t.default?me:null,plugins:[]},this.generateId=re({minify:!1});for(var r=0;r<z.length;r++)this.plugins.use(z[r],{queue:"internal"});this.setup(e)}var n=r.prototype;return n.setup=function(t){return void 0===t&&(t={}),t.createGenerateId&&(this.options.createGenerateId=t.createGenerateId),t.id&&(this.options.id=(0,e.default)({},this.options.id,t.id)),(t.createGenerateId||t.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=t.insertionPoint&&(this.options.insertionPoint=t.insertionPoint),"Renderer"in t&&(this.options.Renderer=t.Renderer),t.plugins&&this.use.apply(this,t.plugins),this},n.createStyleSheet=function(t,r){void 0===r&&(r={});var n=r.index;"number"!=typeof n&&(n=0===X.index?0:X.index+1);var i=new H(t,(0,e.default)({},r,{jss:this,generateId:r.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(i),i},n.removeStyleSheet=function(e){return e.detach(),X.remove(e),this},n.createRule=function(t,r,n){if(void 0===r&&(r={}),void 0===n&&(n={}),"object"==typeof t)return this.createRule(void 0,t,r);var i=(0,e.default)({},n,{name:t,jss:this,Renderer:this.options.Renderer});i.generateId||(i.generateId=this.generateId),i.classes||(i.classes={}),i.keyframes||(i.keyframes={});var s=l(t,r,i);return s&&this.plugins.onProcessRule(s),s},n.use=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach(function(t){e.plugins.use(t)}),this},r}();function Se(e){var t=null;for(var r in e){var n=e[r],i=typeof n;if("function"===i)t||(t={}),t[r]=n;else if("object"===i&&null!==n&&!Array.isArray(n)){var s=Se(n);s&&(t||(t={}),t[r]=s)}}return t}var be=function(){function e(){this.length=0,this.sheets=new WeakMap}var t=e.prototype;return t.get=function(e){var t=this.sheets.get(e);return t&&t.sheet},t.add=function(e,t){this.sheets.has(e)||(this.length++,this.sheets.set(e,{sheet:t,refs:0}))},t.manage=function(e){var t=this.sheets.get(e);if(t)return 0===t.refs&&t.sheet.attach(),t.refs++,t.sheet;(0,r.default)(!1,"[JSS] SheetsManager: can't find sheet to manage")},t.unmanage=function(e){var t=this.sheets.get(e);t?t.refs>0&&(t.refs--,0===t.refs&&t.sheet.detach()):(0,r.default)(!1,"SheetsManager: can't find sheet to unmanage")},(0,n.default)(e,[{key:"size",get:function(){return this.length}}]),e}();exports.SheetsManager=be;var ke="object"==typeof CSS&&null!=CSS&&"number"in CSS;exports.hasCSSTOMSupport=ke;var Pe=function(e){return new xe(e)};exports.create=Pe;var we=Pe(),Ce=we;exports.default=Ce;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","is-in-browser":"QDke","tiny-warning":"sIbj","@babel/runtime/helpers/esm/createClass":"l5p4","@babel/runtime/helpers/esm/inheritsLoose":"S11h","@babel/runtime/helpers/esm/assertThisInitialized":"bk0i","@babel/runtime/helpers/esm/objectWithoutPropertiesLoose":"Vabl"}],"EGw1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("tiny-warning")),r=require("jss");function n(e){return e&&e.__esModule?e:{default:e}}var t=Date.now(),u="fnValues"+t,o="fnStyle"+ ++t,i=function(){return{onCreateRule:function(e,n,t){if("function"!=typeof n)return null;var u=(0,r.createRule)(e,{},t);return u[o]=n,u},onProcessStyle:function(e,r){if(u in r||o in r)return e;var n={};for(var t in e){var i=e[t];"function"==typeof i&&(delete e[t],n[t]=i)}return r[u]=n,e},onUpdate:function(e,r,n,t){var i=r,f=i[o];f&&(i.style=f(e)||{});var a=i[u];if(a)for(var l in a)i.prop(l,a[l](e),t)}}},f=i;exports.default=f;
},{"tiny-warning":"sIbj","jss":"buqW"}],"dCWS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("@babel/runtime/helpers/esm/extends")),e=require("jss");function r(t){return t&&t.__esModule?t:{default:t}}var s="@global",n="@global ",i=function(){function r(r,n,i){for(var o in this.type="global",this.at=s,this.rules=void 0,this.options=void 0,this.key=void 0,this.isProcessed=!1,this.key=r,this.options=i,this.rules=new e.RuleList((0,t.default)({},i,{parent:this})),n)this.rules.add(o,n[o]);this.rules.process()}var n=r.prototype;return n.getRule=function(t){return this.rules.get(t)},n.addRule=function(t,e,r){var s=this.rules.add(t,e,r);return s&&this.options.jss.plugins.onProcessRule(s),s},n.indexOf=function(t){return this.rules.indexOf(t)},n.toString=function(){return this.rules.toString()},r}(),o=function(){function e(e,r,i){this.type="global",this.at=s,this.options=void 0,this.rule=void 0,this.isProcessed=!1,this.key=void 0,this.key=e,this.options=i;var o=e.substr(n.length);this.rule=i.jss.createRule(o,r,(0,t.default)({},i,{parent:this}))}return e.prototype.toString=function(t){return this.rule?this.rule.toString(t):""},e}(),u=/\s*,\s*/g;function l(t,e){for(var r=t.split(u),s="",n=0;n<r.length;n++)s+=e+" "+r[n].trim(),r[n+1]&&(s+=", ");return s}function a(e,r){var n=e.options,i=e.style,o=i?i[s]:null;if(o){for(var u in o)r.addRule(u,o[u],(0,t.default)({},n,{selector:l(u,e.selector)}));delete i[s]}}function d(e,r){var n=e.options,i=e.style;for(var o in i)if("@"===o[0]&&o.substr(0,s.length)===s){var u=l(o.substr(s.length),e.selector);r.addRule(u,i[o],(0,t.default)({},n,{selector:u})),delete i[o]}}function f(){return{onCreateRule:function(t,e,r){if(!t)return null;if(t===s)return new i(t,e,r);if("@"===t[0]&&t.substr(0,n.length)===n)return new o(t,e,r);var u=r.parent;return u&&("global"===u.type||u.options.parent&&"global"===u.options.parent.type)&&(r.scoped=!1),!1===r.scoped&&(r.selector=t),null},onProcessRule:function(t,e){"style"===t.type&&e&&(a(t,e),d(t,e))}}}var h=f;exports.default=h;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","jss":"buqW"}],"USTf":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("@babel/runtime/helpers/esm/extends")),r=t(require("tiny-warning"));function t(e){return e&&e.__esModule?e:{default:e}}var n=/\s*,\s*/g,i=/&/g,l=/\$([\w-]+)/g;function u(){function r(e,r){return function(t,n){var i=e.getRule(n)||r&&r.getRule(n);return i?(i=i).selector:n}}function t(e,r){for(var t=r.split(n),l=e.split(n),u="",o=0;o<t.length;o++)for(var a=t[o],s=0;s<l.length;s++){var d=l[s];u&&(u+=", "),u+=-1!==d.indexOf("&")?d.replace(i,a):a+" "+d}return u}function u(r,t,n){if(n)return(0,e.default)({},n,{index:n.index+1});var i=r.options.nestingLevel;i=void 0===i?1:i+1;var l=(0,e.default)({},r.options,{nestingLevel:i,index:t.indexOf(r)+1});return delete l.name,l}return{onProcessStyle:function(n,i,o){if("style"!==i.type)return n;var a,s,d=i,f=d.options.parent;for(var v in n){var c=-1!==v.indexOf("&"),p="@"===v[0];if(c||p){if(a=u(d,f,a),c){var g=t(v,d.selector);s||(s=r(f,o)),g=g.replace(l,s),f.addRule(g,n[v],(0,e.default)({},a,{selector:g}))}else p&&f.addRule(v,{},a).addRule(d.key,n[v],{selector:d.selector});delete n[v]}}return n}}}var o=u;exports.default=o;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","tiny-warning":"sIbj"}],"jNGL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=/[A-Z]/g,r=/^ms-/,t={};function o(e){return"-"+e.toLowerCase()}function s(s){if(t.hasOwnProperty(s))return t[s];var u=s.replace(e,o);return t[s]=r.test(u)?"-"+u:u}var u=s;exports.default=u;
},{}],"vFv8":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var r=e(require("hyphenate-style-name"));function e(r){return r&&r.__esModule?r:{default:r}}function a(e){var n={};for(var t in e){n[0===t.indexOf("--")?t:(0,r.default)(t)]=e[t]}return e.fallbacks&&(Array.isArray(e.fallbacks)?n.fallbacks=e.fallbacks.map(a):n.fallbacks=a(e.fallbacks)),n}function n(){return{onProcessStyle:function(r){if(Array.isArray(r)){for(var e=0;e<r.length;e++)r[e]=a(r[e]);return r}return a(r)},onChangeValue:function(e,a,n){if(0===a.indexOf("--"))return e;var t=(0,r.default)(a);return a===t?e:(n.prop(t,e),null)}}}var t=n;exports.default=t;
},{"hyphenate-style-name":"jNGL"}],"NPbh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var r=require("jss"),t=r.hasCSSTOMSupport&&CSS?CSS.px:"px",i=r.hasCSSTOMSupport&&CSS?CSS.ms:"ms",e=r.hasCSSTOMSupport&&CSS?CSS.percent:"%",o={"animation-delay":i,"animation-duration":i,"background-position":t,"background-position-x":t,"background-position-y":t,"background-size":t,border:t,"border-bottom":t,"border-bottom-left-radius":t,"border-bottom-right-radius":t,"border-bottom-width":t,"border-left":t,"border-left-width":t,"border-radius":t,"border-right":t,"border-right-width":t,"border-top":t,"border-top-left-radius":t,"border-top-right-radius":t,"border-top-width":t,"border-width":t,"border-block":t,"border-block-end":t,"border-block-end-width":t,"border-block-start":t,"border-block-start-width":t,"border-block-width":t,"border-inline":t,"border-inline-end":t,"border-inline-end-width":t,"border-inline-start":t,"border-inline-start-width":t,"border-inline-width":t,"border-start-start-radius":t,"border-start-end-radius":t,"border-end-start-radius":t,"border-end-end-radius":t,margin:t,"margin-bottom":t,"margin-left":t,"margin-right":t,"margin-top":t,"margin-block":t,"margin-block-end":t,"margin-block-start":t,"margin-inline":t,"margin-inline-end":t,"margin-inline-start":t,padding:t,"padding-bottom":t,"padding-left":t,"padding-right":t,"padding-top":t,"padding-block":t,"padding-block-end":t,"padding-block-start":t,"padding-inline":t,"padding-inline-end":t,"padding-inline-start":t,"mask-position-x":t,"mask-position-y":t,"mask-size":t,height:t,width:t,"min-height":t,"max-height":t,"min-width":t,"max-width":t,bottom:t,left:t,top:t,right:t,inset:t,"inset-block":t,"inset-block-end":t,"inset-block-start":t,"inset-inline":t,"inset-inline-end":t,"inset-inline-start":t,"box-shadow":t,"text-shadow":t,"column-gap":t,"column-rule":t,"column-rule-width":t,"column-width":t,"font-size":t,"font-size-delta":t,"letter-spacing":t,"text-decoration-thickness":t,"text-indent":t,"text-stroke":t,"text-stroke-width":t,"word-spacing":t,motion:t,"motion-offset":t,outline:t,"outline-offset":t,"outline-width":t,perspective:t,"perspective-origin-x":e,"perspective-origin-y":e,"transform-origin":e,"transform-origin-x":e,"transform-origin-y":e,"transform-origin-z":e,"transition-delay":i,"transition-duration":i,"vertical-align":t,"flex-basis":t,"shape-margin":t,size:t,gap:t,grid:t,"grid-gap":t,"row-gap":t,"grid-row-gap":t,"grid-column-gap":t,"grid-template-rows":t,"grid-template-columns":t,"grid-auto-rows":t,"grid-auto-columns":t,"box-shadow-x":t,"box-shadow-y":t,"box-shadow-blur":t,"box-shadow-spread":t,"font-line-height":t,"text-shadow-x":t,"text-shadow-y":t,"text-shadow-blur":t};function n(r){var t=/(-[a-z])/g,i=function(r){return r[1].toUpperCase()},e={};for(var o in r)e[o]=r[o],e[o.replace(t,i)]=r[o];return e}var d=n(o);function a(r,i,e){if(null==i)return i;if(Array.isArray(i))for(var o=0;o<i.length;o++)i[o]=a(r,i[o],e);else if("object"==typeof i)if("fallbacks"===r)for(var n in i)i[n]=a(n,i[n],e);else for(var s in i)i[s]=a(r+"-"+s,i[s],e);else if("number"==typeof i&&!1===isNaN(i)){var l=e[r]||d[r];return!l||0===i&&l===t?i.toString():"function"==typeof l?l(i).toString():""+i+l}return i}function s(r){void 0===r&&(r={});var t=n(r);return{onProcessStyle:function(r,i){if("style"!==i.type)return r;for(var e in r)r[e]=a(e,r[e],t);return r},onChangeValue:function(r,i){return a(i,r,t)}}}var l=s;exports.default=l;
},{"jss":"buqW"}],"SBoI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.supportedKeyframes=m,exports.supportedProperty=J,exports.supportedValue=Z,exports.prefix=void 0;var r=t(require("is-in-browser")),e=t(require("@babel/runtime/helpers/esm/toConsumableArray"));function t(r){return r&&r.__esModule?r:{default:r}}var n="",o="",i="",s="",u=r.default&&"ontouchstart"in document.documentElement;if(r.default){var l={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},p=document.createElement("p"),a=p.style,f="Transform";for(var c in l)if(c+f in a){n=c,o=l[c];break}"Webkit"===n&&"msHyphens"in a&&(n="ms",o=l.ms,s="edge"),"Webkit"===n&&"-apple-trailing-word"in a&&(i="apple")}var d={js:n,css:o,vendor:i,browser:s,isTouch:u};function m(r){return"-"===r[1]?r:"ms"===d.js?r:"@"+d.css+"keyframes"+r.substr(10)}exports.prefix=d;var y={noPrefill:["appearance"],supportedProperty:function(r){return"appearance"===r&&("ms"===d.js?"-webkit-"+r:d.css+r)}},b={noPrefill:["color-adjust"],supportedProperty:function(r){return"color-adjust"===r&&("Webkit"===d.js?d.css+"print-"+r:r)}},x=/[-\s]+(.)?/g;function v(r,e){return e?e.toUpperCase():""}function P(r){return r.replace(x,v)}function g(r){return P("-"+r)}var j,k={noPrefill:["mask"],supportedProperty:function(r,e){if(!/^mask/.test(r))return!1;if("Webkit"===d.js){if(P("mask-image")in e)return r;if(d.js+g("mask-image")in e)return d.css+r}return r}},w={noPrefill:["text-orientation"],supportedProperty:function(r){return"text-orientation"===r&&("apple"!==d.vendor||d.isTouch?r:d.css+r)}},h={noPrefill:["transform"],supportedProperty:function(r,e,t){return"transform"===r&&(t.transform?r:d.css+r)}},W={noPrefill:["transition"],supportedProperty:function(r,e,t){return"transition"===r&&(t.transition?r:d.css+r)}},z={noPrefill:["writing-mode"],supportedProperty:function(r){return"writing-mode"===r&&("Webkit"===d.js||"ms"===d.js&&"edge"!==d.browser?d.css+r:r)}},E={noPrefill:["user-select"],supportedProperty:function(r){return"user-select"===r&&("Moz"===d.js||"ms"===d.js||"apple"===d.vendor?d.css+r:r)}},M={supportedProperty:function(r,e){return!!/^break-/.test(r)&&("Webkit"===d.js?"WebkitColumn"+g(r)in e&&d.css+"column-"+r:"Moz"===d.js&&("page"+g(r)in e&&"page-"+r))}},C={supportedProperty:function(r,e){if(!/^(border|margin|padding)-inline/.test(r))return!1;if("Moz"===d.js)return r;var t=r.replace("-inline","");return d.js+g(t)in e&&d.css+t}},N={supportedProperty:function(r,e){return P(r)in e&&r}},O={supportedProperty:function(r,e){var t=g(r);return"-"===r[0]?r:"-"===r[0]&&"-"===r[1]?r:d.js+t in e?d.css+r:"Webkit"!==d.js&&"Webkit"+t in e&&"-webkit-"+r}},_={supportedProperty:function(r){return"scroll-snap"===r.substring(0,11)&&("ms"===d.js?""+d.css+r:r)}},A={supportedProperty:function(r){return"overscroll-behavior"===r&&("ms"===d.js?d.css+"scroll-chaining":r)}},T={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},q={supportedProperty:function(r,e){var t=T[r];return!!t&&(d.js+g(t)in e&&d.css+t)}},H={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},I=Object.keys(H),K=function(r){return d.css+r},S={supportedProperty:function(r,e,t){var n=t.multiple;if(I.indexOf(r)>-1){var o=H[r];if(!Array.isArray(o))return d.js+g(o)in e&&d.css+o;if(!n)return!1;for(var i=0;i<o.length;i++)if(!(d.js+g(o[0])in e))return!1;return o.map(K)}return!1}},U=[y,b,k,w,h,W,z,E,M,C,N,O,_,A,q,S],V=U.filter(function(r){return r.supportedProperty}).map(function(r){return r.supportedProperty}),B=U.filter(function(r){return r.noPrefill}).reduce(function(r,t){return r.push.apply(r,(0,e.default)(t.noPrefill)),r},[]),D={};if(r.default){j=document.createElement("p");var F=window.getComputedStyle(document.documentElement,"");for(var G in F)isNaN(G)||(D[F[G]]=F[G]);B.forEach(function(r){return delete D[r]})}function J(r,e){if(void 0===e&&(e={}),!j)return r;if(null!=D[r])return D[r];"transition"!==r&&"transform"!==r||(e[r]=r in j.style);for(var t=0;t<V.length&&(D[r]=V[t](r,j.style,e),!D[r]);t++);try{j.style[r]=""}catch(n){return!1}return D[r]}var L,Q={},R={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},X=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function Y(r,e,t){if("var"===e)return"var";if("all"===e)return"all";if("all"===t)return", all";var n=e?J(e):", "+J(t);return n||(e||t)}function Z(r,e){var t=e;if(!L||"content"===r)return e;if("string"!=typeof t||!isNaN(parseInt(t,10)))return t;var n=r+t;if(null!=Q[n])return Q[n];try{L.style[r]=t}catch(o){return Q[n]=!1,!1}if(R[r])t=t.replace(X,Y);else if(""===L.style[r]&&("-ms-flex"===(t=d.css+t)&&(L.style[r]="-ms-flexbox"),L.style[r]=t,""===L.style[r]))return Q[n]=!1,!1;return L.style[r]="",Q[n]=t,Q[n]}r.default&&(L=document.createElement("p"));
},{"is-in-browser":"QDke","@babel/runtime/helpers/esm/toConsumableArray":"Qv3s"}],"ECZg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("css-vendor"),r=require("jss");function t(){function t(s){for(var u in s){var a=s[u];if("fallbacks"===u&&Array.isArray(a))s[u]=a.map(t);else{var o=!1,n=(0,e.supportedProperty)(u);n&&n!==u&&(o=!0);var l=!1,p=(0,e.supportedValue)(n,(0,r.toCssValue)(a));p&&p!==a&&(l=!0),(o||l)&&(o&&delete s[u],s[n||u]=p||a)}}return s}return{onProcessRule:function(r){if("keyframes"===r.type){var t=r;t.at=(0,e.supportedKeyframes)(t.at)}},onProcessStyle:function(e,r){return"style"!==r.type?e:t(e)},onChangeValue:function(t,s){return(0,e.supportedValue)(s,(0,r.toCssValue)(t))||t}}}var s=t;exports.default=s;
},{"css-vendor":"SBoI","jss":"buqW"}],"AGLi":[function(require,module,exports) {
"use strict";function e(){var e=function(e,t){return e.length===t.length?e>t?1:-1:e.length-t.length};return{onProcessStyle:function(t,r){if("style"!==r.type)return t;for(var n={},o=Object.keys(t).sort(e),u=0;u<o.length;u++)n[o[u]]=t[o[u]];return n}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e;exports.default=t;
},{}],"wtDD":[function(require,module,exports) {

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=d;var e=n(require("jss-plugin-rule-value-function")),u=n(require("jss-plugin-global")),r=n(require("jss-plugin-nested")),l=n(require("jss-plugin-camel-case")),s=n(require("jss-plugin-default-unit")),t=n(require("jss-plugin-vendor-prefixer")),i=n(require("jss-plugin-props-sort"));function n(e){return e&&e.__esModule?e:{default:e}}function d(){return{plugins:[(0,e.default)(),(0,u.default)(),(0,r.default)(),(0,l.default)(),(0,s.default)(),"undefined"==typeof window?null:(0,t.default)(),(0,i.default)()]}}
},{"jss-plugin-rule-value-function":"EGw1","jss-plugin-global":"dCWS","jss-plugin-nested":"USTf","jss-plugin-camel-case":"vFv8","jss-plugin-default-unit":"NPbh","jss-plugin-vendor-prefixer":"ECZg","jss-plugin-props-sort":"AGLi"}],"hGot":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./jssPreset"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./jssPreset":"wtDD"}],"wlMU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=n;var e=r(require("@babel/runtime/helpers/esm/extends")),t=require("@material-ui/utils");function r(e){return e&&e.__esModule?e:{default:e}}function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.baseClasses,n=t.newClasses;t.Component;if(!n)return r;var s=(0,e.default)({},r);return Object.keys(n).forEach(function(e){n[e]&&(s[e]="".concat(r[e]," ").concat(n[e]))}),s}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@material-ui/utils":"gEhD"}],"pt6u":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./mergeClasses"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./mergeClasses":"wlMU"}],"SflP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={set:function(e,t,r,o){var n=e.get(t);n||(n=new Map,e.set(t,n)),n.set(r,o)},get:function(e,t,r){var o=e.get(t);return o?o.get(r):void 0},delete:function(e,t,r){e.get(t).delete(r)}},t=e;exports.default=t;
},{}],"XKuV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("react"));function t(e){return e&&e.__esModule?e:{default:e}}var r=e.default.createContext(null);var u=r;exports.default=u;
},{"react":"n8MK"}],"GIos":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=r(require("react")),t=r(require("./ThemeContext"));function r(e){return e&&e.__esModule?e:{default:e}}function u(){var r=e.default.useContext(t.default);return r}
},{"react":"n8MK","./ThemeContext":"XKuV"}],"J4W1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./useTheme"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./useTheme":"GIos"}],"FHnM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=m,exports.StylesContext=exports.sheetsManager=void 0;var e=o(require("@babel/runtime/helpers/esm/extends")),t=o(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=o(require("react")),s=o(require("prop-types")),i=require("@material-ui/utils"),n=o(require("../createGenerateClassName")),a=require("jss"),u=o(require("../jssPreset"));function o(e){return e&&e.__esModule?e:{default:e}}var l=(0,a.create)((0,u.default)()),d=(0,n.default)(),c=new Map;exports.sheetsManager=c;var f,p={disableGeneration:!1,generateClassName:d,jss:l,sheetsCache:null,sheetsManager:c,sheetsRegistry:null},h=r.default.createContext(p);function m(s){var i=s.children,n=s.injectFirst,o=void 0!==n&&n,l=s.disableGeneration,d=void 0!==l&&l,c=(0,t.default)(s,["children","injectFirst","disableGeneration"]),p=r.default.useContext(h),m=(0,e.default)({},p,{disableGeneration:d},c);if(!m.jss.options.insertionPoint&&o&&"undefined"!=typeof window){if(!f){var v=document.head;f=document.createComment("mui-inject-first"),v.insertBefore(f,v.firstChild)}m.jss=(0,a.create)({plugins:(0,u.default)().plugins,insertionPoint:f})}return r.default.createElement(h.Provider,{value:m},i)}exports.StylesContext=h;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","@material-ui/utils":"gEhD","../createGenerateClassName":"SeWB","jss":"buqW","../jssPreset":"hGot"}],"rxZy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={};Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t.default}});var t=n(require("./StylesProvider"));function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var f=o?Object.getOwnPropertyDescriptor(e,u):null;f&&(f.get||f.set)?Object.defineProperty(n,u,f):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}Object.keys(t).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||r in exports&&exports[r]===t[r]||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return t[r]}}))});
},{"./StylesProvider":"FHnM"}],"Qo7l":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.increment=r;var e=-1e9;function r(){return e+=1}
},{}],"pfAB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={},t=e;exports.default=t;
},{}],"ghIF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=o;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/typeof")),t=require("@material-ui/utils"),u=i(require("./noopTheme"));function i(e){return e&&e.__esModule?e:{default:e}}function o(r){var u="function"==typeof r;return{create:function(i,o){var n;try{n=u?r(i):r}catch(f){throw f}if(!o||!i.overrides||!i.overrides[o])return n;var s=i.overrides[o],a=(0,e.default)({},n);return Object.keys(s).forEach(function(e){a[e]=(0,t.deepmerge)(a[e],s[e])}),a},options:{}}}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/typeof":"xLw6","@material-ui/utils":"gEhD","./noopTheme":"pfAB"}],"dfO5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./getStylesCreator"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./getStylesCreator":"ghIF"}],"N1Xy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=v;var e=o(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=o(require("@babel/runtime/helpers/esm/extends")),s=o(require("react")),a=require("jss"),r=o(require("../mergeClasses")),l=o(require("./multiKeyStore")),n=o(require("../useTheme")),u=require("../StylesProvider"),c=require("./indexCounter"),i=o(require("../getStylesCreator")),f=o(require("../getStylesCreator/noopTheme"));function o(e){return e&&e.__esModule?e:{default:e}}function d(e,t,s){var a=e.state;if(e.stylesOptions.disableGeneration)return t||{};a.cacheClasses||(a.cacheClasses={value:null,lastProp:null,lastJSS:{}});var l=!1;return a.classes!==a.cacheClasses.lastJSS&&(a.cacheClasses.lastJSS=a.classes,l=!0),t!==a.cacheClasses.lastProp&&(a.cacheClasses.lastProp=t,l=!0),l&&(a.cacheClasses.value=(0,r.default)({baseClasses:a.cacheClasses.lastJSS,newClasses:t,Component:s})),a.cacheClasses.value}function h(e,s){var n=e.state,u=e.theme,c=e.stylesOptions,i=e.stylesCreator,f=e.name;if(!c.disableGeneration){var o=l.default.get(c.sheetsManager,i,u);o||(o={refs:0,staticSheet:null,dynamicStyles:null},l.default.set(c.sheetsManager,i,u,o));var d=(0,t.default)({},i.options,c,{theme:u,flip:"boolean"==typeof c.flip?c.flip:"rtl"===u.direction});d.generateId=d.serverGenerateClassName||d.generateClassName;var h=c.sheetsRegistry;if(0===o.refs){var m;c.sheetsCache&&(m=l.default.get(c.sheetsCache,i,u));var S=i.create(u,f);m||((m=c.jss.createStyleSheet(S,(0,t.default)({link:!1},d))).attach(),c.sheetsCache&&l.default.set(c.sheetsCache,i,u,m)),h&&h.add(m),o.staticSheet=m,o.dynamicStyles=(0,a.getDynamicStyles)(S)}if(o.dynamicStyles){var y=c.jss.createStyleSheet(o.dynamicStyles,(0,t.default)({link:!0},d));y.update(s),y.attach(),n.dynamicSheet=y,n.classes=(0,r.default)({baseClasses:o.staticSheet.classes,newClasses:y.classes}),h&&h.add(y)}else n.classes=o.staticSheet.classes;o.refs+=1}}function m(e,t){var s=e.state;s.dynamicSheet&&s.dynamicSheet.update(t)}function S(e){var t=e.state,s=e.theme,a=e.stylesOptions,r=e.stylesCreator;if(!a.disableGeneration){var n=l.default.get(a.sheetsManager,r,s);n.refs-=1;var u=a.sheetsRegistry;0===n.refs&&(l.default.delete(a.sheetsManager,r,s),a.jss.removeStyleSheet(n.staticSheet),u&&u.remove(n.staticSheet)),t.dynamicSheet&&(a.jss.removeStyleSheet(t.dynamicSheet),u&&u.remove(t.dynamicSheet))}}function y(e,t){var a,r=s.default.useRef([]),l=s.default.useMemo(function(){return{}},t);r.current!==l&&(r.current=l,a=e()),s.default.useEffect(function(){return function(){a&&a()}},[l])}function v(a){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=r.name,o=r.classNamePrefix,v=r.Component,C=r.defaultTheme,p=void 0===C?f.default:C,g=(0,e.default)(r,["name","classNamePrefix","Component","defaultTheme"]),b=(0,i.default)(a),q=l||o||"makeStyles";b.options={index:(0,c.increment)(),name:l,meta:q,classNamePrefix:q};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(0,n.default)()||p,r=(0,t.default)({},s.default.useContext(u.StylesContext),g),c=s.default.useRef(),i=s.default.useRef();y(function(){var t={name:l,state:{},stylesCreator:b,stylesOptions:r,theme:a};return h(t,e),i.current=!1,c.current=t,function(){S(t)}},[a,b]),s.default.useEffect(function(){i.current&&m(c.current,e),i.current=!0});var f=d(c.current,e.classes,v);return f}}
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","jss":"buqW","../mergeClasses":"pt6u","./multiKeyStore":"SflP","../useTheme":"J4W1","../StylesProvider":"rxZy","./indexCounter":"Qo7l","../getStylesCreator":"dfO5","../getStylesCreator/noopTheme":"pfAB"}],"oHuV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./makeStyles"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./makeStyles":"N1Xy"}],"VEjx":[function(require,module,exports) {
"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"Aj7A":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/classCallCheck")),r=u(require("@babel/runtime/helpers/esm/createClass")),s=u(require("react")),i=require("jss"),a=u(require("../StylesProvider")),l=u(require("../createGenerateClassName"));function u(e){return e&&e.__esModule?e:{default:e}}var n=function(){function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,t.default)(this,u),this.options=e}return(0,r.default)(u,[{key:"collect",value:function(t){var r=new Map;this.sheetsRegistry=new i.SheetsRegistry;var u=(0,l.default)();return s.default.createElement(a.default,(0,e.default)({sheetsManager:r,serverGenerateClassName:u,sheetsRegistry:this.sheetsRegistry},this.options),t)}},{key:"toString",value:function(){return this.sheetsRegistry?this.sheetsRegistry.toString():""}},{key:"getStyleElement",value:function(t){return s.default.createElement("style",(0,e.default)({id:"jss-server-side",key:"jss-server-side",dangerouslySetInnerHTML:{__html:this.toString()}},t))}}]),u}();exports.default=n;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/classCallCheck":"VEjx","@babel/runtime/helpers/esm/createClass":"l5p4","react":"n8MK","jss":"buqW","../StylesProvider":"rxZy","../createGenerateClassName":"SeWB"}],"jY3q":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ServerStyleSheets"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ServerStyleSheets":"Aj7A"}],"WLGK":[function(require,module,exports) {
"use strict";function e(r){var t,f,o="";if("string"==typeof r||"number"==typeof r)o+=r;else if("object"==typeof r)if(Array.isArray(r))for(t=0;t<r.length;t++)r[t]&&(f=e(r[t]))&&(o&&(o+=" "),o+=f);else for(t in r)r[t]&&(o&&(o+=" "),o+=t);return o}function r(){for(var r,t,f=0,o="";f<arguments.length;)(r=arguments[f++])&&(t=e(r))&&(o&&(o+=" "),o+=t);return o}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=r;
},{}],"RsE0":[function(require,module,exports) {
"use strict";var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,f=e?Symbol.for("react.context"):60110,p=e?Symbol.for("react.async_mode"):60111,a=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,i=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,l=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,$=e?Symbol.for("react.scope"):60119;function d(e){if("object"==typeof e&&null!==e){var y=e.$$typeof;switch(y){case r:switch(e=e.type){case p:case a:case o:case s:case n:case i:return e;default:switch(e=e&&e.$$typeof){case f:case u:case m:case l:case c:return e;default:return y}}case t:return y}}}function C(e){return d(e)===a}exports.AsyncMode=p,exports.ConcurrentMode=a,exports.ContextConsumer=f,exports.ContextProvider=c,exports.Element=r,exports.ForwardRef=u,exports.Fragment=o,exports.Lazy=m,exports.Memo=l,exports.Portal=t,exports.Profiler=s,exports.StrictMode=n,exports.Suspense=i,exports.isAsyncMode=function(e){return C(e)||d(e)===p},exports.isConcurrentMode=C,exports.isContextConsumer=function(e){return d(e)===f},exports.isContextProvider=function(e){return d(e)===c},exports.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},exports.isForwardRef=function(e){return d(e)===u},exports.isFragment=function(e){return d(e)===o},exports.isLazy=function(e){return d(e)===m},exports.isMemo=function(e){return d(e)===l},exports.isPortal=function(e){return d(e)===t},exports.isProfiler=function(e){return d(e)===s},exports.isStrictMode=function(e){return d(e)===n},exports.isSuspense=function(e){return d(e)===i},exports.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===a||e===s||e===n||e===i||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.$$typeof===S||e.$$typeof===$||e.$$typeof===x)},exports.typeOf=d;
},{}],"H1RQ":[function(require,module,exports) {
"use strict";module.exports=require("./cjs/react-is.production.min.js");
},{"./cjs/react-is.production.min.js":"RsE0"}],"ElIr":[function(require,module,exports) {
"use strict";var e=require("react-is"),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},p={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function y(r){return e.isMemo(r)?p:a[r.$$typeof]||t}a[e.ForwardRef]=o,a[e.Memo]=p;var s=Object.defineProperty,c=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,n=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,l=Object.prototype;function m(e,t,o){if("string"!=typeof t){if(l){var p=f(t);p&&p!==l&&m(e,p,o)}var a=c(t);i&&(a=a.concat(i(t)));for(var d=y(e),u=y(t),g=0;g<a.length;++g){var O=a[g];if(!(r[O]||o&&o[O]||u&&u[O]||d&&d[O])){var P=n(t,O);try{s(e,O,P)}catch(v){}}}}return e}module.exports=m;
},{"react-is":"H1RQ"}],"wR2M":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var e=s(require("@babel/runtime/helpers/esm/extends")),r=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=s(require("react")),a=s(require("clsx")),n=s(require("prop-types")),u=require("@material-ui/utils"),l=s(require("hoist-non-react-statics")),o=s(require("../makeStyles"));function s(e){return e&&e.__esModule?e:{default:e}}function f(e,r){var t={};return Object.keys(e).forEach(function(a){-1===r.indexOf(a)&&(t[a]=e[a])}),t}function i(n){return function(u){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=s.name,c=(0,r.default)(s,["name"]);var p,d=i,m="function"==typeof u?function(r){return{root:function(t){return u((0,e.default)({theme:r},t))}}}:{root:u},y=(0,o.default)(m,(0,e.default)({Component:n,name:i||n.displayName,classNamePrefix:d},c));u.filterProps&&(p=u.filterProps,delete u.filterProps),u.propTypes&&(u.propTypes,delete u.propTypes);var h=t.default.forwardRef(function(u,l){var o=u.children,s=u.className,i=u.clone,c=u.component,d=(0,r.default)(u,["children","className","clone","component"]),m=y(u),h=(0,a.default)(m.root,s),v=d;if(p&&(v=f(v,p)),i)return t.default.cloneElement(o,(0,e.default)({className:(0,a.default)(o.props.className,h)},v));if("function"==typeof o)return o((0,e.default)({className:h},v));var q=c||n;return t.default.createElement(q,(0,e.default)({ref:l,className:h},v),o)});return(0,l.default)(h,n),h}}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","clsx":"WLGK","prop-types":"D9Od","@material-ui/utils":"gEhD","hoist-non-react-statics":"ElIr","../makeStyles":"oHuV"}],"JFhz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./styled"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./styled":"wR2M"}],"oOXH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("react")),u=i(require("prop-types")),t=require("@material-ui/utils"),l=i(require("../useTheme/ThemeContext")),n=i(require("../useTheme")),a=i(require("./nested"));function i(e){return e&&e.__esModule?e:{default:e}}function d(r,u){if("function"==typeof u){var t=u(r);return t}return(0,e.default)({},r,u)}function f(e){var u=e.children,t=e.theme,i=(0,n.default)();var f=r.default.useMemo(function(){var e=null===i?t:d(i,t);return null!=e&&(e[a.default]=null!==i),e},[t,i]);return r.default.createElement(l.default.Provider,{value:f},u)}var o=f;exports.default=o;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","@material-ui/utils":"gEhD","../useTheme/ThemeContext":"XKuV","../useTheme":"J4W1","./nested":"jllt"}],"CnGP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./ThemeProvider"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./ThemeProvider":"oOXH"}],"KWjr":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),t=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=f(require("react")),a=f(require("prop-types")),u=f(require("hoist-non-react-statics")),s=require("@material-ui/utils"),l=f(require("../makeStyles")),i=f(require("../getThemeProps")),n=f(require("../useTheme"));function f(e){return e&&e.__esModule?e:{default:e}}var d=function(a){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(f){var d=s.defaultTheme,o=s.withTheme,m=void 0!==o&&o,h=s.name,p=(0,t.default)(s,["defaultTheme","withTheme","name"]);var c=h,v=(0,l.default)(a,(0,e.default)({defaultTheme:d,Component:f,name:h||f.displayName,classNamePrefix:c},p)),q=r.default.forwardRef(function(a,u){a.classes;var s,l=a.innerRef,o=(0,t.default)(a,["classes","innerRef"]),p=v((0,e.default)({},f.defaultProps,a)),c=o;return("string"==typeof h||m)&&(s=(0,n.default)()||d,h&&(c=(0,i.default)({theme:s,name:h,props:o})),m&&!c.theme&&(c.theme=s)),r.default.createElement(f,(0,e.default)({ref:l||u,classes:p},c))});return(0,u.default)(q,f),q}},o=d;exports.default=o;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","hoist-non-react-statics":"ElIr","@material-ui/utils":"gEhD","../makeStyles":"oHuV","../getThemeProps":"D8yE","../useTheme":"J4W1"}],"IYOX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./withStyles"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./withStyles":"KWjr"}],"yXUJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withThemeCreator=o,exports.default=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),r=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=l(require("react")),u=l(require("prop-types")),i=l(require("hoist-non-react-statics")),a=require("@material-ui/utils"),n=l(require("../useTheme"));function l(e){return e&&e.__esModule?e:{default:e}}function o(){var u=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).defaultTheme;return function(a){var l=t.default.forwardRef(function(i,l){var o=i.innerRef,f=(0,r.default)(i,["innerRef"]),s=(0,n.default)()||u;return t.default.createElement(a,(0,e.default)({theme:s,ref:o||l},f))});return(0,i.default)(l,a),l}}var f=o(),s=f;exports.default=s;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","hoist-non-react-statics":"ElIr","@material-ui/utils":"gEhD","../useTheme":"J4W1"}],"eXoZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={};Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t.default}});var t=n(require("./withTheme"));function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var f=o?Object.getOwnPropertyDescriptor(e,u):null;f&&(f.get||f.set)?Object.defineProperty(n,u,f):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}Object.keys(t).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||r in exports&&exports[r]===t[r]||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return t[r]}}))});
},{"./withTheme":"yXUJ"}],"thJn":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={createGenerateClassName:!0,createStyles:!0,getThemeProps:!0,jssPreset:!0,makeStyles:!0,mergeClasses:!0,ServerStyleSheets:!0,styled:!0,StylesProvider:!0,ThemeProvider:!0,useTheme:!0,withStyles:!0,withTheme:!0};Object.defineProperty(exports,"createGenerateClassName",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"createStyles",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"getThemeProps",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"jssPreset",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"makeStyles",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"mergeClasses",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"ServerStyleSheets",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"styled",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"StylesProvider",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"ThemeProvider",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"useTheme",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"withStyles",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(exports,"withTheme",{enumerable:!0,get:function(){return b.default}});var t=require("@material-ui/utils"),r=O(require("./createGenerateClassName"));Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===r[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return r[t]}}))});var o=O(require("./createStyles"));Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===o[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return o[t]}}))});var n=O(require("./getThemeProps"));Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===n[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return n[t]}}))});var u=O(require("./jssPreset"));Object.keys(u).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===u[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return u[t]}}))});var s=O(require("./makeStyles"));Object.keys(s).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===s[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return s[t]}}))});var a=O(require("./mergeClasses"));Object.keys(a).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===a[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return a[t]}}))});var c=O(require("./ServerStyleSheets"));Object.keys(c).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===c[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return c[t]}}))});var p=O(require("./styled"));Object.keys(p).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===p[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return p[t]}}))});var l=O(require("./StylesProvider"));Object.keys(l).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===l[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return l[t]}}))});var i=O(require("./ThemeProvider"));Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===i[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return i[t]}}))});var f=O(require("./useTheme"));Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===f[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return f[t]}}))});var y=O(require("./withStyles"));Object.keys(y).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===y[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return y[t]}}))});var b=O(require("./withTheme"));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function O(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var u=o?Object.getOwnPropertyDescriptor(e,n):null;u&&(u.get||u.set)?Object.defineProperty(r,n,u):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}Object.keys(b).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===b[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return b[t]}}))});
},{"@material-ui/utils":"gEhD","./createGenerateClassName":"SeWB","./createStyles":"jLuc","./getThemeProps":"D8yE","./jssPreset":"hGot","./makeStyles":"oHuV","./mergeClasses":"pt6u","./ServerStyleSheets":"jY3q","./styled":"JFhz","./StylesProvider":"rxZy","./ThemeProvider":"CnGP","./useTheme":"J4W1","./withStyles":"IYOX","./withTheme":"eXoZ"}],"qnwY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;var e=require("@material-ui/styles");function t(t){return(0,e.createStyles)(t)}
},{"@material-ui/styles":"thJn"}],"REFh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./createMuiTheme"));function t(e){return e&&e.__esModule?e:{default:e}}var r=(0,e.default)(),u=r;exports.default=u;
},{"./createMuiTheme":"p8oh"}],"nyV8":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=require("@material-ui/styles"),r=u(require("./defaultTheme"));function u(e){return e&&e.__esModule?e:{default:e}}function l(u){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,t.makeStyles)(u,(0,e.default)({defaultTheme:r.default},l))}var a=l;exports.default=a;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@material-ui/styles":"thJn","./defaultTheme":"REFh"}],"jfsI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isUnitless=r,exports.getUnit=n,exports.toUnitless=i,exports.convertLength=o,exports.alignProperty=u,exports.fontGrid=s,exports.responsiveProperty=a;var e=t(require("@babel/runtime/helpers/esm/defineProperty"));function t(e){return e&&e.__esModule?e:{default:e}}function r(e){return String(parseFloat(e)).length===String(e).length}function n(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function i(e){return parseFloat(e)}function o(e){return function(t,r){var o=n(t);if(o===r)return t;var u=i(t);if("px"!==o)if("em"===o)u=i(t)*i(e);else if("rem"===o)return u=i(t)*i(e),t;var s=u;if("px"!==r)if("em"===r)s=u/i(e);else{if("rem"!==r)return t;s=u/i(e)}return parseFloat(s.toFixed(5))+r}}function u(e){var t=e.size,r=e.grid,n=t-t%r,i=n+r;return t-n<i-t?n:i}function s(e){var t=e.lineHeight;return e.pixels/(t*e.htmlFontSize)}function a(t){var r=t.cssProperty,n=t.min,i=t.max,o=t.unit,u=void 0===o?"rem":o,s=t.breakpoints,a=void 0===s?[600,960,1280]:s,c=t.transform,l=void 0===c?null:c,f=(0,e.default)({},r,"".concat(n).concat(u)),p=(i-n)/a[a.length-1];return a.forEach(function(t){var i=n+p*t;null!==l&&(i=l(i)),f["@media (min-width:".concat(t,"px)")]=(0,e.default)({},r,"".concat(Math.round(1e4*i)/1e4).concat(u))}),f}
},{"@babel/runtime/helpers/esm/defineProperty":"gpd2"}],"EGrR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=o;var e=i(require("@babel/runtime/helpers/esm/extends")),t=require("@material-ui/utils"),r=require("./cssUtils");function i(e){return e&&e.__esModule?e:{default:e}}function o(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.breakpoints,a=void 0===n?["sm","md","lg"]:n,s=o.disableAlign,l=void 0!==s&&s,u=o.factor,p=void 0===u?2:u,d=o.variants,f=void 0===d?["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]:d,h=(0,e.default)({},i);h.typography=(0,e.default)({},h.typography);var v=h.typography,m=(0,r.convertLength)(v.htmlFontSize),c=a.map(function(e){return h.breakpoints.values[e]});return f.forEach(function(i){var o=v[i],n=parseFloat(m(o.fontSize,"rem"));if(!(n<=1)){var a=n,s=1+(a-1)/p,u=o.lineHeight;if(!(0,r.isUnitless)(u)&&!l)throw new Error((0,t.formatMuiErrorMessage)(6));(0,r.isUnitless)(u)||(u=parseFloat(m(u,"rem"))/parseFloat(n));var d=null;l||(d=function(e){return(0,r.alignProperty)({size:e,grid:(0,r.fontGrid)({pixels:4,lineHeight:u,htmlFontSize:v.htmlFontSize})})}),v[i]=(0,e.default)({},o,(0,r.responsiveProperty)({cssProperty:"fontSize",min:s,max:a,unit:"rem",breakpoints:c,transform:d}))}}),h}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@material-ui/utils":"gEhD","./cssUtils":"jfsI"}],"SN5G":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=require("@material-ui/styles"),r=u(require("./defaultTheme"));function u(e){return e&&e.__esModule?e:{default:e}}var l=function(u){var l=(0,t.styled)(u);return function(t,u){return l(t,(0,e.default)({defaultTheme:r.default},u))}},a=l;exports.default=a;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@material-ui/styles":"thJn","./defaultTheme":"REFh"}],"nmB4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;var e=require("@material-ui/styles"),r=u(require("react")),t=u(require("./defaultTheme"));function u(e){return e&&e.__esModule?e:{default:e}}function a(){var r=(0,e.useTheme)()||t.default;return r}
},{"@material-ui/styles":"thJn","react":"n8MK","./defaultTheme":"REFh"}],"awmK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=require("@material-ui/styles"),r=u(require("./defaultTheme"));function u(e){return e&&e.__esModule?e:{default:e}}function l(u,l){return(0,t.withStyles)(u,(0,e.default)({defaultTheme:r.default},l))}var a=l;exports.default=a;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@material-ui/styles":"thJn","./defaultTheme":"REFh"}],"Nkc9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@material-ui/styles"),t=r(require("./defaultTheme"));function r(e){return e&&e.__esModule?e:{default:e}}var u=(0,e.withThemeCreator)({defaultTheme:t.default}),a=u;exports.default=a;
},{"@material-ui/styles":"thJn","./defaultTheme":"REFh"}],"UUDD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={createMuiTheme:!0,unstable_createMuiStrictModeTheme:!0,createStyles:!0,makeStyles:!0,responsiveFontSizes:!0,styled:!0,useTheme:!0,withStyles:!0,withTheme:!0,createGenerateClassName:!0,jssPreset:!0,ServerStyleSheets:!0,StylesProvider:!0,MuiThemeProvider:!0,ThemeProvider:!0};Object.defineProperty(exports,"createMuiTheme",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"unstable_createMuiStrictModeTheme",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"createStyles",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"makeStyles",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"responsiveFontSizes",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"styled",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"useTheme",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"withStyles",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"withTheme",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"createGenerateClassName",{enumerable:!0,get:function(){return p.createGenerateClassName}}),Object.defineProperty(exports,"jssPreset",{enumerable:!0,get:function(){return p.jssPreset}}),Object.defineProperty(exports,"ServerStyleSheets",{enumerable:!0,get:function(){return p.ServerStyleSheets}}),Object.defineProperty(exports,"StylesProvider",{enumerable:!0,get:function(){return p.StylesProvider}}),Object.defineProperty(exports,"MuiThemeProvider",{enumerable:!0,get:function(){return p.ThemeProvider}}),Object.defineProperty(exports,"ThemeProvider",{enumerable:!0,get:function(){return p.ThemeProvider}});var r=require("./colorManipulator");Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===r[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return r[t]}}))});var t=d(require("./createMuiTheme")),n=d(require("./createMuiStrictModeTheme")),u=d(require("./createStyles")),o=d(require("./makeStyles")),i=d(require("./responsiveFontSizes")),s=d(require("./styled")),a=require("./transitions");Object.keys(a).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||r in exports&&exports[r]===a[r]||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return a[r]}}))});var l=d(require("./useTheme")),c=d(require("./withStyles")),f=d(require("./withTheme")),p=require("@material-ui/styles");function d(e){return e&&e.__esModule?e:{default:e}}
},{"./colorManipulator":"aguB","./createMuiTheme":"p8oh","./createMuiStrictModeTheme":"U5fh","./createStyles":"qnwY","./makeStyles":"nyV8","./responsiveFontSizes":"EGrR","./styled":"SN5G","./transitions":"geVf","./useTheme":"nmB4","./withStyles":"awmK","./withTheme":"Nkc9","@material-ui/styles":"thJn"}],"pz6A":[function(require,module,exports) {
module.exports=function(r,e,t,o){var n=t?t.call(o,r,e):void 0;if(void 0!==n)return!!n;if(r===e)return!0;if("object"!=typeof r||!r||"object"!=typeof e||!e)return!1;var i=Object.keys(r),f=Object.keys(e);if(i.length!==f.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(e),v=0;v<i.length;v++){var a=i[v];if(!u(a))return!1;var c=r[a],l=e[a];if(!1===(n=t?t.call(o,c,l,a):void 0)||void 0===n&&c!==l)return!1}return!0};
},{}],"gTWe":[function(require,module,exports) {
"use strict";function e(e){function r(e,r,t){var c=r.trim().split(d);r=c;var s=c.length,i=e.length;switch(i){case 0:case 1:var n=0;for(e=0===i?"":e[0]+" ";n<s;++n)r[n]=a(e,r[n],t).trim();break;default:var l=n=0;for(r=[];n<s;++n)for(var o=0;o<i;++o)r[l++]=a(e[o]+" ",c[n],t).trim()}return r}function a(e,r,a){var t=r.charCodeAt(0);switch(33>t&&(t=(r=r.trim()).charCodeAt(0)),t){case 38:return r.replace(k,"$1"+e.trim());case 58:return e.trim()+r.replace(k,"$1"+e.trim());default:if(0<1*a&&0<r.indexOf("\f"))return r.replace(k,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+r}function t(e,r,a,s){var i=e+";",n=2*r+3*a+4*s;if(944===n){e=i.indexOf(":",9)+1;var l=i.substring(e,i.length-1).trim();return l=i.substring(0,e).trim()+l+";",1===S||2===S&&c(l,1)?"-webkit-"+l+l:l}if(0===S||2===S&&!c(i,1))return i;switch(n){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(O,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(l=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+l+i;case 1005:return h.test(i)?i.replace(b,":-webkit-")+i.replace(b,":-moz-")+i:i;case 1e3:switch(r=(l=i.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(r)){case 226:l=i.replace(A,"tb");break;case 232:l=i.replace(A,"tb-rl");break;case 220:l=i.replace(A,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+l+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(r=(i=e).length-10,n=(l=(33===i.charCodeAt(r)?i.substring(0,r):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(111>l.charCodeAt(8))break;case 115:i=i.replace(l,"-webkit-"+l)+";"+i;break;case 207:case 102:i=i.replace(l,"-webkit-"+(102<n?"inline-":"")+"box")+";"+i.replace(l,"-webkit-"+l)+";"+i.replace(l,"-ms-"+l+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return l=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+l+"-ms-flex-"+l+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(v,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(v,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===$.test(e))return 115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0)?t(e.replace("stretch","fill-available"),r,a,s).replace(":fill-available",":stretch"):i.replace(l,"-webkit-"+l)+i.replace(l,"-moz-"+l.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===a+s&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(u,"$1-webkit-$2")+i}return i}function c(e,r){var a=e.indexOf(1===r?":":"{"),t=e.substring(0,3!==r?a:10);return a=e.substring(a+1,e.length-1),q(2!==r?t:t.replace(x,"$1"),a,r)}function s(e,r){var a=t(r,r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2));return a!==r+";"?a.replace(m," or ($1)").substring(4):"("+r+")"}function i(e,r,a,t,c,s,i,n,o,f){for(var b,h=0,u=r;h<P;++h)switch(b=M[h].call(l,e,u,a,t,c,s,i,n,o,f)){case void 0:case!1:case!0:case null:break;default:u=b}if(u!==r)return u}function n(e){return void 0!==(e=e.prefix)&&(q=null,e?"function"!=typeof e?S=1:(S=2,q=e):S=0),n}function l(e,a){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<P){var l=i(-1,a,n,n,z,y,0,0,0,0);void 0!==l&&"string"==typeof l&&(a=l)}var b=function e(a,n,l,b,h){for(var u,d,k,A,m,v=0,x=0,$=0,O=0,M=0,q=0,D=k=u=0,E=0,F=0,G=0,H=0,I=l.length,J=I-1,K="",L="",N="",Q="";E<I;){if(d=l.charCodeAt(E),E===J&&0!==x+O+$+v&&(0!==x&&(d=47===x?10:47),O=$=v=0,I++,J++),0===x+O+$+v){if(E===J&&(0<F&&(K=K.replace(f,"")),0<K.trim().length)){switch(d){case 32:case 9:case 59:case 13:case 10:break;default:K+=l.charAt(E)}d=59}switch(d){case 123:for(u=(K=K.trim()).charCodeAt(0),k=1,H=++E;E<I;){switch(d=l.charCodeAt(E)){case 123:k++;break;case 125:k--;break;case 47:switch(d=l.charCodeAt(E+1)){case 42:case 47:e:{for(D=E+1;D<J;++D)switch(l.charCodeAt(D)){case 47:if(42===d&&42===l.charCodeAt(D-1)&&E+2!==D){E=D+1;break e}break;case 10:if(47===d){E=D+1;break e}}E=D}}break;case 91:d++;case 40:d++;case 34:case 39:for(;E++<J&&l.charCodeAt(E)!==d;);}if(0===k)break;E++}switch(k=l.substring(H,E),0===u&&(u=(K=K.replace(o,"").trim()).charCodeAt(0)),u){case 64:switch(0<F&&(K=K.replace(f,"")),d=K.charCodeAt(1)){case 100:case 109:case 115:case 45:F=n;break;default:F=_}if(H=(k=e(n,F,k,d,h+1)).length,0<P&&(m=i(3,k,F=r(_,K,G),n,z,y,H,d,h,b),K=F.join(""),void 0!==m&&0===(H=(k=m.trim()).length)&&(d=0,k="")),0<H)switch(d){case 115:K=K.replace(C,s);case 100:case 109:case 45:k=K+"{"+k+"}";break;case 107:k=(K=K.replace(w,"$1 $2"))+"{"+k+"}",k=1===S||2===S&&c("@"+k,3)?"@-webkit-"+k+"@"+k:"@"+k;break;default:k=K+k,112===b&&(L+=k,k="")}else k="";break;default:k=e(n,r(n,K,G),k,b,h+1)}N+=k,k=G=F=D=u=0,K="",d=l.charCodeAt(++E);break;case 125:case 59:if(1<(H=(K=(0<F?K.replace(f,""):K).trim()).length))switch(0===D&&(u=K.charCodeAt(0),45===u||96<u&&123>u)&&(H=(K=K.replace(" ",":")).length),0<P&&void 0!==(m=i(1,K,n,a,z,y,L.length,b,h,b))&&0===(H=(K=m.trim()).length)&&(K="\0\0"),u=K.charCodeAt(0),d=K.charCodeAt(1),u){case 0:break;case 64:if(105===d||99===d){Q+=K+l.charAt(E);break}default:58!==K.charCodeAt(H-1)&&(L+=t(K,u,d,K.charCodeAt(2)))}G=F=D=u=0,K="",d=l.charCodeAt(++E)}}switch(d){case 13:case 10:47===x?x=0:0===1+u&&107!==b&&0<K.length&&(F=1,K+="\0"),0<P*B&&i(0,K,n,a,z,y,L.length,b,h,b),y=1,z++;break;case 59:case 125:if(0===x+O+$+v){y++;break}default:switch(y++,A=l.charAt(E),d){case 9:case 32:if(0===O+v+x)switch(M){case 44:case 58:case 9:case 32:A="";break;default:32!==d&&(A=" ")}break;case 0:A="\\0";break;case 12:A="\\f";break;case 11:A="\\v";break;case 38:0===O+x+v&&(F=G=1,A="\f"+A);break;case 108:if(0===O+x+v+j&&0<D)switch(E-D){case 2:112===M&&58===l.charCodeAt(E-3)&&(j=M);case 8:111===q&&(j=q)}break;case 58:0===O+x+v&&(D=E);break;case 44:0===x+$+O+v&&(F=1,A+="\r");break;case 34:case 39:0===x&&(O=O===d?0:0===O?d:O);break;case 91:0===O+x+$&&v++;break;case 93:0===O+x+$&&v--;break;case 41:0===O+x+v&&$--;break;case 40:if(0===O+x+v){if(0===u)switch(2*M+3*q){case 533:break;default:u=1}$++}break;case 64:0===x+$+O+v+D+k&&(k=1);break;case 42:case 47:if(!(0<O+v+$))switch(x){case 0:switch(2*d+3*l.charCodeAt(E+1)){case 235:x=47;break;case 220:H=E,x=42}break;case 42:47===d&&42===M&&H+2!==E&&(33===l.charCodeAt(H+2)&&(L+=l.substring(H,E+1)),A="",x=0)}}0===x&&(K+=A)}q=M,M=d,E++}if(0<(H=L.length)){if(F=n,0<P&&void 0!==(m=i(2,L,F,a,z,y,H,b,h,b))&&0===(L=m).length)return Q+L+N;if(L=F.join(",")+"{"+L+"}",0!=S*j){switch(2!==S||c(L,2)||(j=0),j){case 111:L=L.replace(g,":-moz-$1")+L;break;case 112:L=L.replace(p,"::-webkit-input-$1")+L.replace(p,"::-moz-$1")+L.replace(p,":-ms-input-$1")+L}j=0}}return Q+L+N}(_,n,a,0,0);return 0<P&&(void 0!==(l=i(-2,b,n,n,z,y,b.length,0,0,0))&&(b=l)),"",j=0,y=z=1,b}var o=/^\0+/g,f=/[\0\r\f]/g,b=/: */g,h=/zoo|gra/,u=/([,: ])(transform)/g,d=/,\r+?/g,k=/([\t\r\n ])*\f?&/g,w=/@(k\w+)\s*(\S*)\s*/,p=/::(place)/g,g=/:(read-only)/g,A=/[svh]\w+-[tblr]{2}/,C=/\(\s*(.*)\s*\)/g,m=/([\s\S]*?);/g,v=/-self|flex-/g,x=/[^]*?(:[rp][el]a[\w-]+)[^]*/,$=/stretch|:\s*\w+\-(?:conte|avail)/,O=/([^-])(image-set\()/,y=1,z=1,j=0,S=1,_=[],M=[],P=0,q=null,B=0;return l.use=function e(r){switch(r){case void 0:case null:P=M.length=0;break;default:if("function"==typeof r)M[P++]=r;else if("object"==typeof r)for(var a=0,t=r.length;a<t;++a)e(r[a]);else B=0|!!r}return e},l.set=n,void 0!==e&&n(e),l}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var r=e;exports.default=r;
},{}],"RtcD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},e=o;exports.default=e;
},{}],"subt":[function(require,module,exports) {
"use strict";function e(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e;exports.default=t;
},{}],"F4RS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("@emotion/memoize"));function t(e){return e&&e.__esModule?e:{default:e}}var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=(0,e.default)(function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),n=i;exports.default=n;
},{"@emotion/memoize":"subt"}],"tFSs":[function(require,module,exports) {
var process = require("process");
var e=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.StyleSheetManager=ce,exports.ThemeProvider=ke,exports.createGlobalStyle=Be,exports.css=Se,exports.isStyledComponent=y,exports.keyframes=De,exports.withTheme=exports.version=exports.useTheme=exports.__PRIVATE__=exports.ThemeContext=exports.ThemeConsumer=exports.StyleSheetContext=exports.StyleSheetConsumer=exports.ServerStyleSheet=exports.default=void 0;var t=require("react-is"),r=c(require("react")),n=u(require("shallowequal")),o=u(require("@emotion/stylis")),i=u(require("@emotion/unitless")),s=u(require("@emotion/is-prop-valid")),a=u(require("hoist-non-react-statics"));function u(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var h=function(e,t){for(var r=[e[0]],n=0,o=t.length;n<o;n+=1)r.push(t[n],e[n+1]);return r},d=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,t.typeOf)(e)},p=Object.freeze([]),v=Object.freeze({});function g(e){return"function"==typeof e}function m(e){return e.displayName||e.name||"Component"}function y(e){return e&&"string"==typeof e.styledComponentId}var S="data-styled",b="5.2.1",w="undefined"!=typeof window&&"HTMLElement"in window,x=Boolean("boolean"==typeof SC_DISABLE_SPEEDY&&SC_DISABLE_SPEEDY),I={},C={};function A(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],r=1,n=arguments.length;r<n;r+=1)t.push(r<0||arguments.length<=r?void 0:arguments[r]);return t.forEach(function(t){e=e.replace(/%[a-z]/,t)}),e}function j(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}exports.version=b;var P=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r<e;r++)t+=this.groupSizes[r];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,o=n;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var i=n;i<o;i++)this.groupSizes[i]=0}for(var s=this.indexOfGroup(e+1),a=0,u=t.length;a<u;a++)this.tag.insertRule(s,t[a])&&(this.groupSizes[e]++,s++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),n=r+t;this.groupSizes[e]=0;for(var o=r;o<n;o++)this.tag.deleteRule(r)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),o=n+r,i=n;i<o;i++)t+=this.tag.getRule(i)+"/*!sc*/\n";return t},e}(),R=new Map,_=new Map,O=1,N=function(e){if(R.has(e))return R.get(e);for(;_.has(O);)O++;var t=O++;return R.set(e,t),_.set(t,e),t},E=function(e){return _.get(e)},T=function(e,t){R.set(e,t),_.set(t,e)},M="style["+S+'][data-styled-version="5.2.1"]',k=new RegExp("^"+S+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),z=function(e,t,r){for(var n,o=r.split(","),i=0,s=o.length;i<s;i++)(n=o[i])&&e.registerName(t,n)},F=function(e,t){for(var r=t.innerHTML.split("/*!sc*/\n"),n=[],o=0,i=r.length;o<i;o++){var s=r[o].trim();if(s){var a=s.match(k);if(a){var u=0|parseInt(a[1],10),l=a[2];0!==u&&(T(l,u),z(e,l,a[3]),e.getTag().insertRules(u,n)),n.length=0}else n.push(s)}}},q=function(){return"undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null},G=function(e){var t=document.head,r=e||t,n=document.createElement("style"),o=function(e){for(var t=e.childNodes,r=t.length;r>=0;r--){var n=t[r];if(n&&1===n.nodeType&&n.hasAttribute(S))return n}}(r),i=void 0!==o?o.nextSibling:null;n.setAttribute(S,"active"),n.setAttribute("data-styled-version","5.2.1");var s=q();return s&&n.setAttribute("nonce",s),r.insertBefore(n,i),n},B=function(){function e(e){var t=this.element=G(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,n=t.length;r<n;r++){var o=t[r];if(o.ownerNode===e)return o}j(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),D=function(){function e(e){var t=this.element=G(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(r,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),$=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),L=w,W={isServer:!w,useCSSOMInjection:!x},H=function(){function e(e,t,r){void 0===e&&(e=v),void 0===t&&(t={}),this.options=f({},W,{},e),this.gs=t,this.names=new Map(r),!this.options.isServer&&w&&L&&(L=!1,function(e){for(var t=document.querySelectorAll(M),r=0,n=t.length;r<n;r++){var o=t[r];o&&"active"!==o.getAttribute(S)&&(F(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return N(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(f({},this.options,{},t),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(r=(t=this.options).isServer,n=t.useCSSOMInjection,o=t.target,e=r?new $(o):n?new B(o):new D(o),new P(e)));var e,t,r,n,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(N(e),this.names.has(e))this.names.get(e).add(t);else{var r=new Set;r.add(t),this.names.set(e,r)}},t.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(N(e),r)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(N(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),r=t.length,n="",o=0;o<r;o++){var i=E(o);if(void 0!==i){var s=e.names.get(i),a=t.getGroup(o);if(void 0!==s&&0!==a.length){var u=S+".g"+o+'[id="'+i+'"]',l="";void 0!==s&&s.forEach(function(e){e.length>0&&(l+=e+",")}),n+=""+a+u+'{content:"'+l+'"}/*!sc*/\n'}}}return n}(this)},e}(),V=/(a)(d)/gi,U=function(e){return String.fromCharCode(e+(e>25?39:97))};function J(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=U(t%52)+r;return(U(t%52)+r).replace(V,"$1-$2")}var Y=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Z=function(e){return Y(5381,e)};function K(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(g(r)&&!y(r))return!1}return!0}var Q=Z("5.2.1"),X=function(){function e(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===r||r.isStatic)&&K(e),this.componentId=t,this.baseHash=Y(Q,t),this.baseStyle=r,H.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,r){var n=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))o.push(this.staticRulesId);else{var i=ye(this.rules,e,t,r).join(""),s=J(Y(this.baseHash,i.length)>>>0);if(!t.hasNameForId(n,s)){var a=r(i,"."+s,void 0,n);t.insertRules(n,s,a)}o.push(s),this.staticRulesId=s}else{for(var u=this.rules.length,l=Y(this.baseHash,r.hash),c="",f=0;f<u;f++){var h=this.rules[f];if("string"==typeof h)c+=h;else if(h){var d=ye(h,e,t,r),p=Array.isArray(d)?d.join(""):d;l=Y(l,p+f),c+=p}}if(c){var v=J(l>>>0);if(!t.hasNameForId(n,v)){var g=r(c,"."+v,void 0,n);t.insertRules(n,v,g)}o.push(v)}}return o.join(" ")},e}(),ee=/^\s*\/\/.*$/gm,te=[":","[",".","#"];function re(e){var t,r,n,i,s=void 0===e?v:e,a=s.options,u=void 0===a?v:a,l=s.plugins,c=void 0===l?p:l,f=new o.default(u),h=[],d=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,o,i,s,a,u,l,c,f){switch(r){case 1:if(0===c&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===l)return n+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(o[0]+n),"";default:return n+(0===f?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}(function(e){h.push(e)}),g=function(e,n,o){return 0===n&&te.includes(o[r.length])||o.match(i)?e:"."+t};function m(e,o,s,a){void 0===a&&(a="&");var u=e.replace(ee,""),l=o&&s?s+" "+o+" { "+u+" }":u;return t=a,r=o,n=new RegExp("\\"+r+"\\b","g"),i=new RegExp("(\\"+r+"\\b){2,}"),f(s||!o?"":o,l)}return f.use([].concat(c,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(r)>0&&(o[0]=o[0].replace(n,g))},d,function(e){if(-2===e){var t=h;return h=[],t}}])),m.hash=c.length?c.reduce(function(e,t){return t.name||j(15),Y(e,t.name)},5381).toString():"",m}var ne=r.default.createContext(),oe=ne.Consumer,ie=r.default.createContext(),se=(ie.Consumer,new H),ae=re();function ue(){return(0,r.useContext)(ne)||se}function le(){return(0,r.useContext)(ie)||ae}function ce(e){var t=(0,r.useState)(e.stylisPlugins),o=t[0],i=t[1],s=ue(),a=(0,r.useMemo)(function(){var t=s;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.sheet,e.target]),u=(0,r.useMemo)(function(){return re({options:{prefix:!e.disableVendorPrefixes},plugins:o})},[e.disableVendorPrefixes,o]);return(0,r.useEffect)(function(){(0,n.default)(o,e.stylisPlugins)||i(e.stylisPlugins)},[e.stylisPlugins]),r.default.createElement(ne.Provider,{value:a},r.default.createElement(ie.Provider,{value:u},e.children))}exports.StyleSheetConsumer=oe,exports.StyleSheetContext=ne;var fe=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=ae);var n=r.name+t.hash;e.hasNameForId(r.id,n)||e.insertRules(r.id,n,t(r.rules,n,"@keyframes"))},this.toString=function(){return j(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ae),this.name+e.hash},e}(),he=/([A-Z])/,de=/([A-Z])/g,pe=/^ms-/,ve=function(e){return"-"+e.toLowerCase()};function ge(e){return he.test(e)?e.replace(de,ve).replace(pe,"-ms-"):e}var me=function(e){return null==e||!1===e||""===e};function ye(e,t,r,n){if(Array.isArray(e)){for(var o,s=[],a=0,u=e.length;a<u;a+=1)""!==(o=ye(e[a],t,r,n))&&(Array.isArray(o)?s.push.apply(s,o):s.push(o));return s}if(me(e))return"";if(y(e))return"."+e.styledComponentId;if(g(e)){if("function"!=typeof(c=e)||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return ye(l,t,r,n)}var c;return e instanceof fe?r?(e.inject(r,n),e.getName(n)):e:d(e)?function e(t,r){var n,o,s=[];for(var a in t)t.hasOwnProperty(a)&&!me(t[a])&&(d(t[a])?s.push.apply(s,e(t[a],a)):g(t[a])?s.push(ge(a)+":",t[a],";"):s.push(ge(a)+": "+(n=a,null==(o=t[a])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||n in i.default?String(o).trim():o+"px")+";"));return r?[r+" {"].concat(s,["}"]):s}(e):e.toString()}function Se(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return g(e)||d(e)?ye(h(p,[e].concat(r))):0===r.length&&1===e.length&&"string"==typeof e[0]?e:ye(h(e,r))}var be=/invalid hook call/i,we=new Set,xe=function(e,t){},Ie=function(e,t,r){return void 0===r&&(r=v),e.theme!==r.theme&&e.theme||t||r.theme},Ce=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ae=/(^-|-$)/g;function je(e){return e.replace(Ce,"-").replace(Ae,"")}var Pe=function(e){return J(Z(e)>>>0)};function Re(e){return"string"==typeof e&&!0}var _e=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Oe=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ne(e,t,r){var n=e[r];_e(t)&&_e(n)?Ee(n,t):e[r]=t}function Ee(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var o=0,i=r;o<i.length;o++){var s=i[o];if(_e(s))for(var a in s)Oe(a)&&Ne(e,s[a],a)}return e}var Te=r.default.createContext(),Me=Te.Consumer;function ke(e){var t=(0,r.useContext)(Te),n=(0,r.useMemo)(function(){return function(e,t){if(!e)return j(14);if(g(e)){var r=e(t);return r}return Array.isArray(e)||"object"!=typeof e?j(8):t?f({},t,{},e):e}(e.theme,t)},[e.theme,t]);return e.children?r.default.createElement(Te.Provider,{value:n},e.children):null}exports.ThemeConsumer=Me,exports.ThemeContext=Te;var ze={};function Fe(e,t,n){var o=y(e),i=!Re(e),u=t.attrs,l=void 0===u?p:u,c=t.componentId,h=void 0===c?function(e,t){var r="string"!=typeof e?"sc":je(e);ze[r]=(ze[r]||0)+1;var n=r+"-"+Pe("5.2.1"+r+ze[r]);return t?t+"-"+n:n}(t.displayName,t.parentComponentId):c,d=t.displayName,S=void 0===d?function(e){return Re(e)?"styled."+e:"Styled("+m(e)+")"}(e):d,b=t.displayName&&t.componentId?je(t.displayName)+"-"+t.componentId:t.componentId||h,w=o&&e.attrs?Array.prototype.concat(e.attrs,l).filter(Boolean):l,x=t.shouldForwardProp;o&&e.shouldForwardProp&&(x=t.shouldForwardProp?function(r,n){return e.shouldForwardProp(r,n)&&t.shouldForwardProp(r,n)}:e.shouldForwardProp);var I,C=new X(n,b,o?e.componentStyle:void 0),A=C.isStatic&&0===l.length,j=function(e,t){return function(e,t,n,o){var i=e.attrs,a=e.componentStyle,u=e.defaultProps,l=e.foldedComponentIds,c=e.shouldForwardProp,h=e.styledComponentId,d=e.target,p=function(e,t,r){void 0===e&&(e=v);var n=f({},t,{theme:e}),o={};return r.forEach(function(e){var t,r,i,s=e;for(t in g(s)&&(s=s(n)),s)n[t]=o[t]="className"===t?(r=o[t],i=s[t],r&&i?r+" "+i:r||i):s[t]}),[n,o]}(Ie(t,(0,r.useContext)(Te),u)||v,t,i),m=p[0],y=p[1],S=function(e,t,r,n){var o=ue(),i=le(),s=t?e.generateAndInjectStyles(v,o,i):e.generateAndInjectStyles(r,o,i);return s}(a,o,m),b=n,w=y.$as||t.$as||y.as||t.as||d,x=Re(w),I=y!==t?f({},t,{},y):t,C={};for(var A in I)"$"!==A[0]&&"as"!==A&&("forwardedAs"===A?C.as=I[A]:(c?c(A,s.default):!x||(0,s.default)(A))&&(C[A]=I[A]));return t.style&&y.style!==t.style&&(C.style=f({},t.style,{},y.style)),C.className=Array.prototype.concat(l,h,S!==h?S:null,t.className,y.className).filter(Boolean).join(" "),C.ref=b,(0,r.createElement)(w,C)}(I,e,t,A)};return j.displayName=S,(I=r.default.forwardRef(j)).attrs=w,I.componentStyle=C,I.displayName=S,I.shouldForwardProp=x,I.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):p,I.styledComponentId=b,I.target=o?e.target:e,I.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(t,["componentId"]),i=r&&r+"-"+(Re(e)?e:je(m(e)));return Fe(e,f({},o,{attrs:w,componentId:i}),n)},Object.defineProperty(I,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?Ee({},e.defaultProps,t):t}}),I.toString=function(){return"."+I.styledComponentId},i&&(0,a.default)(I,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),I}var qe=function(e){return function e(r,n,o){if(void 0===o&&(o=v),!(0,t.isValidElementType)(n))return j(1,String(n));var i=function(){return r(n,o,Se.apply(void 0,arguments))};return i.withConfig=function(t){return e(r,n,f({},o,{},t))},i.attrs=function(t){return e(r,n,f({},o,{attrs:Array.prototype.concat(o.attrs,t).filter(Boolean)}))},i}(Fe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){qe[e]=qe(e)});var Ge=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=K(e),H.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,r,n){var o=n(ye(this.rules,t,r,n).join(""),""),i=this.componentId+e;r.insertRules(i,i,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,r,n){e>2&&H.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)},e}();function Be(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=Se.apply(void 0,[e].concat(n)),s="sc-global-"+Pe(JSON.stringify(i)),a=new Ge(i,s);function u(e){var t=ue(),n=le(),o=(0,r.useContext)(Te),i=(0,r.useRef)(t.allocateGSInstance(s)).current;return(0,r.useLayoutEffect)(function(){return l(i,e,t,o,n),function(){return a.removeStyles(i,t)}},[i,e,t,o,n]),null}function l(e,t,r,n,o){if(a.isStatic)a.renderStyles(e,I,r,o);else{var i=f({},t,{theme:Ie(t,n,u.defaultProps)});a.renderStyles(e,i,r,o)}}return r.default.memo(u)}function De(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=Se.apply(void 0,[e].concat(r)).join(""),i=Pe(o);return new fe(i,o)}var $e=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),r=q();return"<style "+[r&&'nonce="'+r+'"',S+'="true"','data-styled-version="5.2.1"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?j(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return j(2);var n=((t={})[S]="",t["data-styled-version"]="5.2.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=q();return o&&(n.nonce=o),[r.default.createElement("style",f({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new H({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?j(2):r.default.createElement(ce,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return j(3)},e}(),Le=function(e){var t=r.default.forwardRef(function(t,n){var o=(0,r.useContext)(Te),i=e.defaultProps,s=Ie(t,o,i);return r.default.createElement(e,f({},t,{theme:s,ref:n}))});return(0,a.default)(t,e),t.displayName="WithTheme("+m(e)+")",t},We=function(){return(0,r.useContext)(Te)},He={StyleSheet:H,masterSheet:se};exports.__PRIVATE__=He,exports.useTheme=We,exports.withTheme=Le,exports.ServerStyleSheet=$e;var Ve=qe;exports.default=Ve;
},{"react-is":"H1RQ","react":"n8MK","shallowequal":"pz6A","@emotion/stylis":"gTWe","@emotion/unitless":"RtcD","@emotion/is-prop-valid":"F4RS","hoist-non-react-statics":"ElIr","process":"pBGv"}],"QFJf":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.darkTheme=exports.lightTheme=void 0;var e=require("@material-ui/core/styles");const t={primary:{main:"#DF5EE8"},secondary:{main:"#606060"}},o={typography:{code:{fontFamily:"'Source Code Pro', monospace",fontSize:"1rem"}}},a={borderRadius:"24px"},i={palette:t,additionalVariables:o,shape:a,typography:{fontFamily:["museo-sans","Source Code Pro"].join(","),display1:{fontWeight:700},display2:{fontWeight:700},display3:{fontWeight:900},display4:{fontWeight:900},body1:{fontWeight:500},body2:{fontWeight:500},button:{fontWeight:500,textTransform:"capitalize"},caption:{fontWeight:500,fontStyle:"italic"}}},r=t=>{const o={...i.palette,type:t};return(0,e.createMuiTheme)({...i,palette:o})},s=r("light");exports.lightTheme=s;const n=r("dark");exports.darkTheme=n;var p={light:s,dark:n};exports.default=p;
},{"@material-ui/core/styles":"UUDD"}],"AO8o":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ReactReduxContext=void 0;var e=t(require("react"));function t(e){return e&&e.__esModule?e:{default:e}}var r=e.default.createContext(null);exports.ReactReduxContext=r;var u=r;exports.default=u;
},{"react":"n8MK"}],"BRzg":[function(require,module,exports) {
"use strict";function t(t){t()}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getBatch=exports.setBatch=void 0;var e=t,r=function(t){return e=t};exports.setBatch=r;var o=function(){return e};exports.getBatch=o;
},{}],"xcjC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./batch"),t={notify:function(){}};function n(){var t=(0,e.getBatch)(),n=null,r=null;return{clear:function(){n=null,r=null},notify:function(){t(function(){for(var e=n;e;)e.callback(),e=e.next})},get:function(){for(var e=[],t=n;t;)e.push(t),t=t.next;return e},subscribe:function(e){var t=!0,s=r={callback:e,next:null,prev:r};return s.prev?s.prev.next=s:n=s,function(){t&&null!==n&&(t=!1,s.next?s.next.prev=s.prev:r=s.prev,s.prev?s.prev.next=s.next:n=s.next)}}}}var r=function(){function e(e,n){this.store=e,this.parentSub=n,this.unsubscribe=null,this.listeners=t,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var r=e.prototype;return r.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},r.notifyNestedSubs=function(){this.listeners.notify()},r.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},r.isSubscribed=function(){return Boolean(this.unsubscribe)},r.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=n())},r.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=t)},e}();exports.default=r;
},{"./batch":"BRzg"}],"N7CO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useIsomorphicLayoutEffect=void 0;var e=require("react"),o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;exports.useIsomorphicLayoutEffect=o;
},{"react":"n8MK"}],"tkWy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),t=o(require("prop-types")),r=require("./Context"),n=o(require("../utils/Subscription")),u=require("../utils/useIsomorphicLayoutEffect");function o(e){return e&&e.__esModule?e:{default:e}}function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=n?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function s(t){var o=t.store,i=t.context,a=t.children,s=(0,e.useMemo)(function(){var e=new n.default(o);return e.onStateChange=e.notifyNestedSubs,{store:o,subscription:e}},[o]),c=(0,e.useMemo)(function(){return o.getState()},[o]);(0,u.useIsomorphicLayoutEffect)(function(){var e=s.subscription;return e.trySubscribe(),c!==o.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[s,c]);var f=i||r.ReactReduxContext;return e.default.createElement(f.Provider,{value:s},a)}var c=s;exports.default=c;
},{"react":"n8MK","prop-types":"D9Od","./Context":"AO8o","../utils/Subscription":"xcjC","../utils/useIsomorphicLayoutEffect":"N7CO"}],"Drzq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=C;var e=s(require("@babel/runtime/helpers/esm/extends")),t=s(require("@babel/runtime/helpers/esm/objectWithoutPropertiesLoose")),r=s(require("hoist-non-react-statics")),n=f(require("react")),u=require("react-is"),o=s(require("../utils/Subscription")),a=require("../utils/useIsomorphicLayoutEffect"),i=require("./Context");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=n?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function s(e){return e&&e.__esModule?e:{default:e}}var d=[],l=[null,null],p=function(e){try{return JSON.stringify(e)}catch(t){return String(e)}};function m(e,t){var r=e[1];return[t.payload,r+1]}function v(e,t,r){(0,a.useIsomorphicLayoutEffect)(function(){return e.apply(void 0,t)},r)}function y(e,t,r,n,u,o,a){e.current=n,t.current=u,r.current=!1,o.current&&(o.current=null,a())}function h(e,t,r,n,u,o,a,i,c,f){if(e){var s=!1,d=null,l=function(){if(!s){var e,r,l=t.getState();try{e=n(l,u.current)}catch(p){r=p,d=p}r||(d=null),e===o.current?a.current||c():(o.current=e,i.current=e,a.current=!0,f({type:"STORE_UPDATED",payload:{error:r}}))}};r.onStateChange=l,r.trySubscribe(),l();return function(){if(s=!0,r.tryUnsubscribe(),r.onStateChange=null,d)throw d}}}var b=function(){return[null,0]};function C(a,c){void 0===c&&(c={});var f=c,s=f.getDisplayName,p=void 0===s?function(e){return"ConnectAdvanced("+e+")"}:s,C=f.methodName,R=void 0===C?"connectAdvanced":C,g=f.renderCountProp,w=void 0===g?void 0:g,x=f.shouldHandleStateChanges,S=void 0===x||x,M=f.storeKey,N=void 0===M?"store":M,P=(f.withRef,f.forwardRef),O=void 0!==P&&P,j=f.context,q=void 0===j?i.ReactReduxContext:j,E=(0,t.default)(f,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),D=q;return function(i){var c=i.displayName||i.name||"Component",f=p(c),s=(0,e.default)({},E,{getDisplayName:p,methodName:R,renderCountProp:w,shouldHandleStateChanges:S,storeKey:N,displayName:f,wrappedComponentName:c,WrappedComponent:i}),C=E.pure;var g=C?n.useMemo:function(e){return e()};function x(r){var c=(0,n.useMemo)(function(){var e=r.reactReduxForwardedRef,n=(0,t.default)(r,["reactReduxForwardedRef"]);return[r.context,e,n]},[r]),f=c[0],p=c[1],C=c[2],R=(0,n.useMemo)(function(){return f&&f.Consumer&&(0,u.isContextConsumer)(n.default.createElement(f.Consumer,null))?f:D},[f,D]),w=(0,n.useContext)(R),x=Boolean(r.store)&&Boolean(r.store.getState)&&Boolean(r.store.dispatch);Boolean(w)&&Boolean(w.store);var M=x?r.store:w.store,N=(0,n.useMemo)(function(){return function(e){return a(e.dispatch,s)}(M)},[M]),P=(0,n.useMemo)(function(){if(!S)return l;var e=new o.default(M,x?null:w.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[M,x,w]),O=P[0],j=P[1],q=(0,n.useMemo)(function(){return x?w:(0,e.default)({},w,{subscription:O})},[x,w,O]),E=(0,n.useReducer)(m,d,b),_=E[0][0],W=E[1];if(_&&_.error)throw _.error;var B=(0,n.useRef)(),A=(0,n.useRef)(C),F=(0,n.useRef)(),H=(0,n.useRef)(!1),K=g(function(){return F.current&&C===A.current?F.current:N(M.getState(),C)},[M,_,C]);v(y,[A,B,H,C,K,F,j]),v(h,[S,M,O,N,A,B,H,F,j,W],[M,O,N]);var L=(0,n.useMemo)(function(){return n.default.createElement(i,(0,e.default)({},K,{ref:p}))},[p,i,K]);return(0,n.useMemo)(function(){return S?n.default.createElement(R.Provider,{value:q},L):L},[R,L,q])}var M=C?n.default.memo(x):x;if(M.WrappedComponent=i,M.displayName=f,O){var P=n.default.forwardRef(function(t,r){return n.default.createElement(M,(0,e.default)({},t,{reactReduxForwardedRef:r}))});return P.displayName=f,P.WrappedComponent=i,(0,r.default)(P,i)}return(0,r.default)(M,i)}}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutPropertiesLoose":"Vabl","hoist-non-react-statics":"ElIr","react":"n8MK","react-is":"H1RQ","../utils/Subscription":"xcjC","../utils/useIsomorphicLayoutEffect":"N7CO","./Context":"AO8o"}],"lY55":[function(require,module,exports) {
"use strict";function e(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function t(t,r){if(e(t,r))return!0;if("object"!=typeof t||null===t||"object"!=typeof r||null===r)return!1;var n=Object.keys(t),o=Object.keys(r);if(n.length!==o.length)return!1;for(var u=0;u<n.length;u++)if(!Object.prototype.hasOwnProperty.call(r,n[u])||!e(t[n[u]],r[n[u]]))return!1;return!0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;
},{}],"JZ8d":[function(require,module,exports) {
"use strict";function e(e){var o,r=e.Symbol;return"function"==typeof r?r.observable?o=r.observable:(o=r("observable"),r.observable=o):o="@@observable",o}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"LkZ7":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var d,o=t(require("./ponyfill.js"));function t(e){return e&&e.__esModule?e:{default:e}}d="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof module?module:Function("return this")();var u=(0,o.default)(d),n=u;exports.default=n;
},{"./ponyfill.js":"JZ8d"}],"aVFJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.applyMiddleware=w,exports.bindActionCreators=p,exports.combineReducers=f,exports.compose=b,exports.createStore=i,exports.__DO_NOT_USE__ActionTypes=void 0;var e=t(require("symbol-observable"));function t(e){return e&&e.__esModule?e:{default:e}}var r=function(){return Math.random().toString(36).substring(7).split("").join(".")},n={INIT:"@@redux/INIT"+r(),REPLACE:"@@redux/REPLACE"+r(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+r()}};function o(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function i(t,r,u){var c;if("function"==typeof r&&"function"==typeof u||"function"==typeof u&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof r&&void 0===u&&(u=r,r=void 0),void 0!==u){if("function"!=typeof u)throw new Error("Expected the enhancer to be a function.");return u(i)(t,r)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var a=t,s=r,f=[],d=f,p=!1;function l(){d===f&&(d=f.slice())}function h(){if(p)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function y(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(p)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return l(),d.push(e),function(){if(t){if(p)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,l();var r=d.indexOf(e);d.splice(r,1),f=null}}}function b(e){if(!o(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,s=a(s,e)}finally{p=!1}for(var t=f=d,r=0;r<t.length;r++){(0,t[r])()}return e}return b({type:n.INIT}),(c={dispatch:b,subscribe:y,getState:h,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");a=e,b({type:n.REPLACE})}})[e.default]=function(){var t,r=y;return(t={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function t(){e.next&&e.next(h())}return t(),{unsubscribe:r(t)}}})[e.default]=function(){return this},t},c}function u(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(t){}}function c(e,t){var r=t&&t.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function a(e,t,r,i){var u=Object.keys(t),c=r&&r.type===n.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===u.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!o(e))return"The "+c+' has unexpected type of "'+{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1]+'". Expected argument to be an object with the following keys: "'+u.join('", "')+'"';var a=Object.keys(e).filter(function(e){return!t.hasOwnProperty(e)&&!i[e]});return a.forEach(function(e){i[e]=!0}),r&&r.type===n.REPLACE?void 0:a.length>0?"Unexpected "+(a.length>1?"keys":"key")+' "'+a.join('", "')+'" found in '+c+'. Expected to find one of the known reducer keys instead: "'+u.join('", "')+'". Unexpected keys will be ignored.':void 0}function s(e){Object.keys(e).forEach(function(t){var r=e[t];if(void 0===r(void 0,{type:n.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:n.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+n.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function f(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];0,"function"==typeof e[o]&&(r[o]=e[o])}var i,u=Object.keys(r);try{s(r)}catch(a){i=a}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var n=!1,o={},a=0;a<u.length;a++){var s=u[a],f=r[s],d=e[s],p=f(d,t);if(void 0===p){var l=c(s,t);throw new Error(l)}o[s]=p,n=n||p!==d}return(n=n||u.length!==Object.keys(e).length)?o:e}}function d(e,t){return function(){return t(e.apply(this,arguments))}}function p(e,t){if("function"==typeof e)return d(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var n in e){var o=e[n];"function"==typeof o&&(r[n]=d(o,t))}return r}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(r,!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function b(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function w(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=t.map(function(e){return e(o)});return y({},r,{dispatch:n=b.apply(void 0,i)(r.dispatch)})}}}function v(){}exports.__DO_NOT_USE__ActionTypes=n;
},{"symbol-observable":"LkZ7"}],"FHLP":[function(require,module,exports) {
"use strict";function e(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return t===r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"KaIY":[function(require,module,exports) {
"use strict";function e(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(o){}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"Fin2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=r(require("./isPlainObject")),t=r(require("./warning"));function r(e){return e&&e.__esModule?e:{default:e}}function u(r,u,n){(0,e.default)(r)||(0,t.default)(n+"() in "+u+" must return a plain object. Instead received "+r+".")}
},{"./isPlainObject":"FHLP","./warning":"KaIY"}],"mtLD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wrapMapToPropsConstant=r,exports.getDependsOnOwnProps=o,exports.wrapMapToPropsFunc=p;var n=e(require("../utils/verifyPlainObject"));function e(n){return n&&n.__esModule?n:{default:n}}function r(n){return function(e,r){var o=n(e,r);function p(){return o}return p.dependsOnOwnProps=!1,p}}function o(n){return null!==n.dependsOnOwnProps&&void 0!==n.dependsOnOwnProps?Boolean(n.dependsOnOwnProps):1!==n.length}function p(n,e){return function(e,r){r.displayName;var p=function(n,e){return p.dependsOnOwnProps?p.mapToProps(n,e):p.mapToProps(n)};return p.dependsOnOwnProps=!0,p.mapToProps=function(e,r){p.mapToProps=n,p.dependsOnOwnProps=o(n);var s=p(e,r);return"function"==typeof s&&(p.mapToProps=s,p.dependsOnOwnProps=o(s),s=p(e,r)),s},p}}
},{"../utils/verifyPlainObject":"Fin2"}],"Qb4D":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.whenMapDispatchToPropsIsFunction=t,exports.whenMapDispatchToPropsIsMissing=e,exports.whenMapDispatchToPropsIsObject=p,exports.default=void 0;var o=require("redux"),r=require("./wrapMapToProps");function t(o){return"function"==typeof o?(0,r.wrapMapToPropsFunc)(o,"mapDispatchToProps"):void 0}function e(o){return o?void 0:(0,r.wrapMapToPropsConstant)(function(o){return{dispatch:o}})}function p(t){return t&&"object"==typeof t?(0,r.wrapMapToPropsConstant)(function(r){return(0,o.bindActionCreators)(t,r)}):void 0}var n=[t,e,p];exports.default=n;
},{"redux":"aVFJ","./wrapMapToProps":"mtLD"}],"gCs6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.whenMapStateToPropsIsFunction=t,exports.whenMapStateToPropsIsMissing=r,exports.default=void 0;var o=require("./wrapMapToProps");function t(t){return"function"==typeof t?(0,o.wrapMapToPropsFunc)(t,"mapStateToProps"):void 0}function r(t){return t?void 0:(0,o.wrapMapToPropsConstant)(function(){return{}})}var e=[t,r];exports.default=e;
},{"./wrapMapToProps":"mtLD"}],"gSdO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultMergeProps=n,exports.wrapMergePropsFunc=u,exports.whenMergePropsIsFunction=o,exports.whenMergePropsIsOmitted=i,exports.default=void 0;var e=t(require("@babel/runtime/helpers/esm/extends")),r=t(require("../utils/verifyPlainObject"));function t(e){return e&&e.__esModule?e:{default:e}}function n(r,t,n){return(0,e.default)({},n,r,t)}function u(e){return function(r,t){t.displayName;var n,u=t.pure,o=t.areMergedPropsEqual,i=!1;return function(r,t,s){var p=e(r,t,s);return i?u&&o(p,n)||(n=p):(i=!0,n=p),n}}}function o(e){return"function"==typeof e?u(e):void 0}function i(e){return e?void 0:function(){return n}}var s=[o,i];exports.default=s;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","../utils/verifyPlainObject":"Fin2"}],"eB6X":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;var e=o(require("../utils/warning"));function o(e){return e&&e.__esModule?e:{default:e}}function r(o,r,t){if(!o)throw new Error("Unexpected value for "+r+" in "+t+".");"mapStateToProps"!==r&&"mapDispatchToProps"!==r||Object.prototype.hasOwnProperty.call(o,"dependsOnOwnProps")||(0,e.default)("The selector for "+r+" of "+t+" did not specify a value for dependsOnOwnProps.")}function t(e,o,t,p){r(e,"mapStateToProps",p),r(o,"mapDispatchToProps",p),r(t,"mergeProps",p)}
},{"../utils/warning":"KaIY"}],"I2Bg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.impureFinalPropsSelectorFactory=n,exports.pureFinalPropsSelectorFactory=o,exports.default=s;var e=t(require("@babel/runtime/helpers/esm/objectWithoutPropertiesLoose")),r=t(require("./verifySubselectors"));function t(e){return e&&e.__esModule?e:{default:e}}function n(e,r,t,n){return function(o,s){return t(e(o,s),r(n,s),s)}}function o(e,r,t,n,o){var s,i,p,u,a,c=o.areStatesEqual,l=o.areOwnPropsEqual,P=o.areStatePropsEqual,d=!1;function f(o,d){var f,M,O=!l(d,i),S=!c(o,s);return s=o,i=d,O&&S?(p=e(s,i),r.dependsOnOwnProps&&(u=r(n,i)),a=t(p,u,i)):O?(e.dependsOnOwnProps&&(p=e(s,i)),r.dependsOnOwnProps&&(u=r(n,i)),a=t(p,u,i)):S?(f=e(s,i),M=!P(f,p),p=f,M&&(a=t(p,u,i)),a):a}return function(o,c){return d?f(o,c):(p=e(s=o,i=c),u=r(n,i),a=t(p,u,i),d=!0,a)}}function s(r,t){var s=t.initMapStateToProps,i=t.initMapDispatchToProps,p=t.initMergeProps,u=(0,e.default)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),a=s(r,u),c=i(r,u),l=p(r,u);return(u.pure?o:n)(a,c,l,r,u)}
},{"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose":"Vabl","./verifySubselectors":"eB6X"}],"mgO7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createConnect=d,exports.default=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/objectWithoutPropertiesLoose")),t=i(require("../components/connectAdvanced")),o=i(require("../utils/shallowEqual")),a=i(require("./mapDispatchToProps")),u=i(require("./mapStateToProps")),n=i(require("./mergeProps")),s=i(require("./selectorFactory"));function i(e){return e&&e.__esModule?e:{default:e}}function p(e,r,t){for(var o=r.length-1;o>=0;o--){var a=r[o](e);if(a)return a}return function(r,o){throw new Error("Invalid value of type "+typeof e+" for "+t+" argument when connecting component "+o.wrappedComponentName+".")}}function l(e,r){return e===r}function d(i){var d=void 0===i?{}:i,c=d.connectHOC,f=void 0===c?t.default:c,v=d.mapStateToPropsFactories,P=void 0===v?u.default:v,m=d.mapDispatchToPropsFactories,q=void 0===m?a.default:m,h=d.mergePropsFactories,E=void 0===h?n.default:h,g=d.selectorFactory,S=void 0===g?s.default:g;return function(t,a,u,n){void 0===n&&(n={});var s=n,i=s.pure,d=void 0===i||i,c=s.areStatesEqual,v=void 0===c?l:c,m=s.areOwnPropsEqual,h=void 0===m?o.default:m,g=s.areStatePropsEqual,w=void 0===g?o.default:g,M=s.areMergedPropsEqual,T=void 0===M?o.default:M,b=(0,r.default)(s,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),y=p(t,P,"mapStateToProps"),x=p(a,q,"mapDispatchToProps"),C=p(u,E,"mergeProps");return f(S,(0,e.default)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:y,initMapDispatchToProps:x,initMergeProps:C,pure:d,areStatesEqual:v,areOwnPropsEqual:h,areStatePropsEqual:w,areMergedPropsEqual:T},b))}}var c=d();exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutPropertiesLoose":"Vabl","../components/connectAdvanced":"Drzq","../utils/shallowEqual":"lY55","./mapDispatchToProps":"Qb4D","./mapStateToProps":"gCs6","./mergeProps":"gSdO","./selectorFactory":"I2Bg"}],"IxK1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useReduxContext=r;var e=require("react"),t=require("../components/Context");function r(){var r=(0,e.useContext)(t.ReactReduxContext);return r}
},{"react":"n8MK","../components/Context":"AO8o"}],"jSpA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createStoreHook=o,exports.useStore=void 0;var e=require("react"),t=require("../components/Context"),r=require("./useReduxContext");function o(o){void 0===o&&(o=t.ReactReduxContext);var u=o===t.ReactReduxContext?r.useReduxContext:function(){return(0,e.useContext)(o)};return function(){return u().store}}var u=o();exports.useStore=u;
},{"react":"n8MK","../components/Context":"AO8o","./useReduxContext":"IxK1"}],"BnBj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createDispatchHook=r,exports.useDispatch=void 0;var e=require("../components/Context"),t=require("./useStore");function r(r){void 0===r&&(r=e.ReactReduxContext);var o=r===e.ReactReduxContext?t.useStore:(0,t.createStoreHook)(r);return function(){return o().dispatch}}var o=r();exports.useDispatch=o;
},{"../components/Context":"AO8o","./useStore":"jSpA"}],"xPUT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createSelectorHook=i,exports.useSelector=void 0;var e=require("react"),r=require("./useReduxContext"),t=c(require("../utils/Subscription")),u=require("../utils/useIsomorphicLayoutEffect"),n=require("../components/Context");function c(e){return e&&e.__esModule?e:{default:e}}var o=function(e,r){return e===r};function s(r,n,c,o){var s,i=(0,e.useReducer)(function(e){return e+1},0)[1],a=(0,e.useMemo)(function(){return new t.default(c,o)},[c,o]),f=(0,e.useRef)(),d=(0,e.useRef)(),v=(0,e.useRef)(),x=(0,e.useRef)(),l=c.getState();try{if(r!==d.current||l!==v.current||f.current){var p=r(l);s=void 0!==x.current&&n(p,x.current)?x.current:p}else s=x.current}catch(R){throw f.current&&(R.message+="\nThe error may be correlated with this previous error:\n"+f.current.stack+"\n\n"),R}return(0,u.useIsomorphicLayoutEffect)(function(){d.current=r,v.current=l,x.current=s,f.current=void 0}),(0,u.useIsomorphicLayoutEffect)(function(){function e(){try{var e=d.current(c.getState());if(n(e,x.current))return;x.current=e}catch(R){f.current=R}i()}return a.onStateChange=e,a.trySubscribe(),e(),function(){return a.tryUnsubscribe()}},[c,a]),s}function i(t){void 0===t&&(t=n.ReactReduxContext);var u=t===n.ReactReduxContext?r.useReduxContext:function(){return(0,e.useContext)(t)};return function(r,t){void 0===t&&(t=o);var n=u(),c=s(r,t,n.store,n.subscription);return(0,e.useDebugValue)(c),c}}var a=i();exports.useSelector=a;
},{"react":"n8MK","./useReduxContext":"IxK1","../utils/Subscription":"xcjC","../utils/useIsomorphicLayoutEffect":"N7CO","../components/Context":"AO8o"}],"FDMQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"unstable_batchedUpdates",{enumerable:!0,get:function(){return e.unstable_batchedUpdates}});var e=require("react-dom");
},{"react-dom":"NKHc"}],"jYIL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Provider",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"connectAdvanced",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"ReactReduxContext",{enumerable:!0,get:function(){return r.ReactReduxContext}}),Object.defineProperty(exports,"connect",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"useDispatch",{enumerable:!0,get:function(){return o.useDispatch}}),Object.defineProperty(exports,"createDispatchHook",{enumerable:!0,get:function(){return o.createDispatchHook}}),Object.defineProperty(exports,"useSelector",{enumerable:!0,get:function(){return u.useSelector}}),Object.defineProperty(exports,"createSelectorHook",{enumerable:!0,get:function(){return u.createSelectorHook}}),Object.defineProperty(exports,"useStore",{enumerable:!0,get:function(){return c.useStore}}),Object.defineProperty(exports,"createStoreHook",{enumerable:!0,get:function(){return c.createStoreHook}}),Object.defineProperty(exports,"batch",{enumerable:!0,get:function(){return s.unstable_batchedUpdates}}),Object.defineProperty(exports,"shallowEqual",{enumerable:!0,get:function(){return i.default}});var e=p(require("./components/Provider")),t=p(require("./components/connectAdvanced")),r=require("./components/Context"),n=p(require("./connect/connect")),o=require("./hooks/useDispatch"),u=require("./hooks/useSelector"),c=require("./hooks/useStore"),a=require("./utils/batch"),s=require("./utils/reactBatchedUpdates"),i=p(require("./utils/shallowEqual"));function p(e){return e&&e.__esModule?e:{default:e}}(0,a.setBatch)(s.unstable_batchedUpdates);
},{"./components/Provider":"tkWy","./components/connectAdvanced":"Drzq","./components/Context":"AO8o","./connect/connect":"mgO7","./hooks/useDispatch":"BnBj","./hooks/useSelector":"xPUT","./hooks/useStore":"jSpA","./utils/batch":"BRzg","./utils/reactBatchedUpdates":"FDMQ","./utils/shallowEqual":"lY55"}],"vCxL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__extends=e,exports.__rest=n,exports.__decorate=o,exports.__param=a,exports.__metadata=i,exports.__awaiter=u,exports.__generator=c,exports.__createBinding=f,exports.__exportStar=l,exports.__values=s,exports.__read=p,exports.__spread=y,exports.__spreadArrays=_,exports.__await=h,exports.__asyncGenerator=v,exports.__asyncDelegator=d,exports.__asyncValues=b,exports.__makeTemplateObject=w,exports.__importStar=x,exports.__importDefault=m,exports.__classPrivateFieldGet=O,exports.__classPrivateFieldSet=g,exports.__assign=void 0;var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};function e(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return exports.__assign=r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function n(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function o(t,e,r,n){var o,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(i=(a<3?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i}function a(t,e){return function(r,n){e(r,n,t)}}function i(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function u(t,e,r,n){return new(r||(r=Promise))(function(o,a){function i(t){try{c(n.next(t))}catch(e){a(e)}}function u(t){try{c(n.throw(t))}catch(e){a(e)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(i,u)}c((n=n.apply(t,e||[])).next())})}function c(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function f(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}function l(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||(e[r]=t[r])}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,a=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(u){o={error:u}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function _(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var a=arguments[e],i=0,u=a.length;i<u;i++,o++)n[o]=a[i];return n}function h(t){return this instanceof h?(this.v=t,this):new h(t)}function v(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(t){o[t]&&(n[t]=function(e){return new Promise(function(r,n){a.push([t,e,r,n])>1||u(t,e)})})}function u(t,e){try{(r=o[t](e)).value instanceof h?Promise.resolve(r.value.v).then(c,f):l(a[0][2],r)}catch(n){l(a[0][3],n)}var r}function c(t){u("next",t)}function f(t){u("throw",t)}function l(t,e){t(e),a.shift(),a.length&&u(a[0][0],a[0][1])}}function d(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:h(t[n](e)),done:"return"===n}:o?o(e):e}:o}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof s?s(t):t[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,o){(function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)})(n,o,(e=t[r](e)).done,e.value)})}}}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function x(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}function O(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function g(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}exports.__assign=r;
},{}],"Qnsq":[function(require,module,exports) {
"use strict";function e(e){return"function"==typeof e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isFunction=e;
},{}],"Q3iD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.config=void 0;var e=!1,r={Promise:void 0,set useDeprecatedSynchronousErrorHandling(r){r&&(new Error).stack;e=r},get useDeprecatedSynchronousErrorHandling(){return e}};exports.config=r;
},{}],"JfKC":[function(require,module,exports) {
"use strict";function e(e){setTimeout(function(){throw e},0)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.hostReportError=e;
},{}],"wIlR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.empty=void 0;var e=require("./config"),r=require("./util/hostReportError"),o={closed:!0,next:function(e){},error:function(o){if(e.config.useDeprecatedSynchronousErrorHandling)throw o;(0,r.hostReportError)(o)},complete:function(){}};exports.empty=o;
},{"./config":"Q3iD","./util/hostReportError":"JfKC"}],"KeTG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isArray=void 0;var r=function(){return Array.isArray||function(r){return r&&"number"==typeof r.length}}();exports.isArray=r;
},{}],"nU7r":[function(require,module,exports) {
"use strict";function e(e){return null!==e&&"object"==typeof e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isObject=e;
},{}],"pMaL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UnsubscriptionError=void 0;var r=function(){function r(r){return Error.call(this),this.message=r?r.length+" errors occurred during unsubscription:\n"+r.map(function(r,t){return t+1+") "+r.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=r,this}return r.prototype=Object.create(Error.prototype),r}(),t=r;exports.UnsubscriptionError=t;
},{}],"I8KM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Subscription=void 0;var r=require("./util/isArray"),i=require("./util/isObject"),s=require("./util/isFunction"),t=require("./util/UnsubscriptionError"),n=function(){function n(r){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,r&&(this._ctorUnsubscribe=!0,this._unsubscribe=r)}var o;return n.prototype.unsubscribe=function(){var o;if(!this.closed){var u=this._parentOrParents,c=this._ctorUnsubscribe,a=this._unsubscribe,f=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,u instanceof n)u.remove(this);else if(null!==u)for(var b=0;b<u.length;++b){u[b].remove(this)}if((0,s.isFunction)(a)){c&&(this._unsubscribe=void 0);try{a.call(this)}catch(l){o=l instanceof t.UnsubscriptionError?e(l.errors):[l]}}if((0,r.isArray)(f)){b=-1;for(var h=f.length;++b<h;){var p=f[b];if((0,i.isObject)(p))try{p.unsubscribe()}catch(l){o=o||[],l instanceof t.UnsubscriptionError?o=o.concat(e(l.errors)):o.push(l)}}}if(o)throw new t.UnsubscriptionError(o)}},n.prototype.add=function(r){var i=r;if(!r)return n.EMPTY;switch(typeof r){case"function":i=new n(r);case"object":if(i===this||i.closed||"function"!=typeof i.unsubscribe)return i;if(this.closed)return i.unsubscribe(),i;if(!(i instanceof n)){var s=i;(i=new n)._subscriptions=[s]}break;default:throw new Error("unrecognized teardown "+r+" added to Subscription.")}var t=i._parentOrParents;if(null===t)i._parentOrParents=this;else if(t instanceof n){if(t===this)return i;i._parentOrParents=[t,this]}else{if(-1!==t.indexOf(this))return i;t.push(this)}var e=this._subscriptions;return null===e?this._subscriptions=[i]:e.push(i),i},n.prototype.remove=function(r){var i=this._subscriptions;if(i){var s=i.indexOf(r);-1!==s&&i.splice(s,1)}},n.EMPTY=((o=new n).closed=!0,o),n}();function e(r){return r.reduce(function(r,i){return r.concat(i instanceof t.UnsubscriptionError?i.errors:i)},[])}exports.Subscription=n;
},{"./util/isArray":"KeTG","./util/isObject":"nU7r","./util/isFunction":"Qnsq","./util/UnsubscriptionError":"pMaL"}],"yAZp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.$$rxSubscriber=exports.rxSubscriber=void 0;var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}();exports.rxSubscriber=r;var e=r;exports.$$rxSubscriber=e;
},{}],"RaFB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SafeSubscriber=exports.Subscriber=void 0;var r=u(require("tslib")),t=require("./util/isFunction"),e=require("./Observer"),n=require("./Subscription"),o=require("../internal/symbol/rxSubscriber"),i=require("./config"),s=require("./util/hostReportError");function c(){if("function"!=typeof WeakMap)return null;var r=new WeakMap;return c=function(){return r},r}function u(r){if(r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var t=c();if(t&&t.has(r))return t.get(r);var e={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o)){var i=n?Object.getOwnPropertyDescriptor(r,o):null;i&&(i.get||i.set)?Object.defineProperty(e,o,i):e[o]=r[o]}return e.default=r,t&&t.set(r,e),e}var p=function(t){function n(r,o,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=e.empty;break;case 1:if(!r){s.destination=e.empty;break}if("object"==typeof r){r instanceof n?(s.syncErrorThrowable=r.syncErrorThrowable,s.destination=r,r.add(s)):(s.syncErrorThrowable=!0,s.destination=new b(s,r));break}default:s.syncErrorThrowable=!0,s.destination=new b(s,r,o,i)}return s}return r.__extends(n,t),n.prototype[o.rxSubscriber]=function(){return this},n.create=function(r,t,e){var o=new n(r,t,e);return o.syncErrorThrowable=!1,o},n.prototype.next=function(r){this.isStopped||this._next(r)},n.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},n.prototype._next=function(r){this.destination.next(r)},n.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},n}(n.Subscription);exports.Subscriber=p;var b=function(n){function o(r,o,i,s){var c,u=n.call(this)||this;u._parentSubscriber=r;var p=u;return(0,t.isFunction)(o)?c=o:o&&(c=o.next,i=o.error,s=o.complete,o!==e.empty&&(p=Object.create(o),(0,t.isFunction)(p.unsubscribe)&&u.add(p.unsubscribe.bind(p)),p.unsubscribe=u.unsubscribe.bind(u))),u._context=p,u._next=c,u._error=i,u._complete=s,u}return r.__extends(o,n),o.prototype.next=function(r){if(!this.isStopped&&this._next){var t=this._parentSubscriber;i.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,r)&&this.unsubscribe():this.__tryOrUnsub(this._next,r)}},o.prototype.error=function(r){if(!this.isStopped){var t=this._parentSubscriber,e=i.config.useDeprecatedSynchronousErrorHandling;if(this._error)e&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,r),this.unsubscribe()):(this.__tryOrUnsub(this._error,r),this.unsubscribe());else if(t.syncErrorThrowable)e?(t.syncErrorValue=r,t.syncErrorThrown=!0):(0,s.hostReportError)(r),this.unsubscribe();else{if(this.unsubscribe(),e)throw r;(0,s.hostReportError)(r)}}},o.prototype.complete=function(){var r=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var e=function(){return r._complete.call(r._context)};i.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}},o.prototype.__tryOrUnsub=function(r,t){try{r.call(this._context,t)}catch(e){if(this.unsubscribe(),i.config.useDeprecatedSynchronousErrorHandling)throw e;(0,s.hostReportError)(e)}},o.prototype.__tryOrSetError=function(r,t,e){if(!i.config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,e)}catch(n){return i.config.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=n,r.syncErrorThrown=!0,!0):((0,s.hostReportError)(n),!0)}return!1},o.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},o}(p);exports.SafeSubscriber=b;
},{"tslib":"vCxL","./util/isFunction":"Qnsq","./Observer":"wIlR","./Subscription":"I8KM","../internal/symbol/rxSubscriber":"yAZp","./config":"Q3iD","./util/hostReportError":"JfKC"}],"wHmS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.canReportError=e;var r=require("../Subscriber");function e(e){for(;e;){var t=e,o=t.closed,i=t.destination,n=t.isStopped;if(o||n)return!1;e=i&&i instanceof r.Subscriber?i:null}return!0}
},{"../Subscriber":"RaFB"}],"SEU0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toSubscriber=i;var r=require("../Subscriber"),e=require("../symbol/rxSubscriber"),b=require("../Observer");function i(i,u,s){if(i){if(i instanceof r.Subscriber)return i;if(i[e.rxSubscriber])return i[e.rxSubscriber]()}return i||u||s?new r.Subscriber(i,u,s):new r.Subscriber(b.empty)}
},{"../Subscriber":"RaFB","../symbol/rxSubscriber":"yAZp","../Observer":"wIlR"}],"tjV3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.observable=void 0;var e=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();exports.observable=e;
},{}],"LXph":[function(require,module,exports) {
"use strict";function e(e){return e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.identity=e;
},{}],"HQCS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pipe=r,exports.pipeFromArray=t;var e=require("./identity");function r(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(e)}function t(r){return 0===r.length?e.identity:1===r.length?r[0]:function(e){return r.reduce(function(e,r){return r(e)},e)}}
},{"./identity":"LXph"}],"wbSE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Observable=void 0;var r=require("./util/canReportError"),e=require("./util/toSubscriber"),o=require("./symbol/observable"),t=require("./util/pipe"),n=require("./config"),i=function(){function i(r){this._isScalar=!1,r&&(this._subscribe=r)}return i.prototype.lift=function(r){var e=new i;return e.source=this,e.operator=r,e},i.prototype.subscribe=function(r,o,t){var i=this.operator,s=(0,e.toSubscriber)(r,o,t);if(i?s.add(i.call(s,this.source)):s.add(this.source||n.config.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),n.config.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},i.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(o){n.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=o),(0,r.canReportError)(e)?e.error(o):console.warn(o)}},i.prototype.forEach=function(r,e){var o=this;return new(e=s(e))(function(e,t){var n;n=o.subscribe(function(e){try{r(e)}catch(o){t(o),n&&n.unsubscribe()}},t,e)})},i.prototype._subscribe=function(r){var e=this.source;return e&&e.subscribe(r)},i.prototype[o.observable]=function(){return this},i.prototype.pipe=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return 0===r.length?this:(0,t.pipeFromArray)(r)(this)},i.prototype.toPromise=function(r){var e=this;return new(r=s(r))(function(r,o){var t;e.subscribe(function(r){return t=r},function(r){return o(r)},function(){return r(t)})})},i.create=function(r){return new i(r)},i}();function s(r){if(r||(r=n.config.Promise||Promise),!r)throw new Error("no Promise impl found");return r}exports.Observable=i;
},{"./util/canReportError":"wHmS","./util/toSubscriber":"SEU0","./symbol/observable":"tjV3","./util/pipe":"HQCS","./config":"Q3iD"}],"xQEi":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ObjectUnsubscribedError=void 0;var r=function(){function r(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return r.prototype=Object.create(Error.prototype),r}(),e=r;exports.ObjectUnsubscribedError=e;
},{}],"fyc3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubjectSubscription=void 0;var e=i(require("tslib")),t=require("./Subscription");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var u=n?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(i,s,u):i[s]=e[s]}return i.default=e,t&&t.set(e,i),i}var n=function(t){function r(e,r){var i=t.call(this)||this;return i.subject=e,i.subscriber=r,i.closed=!1,i}return e.__extends(r,t),r.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},r}(t.Subscription);exports.SubjectSubscription=n;
},{"tslib":"vCxL","./Subscription":"I8KM"}],"r9t1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnonymousSubject=exports.Subject=exports.SubjectSubscriber=void 0;var r=c(require("tslib")),e=require("./Observable"),t=require("./Subscriber"),o=require("./Subscription"),s=require("./util/ObjectUnsubscribedError"),i=require("./SubjectSubscription"),n=require("../internal/symbol/rxSubscriber");function u(){if("function"!=typeof WeakMap)return null;var r=new WeakMap;return u=function(){return r},r}function c(r){if(r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var e=u();if(e&&e.has(r))return e.get(r);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){var i=o?Object.getOwnPropertyDescriptor(r,s):null;i&&(i.get||i.set)?Object.defineProperty(t,s,i):t[s]=r[s]}return t.default=r,e&&e.set(r,t),t}var b=function(e){function t(r){var t=e.call(this,r)||this;return t.destination=r,t}return r.__extends(t,e),t}(t.Subscriber);exports.SubjectSubscriber=b;var p=function(t){function u(){var r=t.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return r.__extends(u,t),u.prototype[n.rxSubscriber]=function(){return new b(this)},u.prototype.lift=function(r){var e=new h(this,this);return e.operator=r,e},u.prototype.next=function(r){if(this.closed)throw new s.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,t=e.length,o=e.slice(),i=0;i<t;i++)o[i].next(r)},u.prototype.error=function(r){if(this.closed)throw new s.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=r,this.isStopped=!0;for(var e=this.observers,t=e.length,o=e.slice(),i=0;i<t;i++)o[i].error(r);this.observers.length=0},u.prototype.complete=function(){if(this.closed)throw new s.ObjectUnsubscribedError;this.isStopped=!0;for(var r=this.observers,e=r.length,t=r.slice(),o=0;o<e;o++)t[o].complete();this.observers.length=0},u.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},u.prototype._trySubscribe=function(r){if(this.closed)throw new s.ObjectUnsubscribedError;return t.prototype._trySubscribe.call(this,r)},u.prototype._subscribe=function(r){if(this.closed)throw new s.ObjectUnsubscribedError;return this.hasError?(r.error(this.thrownError),o.Subscription.EMPTY):this.isStopped?(r.complete(),o.Subscription.EMPTY):(this.observers.push(r),new i.SubjectSubscription(this,r))},u.prototype.asObservable=function(){var r=new e.Observable;return r.source=this,r},u.create=function(r,e){return new h(r,e)},u}(e.Observable);exports.Subject=p;var h=function(e){function t(r,t){var o=e.call(this)||this;return o.destination=r,o.source=t,o}return r.__extends(t,e),t.prototype.next=function(r){var e=this.destination;e&&e.next&&e.next(r)},t.prototype.error=function(r){var e=this.destination;e&&e.error&&this.destination.error(r)},t.prototype.complete=function(){var r=this.destination;r&&r.complete&&this.destination.complete()},t.prototype._subscribe=function(r){return this.source?this.source.subscribe(r):o.Subscription.EMPTY},t}(p);exports.AnonymousSubject=h;
},{"tslib":"vCxL","./Observable":"wbSE","./Subscriber":"RaFB","./Subscription":"I8KM","./util/ObjectUnsubscribedError":"xQEi","./SubjectSubscription":"fyc3","../internal/symbol/rxSubscriber":"yAZp"}],"vT9o":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.refCount=o;var e=r(require("tslib")),n=require("../Subscriber");function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t();if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if(Object.prototype.hasOwnProperty.call(e,c)){var i=o?Object.getOwnPropertyDescriptor(e,c):null;i&&(i.get||i.set)?Object.defineProperty(r,c,i):r[c]=e[c]}return r.default=e,n&&n.set(e,r),r}function o(){return function(e){return e.lift(new c(e))}}var c=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,n){var t=this.connectable;t._refCount++;var r=new i(e,t),o=n.subscribe(r);return r.closed||(r.connection=t.connect()),o},e}(),i=function(n){function t(e,t){var r=n.call(this,e)||this;return r.connectable=t,r}return e.__extends(t,n),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var n=e._refCount;if(n<=0)this.connection=null;else if(e._refCount=n-1,n>1)this.connection=null;else{var t=this.connection,r=e._connection;this.connection=null,!r||t&&r!==t||r.unsubscribe()}}else this.connection=null},t}(n.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"kkfD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.connectableObservableDescriptor=exports.ConnectableObservable=void 0;var e=i(require("tslib")),t=require("../Subject"),n=require("../Observable"),r=require("../Subscriber"),o=require("../Subscription"),c=require("../operators/refCount");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var c=r?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(n,o,c):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}var s=function(t){function n(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return e.__extends(n,t),n.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},n.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},n.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new o.Subscription).add(this.source.subscribe(new b(this.getSubject(),this))),e.closed&&(this._connection=null,e=o.Subscription.EMPTY)),e},n.prototype.refCount=function(){return(0,c.refCount)()(this)},n}(n.Observable);exports.ConnectableObservable=s;var l=function(){var e=s.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}();exports.connectableObservableDescriptor=l;var b=function(t){function n(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return e.__extends(n,t),n.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},n.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},n.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},n}(t.SubjectSubscriber),a=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new p(e,n),o=t.subscribe(r);return r.closed||(r.connection=n.connect()),o},e}(),p=function(t){function n(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return e.__extends(n,t),n.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},n}(r.Subscriber);
},{"tslib":"vCxL","../Subject":"r9t1","../Observable":"wbSE","../Subscriber":"RaFB","../Subscription":"I8KM","../operators/refCount":"vT9o"}],"dNgG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.groupBy=s,exports.GroupedObservable=void 0;var t=u(require("tslib")),e=require("../Subscriber"),r=require("../Subscription"),o=require("../Observable"),n=require("../Subject");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function u(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var u=o?Object.getOwnPropertyDescriptor(t,n):null;u&&(u.get||u.set)?Object.defineProperty(r,n,u):r[n]=t[n]}return r.default=t,e&&e.set(t,r),r}function s(t,e,r,o){return function(n){return n.lift(new c(t,e,r,o))}}var c=function(){function t(t,e,r,o){this.keySelector=t,this.elementSelector=e,this.durationSelector=r,this.subjectSelector=o}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),p=function(e){function r(t,r,o,n,i){var u=e.call(this,t)||this;return u.keySelector=r,u.elementSelector=o,u.durationSelector=n,u.subjectSelector=i,u.groups=null,u.attemptedToUnsubscribe=!1,u.count=0,u}return t.__extends(r,e),r.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(r){return void this.error(r)}this._group(t,e)},r.prototype._group=function(t,e){var r=this.groups;r||(r=this.groups=new Map);var o,i=r.get(e);if(this.elementSelector)try{o=this.elementSelector(t)}catch(c){this.error(c)}else o=t;if(!i){i=this.subjectSelector?this.subjectSelector():new n.Subject,r.set(e,i);var u=new a(e,i,this);if(this.destination.next(u),this.durationSelector){var s=void 0;try{s=this.durationSelector(new a(e,i))}catch(c){return void this.error(c)}this.add(s.subscribe(new l(e,i,this)))}}i.closed||i.next(o)},r.prototype._error=function(t){var e=this.groups;e&&(e.forEach(function(e,r){e.error(t)}),e.clear()),this.destination.error(t)},r.prototype._complete=function(){var t=this.groups;t&&(t.forEach(function(t,e){t.complete()}),t.clear()),this.destination.complete()},r.prototype.removeGroup=function(t){this.groups.delete(t)},r.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},r}(e.Subscriber),l=function(e){function r(t,r,o){var n=e.call(this,r)||this;return n.key=t,n.group=r,n.parent=o,n}return t.__extends(r,e),r.prototype._next=function(t){this.complete()},r.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},r}(e.Subscriber),a=function(e){function o(t,r,o){var n=e.call(this)||this;return n.key=t,n.groupSubject=r,n.refCountSubscription=o,n}return t.__extends(o,e),o.prototype._subscribe=function(t){var e=new r.Subscription,o=this.refCountSubscription,n=this.groupSubject;return o&&!o.closed&&e.add(new b(o)),e.add(n.subscribe(t)),e},o}(o.Observable);exports.GroupedObservable=a;var b=function(e){function r(t){var r=e.call(this)||this;return r.parent=t,t.count++,r}return t.__extends(r,e),r.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},r}(r.Subscription);
},{"tslib":"vCxL","../Subscriber":"RaFB","../Subscription":"I8KM","../Observable":"wbSE","../Subject":"r9t1"}],"MPU6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BehaviorSubject=void 0;var e=n(require("tslib")),t=require("./Subject"),r=require("./util/ObjectUnsubscribedError");function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=n?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(r,u,i):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}var u=function(t){function o(e){var r=t.call(this)||this;return r._value=e,r}return e.__extends(o,t),Object.defineProperty(o.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),o.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return r&&!r.closed&&e.next(this._value),r},o.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new r.ObjectUnsubscribedError;return this._value},o.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},o}(t.Subject);exports.BehaviorSubject=u;
},{"tslib":"vCxL","./Subject":"r9t1","./util/ObjectUnsubscribedError":"xQEi"}],"arqX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Action=void 0;var e=n(require("tslib")),t=require("../Subscription");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var u=o?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}var o=function(t){function r(e,r){return t.call(this)||this}return e.__extends(r,t),r.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},r}(t.Subscription);exports.Action=o;
},{"tslib":"vCxL","../Subscription":"I8KM"}],"llYF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsyncAction=void 0;var t=r(require("tslib")),e=require("./Action");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function r(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var c=n?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(r,s,c):r[s]=t[s]}return r.default=t,e&&e.set(t,r),r}var n=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.scheduler=t,r.work=i,r.pending=!1,r}return t.__extends(i,e),i.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},i.prototype.requestAsyncId=function(t,e,i){return void 0===i&&(i=0),setInterval(t.flush.bind(t,this),i)},i.prototype.recycleAsyncId=function(t,e,i){if(void 0===i&&(i=0),null!==i&&this.delay===i&&!1===this.pending)return e;clearInterval(e)},i.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,e);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},i.prototype._execute=function(t,e){var i=!1,r=void 0;try{this.work(t)}catch(n){i=!0,r=!!n&&n||new Error(n)}if(i)return this.unsubscribe(),r},i.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,i=e.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},i}(e.Action);exports.AsyncAction=n;
},{"tslib":"vCxL","./Action":"arqX"}],"pLkv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueueAction=void 0;var e=n(require("tslib")),t=require("./AsyncAction");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=o?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}var o=function(t){function r(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return e.__extends(r,t),r.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},r.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},r.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,n):e.flush(this)},r}(t.AsyncAction);exports.QueueAction=o;
},{"tslib":"vCxL","./AsyncAction":"llYF"}],"QglZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Scheduler=void 0;var e=function(){function e(t,o){void 0===o&&(o=e.now),this.SchedulerAction=t,this.now=o}return e.prototype.schedule=function(e,t,o){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(o,t)},e.now=function(){return Date.now()},e}();exports.Scheduler=e;
},{}],"hnPK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsyncScheduler=void 0;var e=i(require("tslib")),t=require("../Scheduler");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(i,o,u):i[o]=e[o]}return i.default=e,t&&t.set(e,i),i}var n=function(r){function i(e,n){void 0===n&&(n=t.Scheduler.now);var o=r.call(this,e,function(){return i.delegate&&i.delegate!==o?i.delegate.now():n()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return e.__extends(i,r),i.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),i.delegate&&i.delegate!==this?i.delegate.schedule(e,t,n):r.prototype.schedule.call(this,e,t,n)},i.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var r;this.active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},i}(t.Scheduler);exports.AsyncScheduler=n;
},{"tslib":"vCxL","../Scheduler":"QglZ"}],"j0lZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueueScheduler=void 0;var e=n(require("tslib")),r=require("./AsyncScheduler");function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=u?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}var u=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(t,r),t}(r.AsyncScheduler);exports.QueueScheduler=u;
},{"tslib":"vCxL","./AsyncScheduler":"hnPK"}],"HGOP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.queue=exports.queueScheduler=void 0;var e=require("./QueueAction"),u=require("./QueueScheduler"),r=new u.QueueScheduler(e.QueueAction);exports.queueScheduler=r;var t=r;exports.queue=t;
},{"./QueueAction":"pLkv","./QueueScheduler":"j0lZ"}],"XsKQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.empty=t,exports.EMPTY=void 0;var e=require("../Observable"),r=new e.Observable(function(e){return e.complete()});function t(e){return e?n(e):r}function n(r){return new e.Observable(function(e){return r.schedule(function(){return e.complete()})})}exports.EMPTY=r;
},{"../Observable":"wbSE"}],"VqoH":[function(require,module,exports) {
"use strict";function e(e){return e&&"function"==typeof e.schedule}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isScheduler=e;
},{}],"lrFe":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeToArray=void 0;var e=function(e){return function(r){for(var o=0,t=e.length;o<t&&!r.closed;o++)r.next(e[o]);r.complete()}};exports.subscribeToArray=e;
},{}],"ZGwk":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduleArray=t;var e=require("../Observable"),r=require("../Subscription");function t(t,n){return new e.Observable(function(e){var u=new r.Subscription,s=0;return u.add(n.schedule(function(){s!==t.length?(e.next(t[s++]),e.closed||u.add(this.schedule())):e.complete()})),u})}
},{"../Observable":"wbSE","../Subscription":"I8KM"}],"PJGF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fromArray=u;var e=require("../Observable"),r=require("../util/subscribeToArray"),s=require("../scheduled/scheduleArray");function u(u,a){return a?(0,s.scheduleArray)(u,a):new e.Observable((0,r.subscribeToArray)(u))}
},{"../Observable":"wbSE","../util/subscribeToArray":"lrFe","../scheduled/scheduleArray":"ZGwk"}],"wZuk":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.of=t;var e=require("../util/isScheduler"),r=require("./fromArray"),u=require("../scheduled/scheduleArray");function t(){for(var t=[],l=0;l<arguments.length;l++)t[l]=arguments[l];var o=t[t.length-1];return(0,e.isScheduler)(o)?(t.pop(),(0,u.scheduleArray)(t,o)):(0,r.fromArray)(t)}
},{"../util/isScheduler":"VqoH","./fromArray":"PJGF","../scheduled/scheduleArray":"ZGwk"}],"FdIu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.throwError=e;var r=require("../Observable");function e(e,o){return o?new r.Observable(function(r){return o.schedule(n,0,{error:e,subscriber:r})}):new r.Observable(function(r){return r.error(e)})}function n(r){var e=r.error;r.subscriber.error(e)}
},{"../Observable":"wbSE"}],"n7Mc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Notification=exports.NotificationKind=void 0;var e,t=require("./observable/empty"),r=require("./observable/of"),o=require("./observable/throwError");exports.NotificationKind=e,function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(e||(exports.NotificationKind=e={}));var i=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,r){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return r&&r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return(0,r.of)(this.value);case"E":return(0,o.throwError)(this.error);case"C":return(0,t.empty)()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();exports.Notification=i;
},{"./observable/empty":"XsKQ","./observable/of":"wZuk","./observable/throwError":"FdIu"}],"ezNs":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.observeOn=s,exports.ObserveOnMessage=exports.ObserveOnSubscriber=exports.ObserveOnOperator=void 0;var e=n(require("tslib")),t=require("../Subscriber"),r=require("../Notification");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}return r.default=e,t&&t.set(e,r),r}function s(e,t){return void 0===t&&(t=0),function(r){return r.lift(new o(e,t))}}var o=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.scheduler,this.delay))},e}();exports.ObserveOnOperator=o;var u=function(t){function i(e,r,i){void 0===i&&(i=0);var n=t.call(this,e)||this;return n.scheduler=r,n.delay=i,n}return e.__extends(i,t),i.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r),this.unsubscribe()},i.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(i.dispatch,this.delay,new c(e,this.destination)))},i.prototype._next=function(e){this.scheduleMessage(r.Notification.createNext(e))},i.prototype._error=function(e){this.scheduleMessage(r.Notification.createError(e)),this.unsubscribe()},i.prototype._complete=function(){this.scheduleMessage(r.Notification.createComplete()),this.unsubscribe()},i}(t.Subscriber);exports.ObserveOnSubscriber=u;var c=function(){return function(e,t){this.notification=e,this.destination=t}}();exports.ObserveOnMessage=c;
},{"tslib":"vCxL","../Subscriber":"RaFB","../Notification":"n7Mc"}],"Cp6P":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReplaySubject=void 0;var e=c(require("tslib")),t=require("./Subject"),r=require("./scheduler/queue"),i=require("./Subscription"),n=require("./operators/observeOn"),o=require("./util/ObjectUnsubscribedError"),s=require("./SubjectSubscription");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}var f=function(t){function u(e,r,i){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=t.call(this)||this;return n.scheduler=i,n._events=[],n._infiniteTimeWindow=!1,n._bufferSize=e<1?1:e,n._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(n._infiniteTimeWindow=!0,n.next=n.nextInfiniteTimeWindow):n.next=n.nextTimeWindow,n}return e.__extends(u,t),u.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,e)},u.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new p(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},u.prototype._subscribe=function(e){var t,r=this._infiniteTimeWindow,u=r?this._events:this._trimBufferThenGetEvents(),c=this.scheduler,f=u.length;if(this.closed)throw new o.ObjectUnsubscribedError;if(this.isStopped||this.hasError?t=i.Subscription.EMPTY:(this.observers.push(e),t=new s.SubjectSubscription(this,e)),c&&e.add(e=new n.ObserveOnSubscriber(e,c)),r)for(var p=0;p<f&&!e.closed;p++)e.next(u[p]);else for(p=0;p<f&&!e.closed;p++)e.next(u[p].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},u.prototype._getNow=function(){return(this.scheduler||r.queue).now()},u.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,r=this._windowTime,i=this._events,n=i.length,o=0;o<n&&!(e-i[o].time<r);)o++;return n>t&&(o=Math.max(o,n-t)),o>0&&i.splice(0,o),i},u}(t.Subject);exports.ReplaySubject=f;var p=function(){return function(e,t){this.time=e,this.value=t}}();
},{"tslib":"vCxL","./Subject":"r9t1","./scheduler/queue":"HGOP","./Subscription":"I8KM","./operators/observeOn":"ezNs","./util/ObjectUnsubscribedError":"xQEi","./SubjectSubscription":"fyc3"}],"Scvc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsyncSubject=void 0;var t=n(require("tslib")),e=require("./Subject"),r=require("./Subscription");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=n?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=t[i]}return r.default=t,e&&e.set(t,r),r}var i=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return t.__extends(o,e),o.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),r.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),r.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},o.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},o.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},o.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},o}(e.Subject);exports.AsyncSubject=i;
},{"tslib":"vCxL","./Subject":"r9t1","./Subscription":"I8KM"}],"Z56L":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TestTools=exports.Immediate=void 0;var e=1,t=function(){return Promise.resolve()}(),r={};function n(e){return e in r&&(delete r[e],!0)}var o={setImmediate:function(o){var i=e++;return r[i]=!0,t.then(function(){return n(i)&&o()}),i},clearImmediate:function(e){n(e)}};exports.Immediate=o;var i={pending:function(){return Object.keys(r).length}};exports.TestTools=i;
},{}],"k3eS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsapAction=void 0;var e=i(require("tslib")),t=require("../util/Immediate"),r=require("./AsyncAction");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=function(r){function n(e,t){var n=r.call(this,e,t)||this;return n.scheduler=e,n.work=t,n}return e.__extends(n,r),n.prototype.requestAsyncId=function(e,n,i){return void 0===i&&(i=0),null!==i&&i>0?r.prototype.requestAsyncId.call(this,e,n,i):(e.actions.push(this),e.scheduled||(e.scheduled=t.Immediate.setImmediate(e.flush.bind(e,null))))},n.prototype.recycleAsyncId=function(e,n,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return r.prototype.recycleAsyncId.call(this,e,n,i);0===e.actions.length&&(t.Immediate.clearImmediate(n),e.scheduled=void 0)},n}(r.AsyncAction);exports.AsapAction=o;
},{"tslib":"vCxL","../util/Immediate":"Z56L","./AsyncAction":"llYF"}],"czze":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsapScheduler=void 0;var e=n(require("tslib")),t=require("./AsyncScheduler");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}var i=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(r,t),r.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do{if(t=e.execute(e.state,e.delay))break}while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},r}(t.AsyncScheduler);exports.AsapScheduler=i;
},{"tslib":"vCxL","./AsyncScheduler":"hnPK"}],"ZqYc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.asap=exports.asapScheduler=void 0;var e=require("./AsapAction"),r=require("./AsapScheduler"),s=new r.AsapScheduler(e.AsapAction);exports.asapScheduler=s;var a=s;exports.asap=a;
},{"./AsapAction":"k3eS","./AsapScheduler":"czze"}],"jun6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.async=exports.asyncScheduler=void 0;var e=require("./AsyncAction"),r=require("./AsyncScheduler"),c=new r.AsyncScheduler(e.AsyncAction);exports.asyncScheduler=c;var s=c;exports.async=s;
},{"./AsyncAction":"llYF","./AsyncScheduler":"hnPK"}],"m8qQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnimationFrameAction=void 0;var e=n(require("tslib")),t=require("./AsyncAction");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var c=o?Object.getOwnPropertyDescriptor(e,i):null;c&&(c.get||c.set)?Object.defineProperty(n,i,c):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}var o=function(t){function r(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return e.__extends(r,t),r.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(function(){return e.flush(null)})))},r.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},r}(t.AsyncAction);exports.AnimationFrameAction=o;
},{"tslib":"vCxL","./AsyncAction":"llYF"}],"gboY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnimationFrameScheduler=void 0;var e=n(require("tslib")),t=require("./AsyncScheduler");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}var i=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(r,t),r.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do{if(t=e.execute(e.state,e.delay))break}while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},r}(t.AsyncScheduler);exports.AnimationFrameScheduler=i;
},{"tslib":"vCxL","./AsyncScheduler":"hnPK"}],"zUKp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.animationFrame=exports.animationFrameScheduler=void 0;var e=require("./AnimationFrameAction"),r=require("./AnimationFrameScheduler"),a=new r.AnimationFrameScheduler(e.AnimationFrameAction);exports.animationFrameScheduler=a;var i=a;exports.animationFrame=i;
},{"./AnimationFrameAction":"m8qQ","./AnimationFrameScheduler":"gboY"}],"RuMO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VirtualAction=exports.VirtualTimeScheduler=void 0;var e=n(require("tslib")),t=require("./AsyncAction"),r=require("./AsyncScheduler");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=function(t){function r(e,r){void 0===e&&(e=u),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e,function(){return i.frame})||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return e.__extends(r,t),r.prototype.flush=function(){for(var e,t,r=this.actions,i=this.maxFrames;(t=r[0])&&t.delay<=i&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},r.frameTimeFactor=10,r}(r.AsyncScheduler);exports.VirtualTimeScheduler=o;var u=function(t){function r(e,r,i){void 0===i&&(i=e.index+=1);var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.index=i,n.active=!0,n.index=e.index=i,n}return e.__extends(r,t),r.prototype.schedule=function(e,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,e,i);this.active=!1;var n=new r(this.scheduler,this.work);return this.add(n),n.schedule(e,i)},r.prototype.requestAsyncId=function(e,t,i){void 0===i&&(i=0),this.delay=e.frame+i;var n=e.actions;return n.push(this),n.sort(r.sortActions),!0},r.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},r.prototype._execute=function(e,r){if(!0===this.active)return t.prototype._execute.call(this,e,r)},r.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},r}(t.AsyncAction);exports.VirtualAction=u;
},{"tslib":"vCxL","./AsyncAction":"llYF","./AsyncScheduler":"hnPK"}],"rXfM":[function(require,module,exports) {
"use strict";function e(){}Object.defineProperty(exports,"__esModule",{value:!0}),exports.noop=e;
},{}],"cUXi":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isObservable=r;var e=require("../Observable");function r(r){return!!r&&(r instanceof e.Observable||"function"==typeof r.lift&&"function"==typeof r.subscribe)}
},{"../Observable":"wbSE"}],"Qh4I":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ArgumentOutOfRangeError=void 0;var r=function(){function r(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return r.prototype=Object.create(Error.prototype),r}(),e=r;exports.ArgumentOutOfRangeError=e;
},{}],"vsl0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmptyError=void 0;var r=function(){function r(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return r.prototype=Object.create(Error.prototype),r}(),e=r;exports.EmptyError=e;
},{}],"SZK7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TimeoutError=void 0;var r=function(){function r(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return r.prototype=Object.create(Error.prototype),r}(),e=r;exports.TimeoutError=e;
},{}],"dNh5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.map=o,exports.MapOperator=void 0;var t=n(require("tslib")),r=require("../Subscriber");function e(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return e=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=e();if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var u=o?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=t[i]}return n.default=t,r&&r.set(t,n),n}function o(t,r){return function(e){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return e.lift(new i(t,r))}}var i=function(){function t(t,r){this.project=t,this.thisArg=r}return t.prototype.call=function(t,r){return r.subscribe(new u(t,this.project,this.thisArg))},t}();exports.MapOperator=i;var u=function(r){function e(t,e,n){var o=r.call(this,t)||this;return o.project=e,o.count=0,o.thisArg=n||o,o}return t.__extends(e,r),e.prototype._next=function(t){var r;try{r=this.project.call(this.thisArg,t,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(r)},e}(r.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"lxDK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bindCallback=a;var r=require("../Observable"),e=require("../AsyncSubject"),t=require("../operators/map"),c=require("../util/canReportError"),n=require("../util/isArray"),u=require("../util/isScheduler");function a(s,o,l){if(o){if(!(0,u.isScheduler)(o))return function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return a(s,l).apply(void 0,r).pipe((0,t.map)(function(r){return(0,n.isArray)(r)?o.apply(void 0,r):o(r)}))};l=o}return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var u,a=this,o={context:a,subject:u,callbackFunc:s,scheduler:l};return new r.Observable(function(r){if(l){var n={args:t,subscriber:r,params:o};return l.schedule(i,0,n)}if(!u){u=new e.AsyncSubject;try{s.apply(a,t.concat([function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];u.next(r.length<=1?r[0]:r),u.complete()}]))}catch(b){(0,c.canReportError)(u)?u.error(b):console.warn(b)}}return u.subscribe(r)})}}function i(r){var t=this,c=r.args,n=r.subscriber,u=r.params,a=u.callbackFunc,i=u.context,o=u.scheduler,l=u.subject;if(!l){l=u.subject=new e.AsyncSubject;try{a.apply(i,c.concat([function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var c=r.length<=1?r[0]:r;t.add(o.schedule(s,0,{value:c,subject:l}))}]))}catch(b){l.error(b)}}this.add(l.subscribe(n))}function s(r){var e=r.value,t=r.subject;t.next(e),t.complete()}function o(r){var e=r.err;r.subject.error(e)}
},{"../Observable":"wbSE","../AsyncSubject":"Scvc","../operators/map":"dNh5","../util/canReportError":"wHmS","../util/isArray":"KeTG","../util/isScheduler":"VqoH"}],"uTDa":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bindNodeCallback=s;var e=require("../Observable"),r=require("../AsyncSubject"),t=require("../operators/map"),c=require("../util/canReportError"),u=require("../util/isScheduler"),n=require("../util/isArray");function s(i,o,l){if(o){if(!(0,u.isScheduler)(o))return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return s(i,l).apply(void 0,e).pipe((0,t.map)(function(e){return(0,n.isArray)(e)?o.apply(void 0,e):o(e)}))};l=o}return function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];var n={subject:void 0,args:t,callbackFunc:i,scheduler:l,context:this};return new e.Observable(function(e){var u=n.context,s=n.subject;if(l)return l.schedule(a,0,{params:n,subscriber:e,context:u});if(!s){s=n.subject=new r.AsyncSubject;try{i.apply(u,t.concat([function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e.shift();t?s.error(t):(s.next(e.length<=1?e[0]:e),s.complete())}]))}catch(o){(0,c.canReportError)(s)?s.error(o):console.warn(o)}}return s.subscribe(e)})}}function a(e){var t=this,c=e.params,u=e.subscriber,n=e.context,s=c.callbackFunc,a=c.args,l=c.scheduler,b=c.subject;if(!b){b=c.subject=new r.AsyncSubject;try{s.apply(n,a.concat([function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var c=e.shift();if(c)t.add(l.schedule(o,0,{err:c,subject:b}));else{var u=e.length<=1?e[0]:e;t.add(l.schedule(i,0,{value:u,subject:b}))}}]))}catch(d){this.add(l.schedule(o,0,{err:d,subject:b}))}}this.add(b.subscribe(u))}function i(e){var r=e.value,t=e.subject;t.next(r),t.complete()}function o(e){var r=e.err;e.subject.error(r)}
},{"../Observable":"wbSE","../AsyncSubject":"Scvc","../operators/map":"dNh5","../util/canReportError":"wHmS","../util/isScheduler":"VqoH","../util/isArray":"KeTG"}],"hZYI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OuterSubscriber=void 0;var t=n(require("tslib")),e=require("./Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var u=o?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}var o=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},r.prototype.notifyError=function(t,e){this.destination.error(t)},r.prototype.notifyComplete=function(t){this.destination.complete()},r}(e.Subscriber);exports.OuterSubscriber=o;
},{"tslib":"vCxL","./Subscriber":"RaFB"}],"aQbR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InnerSubscriber=void 0;var e=n(require("tslib")),t=require("./Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}var i=function(t){function r(e,r,n){var i=t.call(this)||this;return i.parent=e,i.outerValue=r,i.outerIndex=n,i.index=0,i}return e.__extends(r,t),r.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},r.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},r.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},r}(t.Subscriber);exports.InnerSubscriber=i;
},{"tslib":"vCxL","./Subscriber":"RaFB"}],"eggw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeToPromise=void 0;var r=require("./hostReportError"),e=function(e){return function(o){return e.then(function(r){o.closed||(o.next(r),o.complete())},function(r){return o.error(r)}).then(null,r.hostReportError),o}};exports.subscribeToPromise=e;
},{"./hostReportError":"JfKC"}],"AqTP":[function(require,module,exports) {
"use strict";function t(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSymbolIterator=t,exports.$$iterator=exports.iterator=void 0;var r=t();exports.iterator=r;var e=r;exports.$$iterator=e;
},{}],"QEdH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeToIterable=void 0;var e=require("../symbol/iterator"),r=function(r){return function(t){for(var o=r[e.iterator]();;){var n=void 0;try{n=o.next()}catch(u){return t.error(u),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof o.return&&t.add(function(){o.return&&o.return()}),t}};exports.subscribeToIterable=r;
},{"../symbol/iterator":"AqTP"}],"buzG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeToObservable=void 0;var e=require("../symbol/observable"),r=function(r){return function(o){var b=r[e.observable]();if("function"!=typeof b.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return b.subscribe(o)}};exports.subscribeToObservable=r;
},{"../symbol/observable":"tjV3"}],"LS84":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isArrayLike=void 0;var e=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};exports.isArrayLike=e;
},{}],"Ok8F":[function(require,module,exports) {
"use strict";function e(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPromise=e;
},{}],"vq9L":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeTo=void 0;var e=require("./subscribeToArray"),r=require("./subscribeToPromise"),i=require("./subscribeToIterable"),s=require("./subscribeToObservable"),o=require("./isArrayLike"),b=require("./isPromise"),u=require("./isObject"),t=require("../symbol/iterator"),a=require("../symbol/observable"),c=function(c){if(c&&"function"==typeof c[a.observable])return(0,s.subscribeToObservable)(c);if((0,o.isArrayLike)(c))return(0,e.subscribeToArray)(c);if((0,b.isPromise)(c))return(0,r.subscribeToPromise)(c);if(c&&"function"==typeof c[t.iterator])return(0,i.subscribeToIterable)(c);var n=(0,u.isObject)(c)?"an invalid object":"'"+c+"'";throw new TypeError("You provided "+n+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};exports.subscribeTo=c;
},{"./subscribeToArray":"lrFe","./subscribeToPromise":"eggw","./subscribeToIterable":"QEdH","./subscribeToObservable":"buzG","./isArrayLike":"LS84","./isPromise":"Ok8F","./isObject":"nU7r","../symbol/iterator":"AqTP","../symbol/observable":"tjV3"}],"JM7e":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeToResult=b;var e=require("../InnerSubscriber"),r=require("./subscribeTo"),s=require("../Observable");function b(b,i,u,c,n){if(void 0===n&&(n=new e.InnerSubscriber(b,u,c)),!n.closed)return i instanceof s.Observable?i.subscribe(n):(0,r.subscribeTo)(i)(n)}
},{"../InnerSubscriber":"aQbR","./subscribeTo":"vq9L","../Observable":"wbSE"}],"omVc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineLatest=a,exports.CombineLatestSubscriber=exports.CombineLatestOperator=void 0;var t=u(require("tslib")),e=require("../util/isScheduler"),r=require("../util/isArray"),i=require("../OuterSubscriber"),o=require("../util/subscribeToResult"),s=require("./fromArray");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function u(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}var l={};function a(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var o=void 0,n=void 0;return(0,e.isScheduler)(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(o=t.pop()),1===t.length&&(0,r.isArray)(t[0])&&(t=t[0]),(0,s.fromArray)(t,n).lift(new c(o))}var c=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.resultSelector))},t}();exports.CombineLatestOperator=c;var p=function(e){function r(t,r){var i=e.call(this,t)||this;return i.resultSelector=r,i.active=0,i.values=[],i.observables=[],i}return t.__extends(r,e),r.prototype._next=function(t){this.values.push(l),this.observables.push(t)},r.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var i=t[r];this.add((0,o.subscribeToResult)(this,i,void 0,r))}}},r.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},r.prototype.notifyNext=function(t,e,r){var i=this.values,o=i[r],s=this.toRespond?o===l?--this.toRespond:this.toRespond:0;i[r]=e,0===s&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},r.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(r){return void this.destination.error(r)}this.destination.next(e)},r}(i.OuterSubscriber);exports.CombineLatestSubscriber=p;
},{"tslib":"vCxL","../util/isScheduler":"VqoH","../util/isArray":"KeTG","../OuterSubscriber":"hZYI","../util/subscribeToResult":"JM7e","./fromArray":"PJGF"}],"lgBy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduleObservable=u;var e=require("../Observable"),r=require("../Subscription"),n=require("../symbol/observable");function u(u,t){return new e.Observable(function(e){var o=new r.Subscription;return o.add(t.schedule(function(){var r=u[n.observable]();o.add(r.subscribe({next:function(r){o.add(t.schedule(function(){return e.next(r)}))},error:function(r){o.add(t.schedule(function(){return e.error(r)}))},complete:function(){o.add(t.schedule(function(){return e.complete()}))}}))})),o})}
},{"../Observable":"wbSE","../Subscription":"I8KM","../symbol/observable":"tjV3"}],"aPE6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.schedulePromise=n;var e=require("../Observable"),r=require("../Subscription");function n(n,u){return new e.Observable(function(e){var t=new r.Subscription;return t.add(u.schedule(function(){return n.then(function(r){t.add(u.schedule(function(){e.next(r),t.add(u.schedule(function(){return e.complete()}))}))},function(r){t.add(u.schedule(function(){return e.error(r)}))})})),t})}
},{"../Observable":"wbSE","../Subscription":"I8KM"}],"XzIO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduleIterable=n;var e=require("../Observable"),r=require("../Subscription"),t=require("../symbol/iterator");function n(n,u){if(!n)throw new Error("Iterable cannot be null");return new e.Observable(function(e){var o,i=new r.Subscription;return i.add(function(){o&&"function"==typeof o.return&&o.return()}),i.add(u.schedule(function(){o=n[t.iterator](),i.add(u.schedule(function(){if(!e.closed){var r,t;try{var n=o.next();r=n.value,t=n.done}catch(u){return void e.error(u)}t?e.complete():(e.next(r),this.schedule())}}))})),i})}
},{"../Observable":"wbSE","../Subscription":"I8KM","../symbol/iterator":"AqTP"}],"CTP2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isInteropObservable=r;var e=require("../symbol/observable");function r(r){return r&&"function"==typeof r[e.observable]}
},{"../symbol/observable":"tjV3"}],"NjuQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isIterable=r;var e=require("../symbol/iterator");function r(r){return r&&"function"==typeof r[e.iterator]}
},{"../symbol/iterator":"AqTP"}],"mNZE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduled=a;var e=require("./scheduleObservable"),r=require("./schedulePromise"),i=require("./scheduleArray"),s=require("./scheduleIterable"),u=require("../util/isInteropObservable"),l=require("../util/isPromise"),t=require("../util/isArrayLike"),o=require("../util/isIterable");function a(a,b){if(null!=a){if((0,u.isInteropObservable)(a))return(0,e.scheduleObservable)(a,b);if((0,l.isPromise)(a))return(0,r.schedulePromise)(a,b);if((0,t.isArrayLike)(a))return(0,i.scheduleArray)(a,b);if((0,o.isIterable)(a)||"string"==typeof a)return(0,s.scheduleIterable)(a,b)}throw new TypeError((null!==a&&typeof a||a)+" is not observable")}
},{"./scheduleObservable":"lgBy","./schedulePromise":"aPE6","./scheduleArray":"ZGwk","./scheduleIterable":"XzIO","../util/isInteropObservable":"CTP2","../util/isPromise":"Ok8F","../util/isArrayLike":"LS84","../util/isIterable":"NjuQ"}],"WXUl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.from=u;var e=require("../Observable"),r=require("../util/subscribeTo"),s=require("../scheduled/scheduled");function u(u,b){return b?(0,s.scheduled)(u,b):u instanceof e.Observable?u:new e.Observable((0,r.subscribeTo)(u))}
},{"../Observable":"wbSE","../util/subscribeTo":"vq9L","../scheduled/scheduled":"mNZE"}],"OHtH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.innerSubscribe=b,exports.ComplexOuterSubscriber=exports.SimpleOuterSubscriber=exports.ComplexInnerSubscriber=exports.SimpleInnerSubscriber=void 0;var t=o(require("tslib")),e=require("./Subscriber"),r=require("./Observable"),n=require("./util/subscribeTo");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=n?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}var u=function(e){function r(t){var r=e.call(this)||this;return r.parent=t,r}return t.__extends(r,e),r.prototype._next=function(t){this.parent.notifyNext(t)},r.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},r.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},r}(e.Subscriber);exports.SimpleInnerSubscriber=u;var s=function(e){function r(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i}return t.__extends(r,e),r.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this)},r.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},r.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},r}(e.Subscriber);exports.ComplexInnerSubscriber=s;var p=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r.prototype.notifyNext=function(t){this.destination.next(t)},r.prototype.notifyError=function(t){this.destination.error(t)},r.prototype.notifyComplete=function(){this.destination.complete()},r}(e.Subscriber);exports.SimpleOuterSubscriber=p;var c=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r.prototype.notifyNext=function(t,e,r,n){this.destination.next(e)},r.prototype.notifyError=function(t){this.destination.error(t)},r.prototype.notifyComplete=function(t){this.destination.complete()},r}(e.Subscriber);function b(t,e){if(!e.closed)return t instanceof r.Observable?t.subscribe(e):(0,n.subscribeTo)(t)(e)}exports.ComplexOuterSubscriber=c;
},{"tslib":"vCxL","./Subscriber":"RaFB","./Observable":"wbSE","./util/subscribeTo":"vq9L"}],"nFsM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeMap=u,exports.flatMap=exports.MergeMapSubscriber=exports.MergeMapOperator=void 0;var t=o(require("tslib")),e=require("./map"),r=require("../observable/from"),n=require("../innerSubscribe");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=n?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}function u(t,n,i){return void 0===i&&(i=Number.POSITIVE_INFINITY),"function"==typeof n?function(o){return o.pipe(u(function(i,o){return(0,r.from)(t(i,o)).pipe((0,e.map)(function(t,e){return n(i,t,o,e)}))},i))}:("number"==typeof n&&(i=n),function(e){return e.lift(new s(t,i))})}var s=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.project,this.concurrent))},t}();exports.MergeMapOperator=s;var p=function(e){function r(t,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return t.__extends(r,e),r.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},r.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(n){return void this.destination.error(n)}this.active++,this._innerSub(e)},r.prototype._innerSub=function(t){var e=new n.SimpleInnerSubscriber(this),r=this.destination;r.add(e);var i=(0,n.innerSubscribe)(t,e);i!==e&&r.add(i)},r.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},r.prototype.notifyNext=function(t){this.destination.next(t)},r.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},r}(n.SimpleOuterSubscriber);exports.MergeMapSubscriber=p;var c=u;exports.flatMap=c;
},{"tslib":"vCxL","./map":"dNh5","../observable/from":"WXUl","../innerSubscribe":"OHtH"}],"Nkv4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeAll=t;var e=require("./mergeMap"),r=require("../util/identity");function t(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),(0,e.mergeMap)(r.identity,t)}
},{"./mergeMap":"nFsM","../util/identity":"LXph"}],"Yxey":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatAll=r;var e=require("./mergeAll");function r(){return(0,e.mergeAll)(1)}
},{"./mergeAll":"Nkv4"}],"CsdO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concat=o;var e=require("./of"),r=require("../operators/concatAll");function o(){for(var o=[],t=0;t<arguments.length;t++)o[t]=arguments[t];return(0,r.concatAll)()(e.of.apply(void 0,o))}
},{"./of":"wZuk","../operators/concatAll":"Yxey"}],"w9G6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defer=u;var e=require("../Observable"),r=require("./from"),t=require("./empty");function u(u){return new e.Observable(function(e){var o;try{o=u()}catch(i){return void e.error(i)}return(o?(0,r.from)(o):(0,t.empty)()).subscribe(e)})}
},{"../Observable":"wbSE","./from":"WXUl","./empty":"XsKQ"}],"R2GC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.forkJoin=u;var r=require("../Observable"),e=require("../util/isArray"),t=require("../operators/map"),n=require("../util/isObject"),o=require("./from");function u(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(1===r.length){var u=r[0];if((0,e.isArray)(u))return i(u,null);if((0,n.isObject)(u)&&Object.getPrototypeOf(u)===Object.prototype){var f=Object.keys(u);return i(f.map(function(r){return u[r]}),f)}}if("function"==typeof r[r.length-1]){var c=r.pop();return i(r=1===r.length&&(0,e.isArray)(r[0])?r[0]:r,null).pipe((0,t.map)(function(r){return c.apply(void 0,r)}))}return i(r,null)}function i(e,t){return new r.Observable(function(r){var n=e.length;if(0!==n)for(var u=new Array(n),i=0,f=0,c=function(c){var l=(0,o.from)(e[c]),a=!1;r.add(l.subscribe({next:function(r){a||(a=!0,f++),u[c]=r},error:function(e){return r.error(e)},complete:function(){++i!==n&&a||(f===n&&r.next(t?t.reduce(function(r,e,t){return r[e]=u[t],r},{}):u),r.complete())}}))},l=0;l<n;l++)c(l);else r.complete()})}
},{"../Observable":"wbSE","../util/isArray":"KeTG","../operators/map":"dNh5","../util/isObject":"nU7r","./from":"WXUl"}],"ZHZV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fromEvent=i;var e=require("../Observable"),n=require("../util/isArray"),t=require("../util/isFunction"),r=require("../operators/map"),o=function(){return Object.prototype.toString}();function i(o,f,c,a){return(0,t.isFunction)(c)&&(a=c,c=void 0),a?i(o,f,c).pipe((0,r.map)(function(e){return(0,n.isArray)(e)?a.apply(void 0,e):a(e)})):new e.Observable(function(e){u(o,f,function(n){arguments.length>1?e.next(Array.prototype.slice.call(arguments)):e.next(n)},e,c)})}function u(e,n,t,r,o){var i;if(a(e)){var s=e;e.addEventListener(n,t,o),i=function(){return s.removeEventListener(n,t,o)}}else if(c(e)){var v=e;e.on(n,t),i=function(){return v.off(n,t)}}else if(f(e)){var p=e;e.addListener(n,t),i=function(){return p.removeListener(n,t)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var l=0,d=e.length;l<d;l++)u(e[l],n,t,r,o)}r.add(i)}function f(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}function c(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}function a(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}
},{"../Observable":"wbSE","../util/isArray":"KeTG","../util/isFunction":"Qnsq","../operators/map":"dNh5"}],"HFE7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fromEventPattern=i;var r=require("../Observable"),e=require("../util/isArray"),t=require("../util/isFunction"),n=require("../operators/map");function i(u,o,a){return a?i(u,o).pipe((0,n.map)(function(r){return(0,e.isArray)(r)?a.apply(void 0,r):a(r)})):new r.Observable(function(r){var e,n=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1===e.length?e[0]:e)};try{e=u(n)}catch(i){return void r.error(i)}if((0,t.isFunction)(o))return function(){return o(n,e)}})}
},{"../Observable":"wbSE","../util/isArray":"KeTG","../util/isFunction":"Qnsq","../operators/map":"dNh5"}],"xNZb":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generate=i;var e=require("../Observable"),r=require("../util/identity"),t=require("../util/isScheduler");function i(i,c,n,a,s){var u,d;if(1==arguments.length){var l=i;d=l.initialState,c=l.condition,n=l.iterate,u=l.resultSelector||r.identity,s=l.scheduler}else void 0===a||(0,t.isScheduler)(a)?(d=i,u=r.identity,s=a):(d=i,u=a);return new e.Observable(function(e){var r=d;if(s)return s.schedule(o,0,{subscriber:e,iterate:n,condition:c,resultSelector:u,state:r});for(;;){if(c){var t=void 0;try{t=c(r)}catch(a){return void e.error(a)}if(!t){e.complete();break}}var i=void 0;try{i=u(r)}catch(a){return void e.error(a)}if(e.next(i),e.closed)break;try{r=n(r)}catch(a){return void e.error(a)}}})}function o(e){var r=e.subscriber,t=e.condition;if(!r.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(c){return void r.error(c)}else e.needIterate=!0;if(t){var i=void 0;try{i=t(e.state)}catch(c){return void r.error(c)}if(!i)return void r.complete();if(r.closed)return}var o;try{o=e.resultSelector(e.state)}catch(c){return void r.error(c)}if(!r.closed&&(r.next(o),!r.closed))return this.schedule(e)}}
},{"../Observable":"wbSE","../util/identity":"LXph","../util/isScheduler":"VqoH"}],"SXp5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.iif=t;var e=require("./defer"),r=require("./empty");function t(t,i,u){return void 0===i&&(i=r.EMPTY),void 0===u&&(u=r.EMPTY),(0,e.defer)(function(){return t()?i:u})}
},{"./defer":"w9G6","./empty":"XsKQ"}],"wBpm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isNumeric=e;var r=require("./isArray");function e(e){return!(0,r.isArray)(e)&&e-parseFloat(e)+1>=0}
},{"./isArray":"KeTG"}],"QHLS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.interval=i;var e=require("../Observable"),r=require("../scheduler/async"),u=require("../util/isNumeric");function i(i,c){return void 0===i&&(i=0),void 0===c&&(c=r.async),(!(0,u.isNumeric)(i)||i<0)&&(i=0),c&&"function"==typeof c.schedule||(c=r.async),new e.Observable(function(e){return e.add(c.schedule(s,i,{subscriber:e,counter:0,period:i})),e})}function s(e){var r=e.subscriber,u=e.counter,i=e.period;r.next(u),this.schedule({subscriber:r,counter:u+1,period:i},i)}
},{"../Observable":"wbSE","../scheduler/async":"jun6","../util/isNumeric":"wBpm"}],"DQig":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.merge=u;var e=require("../Observable"),r=require("../util/isScheduler"),l=require("../operators/mergeAll"),t=require("./fromArray");function u(){for(var u=[],o=0;o<arguments.length;o++)u[o]=arguments[o];var n=Number.POSITIVE_INFINITY,p=null,i=u[u.length-1];return(0,r.isScheduler)(i)?(p=u.pop(),u.length>1&&"number"==typeof u[u.length-1]&&(n=u.pop())):"number"==typeof i&&(n=u.pop()),null===p&&1===u.length&&u[0]instanceof e.Observable?u[0]:(0,l.mergeAll)(n)((0,t.fromArray)(u,p))}
},{"../Observable":"wbSE","../util/isScheduler":"VqoH","../operators/mergeAll":"Nkv4","./fromArray":"PJGF"}],"TBTl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.never=t,exports.NEVER=void 0;var e=require("../Observable"),r=require("../util/noop"),o=new e.Observable(r.noop);function t(){return o}exports.NEVER=o;
},{"../Observable":"wbSE","../util/noop":"rXfM"}],"VCq5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.onErrorResumeNext=i;var e=require("../Observable"),r=require("./from"),t=require("../util/isArray"),n=require("./empty");function i(){for(var u=[],o=0;o<arguments.length;o++)u[o]=arguments[o];if(0===u.length)return n.EMPTY;var s=u[0],a=u.slice(1);return 1===u.length&&(0,t.isArray)(s)?i.apply(void 0,s):new e.Observable(function(e){var t=function(){return e.add(i.apply(void 0,a).subscribe(e))};return(0,r.from)(s).subscribe({next:function(r){e.next(r)},error:t,complete:t})})}
},{"../Observable":"wbSE","./from":"WXUl","../util/isArray":"KeTG","./empty":"XsKQ"}],"QHfc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pairs=s,exports.dispatch=i;var e=require("../Observable"),r=require("../Subscription");function s(s,t){return t?new e.Observable(function(e){var n=Object.keys(s),b=new r.Subscription;return b.add(t.schedule(i,0,{keys:n,index:0,subscriber:e,subscription:b,obj:s})),b}):new e.Observable(function(e){for(var r=Object.keys(s),i=0;i<r.length&&!e.closed;i++){var t=r[i];s.hasOwnProperty(t)&&e.next([t,s[t]])}e.complete()})}function i(e){var r=e.keys,s=e.index,i=e.subscriber,t=e.subscription,n=e.obj;if(!i.closed)if(s<r.length){var b=r[s];i.next([b,n[b]]),t.add(this.schedule({keys:r,index:s+1,subscriber:i,subscription:t,obj:n}))}else i.complete()}
},{"../Observable":"wbSE","../Subscription":"I8KM"}],"nij6":[function(require,module,exports) {
"use strict";function e(e,r){function t(){return!t.pred.apply(t.thisArg,arguments)}return t.pred=e,t.thisArg=r,t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.not=e;
},{}],"HKzi":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.filter=i;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var o=i?Object.getOwnPropertyDescriptor(t,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}function i(t,e){return function(r){return r.lift(new u(t,e))}}var u=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.predicate,this.thisArg))},t}(),o=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return t.__extends(r,e),r.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(r){return void this.destination.error(r)}e&&this.destination.next(t)},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"wJ9V":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.partition=s;var e=require("../util/not"),r=require("../util/subscribeTo"),t=require("../operators/filter"),i=require("../Observable");function s(s,u,b){return[(0,t.filter)(u,b)(new i.Observable((0,r.subscribeTo)(s))),(0,t.filter)((0,e.not)(u,b))(new i.Observable((0,r.subscribeTo)(s)))]}
},{"../util/not":"nij6","../util/subscribeTo":"vq9L","../operators/filter":"HKzi","../Observable":"wbSE"}],"bwYX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.race=u,exports.RaceSubscriber=exports.RaceOperator=void 0;var r=o(require("tslib")),t=require("../util/isArray"),e=require("./fromArray"),i=require("../OuterSubscriber"),s=require("../util/subscribeToResult");function n(){if("function"!=typeof WeakMap)return null;var r=new WeakMap;return n=function(){return r},r}function o(r){if(r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var t=n();if(t&&t.has(r))return t.get(r);var e={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){var o=i?Object.getOwnPropertyDescriptor(r,s):null;o&&(o.get||o.set)?Object.defineProperty(e,s,o):e[s]=r[s]}return e.default=r,t&&t.set(r,e),e}function u(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(1===r.length){if(!(0,t.isArray)(r[0]))return r[0];r=r[0]}return(0,e.fromArray)(r,void 0).lift(new a)}var a=function(){function r(){}return r.prototype.call=function(r,t){return t.subscribe(new c(r))},r}();exports.RaceOperator=a;var c=function(t){function e(r){var e=t.call(this,r)||this;return e.hasFirst=!1,e.observables=[],e.subscriptions=[],e}return r.__extends(e,t),e.prototype._next=function(r){this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,t=r.length;if(0===t)this.destination.complete();else{for(var e=0;e<t&&!this.hasFirst;e++){var i=r[e],n=(0,s.subscribeToResult)(this,i,void 0,e);this.subscriptions&&this.subscriptions.push(n),this.add(n)}this.observables=null}},e.prototype.notifyNext=function(r,t,e){if(!this.hasFirst){this.hasFirst=!0;for(var i=0;i<this.subscriptions.length;i++)if(i!==e){var s=this.subscriptions[i];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(t)},e}(i.OuterSubscriber);exports.RaceSubscriber=c;
},{"tslib":"vCxL","../util/isArray":"KeTG","./fromArray":"PJGF","../OuterSubscriber":"hZYI","../util/subscribeToResult":"JM7e"}],"N84r":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.range=r,exports.dispatch=t;var e=require("../Observable");function r(r,s,i){return void 0===r&&(r=0),new e.Observable(function(e){void 0===s&&(s=r,r=0);var n=0,o=r;if(i)return i.schedule(t,0,{index:n,count:s,start:r,subscriber:e});for(;;){if(n++>=s){e.complete();break}if(e.next(o++),e.closed)break}})}function t(e){var r=e.start,t=e.index,s=e.count,i=e.subscriber;t>=s?i.complete():(i.next(r),i.closed||(e.index=t+1,e.start=r+1,this.schedule(e)))}
},{"../Observable":"wbSE"}],"RPvN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timer=s;var e=require("../Observable"),r=require("../scheduler/async"),i=require("../util/isNumeric"),u=require("../util/isScheduler");function s(s,n,t){void 0===s&&(s=0);var d=-1;return(0,i.isNumeric)(n)?d=Number(n)<1?1:Number(n):(0,u.isScheduler)(n)&&(t=n),(0,u.isScheduler)(t)||(t=r.async),new e.Observable(function(e){var r=(0,i.isNumeric)(s)?s:+s-t.now();return t.schedule(c,r,{index:0,period:d,subscriber:e})})}function c(e){var r=e.index,i=e.period,u=e.subscriber;if(u.next(r),!u.closed){if(-1===i)return u.complete();e.index=r+1,this.schedule(e,i)}}
},{"../Observable":"wbSE","../scheduler/async":"jun6","../util/isNumeric":"wBpm","../util/isScheduler":"VqoH"}],"gc1W":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.using=t;var r=require("../Observable"),e=require("./from"),u=require("./empty");function t(t,n){return new r.Observable(function(r){var i,s;try{i=t()}catch(c){return void r.error(c)}try{s=n(i)}catch(c){return void r.error(c)}var o=(s?(0,e.from)(s):u.EMPTY).subscribe(r);return function(){o.unsubscribe(),i&&i.unsubscribe()}})}
},{"../Observable":"wbSE","./from":"WXUl","./empty":"XsKQ"}],"ff2A":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.zip=a,exports.ZipSubscriber=exports.ZipOperator=void 0;var t=u(require("tslib")),e=require("./fromArray"),r=require("../util/isArray"),n=require("../Subscriber"),i=require("../../internal/symbol/iterator"),o=require("../innerSubscribe");function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function(){return t},t}function u(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=s();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=n?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=t[i]}return r.default=t,e&&e.set(t,r),r}function a(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[t.length-1];return"function"==typeof n&&t.pop(),(0,e.fromArray)(t,void 0).lift(new l(n))}var l=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.resultSelector))},t}();exports.ZipOperator=l;var p=function(e){function n(t,r,n){void 0===n&&(n=Object.create(null));var i=e.call(this,t)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return t.__extends(n,e),n.prototype._next=function(t){var e=this.iterators;(0,r.isArray)(t)?e.push(new h(t)):"function"==typeof t[i.iterator]?e.push(new c(t[i.iterator]())):e.push(new f(this.destination,this,t))},n.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var r=0;r<e;r++){var n=t[r];if(n.stillUnsubscribed)this.destination.add(n.subscribe());else this.active--}}else this.destination.complete()},n.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},n.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,n=0;n<e;n++){if("function"==typeof(s=t[n]).hasValue&&!s.hasValue())return}var i=!1,o=[];for(n=0;n<e;n++){var s,u=(s=t[n]).next();if(s.hasCompleted()&&(i=!0),u.done)return void r.complete();o.push(u.value)}this.resultSelector?this._tryresultSelector(o):r.next(o),i&&r.complete()},n.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(r){return void this.destination.error(r)}this.destination.next(e)},n}(n.Subscriber);exports.ZipSubscriber=p;var c=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),h=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[i.iterator]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),f=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return t.__extends(r,e),r.prototype[i.iterator]=function(){return this},r.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},r.prototype.hasValue=function(){return this.buffer.length>0},r.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},r.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},r.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},r.prototype.subscribe=function(){return(0,o.innerSubscribe)(this.observable,new o.SimpleInnerSubscriber(this))},r}(o.SimpleOuterSubscriber);
},{"tslib":"vCxL","./fromArray":"PJGF","../util/isArray":"KeTG","../Subscriber":"RaFB","../../internal/symbol/iterator":"AqTP","../innerSubscribe":"OHtH"}],"iRqj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Observable",{enumerable:!0,get:function(){return e.Observable}}),Object.defineProperty(exports,"ConnectableObservable",{enumerable:!0,get:function(){return r.ConnectableObservable}}),Object.defineProperty(exports,"GroupedObservable",{enumerable:!0,get:function(){return t.GroupedObservable}}),Object.defineProperty(exports,"observable",{enumerable:!0,get:function(){return n.observable}}),Object.defineProperty(exports,"Subject",{enumerable:!0,get:function(){return i.Subject}}),Object.defineProperty(exports,"BehaviorSubject",{enumerable:!0,get:function(){return u.BehaviorSubject}}),Object.defineProperty(exports,"ReplaySubject",{enumerable:!0,get:function(){return o.ReplaySubject}}),Object.defineProperty(exports,"AsyncSubject",{enumerable:!0,get:function(){return b.AsyncSubject}}),Object.defineProperty(exports,"asap",{enumerable:!0,get:function(){return a.asap}}),Object.defineProperty(exports,"asapScheduler",{enumerable:!0,get:function(){return a.asapScheduler}}),Object.defineProperty(exports,"async",{enumerable:!0,get:function(){return l.async}}),Object.defineProperty(exports,"asyncScheduler",{enumerable:!0,get:function(){return l.asyncScheduler}}),Object.defineProperty(exports,"queue",{enumerable:!0,get:function(){return c.queue}}),Object.defineProperty(exports,"queueScheduler",{enumerable:!0,get:function(){return c.queueScheduler}}),Object.defineProperty(exports,"animationFrame",{enumerable:!0,get:function(){return p.animationFrame}}),Object.defineProperty(exports,"animationFrameScheduler",{enumerable:!0,get:function(){return p.animationFrameScheduler}}),Object.defineProperty(exports,"VirtualTimeScheduler",{enumerable:!0,get:function(){return s.VirtualTimeScheduler}}),Object.defineProperty(exports,"VirtualAction",{enumerable:!0,get:function(){return s.VirtualAction}}),Object.defineProperty(exports,"Scheduler",{enumerable:!0,get:function(){return f.Scheduler}}),Object.defineProperty(exports,"Subscription",{enumerable:!0,get:function(){return d.Subscription}}),Object.defineProperty(exports,"Subscriber",{enumerable:!0,get:function(){return m.Subscriber}}),Object.defineProperty(exports,"Notification",{enumerable:!0,get:function(){return y.Notification}}),Object.defineProperty(exports,"NotificationKind",{enumerable:!0,get:function(){return y.NotificationKind}}),Object.defineProperty(exports,"pipe",{enumerable:!0,get:function(){return g.pipe}}),Object.defineProperty(exports,"noop",{enumerable:!0,get:function(){return O.noop}}),Object.defineProperty(exports,"identity",{enumerable:!0,get:function(){return j.identity}}),Object.defineProperty(exports,"isObservable",{enumerable:!0,get:function(){return P.isObservable}}),Object.defineProperty(exports,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return x.ArgumentOutOfRangeError}}),Object.defineProperty(exports,"EmptyError",{enumerable:!0,get:function(){return q.EmptyError}}),Object.defineProperty(exports,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return v.ObjectUnsubscribedError}}),Object.defineProperty(exports,"UnsubscriptionError",{enumerable:!0,get:function(){return E.UnsubscriptionError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return S.TimeoutError}}),Object.defineProperty(exports,"bindCallback",{enumerable:!0,get:function(){return h.bindCallback}}),Object.defineProperty(exports,"bindNodeCallback",{enumerable:!0,get:function(){return N.bindNodeCallback}}),Object.defineProperty(exports,"combineLatest",{enumerable:!0,get:function(){return R.combineLatest}}),Object.defineProperty(exports,"concat",{enumerable:!0,get:function(){return k.concat}}),Object.defineProperty(exports,"defer",{enumerable:!0,get:function(){return C.defer}}),Object.defineProperty(exports,"empty",{enumerable:!0,get:function(){return A.empty}}),Object.defineProperty(exports,"EMPTY",{enumerable:!0,get:function(){return A.EMPTY}}),Object.defineProperty(exports,"forkJoin",{enumerable:!0,get:function(){return T.forkJoin}}),Object.defineProperty(exports,"from",{enumerable:!0,get:function(){return V.from}}),Object.defineProperty(exports,"fromEvent",{enumerable:!0,get:function(){return U.fromEvent}}),Object.defineProperty(exports,"fromEventPattern",{enumerable:!0,get:function(){return F.fromEventPattern}}),Object.defineProperty(exports,"generate",{enumerable:!0,get:function(){return B.generate}}),Object.defineProperty(exports,"iif",{enumerable:!0,get:function(){return w.iif}}),Object.defineProperty(exports,"interval",{enumerable:!0,get:function(){return z.interval}}),Object.defineProperty(exports,"merge",{enumerable:!0,get:function(){return J.merge}}),Object.defineProperty(exports,"never",{enumerable:!0,get:function(){return L.never}}),Object.defineProperty(exports,"NEVER",{enumerable:!0,get:function(){return L.NEVER}}),Object.defineProperty(exports,"of",{enumerable:!0,get:function(){return M.of}}),Object.defineProperty(exports,"onErrorResumeNext",{enumerable:!0,get:function(){return G.onErrorResumeNext}}),Object.defineProperty(exports,"pairs",{enumerable:!0,get:function(){return K.pairs}}),Object.defineProperty(exports,"partition",{enumerable:!0,get:function(){return Y.partition}}),Object.defineProperty(exports,"race",{enumerable:!0,get:function(){return _.race}}),Object.defineProperty(exports,"range",{enumerable:!0,get:function(){return D.range}}),Object.defineProperty(exports,"throwError",{enumerable:!0,get:function(){return H.throwError}}),Object.defineProperty(exports,"timer",{enumerable:!0,get:function(){return I.timer}}),Object.defineProperty(exports,"using",{enumerable:!0,get:function(){return Q.using}}),Object.defineProperty(exports,"zip",{enumerable:!0,get:function(){return W.zip}}),Object.defineProperty(exports,"scheduled",{enumerable:!0,get:function(){return X.scheduled}}),Object.defineProperty(exports,"config",{enumerable:!0,get:function(){return Z.config}});var e=require("./internal/Observable"),r=require("./internal/observable/ConnectableObservable"),t=require("./internal/operators/groupBy"),n=require("./internal/symbol/observable"),i=require("./internal/Subject"),u=require("./internal/BehaviorSubject"),o=require("./internal/ReplaySubject"),b=require("./internal/AsyncSubject"),a=require("./internal/scheduler/asap"),l=require("./internal/scheduler/async"),c=require("./internal/scheduler/queue"),p=require("./internal/scheduler/animationFrame"),s=require("./internal/scheduler/VirtualTimeScheduler"),f=require("./internal/Scheduler"),d=require("./internal/Subscription"),m=require("./internal/Subscriber"),y=require("./internal/Notification"),g=require("./internal/util/pipe"),O=require("./internal/util/noop"),j=require("./internal/util/identity"),P=require("./internal/util/isObservable"),x=require("./internal/util/ArgumentOutOfRangeError"),q=require("./internal/util/EmptyError"),v=require("./internal/util/ObjectUnsubscribedError"),E=require("./internal/util/UnsubscriptionError"),S=require("./internal/util/TimeoutError"),h=require("./internal/observable/bindCallback"),N=require("./internal/observable/bindNodeCallback"),R=require("./internal/observable/combineLatest"),k=require("./internal/observable/concat"),C=require("./internal/observable/defer"),A=require("./internal/observable/empty"),T=require("./internal/observable/forkJoin"),V=require("./internal/observable/from"),U=require("./internal/observable/fromEvent"),F=require("./internal/observable/fromEventPattern"),B=require("./internal/observable/generate"),w=require("./internal/observable/iif"),z=require("./internal/observable/interval"),J=require("./internal/observable/merge"),L=require("./internal/observable/never"),M=require("./internal/observable/of"),G=require("./internal/observable/onErrorResumeNext"),K=require("./internal/observable/pairs"),Y=require("./internal/observable/partition"),_=require("./internal/observable/race"),D=require("./internal/observable/range"),H=require("./internal/observable/throwError"),I=require("./internal/observable/timer"),Q=require("./internal/observable/using"),W=require("./internal/observable/zip"),X=require("./internal/scheduled/scheduled"),Z=require("./internal/config");
},{"./internal/Observable":"wbSE","./internal/observable/ConnectableObservable":"kkfD","./internal/operators/groupBy":"dNgG","./internal/symbol/observable":"tjV3","./internal/Subject":"r9t1","./internal/BehaviorSubject":"MPU6","./internal/ReplaySubject":"Cp6P","./internal/AsyncSubject":"Scvc","./internal/scheduler/asap":"ZqYc","./internal/scheduler/async":"jun6","./internal/scheduler/queue":"HGOP","./internal/scheduler/animationFrame":"zUKp","./internal/scheduler/VirtualTimeScheduler":"RuMO","./internal/Scheduler":"QglZ","./internal/Subscription":"I8KM","./internal/Subscriber":"RaFB","./internal/Notification":"n7Mc","./internal/util/pipe":"HQCS","./internal/util/noop":"rXfM","./internal/util/identity":"LXph","./internal/util/isObservable":"cUXi","./internal/util/ArgumentOutOfRangeError":"Qh4I","./internal/util/EmptyError":"vsl0","./internal/util/ObjectUnsubscribedError":"xQEi","./internal/util/UnsubscriptionError":"pMaL","./internal/util/TimeoutError":"SZK7","./internal/observable/bindCallback":"lxDK","./internal/observable/bindNodeCallback":"uTDa","./internal/observable/combineLatest":"omVc","./internal/observable/concat":"CsdO","./internal/observable/defer":"w9G6","./internal/observable/empty":"XsKQ","./internal/observable/forkJoin":"R2GC","./internal/observable/from":"WXUl","./internal/observable/fromEvent":"ZHZV","./internal/observable/fromEventPattern":"HFE7","./internal/observable/generate":"xNZb","./internal/observable/iif":"SXp5","./internal/observable/interval":"QHLS","./internal/observable/merge":"DQig","./internal/observable/never":"TBTl","./internal/observable/of":"wZuk","./internal/observable/onErrorResumeNext":"VCq5","./internal/observable/pairs":"QHfc","./internal/observable/partition":"wJ9V","./internal/observable/race":"bwYX","./internal/observable/range":"N84r","./internal/observable/throwError":"FdIu","./internal/observable/timer":"RPvN","./internal/observable/using":"gc1W","./internal/observable/zip":"ff2A","./internal/scheduled/scheduled":"mNZE","./internal/config":"Q3iD"}],"Pdg2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.audit=n;var t=i(require("tslib")),e=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=n?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(i,o,u):i[o]=t[o]}return i.default=t,e&&e.set(t,i),i}function n(t){return function(e){return e.lift(new o(t))}}var o=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.durationSelector))},t}(),u=function(r){function i(t,e){var i=r.call(this,t)||this;return i.durationSelector=e,i.hasValue=!1,i}return t.__extends(i,r),i.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var r=void 0;try{r=(0,this.durationSelector)(t)}catch(n){return this.destination.error(n)}var i=(0,e.innerSubscribe)(r,new e.SimpleInnerSubscriber(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}},i.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,r=this.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),e&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))},i.prototype.notifyNext=function(){this.clearThrottle()},i.prototype.notifyComplete=function(){this.clearThrottle()},i}(e.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"jcYn":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.auditTime=i;var e=require("../scheduler/async"),r=require("./audit"),t=require("../observable/timer");function i(i,u){return void 0===u&&(u=e.async),(0,r.audit)(function(){return(0,t.timer)(i,u)})}
},{"../scheduler/async":"jun6","./audit":"Pdg2","../observable/timer":"RPvN"}],"mG6b":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.buffer=i;var e=n(require("tslib")),t=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}function i(e){return function(t){return t.lift(new u(e))}}var u=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new o(e,this.closingNotifier))},e}(),o=function(r){function n(e,n){var i=r.call(this,e)||this;return i.buffer=[],i.add((0,t.innerSubscribe)(n,new t.SimpleInnerSubscriber(i))),i}return e.__extends(n,r),n.prototype._next=function(e){this.buffer.push(e)},n.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},n}(t.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"f9IP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bufferCount=i;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var f=i?Object.getOwnPropertyDescriptor(t,u):null;f&&(f.get||f.set)?Object.defineProperty(n,u,f):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}function i(t,e){return void 0===e&&(e=null),function(r){return r.lift(new u(t,e))}}var u=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?s:f}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),f=function(e){function r(t,r){var n=e.call(this,t)||this;return n.bufferSize=r,n.buffer=[],n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},r.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},r}(e.Subscriber),s=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return t.__extends(r,e),r.prototype._next=function(t){var e=this.bufferSize,r=this.startBufferEvery,n=this.buffers,i=this.count;this.count++,i%r==0&&n.push([]);for(var u=n.length;u--;){var f=n[u];f.push(t),f.length===e&&(n.splice(u,1),this.destination.next(f))}},r.prototype._complete=function(){for(var t=this.buffers,r=this.destination;t.length>0;){var n=t.shift();n.length>0&&r.next(n)}e.prototype._complete.call(this)},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"Axj2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bufferTime=s;var e=o(require("tslib")),t=require("../scheduler/async"),r=require("../Subscriber"),n=require("../util/isScheduler");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function s(e){var r=arguments.length,i=t.async;(0,n.isScheduler)(arguments[arguments.length-1])&&(i=arguments[arguments.length-1],r--);var o=null;r>=2&&(o=arguments[1]);var s=Number.POSITIVE_INFINITY;return r>=3&&(s=arguments[2]),function(t){return t.lift(new u(e,o,s,i))}}var u=function(){function e(e,t,r,n){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),c=function(){return function(){this.buffer=[]}}(),f=function(t){function r(e,r,n,i,o){var s=t.call(this,e)||this;s.bufferTimeSpan=r,s.bufferCreationInterval=n,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var u=s.openContext();if(s.timespanOnly=null==n||n<0,s.timespanOnly){var c={subscriber:s,context:u,bufferTimeSpan:r};s.add(u.closeAction=o.schedule(l,r,c))}else{var f={subscriber:s,context:u},p={bufferTimeSpan:r,bufferCreationInterval:n,subscriber:s,scheduler:o};s.add(u.closeAction=o.schedule(h,r,f)),s.add(o.schedule(a,n,p))}return s}return e.__extends(r,t),r.prototype._next=function(e){for(var t,r=this.contexts,n=r.length,i=0;i<n;i++){var o=r[i],s=o.buffer;s.push(e),s.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},r.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},r.prototype._complete=function(){for(var e=this.contexts,r=this.destination;e.length>0;){var n=e.shift();r.next(n.buffer)}t.prototype._complete.call(this)},r.prototype._unsubscribe=function(){this.contexts=null},r.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:e,bufferTimeSpan:r};this.add(e.closeAction=this.scheduler.schedule(l,r,n))}},r.prototype.openContext=function(){var e=new c;return this.contexts.push(e),e},r.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},r}(r.Subscriber);function l(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function a(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openContext();n.closed||(n.add(o.closeAction=i.schedule(h,r,{subscriber:n,context:o})),this.schedule(e,t))}function h(e){var t=e.subscriber,r=e.context;t.closeContext(r)}
},{"tslib":"vCxL","../scheduler/async":"jun6","../Subscriber":"RaFB","../util/isScheduler":"VqoH"}],"ZTTP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bufferToggle=s;var t=i(require("tslib")),e=require("../Subscription"),r=require("../util/subscribeToResult"),n=require("../OuterSubscriber");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=n?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=t[i]}return r.default=t,e&&e.set(t,r),r}function s(t,e){return function(r){return r.lift(new u(t,e))}}var u=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.openings,this.closingSelector))},t}(),c=function(n){function o(t,e,o){var i=n.call(this,t)||this;return i.closingSelector=o,i.contexts=[],i.add((0,r.subscribeToResult)(i,e)),i}return t.__extends(o,n),o.prototype._next=function(t){for(var e=this.contexts,r=e.length,n=0;n<r;n++)e[n].buffer.push(t)},o.prototype._error=function(t){for(var e=this.contexts;e.length>0;){var r=e.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,n.prototype._error.call(this,t)},o.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var e=t.shift();this.destination.next(e.buffer),e.subscription.unsubscribe(),e.buffer=null,e.subscription=null}this.contexts=null,n.prototype._complete.call(this)},o.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},o.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},o.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(r){this._error(r)}},o.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var r=t.buffer,n=t.subscription;this.destination.next(r),e.splice(e.indexOf(t),1),this.remove(n),n.unsubscribe()}},o.prototype.trySubscribe=function(t){var n=this.contexts,o=new e.Subscription,i={buffer:[],subscription:o};n.push(i);var s=(0,r.subscribeToResult)(this,t,i);!s||s.closed?this.closeBuffer(i):(s.context=i,this.add(s),o.add(s))},o}(n.OuterSubscriber);
},{"tslib":"vCxL","../Subscription":"I8KM","../util/subscribeToResult":"JM7e","../OuterSubscriber":"hZYI"}],"Ul3A":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bufferWhen=o;var t=n(require("tslib")),e=require("../Subscription"),r=require("../innerSubscribe");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=n?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}function o(t){return function(e){return e.lift(new u(t))}}var u=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.closingSelector))},t}(),s=function(i){function n(t,e){var r=i.call(this,t)||this;return r.closingSelector=e,r.subscribing=!1,r.openBuffer(),r}return t.__extends(n,i),n.prototype._next=function(t){this.buffer.push(t)},n.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),i.prototype._complete.call(this)},n.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},n.prototype.notifyNext=function(){this.openBuffer()},n.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},n.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var i,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{i=(0,this.closingSelector)()}catch(o){return this.error(o)}t=new e.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add((0,r.innerSubscribe)(i,new r.SimpleInnerSubscriber(this))),this.subscribing=!1},n}(r.SimpleOuterSubscriber);
},{"tslib":"vCxL","../Subscription":"I8KM","../innerSubscribe":"OHtH"}],"THoY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.catchError=i;var e=n(require("tslib")),r=require("../innerSubscribe");function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}function i(e){return function(r){var t=new u(e),n=r.lift(t);return t.caught=n}}var u=function(){function e(e){this.selector=e}return e.prototype.call=function(e,r){return r.subscribe(new o(e,this.selector,this.caught))},e}(),o=function(t){function n(e,r,n){var i=t.call(this,e)||this;return i.selector=r,i.caught=n,i}return e.__extends(n,t),n.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(o){return void t.prototype.error.call(this,o)}this._unsubscribeAndRecycle();var i=new r.SimpleInnerSubscriber(this);this.add(i);var u=(0,r.innerSubscribe)(n,i);u!==i&&this.add(u)}},n}(r.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"TMFF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineAll=t;var e=require("../observable/combineLatest");function t(t){return function(r){return r.lift(new e.CombineLatestOperator(t))}}
},{"../observable/combineLatest":"omVc"}],"DJQm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineLatest=n;var e=require("../util/isArray"),r=require("../observable/combineLatest"),t=require("../observable/from"),o={};function n(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=null;return"function"==typeof o[o.length-1]&&(i=o.pop()),1===o.length&&(0,e.isArray)(o[0])&&(o=o[0].slice()),function(e){return e.lift.call((0,t.from)([e].concat(o)),new r.CombineLatestOperator(i))}}
},{"../util/isArray":"KeTG","../observable/combineLatest":"omVc","../observable/from":"WXUl"}],"ZHmI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concat=t;var e=require("../observable/concat");function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return function(r){return r.lift.call(e.concat.apply(void 0,[r].concat(t)))}}
},{"../observable/concat":"CsdO"}],"DoUK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatMap=r;var e=require("./mergeMap");function r(r,t){return(0,e.mergeMap)(r,t,1)}
},{"./mergeMap":"nFsM"}],"APQq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatMapTo=t;var e=require("./concatMap");function t(t,r){return(0,e.concatMap)(function(){return t},r)}
},{"./concatMap":"DoUK"}],"U1Ln":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.count=i;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=i?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=t[o]}return n.default=t,e&&e.set(t,n),n}function i(t){return function(e){return e.lift(new o(t,e))}}var o=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.predicate,this.source))},t}(),u=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return t.__extends(r,e),r.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},r.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(r){return void this.destination.error(r)}e&&this.count++},r.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"y9EZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.debounce=n;var t=i(require("tslib")),e=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=n?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(i,o,u):i[o]=t[o]}return i.default=t,e&&e.set(t,i),i}function n(t){return function(e){return e.lift(new o(t))}}var o=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.durationSelector))},t}(),u=function(r){function i(t,e){var i=r.call(this,t)||this;return i.durationSelector=e,i.hasValue=!1,i}return t.__extends(i,r),i.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(r){this.destination.error(r)}},i.prototype._complete=function(){this.emitValue(),this.destination.complete()},i.prototype._tryNext=function(t,r){var i=this.durationSubscription;this.value=t,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),(i=(0,e.innerSubscribe)(r,new e.SimpleInnerSubscriber(this)))&&!i.closed&&this.add(this.durationSubscription=i)},i.prototype.notifyNext=function(){this.emitValue()},i.prototype.notifyComplete=function(){this.emitValue()},i.prototype.emitValue=function(){if(this.hasValue){var t=this.value,e=this.durationSubscription;e&&(this.durationSubscription=void 0,e.unsubscribe(),this.remove(e)),this.value=void 0,this.hasValue=!1,r.prototype._next.call(this,t)}},i}(e.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"KBFO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.debounceTime=i;var e=u(require("tslib")),t=require("../Subscriber"),n=require("../scheduler/async");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=u?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function i(e,t){return void 0===t&&(t=n.async),function(n){return n.lift(new o(e,t))}}var o=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.dueTime,this.scheduler))},e}(),s=function(t){function n(e,n,r){var u=t.call(this,e)||this;return u.dueTime=n,u.scheduler=r,u.debouncedSubscription=null,u.lastValue=null,u.hasValue=!1,u}return e.__extends(n,t),n.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(c,this.dueTime,this))},n.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},n.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},n.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},n}(t.Subscriber);function c(e){e.debouncedNext()}
},{"tslib":"vCxL","../Subscriber":"RaFB","../scheduler/async":"jun6"}],"YBdz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultIfEmpty=i;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var o=i?Object.getOwnPropertyDescriptor(t,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}function i(t){return void 0===t&&(t=null),function(e){return e.lift(new u(t))}}var u=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.defaultValue))},t}(),o=function(e){function r(t,r){var n=e.call(this,t)||this;return n.defaultValue=r,n.isEmpty=!0,n}return t.__extends(r,e),r.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},r.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"rxSS":[function(require,module,exports) {
"use strict";function e(e){return e instanceof Date&&!isNaN(+e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isDate=e;
},{}],"zkgx":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.delay=u;var e=s(require("tslib")),t=require("../scheduler/async"),i=require("../util/isDate"),r=require("../Subscriber"),n=require("../Notification");function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=r?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(i,n,s):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i}function u(e,r){void 0===r&&(r=t.async);var n=(0,i.isDate)(e)?+e-r.now():Math.abs(e);return function(e){return e.lift(new c(n,r))}}var c=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.delay,this.scheduler))},e}(),a=function(t){function i(e,i,r){var n=t.call(this,e)||this;return n.delay=i,n.scheduler=r,n.queue=[],n.active=!1,n.errored=!1,n}return e.__extends(i,t),i.dispatch=function(e){for(var t=e.source,i=t.queue,r=e.scheduler,n=e.destination;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(n);if(i.length>0){var o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},i.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(i.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},i.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,i=new h(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}},i.prototype._next=function(e){this.scheduleNotification(n.Notification.createNext(e))},i.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},i.prototype._complete=function(){this.scheduleNotification(n.Notification.createComplete()),this.unsubscribe()},i}(r.Subscriber),h=function(){return function(e,t){this.time=e,this.notification=t}}();
},{"tslib":"vCxL","../scheduler/async":"jun6","../util/isDate":"rxSS","../Subscriber":"RaFB","../Notification":"n7Mc"}],"iVuv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.delayWhen=u;var t=s(require("tslib")),e=require("../Subscriber"),r=require("../Observable"),i=require("../OuterSubscriber"),o=require("../util/subscribeToResult");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function s(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}function u(t,e){return e?function(r){return new b(r,e).lift(new c(t))}:function(e){return e.lift(new c(t))}}var c=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.delayDurationSelector))},t}(),p=function(e){function r(t,r){var i=e.call(this,t)||this;return i.delayDurationSelector=r,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return t.__extends(r,e),r.prototype.notifyNext=function(t,e,r,i,o){this.destination.next(t),this.removeSubscription(o),this.tryComplete()},r.prototype.notifyError=function(t,e){this._error(t)},r.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},r.prototype._next=function(t){var e=this.index++;try{var r=this.delayDurationSelector(t,e);r&&this.tryDelay(r,t)}catch(i){this.destination.error(i)}},r.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},r.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},r.prototype.tryDelay=function(t,e){var r=(0,o.subscribeToResult)(this,t,e);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},r.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},r}(i.OuterSubscriber),b=function(e){function r(t,r){var i=e.call(this)||this;return i.source=t,i.subscriptionDelay=r,i}return t.__extends(r,e),r.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new l(t,this.source))},r}(r.Observable),l=function(e){function r(t,r){var i=e.call(this)||this;return i.parent=t,i.source=r,i.sourceSubscribed=!1,i}return t.__extends(r,e),r.prototype._next=function(t){this.subscribeToSource()},r.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},r.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},r.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../Observable":"wbSE","../OuterSubscriber":"hZYI","../util/subscribeToResult":"JM7e"}],"v6b5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.dematerialize=u;var e=n(require("tslib")),t=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=u?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function u(){return function(e){return e.lift(new i)}}var i=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new o(e))},e}(),o=function(t){function r(e){return t.call(this,e)||this}return e.__extends(r,t),r.prototype._next=function(e){e.observe(this.destination)},r}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"H608":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.distinct=i,exports.DistinctSubscriber=void 0;var e=n(require("tslib")),t=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function i(e,t){return function(r){return r.lift(new o(e,t))}}var o=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.keySelector,this.flushes))},e}(),u=function(r){function n(e,n,i){var o=r.call(this,e)||this;return o.keySelector=n,o.values=new Set,i&&o.add((0,t.innerSubscribe)(i,new t.SimpleInnerSubscriber(o))),o}return e.__extends(n,r),n.prototype.notifyNext=function(){this.values.clear()},n.prototype.notifyError=function(e){this._error(e)},n.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},n.prototype._useKeySelector=function(e){var t,r=this.destination;try{t=this.keySelector(e)}catch(n){return void r.error(n)}this._finalizeNext(t,e)},n.prototype._finalizeNext=function(e,t){var r=this.values;r.has(e)||(r.add(e),this.destination.next(t))},n}(t.SimpleOuterSubscriber);exports.DistinctSubscriber=u;
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"hFX7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.distinctUntilChanged=i;var e=n(require("tslib")),t=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var c=i?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(n,o,c):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function i(e,t){return function(r){return r.lift(new o(e,t))}}var o=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.compare,this.keySelector))},e}(),c=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return e.__extends(r,t),r.prototype.compare=function(e,t){return e===t},r.prototype._next=function(e){var t;try{var r=this.keySelector;t=r?r(e):e}catch(i){return this.destination.error(i)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,t)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))},r}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"Egbr":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.distinctUntilKeyChanged=e;var t=require("./distinctUntilChanged");function e(e,n){return(0,t.distinctUntilChanged)(function(t,i){return n?n(t[e],i[e]):t[e]===i[e]})}
},{"./distinctUntilChanged":"hFX7"}],"D7Ma":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.throwIfEmpty=i;var t=o(require("tslib")),r=require("../util/EmptyError"),e=require("../Subscriber");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=n();if(r&&r.has(t))return r.get(t);var e={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var u=o?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(e,i,u):e[i]=t[i]}return e.default=t,r&&r.set(t,e),e}function i(t){return void 0===t&&(t=a),function(r){return r.lift(new u(t))}}var u=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,r){return r.subscribe(new c(t,this.errorFactory))},t}(),c=function(r){function e(t,e){var n=r.call(this,t)||this;return n.errorFactory=e,n.hasValue=!1,n}return t.__extends(e,r),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(r){t=r}this.destination.error(t)},e}(e.Subscriber);function a(){return new r.EmptyError}
},{"tslib":"vCxL","../util/EmptyError":"vsl0","../Subscriber":"RaFB"}],"JVEz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.take=o;var t=u(require("tslib")),e=require("../Subscriber"),r=require("../util/ArgumentOutOfRangeError"),n=require("../observable/empty");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function u(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var o=n?Object.getOwnPropertyDescriptor(t,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=t[u]}return r.default=t,e&&e.set(t,r),r}function o(t){return function(e){return 0===t?(0,n.empty)():e.lift(new c(t))}}var c=function(){function t(t){if(this.total=t,this.total<0)throw new r.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.total))},t}(),s=function(e){function r(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.total,r=++this.count;r<=e&&(this.destination.next(t),r===e&&(this.destination.complete(),this.unsubscribe()))},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../util/ArgumentOutOfRangeError":"Qh4I","../observable/empty":"XsKQ"}],"TbZV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.elementAt=f;var e=require("../util/ArgumentOutOfRangeError"),r=require("./filter"),t=require("./throwIfEmpty"),u=require("./defaultIfEmpty"),n=require("./take");function f(f,i){if(f<0)throw new e.ArgumentOutOfRangeError;var o=arguments.length>=2;return function(a){return a.pipe((0,r.filter)(function(e,r){return r===f}),(0,n.take)(1),o?(0,u.defaultIfEmpty)(i):(0,t.throwIfEmpty)(function(){return new e.ArgumentOutOfRangeError}))}}
},{"../util/ArgumentOutOfRangeError":"Qh4I","./filter":"HKzi","./throwIfEmpty":"D7Ma","./defaultIfEmpty":"YBdz","./take":"JVEz"}],"loee":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.endWith=o;var e=require("../observable/concat"),r=require("../observable/of");function o(){for(var o=[],t=0;t<arguments.length;t++)o[t]=arguments[t];return function(t){return(0,e.concat)(t,r.of.apply(void 0,o))}}
},{"../observable/concat":"CsdO","../observable/of":"wZuk"}],"eEZZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.every=n;var t=i(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=n?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=t[o]}return i.default=t,e&&e.set(t,i),i}function n(t,e){return function(r){return r.lift(new o(t,e,r))}}var o=function(){function t(t,e,r){this.predicate=t,this.thisArg=e,this.source=r}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg,this.source))},t}(),s=function(e){function r(t,r,i,n){var o=e.call(this,t)||this;return o.predicate=r,o.thisArg=i,o.source=n,o.index=0,o.thisArg=i||o,o}return t.__extends(r,e),r.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},r.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(r){return void this.destination.error(r)}e||this.notifyComplete(!1)},r.prototype._complete=function(){this.notifyComplete(!0)},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"ifNj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exhaust=i;var t=n(require("tslib")),e=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=i?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=t[o]}return n.default=t,e&&e.set(t,n),n}function i(){return function(t){return t.lift(new o)}}var o=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new u(t))},t}(),u=function(r){function n(t){var e=r.call(this,t)||this;return e.hasCompleted=!1,e.hasSubscription=!1,e}return t.__extends(n,r),n.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add((0,e.innerSubscribe)(t,new e.SimpleInnerSubscriber(this))))},n.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},n.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},n}(e.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"DGWU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exhaustMap=u;var t=o(require("tslib")),e=require("./map"),r=require("../observable/from"),n=require("../innerSubscribe");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=n?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}function u(t,n){return n?function(i){return i.pipe(u(function(i,o){return(0,r.from)(t(i,o)).pipe((0,e.map)(function(t,e){return n(i,t,o,e)}))}))}:function(e){return e.lift(new s(t))}}var s=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.project))},t}(),p=function(e){function r(t,r){var n=e.call(this,t)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return t.__extends(r,e),r.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},r.prototype.tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(n){return void this.destination.error(n)}this.hasSubscription=!0,this._innerSub(e)},r.prototype._innerSub=function(t){var e=new n.SimpleInnerSubscriber(this),r=this.destination;r.add(e);var i=(0,n.innerSubscribe)(t,e);i!==e&&r.add(i)},r.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},r.prototype.notifyNext=function(t){this.destination.next(t)},r.prototype.notifyError=function(t){this.destination.error(t)},r.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},r}(n.SimpleOuterSubscriber);
},{"tslib":"vCxL","./map":"dNh5","../observable/from":"WXUl","../innerSubscribe":"OHtH"}],"iYcS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.expand=n,exports.ExpandSubscriber=exports.ExpandOperator=void 0;var e=i(require("tslib")),t=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}return i.default=e,t&&t.set(e,i),i}function n(e,t,r){return void 0===t&&(t=Number.POSITIVE_INFINITY),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(i){return i.lift(new s(e,t,r))}}var s=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new o(e,this.project,this.concurrent,this.scheduler))},e}();exports.ExpandOperator=s;var o=function(r){function i(e,t,i,n){var s=r.call(this,e)||this;return s.project=t,s.concurrent=i,s.scheduler=n,s.index=0,s.active=0,s.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(s.buffer=[]),s}return e.__extends(i,r),i.dispatch=function(e){var t=e.subscriber,r=e.result,i=e.value,n=e.index;t.subscribeToProjection(r,i,n)},i.prototype._next=function(e){var t=this.destination;if(t.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){t.next(e);try{var n=(0,this.project)(e,r);if(this.scheduler){var s={subscriber:this,result:n,value:e,index:r};this.destination.add(this.scheduler.schedule(i.dispatch,0,s))}else this.subscribeToProjection(n,e,r)}catch(o){t.error(o)}}else this.buffer.push(e)}},i.prototype.subscribeToProjection=function(e,r,i){this.active++,this.destination.add((0,t.innerSubscribe)(e,new t.SimpleInnerSubscriber(this)))},i.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},i.prototype.notifyNext=function(e){this._next(e)},i.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},i}(t.SimpleOuterSubscriber);exports.ExpandSubscriber=o;
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"x5qu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.finalize=u;var e=i(require("tslib")),r=require("../Subscriber"),t=require("../Subscription");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n();if(r&&r.has(e))return r.get(e);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(t,u,o):t[u]=e[u]}return t.default=e,r&&r.set(e,t),t}function u(e){return function(r){return r.lift(new o(e))}}var o=function(){function e(e){this.callback=e}return e.prototype.call=function(e,r){return r.subscribe(new c(e,this.callback))},e}(),c=function(r){function n(e,n){var i=r.call(this,e)||this;return i.add(new t.Subscription(n)),i}return e.__extends(n,r),n}(r.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../Subscription":"I8KM"}],"t6rP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.find=n,exports.FindValueSubscriber=exports.FindValueOperator=void 0;var e=i(require("tslib")),t=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,t&&t.set(e,i),i}function n(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(r){return r.lift(new o(e,r,!1,t))}}var o=function(){function e(e,t,r,i){this.predicate=e,this.source=t,this.yieldIndex=r,this.thisArg=i}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();exports.FindValueOperator=o;var s=function(t){function r(e,r,i,n,o){var s=t.call(this,e)||this;return s.predicate=r,s.source=i,s.yieldIndex=n,s.thisArg=o,s.index=0,s}return e.__extends(r,t),r.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},r.prototype._next=function(e){var t=this.predicate,r=this.thisArg,i=this.index++;try{t.call(r||this,e,i,this.source)&&this.notifyComplete(this.yieldIndex?i:e)}catch(n){this.destination.error(n)}},r.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},r}(t.Subscriber);exports.FindValueSubscriber=s;
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"GIlo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findIndex=r;var e=require("../operators/find");function r(r,t){return function(n){return n.lift(new e.FindValueOperator(r,n,!0,t))}}
},{"../operators/find":"t6rP"}],"f9sd":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.first=f;var r=require("../util/EmptyError"),e=require("./filter"),t=require("./take"),i=require("./defaultIfEmpty"),u=require("./throwIfEmpty"),n=require("../util/identity");function f(f,o){var p=arguments.length>=2;return function(l){return l.pipe(f?(0,e.filter)(function(r,e){return f(r,e,l)}):n.identity,(0,t.take)(1),p?(0,i.defaultIfEmpty)(o):(0,u.throwIfEmpty)(function(){return new r.EmptyError}))}}
},{"../util/EmptyError":"vsl0","./filter":"HKzi","./take":"JVEz","./defaultIfEmpty":"YBdz","./throwIfEmpty":"D7Ma","../util/identity":"LXph"}],"P82l":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ignoreElements=u;var e=n(require("tslib")),t=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=u?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function u(){return function(e){return e.lift(new o)}}var o=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new i(e))},e}(),i=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(r,t),r.prototype._next=function(e){},r}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"LqVv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isEmpty=o;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var u=o?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function o(){return function(t){return t.lift(new i)}}var i=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new u(t))},t}(),u=function(e){function r(t){return e.call(this,t)||this}return t.__extends(r,e),r.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},r.prototype._next=function(t){this.notifyComplete(!1)},r.prototype._complete=function(){this.notifyComplete(!0)},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"FbHg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.takeLast=u;var t=i(require("tslib")),e=require("../Subscriber"),r=require("../util/ArgumentOutOfRangeError"),n=require("../observable/empty");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var u=n?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(r,i,u):r[i]=t[i]}return r.default=t,e&&e.set(t,r),r}function u(t){return function(e){return 0===t?(0,n.empty)():e.lift(new a(t))}}var a=function(){function t(t){if(this.total=t,this.total<0)throw new r.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.total))},t}(),c=function(e){function r(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=new Array,n.count=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.ring,r=this.total,n=this.count++;e.length<r?e.push(t):e[n%r]=t},r.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,o=0;o<r;o++){var i=e++%r;t.next(n[i])}t.complete()},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../util/ArgumentOutOfRangeError":"Qh4I","../observable/empty":"XsKQ"}],"xu0X":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.last=f;var t=require("../util/EmptyError"),e=require("./filter"),r=require("./takeLast"),i=require("./throwIfEmpty"),u=require("./defaultIfEmpty"),n=require("../util/identity");function f(f,o){var p=arguments.length>=2;return function(a){return a.pipe(f?(0,e.filter)(function(t,e){return f(t,e,a)}):n.identity,(0,r.takeLast)(1),p?(0,u.defaultIfEmpty)(o):(0,i.throwIfEmpty)(function(){return new t.EmptyError}))}}
},{"../util/EmptyError":"vsl0","./filter":"HKzi","./takeLast":"FbHg","./throwIfEmpty":"D7Ma","./defaultIfEmpty":"YBdz","../util/identity":"LXph"}],"yJbZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mapTo=u;var e=n(require("tslib")),t=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=u?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function u(e){return function(t){return t.lift(new i(e))}}var i=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new o(e,this.value))},e}(),o=function(t){function r(e,r){var n=t.call(this,e)||this;return n.value=r,n}return e.__extends(r,t),r.prototype._next=function(e){this.destination.next(this.value)},r}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"ZwCH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.materialize=o;var t=i(require("tslib")),e=require("../Subscriber"),r=require("../Notification");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=i?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}function o(){return function(t){return t.lift(new u)}}var u=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new c(t))},t}(),c=function(e){function n(t){return e.call(this,t)||this}return t.__extends(n,e),n.prototype._next=function(t){this.destination.next(r.Notification.createNext(t))},n.prototype._error=function(t){var e=this.destination;e.next(r.Notification.createError(t)),e.complete()},n.prototype._complete=function(){var t=this.destination;t.next(r.Notification.createComplete()),t.complete()},n}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../Notification":"n7Mc"}],"U785":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scan=i;var e=n(require("tslib")),t=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var u=i?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(n,s,u):n[s]=e[s]}return n.default=e,t&&t.set(e,n),n}function i(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new s(e,t,r))}}var s=function(){function e(e,t,r){void 0===r&&(r=!1),this.accumulator=e,this.seed=t,this.hasSeed=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.accumulator,this.seed,this.hasSeed))},e}(),u=function(t){function r(e,r,n,i){var s=t.call(this,e)||this;return s.accumulator=r,s._seed=n,s.hasSeed=i,s.index=0,s}return e.__extends(r,t),Object.defineProperty(r.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),r.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},r.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.accumulator(this.seed,e,r)}catch(n){this.destination.error(n)}this.seed=t,this.destination.next(t)},r}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"BORG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reduce=n;var e=require("./scan"),t=require("./takeLast"),r=require("./defaultIfEmpty"),u=require("../util/pipe");function n(n,i){return arguments.length>=2?function(a){return(0,u.pipe)((0,e.scan)(n,i),(0,t.takeLast)(1),(0,r.defaultIfEmpty)(i))(a)}:function(r){return(0,u.pipe)((0,e.scan)(function(e,t,r){return n(e,t,r+1)}),(0,t.takeLast)(1))(r)}}
},{"./scan":"U785","./takeLast":"FbHg","./defaultIfEmpty":"YBdz","../util/pipe":"HQCS"}],"BgD2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.max=r;var e=require("./reduce");function r(r){var t="function"==typeof r?function(e,t){return r(e,t)>0?e:t}:function(e,r){return e>r?e:r};return(0,e.reduce)(t)}
},{"./reduce":"BORG"}],"sbfV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.merge=r;var e=require("../observable/merge");function r(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return function(t){return t.lift.call(e.merge.apply(void 0,[t].concat(r)))}}
},{"../observable/merge":"DQig"}],"S3q6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeMapTo=r;var e=require("./mergeMap");function r(r,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?(0,e.mergeMap)(function(){return r},t,n):("number"==typeof t&&(n=t),(0,e.mergeMap)(function(){return r},n))}
},{"./mergeMap":"nFsM"}],"wQne":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeScan=n,exports.MergeScanSubscriber=exports.MergeScanOperator=void 0;var t=i(require("tslib")),e=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var o=n?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,e&&e.set(t,i),i}function n(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(i){return i.lift(new s(t,e,r))}}var s=function(){function t(t,e,r){this.accumulator=t,this.seed=e,this.concurrent=r}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.accumulator,this.seed,this.concurrent))},t}();exports.MergeScanOperator=s;var o=function(r){function i(t,e,i,n){var s=r.call(this,t)||this;return s.accumulator=e,s.acc=i,s.concurrent=n,s.hasValue=!1,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return t.__extends(i,r),i.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,r=this.destination,i=void 0;try{i=(0,this.accumulator)(this.acc,t,e)}catch(n){return r.error(n)}this.active++,this._innerSub(i)}else this.buffer.push(t)},i.prototype._innerSub=function(t){var r=new e.SimpleInnerSubscriber(this),i=this.destination;i.add(r);var n=(0,e.innerSubscribe)(t,r);n!==r&&i.add(n)},i.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},i.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},i.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},i}(e.SimpleOuterSubscriber);exports.MergeScanSubscriber=o;
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"bAWd":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.min=r;var e=require("./reduce");function r(r){var t="function"==typeof r?function(e,t){return r(e,t)<0?e:t}:function(e,r){return e<r?e:r};return(0,e.reduce)(t)}
},{"./reduce":"BORG"}],"M6Em":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.multicast=e,exports.MulticastOperator=void 0;var t=require("../observable/ConnectableObservable");function e(e,c){return function(o){var n;if(n="function"==typeof e?e:function(){return e},"function"==typeof c)return o.lift(new r(n,c));var s=Object.create(o,t.connectableObservableDescriptor);return s.source=o,s.subjectFactory=n,s}}var r=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,c=this.subjectFactory(),o=r(c).subscribe(t);return o.add(e.subscribe(c)),o},t}();exports.MulticastOperator=r;
},{"../observable/ConnectableObservable":"kkfD"}],"S4UH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.onErrorResumeNext=u,exports.onErrorResumeNextStatic=s;var e=o(require("tslib")),r=require("../observable/from"),t=require("../util/isArray"),n=require("../innerSubscribe");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(t,o,u):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function u(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return 1===e.length&&(0,t.isArray)(e[0])&&(e=e[0]),function(r){return r.lift(new c(e))}}function s(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i;return 1===e.length&&(0,t.isArray)(e[0])&&(e=e[0]),i=e.shift(),(0,r.from)(i).lift(new c(e))}var c=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,r){return r.subscribe(new f(e,this.nextSources))},e}(),f=function(r){function t(e,t){var n=r.call(this,e)||this;return n.destination=e,n.nextSources=t,n}return e.__extends(t,r),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var r=new n.SimpleInnerSubscriber(this),t=this.destination;t.add(r);var i=(0,n.innerSubscribe)(e,r);i!==r&&t.add(i)}else this.destination.complete()},t}(n.SimpleOuterSubscriber);
},{"tslib":"vCxL","../observable/from":"WXUl","../util/isArray":"KeTG","../innerSubscribe":"OHtH"}],"u6OS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pairwise=i;var e=n(require("tslib")),t=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}function i(){return function(e){return e.lift(new u)}}var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new o(e))},e}(),o=function(t){function r(e){var r=t.call(this,e)||this;return r.hasPrev=!1,r}return e.__extends(r,t),r.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},r}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"jvG2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.partition=t;var e=require("../util/not"),r=require("./filter");function t(t,i){return function(n){return[(0,r.filter)(t,i)(n),(0,r.filter)((0,e.not)(t,i))(n)]}}
},{"../util/not":"nij6","./filter":"HKzi"}],"TdE4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pluck=e;var r=require("./map");function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=e.length;if(0===o)throw new Error("list of properties cannot be empty.");return function(n){return(0,r.map)(t(e,o))(n)}}function t(r,e){return function(t){for(var n=t,o=0;o<e;o++){var u=null!=n?n[r[o]]:void 0;if(void 0===u)return;n=u}return n}}
},{"./map":"dNh5"}],"TQAB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.publish=u;var e=require("../Subject"),t=require("./multicast");function u(u){return u?(0,t.multicast)(function(){return new e.Subject},u):(0,t.multicast)(new e.Subject)}
},{"../Subject":"r9t1","./multicast":"M6Em"}],"fUyM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.publishBehavior=t;var e=require("../BehaviorSubject"),r=require("./multicast");function t(t){return function(u){return(0,r.multicast)(new e.BehaviorSubject(t))(u)}}
},{"../BehaviorSubject":"MPU6","./multicast":"M6Em"}],"fQ7S":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.publishLast=r;var e=require("../AsyncSubject"),t=require("./multicast");function r(){return function(r){return(0,t.multicast)(new e.AsyncSubject)(r)}}
},{"../AsyncSubject":"Scvc","./multicast":"M6Em"}],"aqWk":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.publishReplay=u;var e=require("../ReplaySubject"),t=require("./multicast");function u(u,r,n,i){n&&"function"!=typeof n&&(i=n);var o="function"==typeof n?n:void 0,c=new e.ReplaySubject(u,r,i);return function(e){return(0,t.multicast)(function(){return c},o)(e)}}
},{"../ReplaySubject":"Cp6P","./multicast":"M6Em"}],"EAaA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.race=t;var r=require("../util/isArray"),e=require("../observable/race");function t(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];return function(a){return 1===t.length&&(0,r.isArray)(t[0])&&(t=t[0]),a.lift.call(e.race.apply(void 0,[a].concat(t)))}}
},{"../util/isArray":"KeTG","../observable/race":"bwYX"}],"Fbxf":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.repeat=i;var e=u(require("tslib")),t=require("../Subscriber"),r=require("../observable/empty");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=u?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function i(e){return void 0===e&&(e=-1),function(t){return 0===e?(0,r.empty)():e<0?t.lift(new o(-1,t)):t.lift(new o(e-1,t))}}var o=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.count,this.source))},e}(),c=function(t){function r(e,r,n){var u=t.call(this,e)||this;return u.count=r,u.source=n,u}return e.__extends(r,t),r.prototype.complete=function(){if(!this.isStopped){var e=this.source,r=this.count;if(0===r)return t.prototype.complete.call(this);r>-1&&(this.count=r-1),e.subscribe(this._unsubscribeAndRecycle())}},r}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../observable/empty":"XsKQ"}],"CT9q":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.repeatWhen=s;var t=n(require("tslib")),e=require("../Subject"),i=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var o=n?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=t[s]}return i.default=t,e&&e.set(t,i),i}function s(t){return function(e){return e.lift(new o(t))}}var o=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,e))},t}(),u=function(r){function n(t,e,i){var n=r.call(this,t)||this;return n.notifier=e,n.source=i,n.sourceIsBeingSubscribedTo=!0,n}return t.__extends(n,r),n.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},n.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return r.prototype.complete.call(this)},n.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return r.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},n.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},n.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,r.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},n.prototype.subscribeToRetries=function(){var t;this.notifications=new e.Subject;try{t=(0,this.notifier)(this.notifications)}catch(n){return r.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=(0,i.innerSubscribe)(t,new i.SimpleInnerSubscriber(this))},n}(i.SimpleOuterSubscriber);
},{"tslib":"vCxL","../Subject":"r9t1","../innerSubscribe":"OHtH"}],"ZHEI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.retry=u;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=u?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=t[o]}return n.default=t,e&&e.set(t,n),n}function u(t){return void 0===t&&(t=-1),function(e){return e.lift(new o(t,e))}}var o=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new i(t,this.count,this.source))},t}(),i=function(e){function r(t,r,n){var u=e.call(this,t)||this;return u.count=r,u.source=n,u}return t.__extends(r,e),r.prototype.error=function(t){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return e.prototype.error.call(this,t);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"GHe2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.retryWhen=n;var r=s(require("tslib")),e=require("../Subject"),t=require("../innerSubscribe");function i(){if("function"!=typeof WeakMap)return null;var r=new WeakMap;return i=function(){return r},r}function s(r){if(r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var e=i();if(e&&e.has(r))return e.get(r);var t={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var u=s?Object.getOwnPropertyDescriptor(r,n):null;u&&(u.get||u.set)?Object.defineProperty(t,n,u):t[n]=r[n]}return t.default=r,e&&e.set(r,t),t}function n(r){return function(e){return e.lift(new u(r,e))}}var u=function(){function r(r,e){this.notifier=r,this.source=e}return r.prototype.call=function(r,e){return e.subscribe(new o(r,this.notifier,this.source))},r}(),o=function(i){function s(r,e,t){var s=i.call(this,r)||this;return s.notifier=e,s.source=t,s}return r.__extends(s,i),s.prototype.error=function(r){if(!this.isStopped){var s=this.errors,n=this.retries,u=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{s=new e.Subject;try{n=(0,this.notifier)(s)}catch(o){return i.prototype.error.call(this,o)}u=(0,t.innerSubscribe)(n,new t.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=s,this.retries=n,this.retriesSubscription=u,s.next(r)}},s.prototype._unsubscribe=function(){var r=this.errors,e=this.retriesSubscription;r&&(r.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},s.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},s}(t.SimpleOuterSubscriber);
},{"tslib":"vCxL","../Subject":"r9t1","../innerSubscribe":"OHtH"}],"Rd9o":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sample=i;var e=n(require("tslib")),t=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}function i(e){return function(t){return t.lift(new u(e))}}var u=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,r){var n=new o(e),i=r.subscribe(n);return i.add((0,t.innerSubscribe)(this.notifier,new t.SimpleInnerSubscriber(n))),i},e}(),o=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return e.__extends(r,t),r.prototype._next=function(e){this.value=e,this.hasValue=!0},r.prototype.notifyNext=function(){this.emitValue()},r.prototype.notifyComplete=function(){this.emitValue()},r.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},r}(t.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"nb45":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sampleTime=u;var e=i(require("tslib")),t=require("../Subscriber"),r=require("../scheduler/async");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var s=i?Object.getOwnPropertyDescriptor(e,u):null;s&&(s.get||s.set)?Object.defineProperty(r,u,s):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function u(e,t){return void 0===t&&(t=r.async),function(r){return r.lift(new s(e,t))}}var s=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new o(e,this.period,this.scheduler))},e}(),o=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(c,r,{subscriber:i,period:r})),i}return e.__extends(r,t),r.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},r.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},r}(t.Subscriber);function c(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}
},{"tslib":"vCxL","../Subscriber":"RaFB","../scheduler/async":"jun6"}],"PMGC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sequenceEqual=o,exports.SequenceEqualSubscriber=exports.SequenceEqualOperator=void 0;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=o?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function o(t,e){return function(r){return r.lift(new i(t,e))}}var i=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.compareTo,this.comparator))},t}();exports.SequenceEqualOperator=i;var s=function(e){function r(t,r,n){var o=e.call(this,t)||this;return o.compareTo=r,o.comparator=n,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(r.subscribe(new u(t,o))),o}return t.__extends(r,e),r.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},r.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},r.prototype.checkValues=function(){for(var t=this._a,e=this._b,r=this.comparator;t.length>0&&e.length>0;){var n=t.shift(),o=e.shift(),i=!1;try{i=r?r(n,o):n===o}catch(s){this.destination.error(s)}i||this.emit(!1)}},r.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},r.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},r.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},r}(e.Subscriber);exports.SequenceEqualSubscriber=s;var u=function(e){function r(t,r){var n=e.call(this,t)||this;return n.parent=r,n}return t.__extends(r,e),r.prototype._next=function(t){this.parent.nextB(t)},r.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},r.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"KBGh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.share=n;var e=require("./multicast"),r=require("./refCount"),t=require("../Subject");function u(){return new t.Subject}function n(){return function(t){return(0,r.refCount)()((0,e.multicast)(u)(t))}}
},{"./multicast":"M6Em","./refCount":"vT9o","../Subject":"r9t1"}],"xsrM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shareReplay=r;var e=require("../ReplaySubject");function r(e,r,u){var t;return t=e&&"object"==typeof e?e:{bufferSize:e,windowTime:r,refCount:!1,scheduler:u},function(e){return e.lift(i(t))}}function i(r){var i,u,t=r.bufferSize,n=void 0===t?Number.POSITIVE_INFINITY:t,o=r.windowTime,c=void 0===o?Number.POSITIVE_INFINITY:o,s=r.refCount,b=r.scheduler,f=0,d=!1,v=!1;return function(r){var t;f++,!i||d?(d=!1,i=new e.ReplaySubject(n,c,b),t=i.subscribe(this),u=r.subscribe({next:function(e){i.next(e)},error:function(e){d=!0,i.error(e)},complete:function(){v=!0,u=void 0,i.complete()}}),v&&(u=void 0)):t=i.subscribe(this),this.add(function(){f--,t.unsubscribe(),t=void 0,u&&!v&&s&&0===f&&(u.unsubscribe(),u=void 0,i=void 0)})}}
},{"../ReplaySubject":"Cp6P"}],"angX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.single=o;var e=i(require("tslib")),t=require("../Subscriber"),r=require("../util/EmptyError");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function o(e){return function(t){return t.lift(new u(e,t))}}var u=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(t){function n(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return e.__extends(n,t),n.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},n.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},n.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(r){this.destination.error(r)}},n.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new r.EmptyError)},n}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../util/EmptyError":"vsl0"}],"vMIz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.skip=o;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var u=o?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function o(t){return function(e){return e.lift(new i(t))}}var i=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.total))},t}(),u=function(e){function r(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return t.__extends(r,e),r.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"iB53":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.skipLast=u;var t=i(require("tslib")),r=require("../Subscriber"),e=require("../util/ArgumentOutOfRangeError");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=n();if(r&&r.has(t))return r.get(t);var e={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var o=i?Object.getOwnPropertyDescriptor(t,u):null;o&&(o.get||o.set)?Object.defineProperty(e,u,o):e[u]=t[u]}return e.default=t,r&&r.set(t,e),e}function u(t){return function(r){return r.lift(new o(t))}}var o=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new e.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new r.Subscriber(t)):e.subscribe(new s(t,this._skipCount))},t}(),s=function(r){function e(t,e){var n=r.call(this,t)||this;return n._skipCount=e,n._count=0,n._ring=new Array(e),n}return t.__extends(e,r),e.prototype._next=function(t){var r=this._skipCount,e=this._count++;if(e<r)this._ring[e]=t;else{var n=e%r,i=this._ring,u=i[n];i[n]=t,this.destination.next(u)}},e}(r.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../util/ArgumentOutOfRangeError":"Qh4I"}],"xmsT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.skipUntil=i;var e=n(require("tslib")),t=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}function i(e){return function(t){return t.lift(new u(e))}}var u=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new o(e,this.notifier))},e}(),o=function(r){function n(e,n){var i=r.call(this,e)||this;i.hasValue=!1;var u=new t.SimpleInnerSubscriber(i);i.add(u),i.innerSubscription=u;var o=(0,t.innerSubscribe)(n,u);return o!==u&&(i.add(o),i.innerSubscription=o),i}return e.__extends(n,r),n.prototype._next=function(e){this.hasValue&&r.prototype._next.call(this,e)},n.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},n.prototype.notifyComplete=function(){},n}(t.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"qjDA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.skipWhile=i;var t=n(require("tslib")),e=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=i?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=t[o]}return n.default=t,e&&e.set(t,n),n}function i(t){return function(e){return e.lift(new o(t))}}var o=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.predicate))},t}(),u=function(e){function r(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},r.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(r){this.destination.error(r)}},r}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"doo6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.startWith=t;var e=require("../observable/concat"),r=require("../util/isScheduler");function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var u=t[t.length-1];return(0,r.isScheduler)(u)?(t.pop(),function(r){return(0,e.concat)(t,r,u)}):function(r){return(0,e.concat)(t,r)}}
},{"../observable/concat":"CsdO","../util/isScheduler":"VqoH"}],"r9wA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubscribeOnObservable=void 0;var e=s(require("tslib")),r=require("../Observable"),t=require("../scheduler/asap"),i=require("../util/isNumeric");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u();if(r&&r.has(e))return r.get(e);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=i?Object.getOwnPropertyDescriptor(e,s):null;n&&(n.get||n.set)?Object.defineProperty(t,s,n):t[s]=e[s]}return t.default=e,r&&r.set(e,t),t}var n=function(r){function u(e,u,s){void 0===u&&(u=0),void 0===s&&(s=t.asap);var n=r.call(this)||this;return n.source=e,n.delayTime=u,n.scheduler=s,(!(0,i.isNumeric)(u)||u<0)&&(n.delayTime=0),s&&"function"==typeof s.schedule||(n.scheduler=t.asap),n}return e.__extends(u,r),u.create=function(e,r,i){return void 0===r&&(r=0),void 0===i&&(i=t.asap),new u(e,r,i)},u.dispatch=function(e){var r=e.source,t=e.subscriber;return this.add(r.subscribe(t))},u.prototype._subscribe=function(e){var r=this.delayTime,t=this.source;return this.scheduler.schedule(u.dispatch,r,{source:t,subscriber:e})},u}(r.Observable);exports.SubscribeOnObservable=n;
},{"tslib":"vCxL","../Observable":"wbSE","../scheduler/asap":"ZqYc","../util/isNumeric":"wBpm"}],"Et1l":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeOn=r;var e=require("../observable/SubscribeOnObservable");function r(e,r){return void 0===r&&(r=0),function(n){return n.lift(new t(e,r))}}var t=function(){function r(e,r){this.scheduler=e,this.delay=r}return r.prototype.call=function(r,t){return new e.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(r)},r}();
},{"../observable/SubscribeOnObservable":"r9wA"}],"g5Rk":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.switchMap=u;var t=o(require("tslib")),e=require("./map"),r=require("../observable/from"),n=require("../innerSubscribe");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=n?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}function u(t,n){return"function"==typeof n?function(i){return i.pipe(u(function(i,o){return(0,r.from)(t(i,o)).pipe((0,e.map)(function(t,e){return n(i,t,o,e)}))}))}:function(e){return e.lift(new c(t))}}var c=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.project))},t}(),p=function(e){function r(t,r){var n=e.call(this,t)||this;return n.project=r,n.index=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(n){return void this.destination.error(n)}this._innerSub(e)},r.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var r=new n.SimpleInnerSubscriber(this),i=this.destination;i.add(r),this.innerSubscription=(0,n.innerSubscribe)(t,r),this.innerSubscription!==r&&i.add(this.innerSubscription)},r.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},r.prototype._unsubscribe=function(){this.innerSubscription=void 0},r.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},r.prototype.notifyNext=function(t){this.destination.next(t)},r}(n.SimpleOuterSubscriber);
},{"tslib":"vCxL","./map":"dNh5","../observable/from":"WXUl","../innerSubscribe":"OHtH"}],"CBg8":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.switchAll=i;var e=require("./switchMap"),t=require("../util/identity");function i(){return(0,e.switchMap)(t.identity)}
},{"./switchMap":"g5Rk","../util/identity":"LXph"}],"Hs9S":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.switchMapTo=e;var t=require("./switchMap");function e(e,r){return r?(0,t.switchMap)(function(){return e},r):(0,t.switchMap)(function(){return e})}
},{"./switchMap":"g5Rk"}],"qGSv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.takeUntil=i;var e=n(require("tslib")),t=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}function i(e){return function(t){return t.lift(new u(e))}}var u=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,r){var n=new o(e),i=(0,t.innerSubscribe)(this.notifier,new t.SimpleInnerSubscriber(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},e}(),o=function(t){function r(e){var r=t.call(this,e)||this;return r.seenValue=!1,r}return e.__extends(r,t),r.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},r.prototype.notifyComplete=function(){},r}(t.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"EYJX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.takeWhile=i;var e=n(require("tslib")),t=require("../Subscriber");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function i(e,t){return void 0===t&&(t=!1),function(r){return r.lift(new o(e,t))}}var o=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.predicate,this.inclusive))},e}(),u=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return e.__extends(r,t),r.prototype._next=function(e){var t,r=this.destination;try{t=this.predicate(e,this.index++)}catch(n){return void r.error(n)}this.nextOrComplete(e,t)},r.prototype.nextOrComplete=function(e,t){var r=this.destination;Boolean(t)?r.next(e):(this.inclusive&&r.next(e),r.complete())},r}(t.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB"}],"okAI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.tap=p;var t=i(require("tslib")),e=require("../Subscriber"),r=require("../util/noop"),o=require("../util/isFunction");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var p=o?Object.getOwnPropertyDescriptor(t,i):null;p&&(p.get||p.set)?Object.defineProperty(r,i,p):r[i]=t[i]}return r.default=t,e&&e.set(t,r),r}function p(t,e,r){return function(o){return o.lift(new c(t,e,r))}}var c=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.nextOrObserver,this.error,this.complete))},t}(),u=function(e){function n(t,n,i,p){var c=e.call(this,t)||this;return c._tapNext=r.noop,c._tapError=r.noop,c._tapComplete=r.noop,c._tapError=i||r.noop,c._tapComplete=p||r.noop,(0,o.isFunction)(n)?(c._context=c,c._tapNext=n):n&&(c._context=n,c._tapNext=n.next||r.noop,c._tapError=n.error||r.noop,c._tapComplete=n.complete||r.noop),c}return t.__extends(n,e),n.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},n.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},n}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../util/noop":"rXfM","../util/isFunction":"Qnsq"}],"Yoo8":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.throttle=o,exports.defaultThrottleConfig=void 0;var t=i(require("tslib")),e=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=n?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=t[o]}return i.default=t,e&&e.set(t,i),i}var n={leading:!0,trailing:!1};function o(t,e){return void 0===e&&(e=n),function(r){return r.lift(new s(t,!!e.leading,!!e.trailing))}}exports.defaultThrottleConfig=n;var s=function(){function t(t,e,r){this.durationSelector=t,this.leading=e,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.durationSelector,this.leading,this.trailing))},t}(),u=function(r){function i(t,e,i,n){var o=r.call(this,t)||this;return o.destination=t,o.durationSelector=e,o._leading=i,o._trailing=n,o._hasValue=!1,o}return t.__extends(i,r),i.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},i.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},i.prototype.throttle=function(t){var r=this.tryDurationSelector(t);r&&this.add(this._throttled=(0,e.innerSubscribe)(r,new e.SimpleInnerSubscriber(this)))},i.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(e){return this.destination.error(e),null}},i.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},i.prototype.notifyNext=function(){this.throttlingDone()},i.prototype.notifyComplete=function(){this.throttlingDone()},i}(e.SimpleOuterSubscriber);
},{"tslib":"vCxL","../innerSubscribe":"OHtH"}],"v3FQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.throttleTime=s;var t=l(require("tslib")),i=require("../Subscriber"),e=require("../scheduler/async"),r=require("./throttle");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function l(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=n();if(i&&i.has(t))return i.get(t);var e={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if(Object.prototype.hasOwnProperty.call(t,l)){var s=r?Object.getOwnPropertyDescriptor(t,l):null;s&&(s.get||s.set)?Object.defineProperty(e,l,s):e[l]=t[l]}return e.default=t,i&&i.set(t,e),e}function s(t,i,n){return void 0===i&&(i=e.async),void 0===n&&(n=r.defaultThrottleConfig),function(e){return e.lift(new a(t,i,n.leading,n.trailing))}}var a=function(){function t(t,i,e,r){this.duration=t,this.scheduler=i,this.leading=e,this.trailing=r}return t.prototype.call=function(t,i){return i.subscribe(new u(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),u=function(i){function e(t,e,r,n,l){var s=i.call(this,t)||this;return s.duration=e,s.scheduler=r,s.leading=n,s.trailing=l,s._hasTrailingValue=!1,s._trailingValue=null,s}return t.__extends(e,i),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(o,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(i.Subscriber);function o(t){t.subscriber.clearThrottle()}
},{"tslib":"vCxL","../Subscriber":"RaFB","../scheduler/async":"jun6","./throttle":"Yoo8"}],"n6SK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timeInterval=u,exports.TimeInterval=void 0;var e=require("../scheduler/async"),r=require("./scan"),n=require("../observable/defer"),t=require("./map");function u(u){return void 0===u&&(u=e.async),function(e){return(0,n.defer)(function(){return e.pipe((0,r.scan)(function(e,r){var n=e.current;return{value:r,current:u.now(),last:n}},{current:u.now(),value:void 0,last:void 0}),(0,t.map)(function(e){var r=e.current,n=e.last,t=e.value;return new i(t,r-n)}))})}}var i=function(){return function(e,r){this.value=e,this.interval=r}}();exports.TimeInterval=i;
},{"../scheduler/async":"jun6","./scan":"U785","../observable/defer":"w9G6","./map":"dNh5"}],"L72b":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timeoutWith=s;var e=u(require("tslib")),t=require("../scheduler/async"),i=require("../util/isDate"),r=require("../innerSubscribe");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var s=r?Object.getOwnPropertyDescriptor(e,u):null;s&&(s.get||s.set)?Object.defineProperty(i,u,s):i[u]=e[u]}return i.default=e,t&&t.set(e,i),i}function s(e,r,n){return void 0===n&&(n=t.async),function(t){var u=(0,i.isDate)(e),s=u?+e-n.now():Math.abs(e);return t.lift(new o(s,u,r,n))}}var o=function(){function e(e,t,i,r){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=i,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),c=function(t){function i(e,i,r,n,u){var s=t.call(this,e)||this;return s.absoluteTimeout=i,s.waitFor=r,s.withObservable=n,s.scheduler=u,s.scheduleTimeout(),s}return e.__extends(i,t),i.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add((0,r.innerSubscribe)(t,new r.SimpleInnerSubscriber(e)))},i.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(i.dispatchTimeout,this.waitFor,this))},i.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},i.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},i}(r.SimpleOuterSubscriber);
},{"tslib":"vCxL","../scheduler/async":"jun6","../util/isDate":"rxSS","../innerSubscribe":"OHtH"}],"Cp8V":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timeout=i;var r=require("../scheduler/async"),e=require("../util/TimeoutError"),t=require("./timeoutWith"),o=require("../observable/throwError");function i(i,u){return void 0===u&&(u=r.async),(0,t.timeoutWith)(i,(0,o.throwError)(new e.TimeoutError),u)}
},{"../scheduler/async":"jun6","../util/TimeoutError":"SZK7","./timeoutWith":"L72b","../observable/throwError":"FdIu"}],"pXuq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timestamp=r,exports.Timestamp=void 0;var e=require("../scheduler/async"),t=require("./map");function r(r){return void 0===r&&(r=e.async),(0,t.map)(function(e){return new i(e,r.now())})}var i=function(){return function(e,t){this.value=e,this.timestamp=t}}();exports.Timestamp=i;
},{"../scheduler/async":"jun6","./map":"dNh5"}],"LA40":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toArray=t;var e=require("./reduce");function r(e,r,t){return 0===t?[r]:(e.push(r),e)}function t(){return(0,e.reduce)(r,[])}
},{"./reduce":"BORG"}],"Iygx":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.window=i;var t=o(require("tslib")),e=require("../Subject"),n=require("../innerSubscribe");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var u=o?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function i(t){return function(e){return e.lift(new u(t))}}var u=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var r=new c(t),o=e.subscribe(r);return o.closed||r.add((0,n.innerSubscribe)(this.windowBoundaries,new n.SimpleInnerSubscriber(r))),o},t}(),c=function(n){function r(t){var r=n.call(this,t)||this;return r.window=new e.Subject,t.next(r.window),r}return t.__extends(r,n),r.prototype.notifyNext=function(){this.openWindow()},r.prototype.notifyError=function(t){this._error(t)},r.prototype.notifyComplete=function(){this._complete()},r.prototype._next=function(t){this.window.next(t)},r.prototype._error=function(t){this.window.error(t),this.destination.error(t)},r.prototype._complete=function(){this.window.complete(),this.destination.complete()},r.prototype._unsubscribe=function(){this.window=null},r.prototype.openWindow=function(){var t=this.window;t&&t.complete();var n=this.destination,r=this.window=new e.Subject;n.next(r)},r}(n.SimpleOuterSubscriber);
},{"tslib":"vCxL","../Subject":"r9t1","../innerSubscribe":"OHtH"}],"GYT2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.windowCount=o;var t=r(require("tslib")),e=require("../Subscriber"),n=require("../Subject");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function r(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=r?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,e&&e.set(t,n),n}function o(t,e){return void 0===e&&(e=0),function(n){return n.lift(new s(t,e))}}var s=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.windowSize,this.startWindowEvery))},t}(),u=function(e){function i(t,i,r){var o=e.call(this,t)||this;return o.destination=t,o.windowSize=i,o.startWindowEvery=r,o.windows=[new n.Subject],o.count=0,t.next(o.windows[0]),o}return t.__extends(i,e),i.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,r=this.windowSize,o=this.windows,s=o.length,u=0;u<s&&!this.closed;u++)o[u].next(t);var c=this.count-r+1;if(c>=0&&c%e==0&&!this.closed&&o.shift().complete(),++this.count%e==0&&!this.closed){var f=new n.Subject;o.push(f),i.next(f)}},i.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},i.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},i.prototype._unsubscribe=function(){this.count=0,this.windows=null},i}(e.Subscriber);
},{"tslib":"vCxL","../Subscriber":"RaFB","../Subject":"r9t1"}],"Okss":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.windowTime=c;var e=u(require("tslib")),n=require("../Subject"),t=require("../scheduler/async"),i=require("../Subscriber"),r=require("../util/isNumeric"),o=require("../util/isScheduler");function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s();if(n&&n.has(e))return n.get(e);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(t,r,o):t[r]=e[r]}return t.default=e,n&&n.set(e,t),t}function c(e){var n=t.async,i=null,s=Number.POSITIVE_INFINITY;return(0,o.isScheduler)(arguments[3])&&(n=arguments[3]),(0,o.isScheduler)(arguments[2])?n=arguments[2]:(0,r.isNumeric)(arguments[2])&&(s=Number(arguments[2])),(0,o.isScheduler)(arguments[1])?n=arguments[1]:(0,r.isNumeric)(arguments[1])&&(i=Number(arguments[1])),function(t){return t.lift(new d(e,i,s,n))}}var d=function(){function e(e,n,t,i){this.windowTimeSpan=e,this.windowCreationInterval=n,this.maxWindowSize=t,this.scheduler=i}return e.prototype.call=function(e,n){return n.subscribe(new l(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),a=function(n){function t(){var e=null!==n&&n.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return e.__extends(t,n),t.prototype.next=function(e){this._numberOfNextedValues++,n.prototype.next.call(this,e)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(n.Subject),l=function(n){function t(e,t,i,r,o){var s=n.call(this,e)||this;s.destination=e,s.windowTimeSpan=t,s.windowCreationInterval=i,s.maxWindowSize=r,s.scheduler=o,s.windows=[];var u=s.openWindow();if(null!==i&&i>=0){var c={subscriber:s,window:u,context:null},d={windowTimeSpan:t,windowCreationInterval:i,subscriber:s,scheduler:o};s.add(o.schedule(f,t,c)),s.add(o.schedule(p,i,d))}else{var a={subscriber:s,window:u,windowTimeSpan:t};s.add(o.schedule(w,t,a))}return s}return e.__extends(t,n),t.prototype._next=function(e){for(var n=this.windows,t=n.length,i=0;i<t;i++){var r=n[i];r.closed||(r.next(e),r.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(r))}},t.prototype._error=function(e){for(var n=this.windows;n.length>0;)n.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var n=e.shift();n.closed||n.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new a;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var n=this.windows;n.splice(n.indexOf(e),1)},t}(i.Subscriber);function w(e){var n=e.subscriber,t=e.windowTimeSpan,i=e.window;i&&n.closeWindow(i),e.window=n.openWindow(),this.schedule(e,t)}function p(e){var n=e.windowTimeSpan,t=e.subscriber,i=e.scheduler,r=e.windowCreationInterval,o=t.openWindow(),s={action:this,subscription:null},u={subscriber:t,window:o,context:s};s.subscription=i.schedule(f,n,u),this.add(s.subscription),this.schedule(e,r)}function f(e){var n=e.subscriber,t=e.window,i=e.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),n.closeWindow(t)}
},{"tslib":"vCxL","../Subject":"r9t1","../scheduler/async":"jun6","../Subscriber":"RaFB","../util/isNumeric":"wBpm","../util/isScheduler":"VqoH"}],"JiQj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.windowToggle=c;var t=s(require("tslib")),e=require("../Subject"),r=require("../Subscription"),n=require("../OuterSubscriber"),o=require("../util/subscribeToResult");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function s(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=n?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}function c(t,e){return function(r){return r.lift(new u(t,e))}}var u=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.openings,this.closingSelector))},t}(),p=function(n){function i(t,e,r){var i=n.call(this,t)||this;return i.openings=e,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=(0,o.subscribeToResult)(i,e,e)),i}return t.__extends(i,n),i.prototype._next=function(t){var e=this.contexts;if(e)for(var r=e.length,n=0;n<r;n++)e[n].window.next(t)},i.prototype._error=function(t){var e=this.contexts;if(this.contexts=null,e)for(var r=e.length,o=-1;++o<r;){var i=e[o];i.window.error(t),i.subscription.unsubscribe()}n.prototype._error.call(this,t)},i.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,r=-1;++r<e;){var o=t[r];o.window.complete(),o.subscription.unsubscribe()}n.prototype._complete.call(this)},i.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,r=-1;++r<e;){var n=t[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},i.prototype.notifyNext=function(t,n,i,s,c){if(t===this.openings){var u=void 0;try{u=(0,this.closingSelector)(n)}catch(a){return this.error(a)}var p=new e.Subject,l=new r.Subscription,f={window:p,subscription:l};this.contexts.push(f);var b=(0,o.subscribeToResult)(this,u,f);b.closed?this.closeWindow(this.contexts.length-1):(b.context=f,l.add(b)),this.destination.next(p)}else this.closeWindow(this.contexts.indexOf(t))},i.prototype.notifyError=function(t){this.error(t)},i.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},i.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,r=e[t],n=r.window,o=r.subscription;e.splice(t,1),n.complete(),o.unsubscribe()}},i}(n.OuterSubscriber);
},{"tslib":"vCxL","../Subject":"r9t1","../Subscription":"I8KM","../OuterSubscriber":"hZYI","../util/subscribeToResult":"JM7e"}],"YaG1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.windowWhen=s;var t=r(require("tslib")),e=require("../Subject"),i=require("../OuterSubscriber"),n=require("../util/subscribeToResult");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function r(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var s=n?Object.getOwnPropertyDescriptor(t,r):null;s&&(s.get||s.set)?Object.defineProperty(i,r,s):i[r]=t[r]}return i.default=t,e&&e.set(t,i),i}function s(t){return function(e){return e.lift(new u(t))}}var u=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.closingSelector))},t}(),c=function(i){function o(t,e){var n=i.call(this,t)||this;return n.destination=t,n.closingSelector=e,n.openWindow(),n}return t.__extends(o,i),o.prototype.notifyNext=function(t,e,i,n,o){this.openWindow(o)},o.prototype.notifyError=function(t){this._error(t)},o.prototype.notifyComplete=function(t){this.openWindow(t)},o.prototype._next=function(t){this.window.next(t)},o.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},o.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},o.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},o.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var i=this.window;i&&i.complete();var o,r=this.window=new e.Subject;this.destination.next(r);try{o=(0,this.closingSelector)()}catch(s){return this.destination.error(s),void this.window.error(s)}this.add(this.closingNotification=(0,n.subscribeToResult)(this,o))},o}(i.OuterSubscriber);
},{"tslib":"vCxL","../Subject":"r9t1","../OuterSubscriber":"hZYI","../util/subscribeToResult":"JM7e"}],"JDwQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withLatestFrom=i;var t=o(require("tslib")),e=require("../OuterSubscriber"),r=require("../util/subscribeToResult");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=o?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=t[i]}return r.default=t,e&&e.set(t,r),r}function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var r;"function"==typeof t[t.length-1]&&(r=t.pop());var n=t;return e.lift(new s(n,r))}}var s=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.observables,this.project))},t}(),u=function(e){function n(t,n,o){var i=e.call(this,t)||this;i.observables=n,i.project=o,i.toRespond=[];var s=n.length;i.values=new Array(s);for(var u=0;u<s;u++)i.toRespond.push(u);for(u=0;u<s;u++){var c=n[u];i.add((0,r.subscribeToResult)(i,c,void 0,u))}return i}return t.__extends(n,e),n.prototype.notifyNext=function(t,e,r){this.values[r]=e;var n=this.toRespond;if(n.length>0){var o=n.indexOf(r);-1!==o&&n.splice(o,1)}},n.prototype.notifyComplete=function(){},n.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},n.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(r){return void this.destination.error(r)}this.destination.next(e)},n}(e.OuterSubscriber);
},{"tslib":"vCxL","../OuterSubscriber":"hZYI","../util/subscribeToResult":"JM7e"}],"UwLD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.zip=r;var e=require("../observable/zip");function r(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return function(t){return t.lift.call(e.zip.apply(void 0,[t].concat(r)))}}
},{"../observable/zip":"ff2A"}],"DmwP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.zipAll=r;var e=require("../observable/zip");function r(r){return function(t){return t.lift(new e.ZipOperator(r))}}
},{"../observable/zip":"ff2A"}],"cVrl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"audit",{enumerable:!0,get:function(){return e.audit}}),Object.defineProperty(exports,"auditTime",{enumerable:!0,get:function(){return r.auditTime}}),Object.defineProperty(exports,"buffer",{enumerable:!0,get:function(){return t.buffer}}),Object.defineProperty(exports,"bufferCount",{enumerable:!0,get:function(){return n.bufferCount}}),Object.defineProperty(exports,"bufferTime",{enumerable:!0,get:function(){return o.bufferTime}}),Object.defineProperty(exports,"bufferToggle",{enumerable:!0,get:function(){return i.bufferToggle}}),Object.defineProperty(exports,"bufferWhen",{enumerable:!0,get:function(){return u.bufferWhen}}),Object.defineProperty(exports,"catchError",{enumerable:!0,get:function(){return a.catchError}}),Object.defineProperty(exports,"combineAll",{enumerable:!0,get:function(){return p.combineAll}}),Object.defineProperty(exports,"combineLatest",{enumerable:!0,get:function(){return l.combineLatest}}),Object.defineProperty(exports,"concat",{enumerable:!0,get:function(){return s.concat}}),Object.defineProperty(exports,"concatAll",{enumerable:!0,get:function(){return c.concatAll}}),Object.defineProperty(exports,"concatMap",{enumerable:!0,get:function(){return f.concatMap}}),Object.defineProperty(exports,"concatMapTo",{enumerable:!0,get:function(){return b.concatMapTo}}),Object.defineProperty(exports,"count",{enumerable:!0,get:function(){return m.count}}),Object.defineProperty(exports,"debounce",{enumerable:!0,get:function(){return d.debounce}}),Object.defineProperty(exports,"debounceTime",{enumerable:!0,get:function(){return g.debounceTime}}),Object.defineProperty(exports,"defaultIfEmpty",{enumerable:!0,get:function(){return y.defaultIfEmpty}}),Object.defineProperty(exports,"delay",{enumerable:!0,get:function(){return x.delay}}),Object.defineProperty(exports,"delayWhen",{enumerable:!0,get:function(){return O.delayWhen}}),Object.defineProperty(exports,"dematerialize",{enumerable:!0,get:function(){return q.dematerialize}}),Object.defineProperty(exports,"distinct",{enumerable:!0,get:function(){return j.distinct}}),Object.defineProperty(exports,"distinctUntilChanged",{enumerable:!0,get:function(){return P.distinctUntilChanged}}),Object.defineProperty(exports,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return h.distinctUntilKeyChanged}}),Object.defineProperty(exports,"elementAt",{enumerable:!0,get:function(){return w.elementAt}}),Object.defineProperty(exports,"endWith",{enumerable:!0,get:function(){return T.endWith}}),Object.defineProperty(exports,"every",{enumerable:!0,get:function(){return W.every}}),Object.defineProperty(exports,"exhaust",{enumerable:!0,get:function(){return k.exhaust}}),Object.defineProperty(exports,"exhaustMap",{enumerable:!0,get:function(){return M.exhaustMap}}),Object.defineProperty(exports,"expand",{enumerable:!0,get:function(){return A.expand}}),Object.defineProperty(exports,"filter",{enumerable:!0,get:function(){return E.filter}}),Object.defineProperty(exports,"finalize",{enumerable:!0,get:function(){return z.finalize}}),Object.defineProperty(exports,"find",{enumerable:!0,get:function(){return C.find}}),Object.defineProperty(exports,"findIndex",{enumerable:!0,get:function(){return L.findIndex}}),Object.defineProperty(exports,"first",{enumerable:!0,get:function(){return v.first}}),Object.defineProperty(exports,"groupBy",{enumerable:!0,get:function(){return I.groupBy}}),Object.defineProperty(exports,"ignoreElements",{enumerable:!0,get:function(){return U.ignoreElements}}),Object.defineProperty(exports,"isEmpty",{enumerable:!0,get:function(){return R.isEmpty}}),Object.defineProperty(exports,"last",{enumerable:!0,get:function(){return B.last}}),Object.defineProperty(exports,"map",{enumerable:!0,get:function(){return F.map}}),Object.defineProperty(exports,"mapTo",{enumerable:!0,get:function(){return K.mapTo}}),Object.defineProperty(exports,"materialize",{enumerable:!0,get:function(){return N.materialize}}),Object.defineProperty(exports,"max",{enumerable:!0,get:function(){return S.max}}),Object.defineProperty(exports,"merge",{enumerable:!0,get:function(){return _.merge}}),Object.defineProperty(exports,"mergeAll",{enumerable:!0,get:function(){return D.mergeAll}}),Object.defineProperty(exports,"mergeMap",{enumerable:!0,get:function(){return G.mergeMap}}),Object.defineProperty(exports,"flatMap",{enumerable:!0,get:function(){return G.flatMap}}),Object.defineProperty(exports,"mergeMapTo",{enumerable:!0,get:function(){return H.mergeMapTo}}),Object.defineProperty(exports,"mergeScan",{enumerable:!0,get:function(){return J.mergeScan}}),Object.defineProperty(exports,"min",{enumerable:!0,get:function(){return Q.min}}),Object.defineProperty(exports,"multicast",{enumerable:!0,get:function(){return V.multicast}}),Object.defineProperty(exports,"observeOn",{enumerable:!0,get:function(){return X.observeOn}}),Object.defineProperty(exports,"onErrorResumeNext",{enumerable:!0,get:function(){return Y.onErrorResumeNext}}),Object.defineProperty(exports,"pairwise",{enumerable:!0,get:function(){return Z.pairwise}}),Object.defineProperty(exports,"partition",{enumerable:!0,get:function(){return $.partition}}),Object.defineProperty(exports,"pluck",{enumerable:!0,get:function(){return ee.pluck}}),Object.defineProperty(exports,"publish",{enumerable:!0,get:function(){return re.publish}}),Object.defineProperty(exports,"publishBehavior",{enumerable:!0,get:function(){return te.publishBehavior}}),Object.defineProperty(exports,"publishLast",{enumerable:!0,get:function(){return ne.publishLast}}),Object.defineProperty(exports,"publishReplay",{enumerable:!0,get:function(){return oe.publishReplay}}),Object.defineProperty(exports,"race",{enumerable:!0,get:function(){return ie.race}}),Object.defineProperty(exports,"reduce",{enumerable:!0,get:function(){return ue.reduce}}),Object.defineProperty(exports,"repeat",{enumerable:!0,get:function(){return ae.repeat}}),Object.defineProperty(exports,"repeatWhen",{enumerable:!0,get:function(){return pe.repeatWhen}}),Object.defineProperty(exports,"retry",{enumerable:!0,get:function(){return le.retry}}),Object.defineProperty(exports,"retryWhen",{enumerable:!0,get:function(){return se.retryWhen}}),Object.defineProperty(exports,"refCount",{enumerable:!0,get:function(){return ce.refCount}}),Object.defineProperty(exports,"sample",{enumerable:!0,get:function(){return fe.sample}}),Object.defineProperty(exports,"sampleTime",{enumerable:!0,get:function(){return be.sampleTime}}),Object.defineProperty(exports,"scan",{enumerable:!0,get:function(){return me.scan}}),Object.defineProperty(exports,"sequenceEqual",{enumerable:!0,get:function(){return de.sequenceEqual}}),Object.defineProperty(exports,"share",{enumerable:!0,get:function(){return ge.share}}),Object.defineProperty(exports,"shareReplay",{enumerable:!0,get:function(){return ye.shareReplay}}),Object.defineProperty(exports,"single",{enumerable:!0,get:function(){return xe.single}}),Object.defineProperty(exports,"skip",{enumerable:!0,get:function(){return Oe.skip}}),Object.defineProperty(exports,"skipLast",{enumerable:!0,get:function(){return qe.skipLast}}),Object.defineProperty(exports,"skipUntil",{enumerable:!0,get:function(){return je.skipUntil}}),Object.defineProperty(exports,"skipWhile",{enumerable:!0,get:function(){return Pe.skipWhile}}),Object.defineProperty(exports,"startWith",{enumerable:!0,get:function(){return he.startWith}}),Object.defineProperty(exports,"subscribeOn",{enumerable:!0,get:function(){return we.subscribeOn}}),Object.defineProperty(exports,"switchAll",{enumerable:!0,get:function(){return Te.switchAll}}),Object.defineProperty(exports,"switchMap",{enumerable:!0,get:function(){return We.switchMap}}),Object.defineProperty(exports,"switchMapTo",{enumerable:!0,get:function(){return ke.switchMapTo}}),Object.defineProperty(exports,"take",{enumerable:!0,get:function(){return Me.take}}),Object.defineProperty(exports,"takeLast",{enumerable:!0,get:function(){return Ae.takeLast}}),Object.defineProperty(exports,"takeUntil",{enumerable:!0,get:function(){return Ee.takeUntil}}),Object.defineProperty(exports,"takeWhile",{enumerable:!0,get:function(){return ze.takeWhile}}),Object.defineProperty(exports,"tap",{enumerable:!0,get:function(){return Ce.tap}}),Object.defineProperty(exports,"throttle",{enumerable:!0,get:function(){return Le.throttle}}),Object.defineProperty(exports,"throttleTime",{enumerable:!0,get:function(){return ve.throttleTime}}),Object.defineProperty(exports,"throwIfEmpty",{enumerable:!0,get:function(){return Ie.throwIfEmpty}}),Object.defineProperty(exports,"timeInterval",{enumerable:!0,get:function(){return Ue.timeInterval}}),Object.defineProperty(exports,"timeout",{enumerable:!0,get:function(){return Re.timeout}}),Object.defineProperty(exports,"timeoutWith",{enumerable:!0,get:function(){return Be.timeoutWith}}),Object.defineProperty(exports,"timestamp",{enumerable:!0,get:function(){return Fe.timestamp}}),Object.defineProperty(exports,"toArray",{enumerable:!0,get:function(){return Ke.toArray}}),Object.defineProperty(exports,"window",{enumerable:!0,get:function(){return Ne.window}}),Object.defineProperty(exports,"windowCount",{enumerable:!0,get:function(){return Se.windowCount}}),Object.defineProperty(exports,"windowTime",{enumerable:!0,get:function(){return _e.windowTime}}),Object.defineProperty(exports,"windowToggle",{enumerable:!0,get:function(){return De.windowToggle}}),Object.defineProperty(exports,"windowWhen",{enumerable:!0,get:function(){return Ge.windowWhen}}),Object.defineProperty(exports,"withLatestFrom",{enumerable:!0,get:function(){return He.withLatestFrom}}),Object.defineProperty(exports,"zip",{enumerable:!0,get:function(){return Je.zip}}),Object.defineProperty(exports,"zipAll",{enumerable:!0,get:function(){return Qe.zipAll}});var e=require("../internal/operators/audit"),r=require("../internal/operators/auditTime"),t=require("../internal/operators/buffer"),n=require("../internal/operators/bufferCount"),o=require("../internal/operators/bufferTime"),i=require("../internal/operators/bufferToggle"),u=require("../internal/operators/bufferWhen"),a=require("../internal/operators/catchError"),p=require("../internal/operators/combineAll"),l=require("../internal/operators/combineLatest"),s=require("../internal/operators/concat"),c=require("../internal/operators/concatAll"),f=require("../internal/operators/concatMap"),b=require("../internal/operators/concatMapTo"),m=require("../internal/operators/count"),d=require("../internal/operators/debounce"),g=require("../internal/operators/debounceTime"),y=require("../internal/operators/defaultIfEmpty"),x=require("../internal/operators/delay"),O=require("../internal/operators/delayWhen"),q=require("../internal/operators/dematerialize"),j=require("../internal/operators/distinct"),P=require("../internal/operators/distinctUntilChanged"),h=require("../internal/operators/distinctUntilKeyChanged"),w=require("../internal/operators/elementAt"),T=require("../internal/operators/endWith"),W=require("../internal/operators/every"),k=require("../internal/operators/exhaust"),M=require("../internal/operators/exhaustMap"),A=require("../internal/operators/expand"),E=require("../internal/operators/filter"),z=require("../internal/operators/finalize"),C=require("../internal/operators/find"),L=require("../internal/operators/findIndex"),v=require("../internal/operators/first"),I=require("../internal/operators/groupBy"),U=require("../internal/operators/ignoreElements"),R=require("../internal/operators/isEmpty"),B=require("../internal/operators/last"),F=require("../internal/operators/map"),K=require("../internal/operators/mapTo"),N=require("../internal/operators/materialize"),S=require("../internal/operators/max"),_=require("../internal/operators/merge"),D=require("../internal/operators/mergeAll"),G=require("../internal/operators/mergeMap"),H=require("../internal/operators/mergeMapTo"),J=require("../internal/operators/mergeScan"),Q=require("../internal/operators/min"),V=require("../internal/operators/multicast"),X=require("../internal/operators/observeOn"),Y=require("../internal/operators/onErrorResumeNext"),Z=require("../internal/operators/pairwise"),$=require("../internal/operators/partition"),ee=require("../internal/operators/pluck"),re=require("../internal/operators/publish"),te=require("../internal/operators/publishBehavior"),ne=require("../internal/operators/publishLast"),oe=require("../internal/operators/publishReplay"),ie=require("../internal/operators/race"),ue=require("../internal/operators/reduce"),ae=require("../internal/operators/repeat"),pe=require("../internal/operators/repeatWhen"),le=require("../internal/operators/retry"),se=require("../internal/operators/retryWhen"),ce=require("../internal/operators/refCount"),fe=require("../internal/operators/sample"),be=require("../internal/operators/sampleTime"),me=require("../internal/operators/scan"),de=require("../internal/operators/sequenceEqual"),ge=require("../internal/operators/share"),ye=require("../internal/operators/shareReplay"),xe=require("../internal/operators/single"),Oe=require("../internal/operators/skip"),qe=require("../internal/operators/skipLast"),je=require("../internal/operators/skipUntil"),Pe=require("../internal/operators/skipWhile"),he=require("../internal/operators/startWith"),we=require("../internal/operators/subscribeOn"),Te=require("../internal/operators/switchAll"),We=require("../internal/operators/switchMap"),ke=require("../internal/operators/switchMapTo"),Me=require("../internal/operators/take"),Ae=require("../internal/operators/takeLast"),Ee=require("../internal/operators/takeUntil"),ze=require("../internal/operators/takeWhile"),Ce=require("../internal/operators/tap"),Le=require("../internal/operators/throttle"),ve=require("../internal/operators/throttleTime"),Ie=require("../internal/operators/throwIfEmpty"),Ue=require("../internal/operators/timeInterval"),Re=require("../internal/operators/timeout"),Be=require("../internal/operators/timeoutWith"),Fe=require("../internal/operators/timestamp"),Ke=require("../internal/operators/toArray"),Ne=require("../internal/operators/window"),Se=require("../internal/operators/windowCount"),_e=require("../internal/operators/windowTime"),De=require("../internal/operators/windowToggle"),Ge=require("../internal/operators/windowWhen"),He=require("../internal/operators/withLatestFrom"),Je=require("../internal/operators/zip"),Qe=require("../internal/operators/zipAll");
},{"../internal/operators/audit":"Pdg2","../internal/operators/auditTime":"jcYn","../internal/operators/buffer":"mG6b","../internal/operators/bufferCount":"f9IP","../internal/operators/bufferTime":"Axj2","../internal/operators/bufferToggle":"ZTTP","../internal/operators/bufferWhen":"Ul3A","../internal/operators/catchError":"THoY","../internal/operators/combineAll":"TMFF","../internal/operators/combineLatest":"DJQm","../internal/operators/concat":"ZHmI","../internal/operators/concatAll":"Yxey","../internal/operators/concatMap":"DoUK","../internal/operators/concatMapTo":"APQq","../internal/operators/count":"U1Ln","../internal/operators/debounce":"y9EZ","../internal/operators/debounceTime":"KBFO","../internal/operators/defaultIfEmpty":"YBdz","../internal/operators/delay":"zkgx","../internal/operators/delayWhen":"iVuv","../internal/operators/dematerialize":"v6b5","../internal/operators/distinct":"H608","../internal/operators/distinctUntilChanged":"hFX7","../internal/operators/distinctUntilKeyChanged":"Egbr","../internal/operators/elementAt":"TbZV","../internal/operators/endWith":"loee","../internal/operators/every":"eEZZ","../internal/operators/exhaust":"ifNj","../internal/operators/exhaustMap":"DGWU","../internal/operators/expand":"iYcS","../internal/operators/filter":"HKzi","../internal/operators/finalize":"x5qu","../internal/operators/find":"t6rP","../internal/operators/findIndex":"GIlo","../internal/operators/first":"f9sd","../internal/operators/groupBy":"dNgG","../internal/operators/ignoreElements":"P82l","../internal/operators/isEmpty":"LqVv","../internal/operators/last":"xu0X","../internal/operators/map":"dNh5","../internal/operators/mapTo":"yJbZ","../internal/operators/materialize":"ZwCH","../internal/operators/max":"BgD2","../internal/operators/merge":"sbfV","../internal/operators/mergeAll":"Nkv4","../internal/operators/mergeMap":"nFsM","../internal/operators/mergeMapTo":"S3q6","../internal/operators/mergeScan":"wQne","../internal/operators/min":"bAWd","../internal/operators/multicast":"M6Em","../internal/operators/observeOn":"ezNs","../internal/operators/onErrorResumeNext":"S4UH","../internal/operators/pairwise":"u6OS","../internal/operators/partition":"jvG2","../internal/operators/pluck":"TdE4","../internal/operators/publish":"TQAB","../internal/operators/publishBehavior":"fUyM","../internal/operators/publishLast":"fQ7S","../internal/operators/publishReplay":"aqWk","../internal/operators/race":"EAaA","../internal/operators/reduce":"BORG","../internal/operators/repeat":"Fbxf","../internal/operators/repeatWhen":"CT9q","../internal/operators/retry":"ZHEI","../internal/operators/retryWhen":"GHe2","../internal/operators/refCount":"vT9o","../internal/operators/sample":"Rd9o","../internal/operators/sampleTime":"nb45","../internal/operators/scan":"U785","../internal/operators/sequenceEqual":"PMGC","../internal/operators/share":"KBGh","../internal/operators/shareReplay":"xsrM","../internal/operators/single":"angX","../internal/operators/skip":"vMIz","../internal/operators/skipLast":"iB53","../internal/operators/skipUntil":"xmsT","../internal/operators/skipWhile":"qjDA","../internal/operators/startWith":"doo6","../internal/operators/subscribeOn":"Et1l","../internal/operators/switchAll":"CBg8","../internal/operators/switchMap":"g5Rk","../internal/operators/switchMapTo":"Hs9S","../internal/operators/take":"JVEz","../internal/operators/takeLast":"FbHg","../internal/operators/takeUntil":"qGSv","../internal/operators/takeWhile":"EYJX","../internal/operators/tap":"okAI","../internal/operators/throttle":"Yoo8","../internal/operators/throttleTime":"v3FQ","../internal/operators/throwIfEmpty":"D7Ma","../internal/operators/timeInterval":"n6SK","../internal/operators/timeout":"Cp8V","../internal/operators/timeoutWith":"L72b","../internal/operators/timestamp":"pXuq","../internal/operators/toArray":"LA40","../internal/operators/window":"Iygx","../internal/operators/windowCount":"GYT2","../internal/operators/windowTime":"Okss","../internal/operators/windowToggle":"JiQj","../internal/operators/windowWhen":"YaG1","../internal/operators/withLatestFrom":"JDwQ","../internal/operators/zip":"UwLD","../internal/operators/zipAll":"DmwP"}],"h011":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ofType=void 0;var r=require("rxjs/operators"),e=function(r,e){return r===e||"function"==typeof e&&r===e.toString()},t=function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return function(t){return t.pipe((0,r.filter)(function(r){var t=r.type,o=n.length;if(1===o)return e(t,n[0]);for(var u=0;u<o;u++)if(e(t,n[u]))return!0;return!1}))}};exports.ofType=t;
},{"rxjs/operators":"cVrl"}],"WUfi":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionsObservable=void 0;var e=require("rxjs"),t=require("./operators"),r=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}();function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(u){function a(e){o(this,a);var t=n(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return t.source=e,t}return i(a,e.Observable),r(a,null,[{key:"of",value:function(){return new this(e.of.apply(void 0,arguments))}},{key:"from",value:function(t,r){return new this((0,e.from)(t,r))}}]),r(a,[{key:"lift",value:function(e){var t=new a(this);return t.operator=e,t}},{key:"ofType",value:function(){return t.ofType.apply(void 0,arguments)(this)}}]),a}();exports.ActionsObservable=u;
},{"rxjs":"iRqj","./operators":"h011"}],"Lint":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StateObservable=void 0;var e=require("rxjs");function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var n=function(n){function i(o,n){t(this,i);var u=r(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,function(e){var t=u.__notifier.subscribe(e);return t&&!t.closed&&e.next(u.value),t}));return u.value=n,u.__notifier=new e.Subject,u.__subscription=o.subscribe(function(e){e!==u.value&&(u.value=e,u.__notifier.next(e))}),u}return o(i,e.Observable),i}();exports.StateObservable=n;
},{"rxjs":"iRqj"}],"ao24":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warn=exports.deprecate=exports.resetDeprecationsSeen=void 0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o={},t=function(){o={}};exports.resetDeprecationsSeen=t;var n="object"===("undefined"==typeof console?"undefined":e(console))&&"function"==typeof console.warn?function(){var e;return(e=console).warn.apply(e,arguments)}:function(){},r=function(e){o[e]||(o[e]=!0,n("redux-observable | DEPRECATION: "+e))};exports.deprecate=r;var c=function(e){n("redux-observable | WARNING: "+e)};exports.warn=c;
},{}],"WIaS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createEpicMiddleware=o;var e=require("rxjs"),r=require("rxjs/operators"),n=require("./ActionsObservable"),t=require("./StateObservable"),u=require("./utils/console");function o(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=new(0,e.queueScheduler.constructor)(e.queueScheduler.SchedulerAction);var i=new e.Subject,s=void 0,c=function(c){s=c;var a=(new e.Subject).pipe((0,r.observeOn)(o)),b=(new e.Subject).pipe((0,r.observeOn)(o)),p=new n.ActionsObservable(a),v=new t.StateObservable(b,s.getState());return i.pipe((0,r.map)(function(e){var r="dependencies"in u?e(p,v,u.dependencies):e(p,v);if(!r)throw new TypeError('Your root Epic "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return r}),(0,r.mergeMap)(function(n){return(0,e.from)(n).pipe((0,r.subscribeOn)(o),(0,r.observeOn)(o))})).subscribe(s.dispatch),function(e){return function(r){var n=e(r);return b.next(s.getState()),a.next(r),n}}};return c.run=function(e){i.next(e)},c}
},{"rxjs":"iRqj","rxjs/operators":"cVrl","./ActionsObservable":"WUfi","./StateObservable":"Lint","./utils/console":"ao24"}],"Piqj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineEpics=void 0;var r=require("rxjs");function e(r){if(Array.isArray(r)){for(var e=0,n=Array(r.length);e<r.length;e++)n[e]=r[e];return n}return Array.from(r)}var n=function(){for(var n=arguments.length,o=Array(n),t=0;t<n;t++)o[t]=arguments[t];var a=function(){for(var n=arguments.length,t=Array(n),a=0;a<n;a++)t[a]=arguments[a];return r.merge.apply(void 0,e(o.map(function(r){var e=r.apply(void 0,t);if(!e)throw new TypeError('combineEpics: one of the provided Epics "'+(r.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return e})))};try{Object.defineProperty(a,"name",{value:"combineEpics("+o.map(function(r){return r.name||"<anonymous>"}).join(", ")+")"})}catch(i){}return a};exports.combineEpics=n;
},{"rxjs":"iRqj"}],"EOFz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"createEpicMiddleware",{enumerable:!0,get:function(){return e.createEpicMiddleware}}),Object.defineProperty(exports,"ActionsObservable",{enumerable:!0,get:function(){return r.ActionsObservable}}),Object.defineProperty(exports,"StateObservable",{enumerable:!0,get:function(){return t.StateObservable}}),Object.defineProperty(exports,"combineEpics",{enumerable:!0,get:function(){return i.combineEpics}}),Object.defineProperty(exports,"ofType",{enumerable:!0,get:function(){return n.ofType}});var e=require("./createEpicMiddleware"),r=require("./ActionsObservable"),t=require("./StateObservable"),i=require("./combineEpics"),n=require("./operators");
},{"./createEpicMiddleware":"WIaS","./ActionsObservable":"WUfi","./StateObservable":"Lint","./combineEpics":"Piqj","./operators":"h011"}],"pGyj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const e="features/AvatarWorker/INITIALIZE_PYODIDE",A="features/AvatarWorker/PYODIDE_INITIALIZED",r="features/AvatarWorker/AVATAR_CODE_UPDATED",I="features/AvatarWorker/AVATARS_NEXT_ACTION_COMPUTED";var t={AVATAR_CODE_UPDATED:r,PYODIDE_INITIALIZED:A,AVATARS_NEXT_ACTION_COMPUTED:I,INITIALIZE_PYODIDE:e};exports.default=t;
},{}],"eLOZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./types"));function t(e){return e&&e.__esModule?e:{default:e}}const r=(t={initialized:!1},r)=>{switch(r.type){case e.default.AVATARS_NEXT_ACTION_COMPUTED:return{...t,avatarAction:r.payload};case e.default.PYODIDE_INITIALIZED:return{...t,initialized:!0};default:return t}};var a=r;exports.default=a;
},{"./types":"pGyj"}],"YYZi":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const N="features/Analytics/SEND_ANALYTICS_EVENT",E="features/Analytics/ANALYTICS_EVENT_SENT",T="features/Analytics/SEND_ANALYTICS_TIMING_EVENT",_="features/Analytics/ANALYTICS_TIMING_EVENT_SENT";var e={SEND_ANALYTICS_EVENT:N,ANALYTICS_EVENT_SENT:E,SEND_ANALYTICS_TIMING_EVENT:T,ANALYTICS_TIMING_EVENT_SENT:_};exports.default=e;
},{}],"DAw3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./types"));function t(e){return e&&e.__esModule?e:{default:e}}const a=(t,a,n="",l=0,i=!1)=>({type:e.default.SEND_ANALYTICS_EVENT,payload:{category:t,action:a,label:n,value:l,nonInteraction:i}}),n=(t,a,n="",l=0)=>({type:e.default.SEND_ANALYTICS_TIMING_EVENT,payload:{category:t,variable:a,label:n,value:l}}),l=()=>({type:e.default.ANALYTICS_EVENT_SENT}),i=()=>({type:e.default.ANALYTICS_TIMING_EVENT_SENT});var o={sendAnalyticsEvent:a,analyticsEventSent:l,analyticsTimingEventSent:i,sendAnalyticsTimingEvent:n};exports.default=o;
},{"./types":"YYZi"}],"E4FU":[function(require,module,exports) {
"use strict";function e(e){console.warn("[react-ga]",e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"c551":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=n(require("prop-types")),r=n(require("../utils/console/warn"));function n(e){return e&&e.__esModule?e:{default:e}}function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=n?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(r,u,i):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(r,!0).forEach(function(t){h(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function l(e,t){if(null==e)return{};var r,n,o=f(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function f(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),e}function b(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?d(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var j="_blank",w=1,k=function(t){function r(){var e,t;p(this,r);for(var n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=arguments[u];return h(d(t=b(this,(e=O(r)).call.apply(e,[this].concat(o)))),"handleClick",function(e){var n=t.props,o=n.target,u=n.eventLabel,i=n.to,c=n.onClick,a=n.trackerNames,l={label:u},f=o!==j,p=!(e.ctrlKey||e.shiftKey||e.metaKey||e.button===w);f&&p?(e.preventDefault(),r.trackLink(l,function(){window.location.href=i},a)):r.trackLink(l,function(){},a),c&&c(e)}),t}return g(r,e.Component),y(r,[{key:"render",value:function(){var t=this.props,r=t.to,n=a({},l(t,["to"]),{href:r,onClick:this.handleClick});return this.props.target===j&&(n.rel="noopener noreferrer"),delete n.eventLabel,delete n.trackerNames,e.default.createElement("a",n)}}]),r}();exports.default=k,h(k,"trackLink",function(){(0,r.default)("ga tracking not enabled")}),h(k,"propTypes",{eventLabel:t.default.string.isRequired,target:t.default.string,to:t.default.string,onClick:t.default.func,trackerNames:t.default.arrayOf(t.default.string)}),h(k,"defaultProps",{target:null,to:null,onClick:null,trackerNames:null});
},{"react":"n8MK","prop-types":"D9Od","../utils/console/warn":"E4FU"}],"elvD":[function(require,module,exports) {
"use strict";function e(e){return"string"==typeof e&&-1!==e.indexOf("@")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"r9T1":[function(require,module,exports) {
"use strict";function e(e){return e.replace(/^\s+|\s+$/g,"")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"RupU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;var e=r(require("./trim"));function r(e){return e&&e.__esModule?e:{default:e}}var t=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;function a(r){return(0,e.default)(r).replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,function(e,r,a){return r>0&&r+e.length!==a.length&&e.search(t)>-1&&":"!==a.charAt(r-2)&&("-"!==a.charAt(r+e.length)||"-"===a.charAt(r-1))&&a.charAt(r-1).search(/[^\s-]/)<0?e.toLowerCase():e.substr(1).search(/[A-Z]|\../)>-1?e:e.charAt(0).toUpperCase()+e.substr(1)})}
},{"./trim":"r9T1"}],"X5Gq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=l;var e=a(require("./mightBeEmail")),r=a(require("./toTitleCase")),t=a(require("./console/warn"));function a(e){return e&&e.__esModule?e:{default:e}}var i="REDACTED (Potential Email Address)";function l(a,l){return(0,e.default)(a)?((0,t.default)("This arg looks like an email address, redacting."),i):l?(0,r.default)(a):a}
},{"./mightBeEmail":"elvD","./toTitleCase":"RupU","./console/warn":"E4FU"}],"OlS2":[function(require,module,exports) {
"use strict";function e(e){return"/"===e.substring(0,1)?e.substring(1):e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"IJhO":[function(require,module,exports) {
"use strict";function e(e){var t,a,s,n,o,c,g,l="https://www.google-analytics.com/analytics.js";e&&e.gaAddress?l=e.gaAddress:e&&e.debug&&(l="https://www.google-analytics.com/analytics_debug.js"),t=window,a=document,s="script",n=l,o="ga",t.GoogleAnalyticsObject=o,t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,c=a.createElement(s),g=a.getElementsByTagName(s)[0],c.async=1,c.src=n,g.parentNode.insertBefore(c,g)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"IrvH":[function(require,module,exports) {
"use strict";function e(e){console.info("[react-ga]",e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"HiHk":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.gaCalls=void 0;var e=[];exports.gaCalls=e;var t={calls:e,ga:function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];e.push([].concat(a))},resetCalls:function(){e.length=0}};exports.default=t;
},{}],"dyZ5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initialize=k,exports.ga=P,exports.set=E,exports.send=N,exports.pageview=T,exports.modalview=I,exports.timing=D,exports.event=C,exports.exception=J,exports.outboundLink=M,exports.default=exports.testModeAPI=exports.plugin=void 0;var e=l(require("./utils/format")),t=l(require("./utils/removeLeadingSlash")),n=l(require("./utils/trim")),a=l(require("./utils/loadGA")),r=l(require("./utils/console/warn")),i=l(require("./utils/console/log")),o=l(require("./utils/testModeAPI"));function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(null==e)return{};var n,a,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(n,!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e){return v(e)||b(e)||y()}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function b(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function v(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}var m="undefined"==typeof window||"undefined"==typeof document,h=!1,O=!0,w=!1,j=!0,x=function(){var e;return w?o.default.ga.apply(o.default,arguments):!m&&(window.ga?(e=window).ga.apply(e,arguments):(0,r.default)("ReactGA.initialize must be called first or GoogleAnalytics should be loaded manually"))};function A(t){return(0,e.default)(t,O)}function q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];var i=n[0];if("function"==typeof x){if("string"!=typeof i)return void(0,r.default)("ga command must be a string");!j&&Array.isArray(e)||x.apply(void 0,n),Array.isArray(e)&&e.forEach(function(e){x.apply(void 0,g(["".concat(e,".").concat(i)].concat(n.slice(1))))})}}function S(e,t){e?t&&(t.debug&&!0===t.debug&&(h=!0),!1===t.titleCase&&(O=!1),t.useExistingGa)||(t&&t.gaOptions?x("create",e,t.gaOptions):x("create",e,"auto")):(0,r.default)("gaTrackingID is required in initialize()")}function k(e,t){if(t&&!0===t.testMode)w=!0;else{if(m)return!1;t&&!0===t.standardImplementation||(0,a.default)(t)}return j=!t||"boolean"!=typeof t.alwaysSendToDefaultTracker||t.alwaysSendToDefaultTracker,Array.isArray(e)?e.forEach(function(e){"object"===p(e)?S(e.trackingId,e):(0,r.default)("All configs must be an object")}):S(e,t),!0}function P(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>0&&(x.apply(void 0,t),h&&((0,i.default)("called ga('arguments');"),(0,i.default)("with arguments: ".concat(JSON.stringify(t))))),window.ga}function E(e,t){e?"object"===p(e)?(0===Object.keys(e).length&&(0,r.default)("empty `fieldsObject` given to .set()"),q(t,"set",e),h&&((0,i.default)("called ga('set', fieldsObject);"),(0,i.default)("with fieldsObject: ".concat(JSON.stringify(e))))):(0,r.default)("Expected `fieldsObject` arg to be an Object"):(0,r.default)("`fieldsObject` is required in .set()")}function N(e,t){q(t,"send",e),h&&((0,i.default)("called ga('send', fieldObject);"),(0,i.default)("with fieldObject: ".concat(JSON.stringify(e))),(0,i.default)("with trackers: ".concat(JSON.stringify(t))))}function T(e,t,a){if(e){var o=(0,n.default)(e);if(""!==o){var l={};if(a&&(l.title=a),"function"==typeof P&&(q(t,"send",d({hitType:"pageview",page:o},l)),h)){(0,i.default)("called ga('send', 'pageview', path);");var u="";a&&(u=" and title: ".concat(a)),(0,i.default)("with path: ".concat(o).concat(u))}}else(0,r.default)("path cannot be an empty string in .pageview()")}else(0,r.default)("path is required in .pageview()")}function I(e,a){if(e){var o=(0,t.default)((0,n.default)(e));if(""!==o){if("function"==typeof P){var l="/modal/".concat(o);q(a,"send","pageview",l),h&&((0,i.default)("called ga('send', 'pageview', path);"),(0,i.default)("with path: ".concat(l)))}}else(0,r.default)("modalName cannot be an empty string or a single / in .modalview()")}else(0,r.default)("modalName is required in .modalview(modalName)")}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.variable,a=e.value,i=e.label,o=arguments.length>1?arguments[1]:void 0;if("function"==typeof P){if(!t||!n||!a||"number"!=typeof a)return void(0,r.default)("args.category, args.variable AND args.value are required in timing() AND args.value has to be a number");var l={hitType:"timing",timingCategory:A(t),timingVar:A(n),timingValue:a};i&&(l.timingLabel=A(i)),N(l,o)}}function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.action,a=e.label,i=e.value,o=e.nonInteraction,l=e.transport,c=u(e,["category","action","label","value","nonInteraction","transport"]),f=arguments.length>1?arguments[1]:void 0;if("function"==typeof P){if(!t||!n)return void(0,r.default)("args.category AND args.action are required in event()");var d={hitType:"event",eventCategory:A(t),eventAction:A(n)};a&&(d.eventLabel=A(a)),void 0!==i&&("number"!=typeof i?(0,r.default)("Expected `args.value` arg to be a Number."):d.eventValue=i),void 0!==o&&("boolean"!=typeof o?(0,r.default)("`args.nonInteraction` must be a boolean."):d.nonInteraction=o),void 0!==l&&("string"!=typeof l?(0,r.default)("`args.transport` must be a string."):(-1===["beacon","xhr","image"].indexOf(l)&&(0,r.default)("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),d.transport=l)),Object.keys(c).filter(function(e){return"dimension"===e.substr(0,"dimension".length)}).forEach(function(e){d[e]=c[e]}),Object.keys(c).filter(function(e){return"metric"===e.substr(0,"metric".length)}).forEach(function(e){d[e]=c[e]}),N(d,f)}}function J(e,t){var n=e.description,a=e.fatal;if("function"==typeof P){var i={hitType:"exception"};n&&(i.exDescription=A(n)),void 0!==a&&("boolean"!=typeof a?(0,r.default)("`args.fatal` must be a boolean."):i.exFatal=a),N(i,t)}}var L={require:function(e,t,a){if("function"==typeof P){if(!e)return void(0,r.default)("`name` is required in .require()");var o=(0,n.default)(e);if(""===o)return void(0,r.default)("`name` cannot be an empty string in .require()");var l=a?"".concat(a,".require"):"require";if(t){if("object"!==p(t))return void(0,r.default)("Expected `options` arg to be an Object");0===Object.keys(t).length&&(0,r.default)("Empty `options` given to .require()"),P(l,o,t),h&&(0,i.default)("called ga('require', '".concat(o,"', ").concat(JSON.stringify(t)))}else P(l,o),h&&(0,i.default)("called ga('require', '".concat(o,"');"))}},execute:function(e,t){var n,a;if(1==(arguments.length<=2?0:arguments.length-2)?n=arguments.length<=2?void 0:arguments[2]:(a=arguments.length<=2?void 0:arguments[2],n=arguments.length<=3?void 0:arguments[3]),"function"==typeof P)if("string"!=typeof e)(0,r.default)("Expected `pluginName` arg to be a String.");else if("string"!=typeof t)(0,r.default)("Expected `action` arg to be a String.");else{var o="".concat(e,":").concat(t);n=n||null,a&&n?(P(o,a,n),h&&((0,i.default)("called ga('".concat(o,"');")),(0,i.default)('actionType: "'.concat(a,'" with payload: ').concat(JSON.stringify(n))))):n?(P(o,n),h&&((0,i.default)("called ga('".concat(o,"');")),(0,i.default)("with payload: ".concat(JSON.stringify(n))))):(P(o),h&&(0,i.default)("called ga('".concat(o,"');")))}}};function M(e,t,n){if("function"==typeof t)if("function"==typeof P){if(!e||!e.label)return void(0,r.default)("args.label is required in outboundLink()");var a={hitType:"event",eventCategory:"Outbound",eventAction:"Click",eventLabel:A(e.label)},i=!1,o=setTimeout(function(){i=!0,t()},250);a.hitCallback=function(){clearTimeout(o),i||t()},N(a,n)}else setTimeout(t,0);else(0,r.default)("hitCallback function is required")}exports.plugin=L;var z=o.default;exports.testModeAPI=z;var G={initialize:k,ga:P,set:E,send:N,pageview:T,modalview:I,timing:D,event:C,exception:J,plugin:L,outboundLink:M,testModeAPI:o.default};exports.default=G;
},{"./utils/format":"X5Gq","./utils/removeLeadingSlash":"OlS2","./utils/trim":"r9T1","./utils/loadGA":"IJhO","./utils/console/warn":"E4FU","./utils/console/log":"IrvH","./utils/testModeAPI":"HiHk"}],"gbPU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.OutboundLink=exports.testModeAPI=exports.outboundLink=exports.plugin=exports.exception=exports.event=exports.timing=exports.modalview=exports.pageview=exports.send=exports.set=exports.ga=exports.initialize=void 0;var e=n(require("./components/OutboundLink")),t=o(require("./core"));function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var p=n?Object.getOwnPropertyDescriptor(e,i):null;p&&(p.get||p.set)?Object.defineProperty(o,i,p):o[i]=e[i]}return o.default=e,t&&t.set(e,o),o}function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(r,!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=t.initialize;exports.initialize=a;var s=t.ga;exports.ga=s;var c=t.set;exports.set=c;var f=t.send;exports.send=f;var l=t.pageview;exports.pageview=l;var d=t.modalview;exports.modalview=d;var v=t.timing;exports.timing=v;var x=t.event;exports.event=x;var b=t.exception;exports.exception=b;var O=t.plugin;exports.plugin=O;var g=t.outboundLink;exports.outboundLink=g;var y=t.testModeAPI;exports.testModeAPI=y,e.default.origTrackLink=e.default.trackLink,e.default.trackLink=t.outboundLink;var P=e.default;exports.OutboundLink=P;var j=p({},t,{OutboundLink:P});exports.default=j;
},{"./components/OutboundLink":"c551","./core":"dyZ5"}],"mxLL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("./types")),t=n(require("./actions")),a=require("./index"),i=n(require("react-ga")),o=require("rxjs/operators"),r=require("redux-observable");function n(e){return e&&e.__esModule?e:{default:e}}const s=n=>n.pipe((0,r.ofType)(e.default.SEND_ANALYTICS_EVENT),(0,o.filter)(a.hasAnalyticsCookiesConsent),(0,o.tap)(e=>i.default.event(e.payload)),(0,o.mapTo)(t.default.analyticsEventSent())),l=n=>n.pipe((0,r.ofType)(e.default.SEND_ANALYTICS_TIMING_EVENT),(0,o.filter)(a.hasAnalyticsCookiesConsent),(0,o.tap)(e=>i.default.timing(e.payload)),(0,o.mapTo)(t.default.analyticsTimingEventSent()));var u={sendToGoogleAnalyticsEpic:s,sendToGoogleAnalyticsTimingEventEpic:l};exports.default=u;
},{"./types":"YYZi","./actions":"DAw3","./index":"tGUC","react-ga":"gbPU","rxjs/operators":"cVrl","redux-observable":"EOFz"}],"tGUC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.hasAnalyticsCookiesConsent=u,Object.defineProperty(exports,"analyticTypes",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"analyticEpics",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"actions",{enumerable:!0,get:function(){return r.default}});var e=n(require("./types")),t=n(require("./epics")),r=n(require("./actions"));function n(e){return e&&e.__esModule?e:{default:e}}function u(){return!!window.OnetrustActiveGroups&&window.OnetrustActiveGroups.split(",").includes("C0002")}
},{"./types":"YYZi","./epics":"mxLL","./actions":"DAw3"}],"PjLo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const E="features/Editor/GET_CODE_REQUEST",_="features/Editor/GET_CODE_SUCCESS",e="features/Editor/GET_CODE_FAILURE",t="features/Editor/POST_CODE_REQUEST",S="features/Editor/POST_CODE_SUCCESS",C="features/Editor/POST_CODE_FAILURE",r="features/Editor/RESET_CODE",O="features/Editor/CODE_RESET";var T={GET_CODE_REQUEST:E,GET_CODE_SUCCESS:_,GET_CODE_FAILURE:e,POST_CODE_REQUEST:t,POST_CODE_SUCCESS:S,POST_CODE_FAILURE:C,RESET_CODE:r,CODE_RESET:O};exports.default=T;
},{}],"oXTF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const E="features/Game/SOCKET_GAME_STATE_RECEIVED",_="features/Game/SOCKET_CONNECT_TO_GAME_REQUEST",A="features/Game/SOCKET_CONNECT_TO_GAME_FAIL",e="features/Game/SOCKET_GAME_STATE_UPDATE_SUCCESS",T="features/Game/SOCKET_GAME_STATE_UPDATE_FAIL",C="features/Game/CONNECTION_PARAMETERS_RECEIVED",S="features/Game/GAME_LOADED",O="features/Game/MAP_PANNED",N="features/Game/CENTER_CAMERA_ON_USER_AVATAR";var a={SOCKET_GAME_STATE_RECEIVED:E,SOCKET_CONNECT_TO_GAME_REQUEST:_,SOCKET_CONNECT_TO_GAME_FAIL:A,SEND_GAME_STATE_SUCCESS:e,SEND_GAME_STATE_FAIL:T,CONNECTION_PARAMETERS_RECEIVED:C,GAME_LOADED:S,MAP_PANNED:O,CENTER_CAMERA_ON_USER_AVATAR:N};exports.default=a;
},{}],"B8Pq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("./types"));function a(e){return e&&e.__esModule?e:{default:e}}const t=(a={},t)=>{switch(t.type){case e.default.SOCKET_GAME_STATE_RECEIVED:return{...a,gameState:t.payload.gameState,gameLoaded:!0};case e.default.CONNECTION_PARAMETERS_RECEIVED:return{...a,connectionParameters:{...a.connectionParameters,currentAvatarID:t.payload.parameters.avatar_id}};case e.default.MAP_PANNED:return{...a,cameraCenteredOnUserAvatar:!1};case e.default.CENTER_CAMERA_ON_USER_AVATAR:return{...a,cameraCenteredOnUserAvatar:!0};default:return a}};var r=t;exports.default=r;
},{"./types":"oXTF"}],"d4e9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./types"));function t(e){return e&&e.__esModule?e:{default:e}}const a=()=>({type:e.default.SOCKET_CONNECT_TO_GAME_REQUEST}),E=()=>({type:e.default.SEND_GAME_STATE_SUCCESS}),d=t=>({type:e.default.SEND_GAME_STATE_FAIL,payload:{error:t}}),_=t=>({type:e.default.SOCKET_GAME_STATE_RECEIVED,payload:{gameState:t}}),r=t=>({type:e.default.CONNECTION_PARAMETERS_RECEIVED,payload:{parameters:t}}),u=()=>({type:e.default.GAME_LOADED}),o=()=>({type:e.default.SET_TIMEOUT}),s=()=>({type:e.default.MAP_PANNED}),A=()=>({type:e.default.CENTER_CAMERA_ON_USER_AVATAR});var T={socketConnectToGameRequest:a,sendGameStateSuccess:E,sendGameStateFail:d,socketGameStateReceived:_,connectionParametersReceived:r,gameLoaded:u,setTimeout:o,mapPanned:s,centerCameraOnUserAvatar:A};exports.default=T;
},{"./types":"oXTF"}],"At7O":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./types"));function t(e){return e&&e.__esModule?e:{default:e}}const a=()=>({type:e.default.INITIALIZE_PYODIDE}),d=()=>({type:e.default.PYODIDE_INITIALIZED}),o=t=>({type:e.default.AVATAR_CODE_UPDATED,payload:{...t}}),i=t=>({type:e.default.AVATARS_NEXT_ACTION_COMPUTED,payload:{...t}});var u={initializePyodide:a,pyodideInitialized:d,avatarCodeUpdated:o,avatarsNextActionComputed:i};exports.default=u;
},{"./types":"pGyj"}],"myfb":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timeoutIfWorkerTakesTooLong=void 0;var e=require("rxjs"),r=require("rxjs/operators");const o=1e3,t=(o,t,a)=>n=>n.pipe((0,r.timeout)(1e3,a),(0,r.catchError)(()=>(t(o.value.editor.code.codeOnServer,o.value.game.connectionParameters.currentAvatarID),(0,e.of)({action:{action_type:"wait"},log:"Hmm, we haven't had an action back from your avatar this turn. Is there a 🐞 in your code?",turnCount:o.value.game.gameState.turnCount+1}))));exports.timeoutIfWorkerTakesTooLong=t;
},{"rxjs":"iRqj","rxjs/operators":"cVrl"}],"aR3I":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("rxjs/operators"),t=u(require("./actions")),a=u(require("./types")),r=require("./operators"),i=require("redux-observable"),o=require("../Game"),p=require("../Editor"),d=require("rxjs");function u(e){return e&&e.__esModule?e:{default:e}}const c=d.Scheduler.async,n=(r,p,{pyodideRunner:{initializePyodide:d}})=>r.pipe((0,i.ofType)(o.gameTypes.SOCKET_CONNECT_TO_GAME_REQUEST,a.default.INITIALIZE_PYODIDE),(0,e.switchMap)(d),(0,e.mapTo)(t.default.pyodideInitialized())),s=(r,o,{pyodideRunner:{updateAvatarCode:d}})=>r.pipe((0,e.zip)(r.pipe((0,i.ofType)(a.default.PYODIDE_INITIALIZED),(0,e.take)(1)),r.pipe((0,i.ofType)(p.editorTypes.GET_CODE_SUCCESS),(0,e.take)(1))),(0,e.switchMap)(()=>d(o.value.editor.code.codeOnServer)),(0,e.map)(t.default.avatarCodeUpdated)),E=(o,u,{api:{socket:n},pyodideRunner:{updateAvatarCode:s,resetWorker:E}},T=c)=>o.pipe((0,i.ofType)(a.default.PYODIDE_INITIALIZED),(0,e.switchMap)(()=>o.pipe((0,i.ofType)(p.editorTypes.POST_CODE_SUCCESS),(0,e.switchMap)(()=>(0,d.from)(s(u.value.editor.code.codeOnServer,u.value.game.gameState,u.value.game.connectionParameters.currentAvatarID)).pipe((0,r.timeoutIfWorkerTakesTooLong)(u,E,T))),(0,e.tap)(n.emitAction),(0,e.map)(t.default.avatarCodeUpdated)))),T=(p,d,{api:{socket:u},pyodideRunner:{computeNextAction$:n,resetWorker:s}},E=c)=>p.pipe((0,i.ofType)(a.default.PYODIDE_INITIALIZED),(0,e.switchMap)(()=>p.pipe((0,i.ofType)(o.gameTypes.SOCKET_GAME_STATE_RECEIVED),(0,e.switchMap)(({payload:{gameState:e}})=>n(e,d.value.game.connectionParameters.currentAvatarID).pipe((0,r.timeoutIfWorkerTakesTooLong)(d,s,E))),(0,e.tap)(u.emitAction),(0,e.map)(t.default.avatarsNextActionComputed))));var l={initializePyodideEpic:n,initialUpdateAvatarCodeEpic:s,updateAvatarCodeEpic:E,computeNextActionEpic:T};exports.default=l;
},{"rxjs/operators":"cVrl","./actions":"At7O","./types":"pGyj","./operators":"myfb","redux-observable":"EOFz","../Game":"EAAz","../Editor":"HJ0x","rxjs":"iRqj"}],"XcZN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"avatarWorkerEpics",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"avatarWorkerTypes",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"avatarWorkerActions",{enumerable:!0,get:function(){return u.default}}),exports.default=void 0;var e=a(require("./reducers")),r=a(require("./epics")),t=a(require("./types")),u=a(require("./actions"));function a(e){return e&&e.__esModule?e:{default:e}}var o=e.default;exports.default=o;
},{"./reducers":"eLOZ","./epics":"aR3I","./types":"pGyj","./actions":"At7O"}],"tfTM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=E(require("./actions")),a=E(require("./types")),r=require("../AvatarWorker"),t=require("../Editor"),i=require("rxjs"),o=require("rxjs/operators"),p=require("redux-observable"),n=require("../Analytics");function E(e){return e&&e.__esModule?e:{default:e}}const s=i.Scheduler.async,c=(r,t,{api:{get:i}})=>r.pipe((0,p.ofType)(a.default.SOCKET_CONNECT_TO_GAME_REQUEST),(0,o.mergeMap)(a=>i(`games/${t.value.game.connectionParameters.game_id}/connection_parameters/`).pipe((0,o.map)(a=>e.default.connectionParametersReceived(a)),(0,o.retryWhen)(e=>e.pipe((0,o.delay)(1e3)))))),d=r=>r.pipe((0,p.ofType)(a.default.SOCKET_CONNECT_TO_GAME_REQUEST),(0,o.switchMap)(()=>r.pipe((0,p.ofType)(a.default.SOCKET_GAME_STATE_RECEIVED),(0,o.first)(),(0,o.mapTo)(e.default.gameLoaded())))),T=(e,r,t,i=s)=>e.pipe((0,p.ofType)(a.default.GAME_LOADED),(0,o.timeInterval)(i),(0,o.map)(e=>n.actions.sendAnalyticsTimingEvent("Kurono","Load","Game",e.interval))),u=(e,r,{api:{socket:t}})=>e.pipe((0,p.ofType)(a.default.CONNECTION_PARAMETERS_RECEIVED),t.connectToGame(),t.startListeners(),(0,o.catchError)(e=>(0,i.of)({type:a.default.SOCKET_CONNECT_TO_GAME_FAIL,payload:e,error:!0}))),l=(e,a,i,E=s)=>e.pipe((0,p.ofType)(t.editorTypes.POST_CODE_REQUEST),(0,o.switchMap)(()=>e.pipe((0,p.ofType)(r.avatarWorkerTypes.AVATAR_CODE_UPDATED),(0,o.timeInterval)(E),(0,o.map)(e=>n.actions.sendAnalyticsTimingEvent("Kurono","Update","User code",e.interval)))));var _={getConnectionParametersEpic:c,connectToGameEpic:u,gameLoadedEpic:d,gameLoadedIntervalEpic:T,codeUpdatingIntervalEpic:l};exports.default=_;
},{"./actions":"d4e9","./types":"oXTF","../AvatarWorker":"XcZN","../Editor":"HJ0x","rxjs":"iRqj","rxjs/operators":"cVrl","redux-observable":"EOFz","../Analytics":"tGUC"}],"EAAz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"gameEpics",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"gameTypes",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"actions",{enumerable:!0,get:function(){return u.default}}),exports.default=void 0;var e=n(require("./reducers")),r=n(require("./epics")),t=n(require("./types")),u=n(require("./actions"));function n(e){return e&&e.__esModule?e:{default:e}}var o=e.default;exports.default=o;
},{"./reducers":"B8Pq","./epics":"tfTM","./types":"oXTF","./actions":"d4e9"}],"IV4i":[function(require,module,exports) {
"use strict";function e(e,t){"function"==typeof e?e(t):e&&(e.current=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"eYEl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=o;var e=u(require("react")),t=r(require("./setRef"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var f=u?Object.getOwnPropertyDescriptor(e,o):null;f&&(f.get||f.set)?Object.defineProperty(r,o,f):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function o(r,n){return e.useMemo(function(){return null==r&&null==n?null:function(e){(0,t.default)(r,e),(0,t.default)(n,e)}},[r,n])}
},{"react":"n8MK","./setRef":"IV4i"}],"AH47":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=r(require("react"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var f=u?Object.getOwnPropertyDescriptor(e,o):null;f&&(f.get||f.set)?Object.defineProperty(n,o,f):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}var n="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function u(t){var r=e.useRef(t);return n(function(){r.current=t}),e.useCallback(function(){return r.current.apply(void 0,arguments)},[])}
},{"react":"n8MK"}],"Z9bb":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.teardown=v,exports.default=m;var e=r(require("react")),t=r(require("react-dom"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var i=!0,o=!1,a=null,u={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!u[t]||e.readOnly)||("TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable)}function s(e){e.metaKey||e.altKey||e.ctrlKey||(i=!0)}function d(){i=!1}function l(){"hidden"===this.visibilityState&&o&&(i=!0)}function f(e){e.addEventListener("keydown",s,!0),e.addEventListener("mousedown",d,!0),e.addEventListener("pointerdown",d,!0),e.addEventListener("touchstart",d,!0),e.addEventListener("visibilitychange",l,!0)}function v(e){e.removeEventListener("keydown",s,!0),e.removeEventListener("mousedown",d,!0),e.removeEventListener("pointerdown",d,!0),e.removeEventListener("touchstart",d,!0),e.removeEventListener("visibilitychange",l,!0)}function p(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return i||c(t)}function y(){o=!0,window.clearTimeout(a),a=window.setTimeout(function(){o=!1},100)}function m(){return{isFocusVisible:p,onBlurVisible:y,ref:e.useCallback(function(e){var n=t.findDOMNode(e);null!=n&&f(n.ownerDocument)},[])}}
},{"react":"n8MK","react-dom":"NKHc"}],"CHq6":[function(require,module,exports) {
"use strict";function s(s,e){return s.classList?!!e&&s.classList.contains(e):-1!==(" "+(s.className.baseVal||s.className)+" ").indexOf(" "+e+" ")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=s;
},{}],"P74j":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;var s=e(require("./hasClass"));function e(s){return s&&s.__esModule?s:{default:s}}function a(e,a){e.classList?e.classList.add(a):(0,s.default)(e,a)||("string"==typeof e.className?e.className=e.className+" "+a:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+a))}
},{"./hasClass":"CHq6"}],"Rbn9":[function(require,module,exports) {
"use strict";function e(e,s){return e.replace(new RegExp("(^|\\s)"+s+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function s(s,a){s.classList?s.classList.remove(a):"string"==typeof s.className?s.className=e(s.className,a):s.setAttribute("class",e(s.className&&s.className.baseVal||"",a))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=s;
},{}],"k2aB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={disabled:!1};exports.default=e;
},{}],"BvlO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.classNamesShape=exports.timeoutsShape=void 0;var e=s(require("prop-types"));function s(e){return e&&e.__esModule?e:{default:e}}var t=null;exports.timeoutsShape=t;var r=null;exports.classNamesShape=r;
},{"prop-types":"D9Od"}],"FWuc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("react"));function t(e){return e&&e.__esModule?e:{default:e}}var r=e.default.createContext(null);exports.default=r;
},{"react":"n8MK"}],"eTro":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.EXITING=exports.ENTERED=exports.ENTERING=exports.EXITED=exports.UNMOUNTED=void 0;var t=u(require("@babel/runtime/helpers/esm/objectWithoutPropertiesLoose")),e=u(require("@babel/runtime/helpers/esm/inheritsLoose")),n=u(require("prop-types")),i=u(require("react")),r=u(require("react-dom")),s=u(require("./config")),o=require("./utils/PropTypes"),a=u(require("./TransitionGroupContext"));function u(t){return t&&t.__esModule?t:{default:t}}var p="unmounted";exports.UNMOUNTED=p;var l="exited";exports.EXITED=l;var d="entering";exports.ENTERING=d;var E="entered";exports.ENTERED=E;var c="exiting";exports.EXITING=c;var f=function(n){function o(t,e){var i;i=n.call(this,t,e)||this;var r,s=e&&!e.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?s?(r=l,i.appearStatus=d):r=E:r=t.unmountOnExit||t.mountOnEnter?p:l,i.state={status:r},i.nextCallback=null,i}(0,e.default)(o,n),o.getDerivedStateFromProps=function(t,e){return t.in&&e.status===p?{status:l}:null};var u=o.prototype;return u.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},u.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==d&&n!==E&&(e=d):n!==d&&n!==E||(e=c)}this.updateStatus(!1,e)},u.componentWillUnmount=function(){this.cancelNextCallback()},u.getTimeouts=function(){var t,e,n,i=this.props.timeout;return t=e=n=i,null!=i&&"number"!=typeof i&&(t=i.exit,e=i.enter,n=void 0!==i.appear?i.appear:e),{exit:t,enter:e,appear:n}},u.updateStatus=function(t,e){void 0===t&&(t=!1),null!==e?(this.cancelNextCallback(),e===d?this.performEnter(t):this.performExit()):this.props.unmountOnExit&&this.state.status===l&&this.setState({status:p})},u.performEnter=function(t){var e=this,n=this.props.enter,i=this.context?this.context.isMounting:t,o=this.props.nodeRef?[i]:[r.default.findDOMNode(this),i],a=o[0],u=o[1],p=this.getTimeouts(),l=i?p.appear:p.enter;!t&&!n||s.default.disabled?this.safeSetState({status:E},function(){e.props.onEntered(a)}):(this.props.onEnter(a,u),this.safeSetState({status:d},function(){e.props.onEntering(a,u),e.onTransitionEnd(l,function(){e.safeSetState({status:E},function(){e.props.onEntered(a,u)})})}))},u.performExit=function(){var t=this,e=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:r.default.findDOMNode(this);e&&!s.default.disabled?(this.props.onExit(i),this.safeSetState({status:c},function(){t.props.onExiting(i),t.onTransitionEnd(n.exit,function(){t.safeSetState({status:l},function(){t.props.onExited(i)})})})):this.safeSetState({status:l},function(){t.props.onExited(i)})},u.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},u.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},u.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,e.nextCallback=null,t(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},u.onTransitionEnd=function(t,e){this.setNextCallback(e);var n=this.props.nodeRef?this.props.nodeRef.current:r.default.findDOMNode(this),i=null==t&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=s[0],a=s[1];this.props.addEndListener(o,a)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},u.render=function(){var e=this.state.status;if(e===p)return null;var n=this.props,r=n.children,s=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,(0,t.default)(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.default.createElement(a.default.Provider,{value:null},"function"==typeof r?r(e,s):i.default.cloneElement(i.default.Children.only(r),s))},o}(i.default.Component);function h(){}f.contextType=a.default,f.propTypes={},f.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},f.UNMOUNTED=p,f.EXITED=l,f.ENTERING=d,f.ENTERED=E,f.EXITING=c;var x=f;exports.default=x;
},{"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose":"Vabl","@babel/runtime/helpers/esm/inheritsLoose":"S11h","prop-types":"D9Od","react":"n8MK","react-dom":"NKHc","./config":"k2aB","./utils/PropTypes":"BvlO","./TransitionGroupContext":"FWuc"}],"dtHp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),s=l(require("@babel/runtime/helpers/esm/objectWithoutPropertiesLoose")),r=l(require("@babel/runtime/helpers/esm/inheritsLoose")),t=l(require("prop-types")),n=l(require("dom-helpers/addClass")),o=l(require("dom-helpers/removeClass")),a=l(require("react")),i=l(require("./Transition")),p=require("./utils/PropTypes");function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e,s){return e&&s&&s.split(" ").forEach(function(s){return(0,n.default)(e,s)})},d=function(e,s){return e&&s&&s.split(" ").forEach(function(s){return(0,o.default)(e,s)})},c=function(t){function n(){for(var e,s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];return(e=t.call.apply(t,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},e.onEnter=function(s,r){var t=e.resolveArguments(s,r),n=t[0],o=t[1];e.removeClasses(n,"exit"),e.addClass(n,o?"appear":"enter","base"),e.props.onEnter&&e.props.onEnter(s,r)},e.onEntering=function(s,r){var t=e.resolveArguments(s,r),n=t[0],o=t[1]?"appear":"enter";e.addClass(n,o,"active"),e.props.onEntering&&e.props.onEntering(s,r)},e.onEntered=function(s,r){var t=e.resolveArguments(s,r),n=t[0],o=t[1]?"appear":"enter";e.removeClasses(n,o),e.addClass(n,o,"done"),e.props.onEntered&&e.props.onEntered(s,r)},e.onExit=function(s){var r=e.resolveArguments(s)[0];e.removeClasses(r,"appear"),e.removeClasses(r,"enter"),e.addClass(r,"exit","base"),e.props.onExit&&e.props.onExit(s)},e.onExiting=function(s){var r=e.resolveArguments(s)[0];e.addClass(r,"exit","active"),e.props.onExiting&&e.props.onExiting(s)},e.onExited=function(s){var r=e.resolveArguments(s)[0];e.removeClasses(r,"exit"),e.addClass(r,"exit","done"),e.props.onExited&&e.props.onExited(s)},e.resolveArguments=function(s,r){return e.props.nodeRef?[e.props.nodeRef.current,s]:[s,r]},e.getClassNames=function(s){var r=e.props.classNames,t="string"==typeof r,n=t?""+(t&&r?r+"-":"")+s:r[s];return{baseClassName:n,activeClassName:t?n+"-active":r[s+"Active"],doneClassName:t?n+"-done":r[s+"Done"]}},e}(0,r.default)(n,t);var o=n.prototype;return o.addClass=function(e,s,r){var t=this.getClassNames(s)[r+"ClassName"],n=this.getClassNames("enter").doneClassName;"appear"===s&&"done"===r&&n&&(t+=" "+n),"active"===r&&e&&e.scrollTop,t&&(this.appliedClasses[s][r]=t,u(e,t))},o.removeClasses=function(e,s){var r=this.appliedClasses[s],t=r.base,n=r.active,o=r.done;this.appliedClasses[s]={},t&&d(e,t),n&&d(e,n),o&&d(e,o)},o.render=function(){var r=this.props,t=(r.classNames,(0,s.default)(r,["classNames"]));return a.default.createElement(i.default,(0,e.default)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},n}(a.default.Component);c.defaultProps={classNames:""},c.propTypes={};var v=c;exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutPropertiesLoose":"Vabl","@babel/runtime/helpers/esm/inheritsLoose":"S11h","prop-types":"D9Od","dom-helpers/addClass":"P74j","dom-helpers/removeClass":"Rbn9","react":"n8MK","./Transition":"eTro","./utils/PropTypes":"BvlO"}],"uFw4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getChildMapping=n,exports.mergeChildMappings=t,exports.getInitialChildMapping=i,exports.getNextChildMapping=l;var e=require("react");function n(n,t){var r=Object.create(null);return n&&e.Children.map(n,function(e){return e}).forEach(function(n){r[n.key]=function(n){return t&&(0,e.isValidElement)(n)?t(n):n}(n)}),r}function t(e,n){function t(t){return t in n?n[t]:e[t]}e=e||{},n=n||{};var r,i=Object.create(null),l=[];for(var o in e)o in n?l.length&&(i[o]=l,l=[]):l.push(o);var u={};for(var a in n){if(i[a])for(r=0;r<i[a].length;r++){var c=i[a][r];u[i[a][r]]=t(c)}u[a]=t(a)}for(r=0;r<l.length;r++)u[l[r]]=t(l[r]);return u}function r(e,n,t){return null!=t[n]?t[n]:e.props[n]}function i(t,i){return n(t.children,function(n){return(0,e.cloneElement)(n,{onExited:i.bind(null,n),in:!0,appear:r(n,"appear",t),enter:r(n,"enter",t),exit:r(n,"exit",t)})})}function l(i,l,o){var u=n(i.children),a=t(l,u);return Object.keys(a).forEach(function(n){var t=a[n];if((0,e.isValidElement)(t)){var c=n in l,p=n in u,f=l[n],d=(0,e.isValidElement)(f)&&!f.props.in;!p||c&&!d?p||!c||d?p&&c&&(0,e.isValidElement)(f)&&(a[n]=(0,e.cloneElement)(t,{onExited:o.bind(null,t),in:f.props.in,exit:r(t,"exit",i),enter:r(t,"enter",i)})):a[n]=(0,e.cloneElement)(t,{in:!1}):a[n]=(0,e.cloneElement)(t,{onExited:o.bind(null,t),in:!0,exit:r(t,"exit",i),enter:r(t,"enter",i)})}}),a}
},{"react":"n8MK"}],"Mfmy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("@babel/runtime/helpers/esm/objectWithoutPropertiesLoose")),t=l(require("@babel/runtime/helpers/esm/extends")),r=l(require("@babel/runtime/helpers/esm/assertThisInitialized")),n=l(require("@babel/runtime/helpers/esm/inheritsLoose")),i=l(require("prop-types")),o=l(require("react")),u=l(require("./TransitionGroupContext")),a=require("./utils/ChildMapping");function l(e){return e&&e.__esModule?e:{default:e}}var d=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},s={component:"div",childFactory:function(e){return e}},p=function(i){function l(e,t){var n,o=(n=i.call(this,e,t)||this).handleExited.bind((0,r.default)(n));return n.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},n}(0,n.default)(l,i);var s=l.prototype;return s.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},s.componentWillUnmount=function(){this.mounted=!1},l.getDerivedStateFromProps=function(e,t){var r=t.children,n=t.handleExited;return{children:t.firstRender?(0,a.getInitialChildMapping)(e,n):(0,a.getNextChildMapping)(e,r,n),firstRender:!1}},s.handleExited=function(e,r){var n=(0,a.getChildMapping)(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(r),this.mounted&&this.setState(function(r){var n=(0,t.default)({},r.children);return delete n[e.key],{children:n}}))},s.render=function(){var t=this.props,r=t.component,n=t.childFactory,i=(0,e.default)(t,["component","childFactory"]),a=this.state.contextValue,l=d(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===r?o.default.createElement(u.default.Provider,{value:a},l):o.default.createElement(u.default.Provider,{value:a},o.default.createElement(r,i,l))},l}(o.default.Component);p.propTypes={},p.defaultProps=s;var c=p;exports.default=c;
},{"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose":"Vabl","@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/assertThisInitialized":"bk0i","@babel/runtime/helpers/esm/inheritsLoose":"S11h","prop-types":"D9Od","react":"n8MK","./TransitionGroupContext":"FWuc","./utils/ChildMapping":"uFw4"}],"P6nY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("@babel/runtime/helpers/esm/objectWithoutPropertiesLoose")),n=l(require("@babel/runtime/helpers/esm/inheritsLoose")),r=l(require("prop-types")),t=l(require("react")),i=l(require("react-dom")),o=l(require("./TransitionGroup"));function l(e){return e&&e.__esModule?e:{default:e}}var a=function(r){function l(){for(var e,n=arguments.length,t=new Array(n),i=0;i<n;i++)t[i]=arguments[i];return(e=r.call.apply(r,[this].concat(t))||this).handleEnter=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onEnter",0,r)},e.handleEntering=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onEntering",0,r)},e.handleEntered=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onEntered",0,r)},e.handleExit=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onExit",1,r)},e.handleExiting=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onExiting",1,r)},e.handleExited=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onExited",1,r)},e}(0,n.default)(l,r);var a=l.prototype;return a.handleLifecycle=function(e,n,r){var o,l=this.props.children,a=t.default.Children.toArray(l)[n];if(a.props[e]&&(o=a.props)[e].apply(o,r),this.props[e]){var d=a.props.nodeRef?void 0:i.default.findDOMNode(this);this.props[e](d)}},a.render=function(){var n=this.props,r=n.children,i=n.in,l=(0,e.default)(n,["children","in"]),a=t.default.Children.toArray(r),d=a[0],h=a[1];return delete l.onEnter,delete l.onEntering,delete l.onEntered,delete l.onExit,delete l.onExiting,delete l.onExited,t.default.createElement(o.default,l,i?t.default.cloneElement(d,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):t.default.cloneElement(h,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},l}(t.default.Component);a.propTypes={};var d=a;exports.default=d;
},{"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose":"Vabl","@babel/runtime/helpers/esm/inheritsLoose":"S11h","prop-types":"D9Od","react":"n8MK","react-dom":"NKHc","./TransitionGroup":"Mfmy"}],"dEWS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.modes=void 0;var e,t,n=i(require("@babel/runtime/helpers/esm/inheritsLoose")),r=i(require("react")),u=i(require("prop-types")),a=require("./Transition"),o=i(require("./TransitionGroupContext"));function i(e){return e&&e.__esModule?e:{default:e}}function l(e,t){return e!==t&&(!r.default.isValidElement(e)||!r.default.isValidElement(t)||null==e.key||e.key!==t.key)}var c={out:"out-in",in:"in-out"};exports.modes=c;var s=function(e,t,n){return function(){var r;e.props[t]&&(r=e.props)[t].apply(r,arguments),n()}},d=((e={})[c.out]=function(e){var t=e.current,n=e.changeState;return r.default.cloneElement(t,{in:!1,onExited:s(t,"onExited",function(){n(a.ENTERING,null)})})},e[c.in]=function(e){var t=e.current,n=e.changeState,u=e.children;return[t,r.default.cloneElement(u,{in:!0,onEntered:s(u,"onEntered",function(){n(a.ENTERING)})})]},e),E=((t={})[c.out]=function(e){var t=e.children,n=e.changeState;return r.default.cloneElement(t,{in:!0,onEntered:s(t,"onEntered",function(){n(a.ENTERED,r.default.cloneElement(t,{in:!0}))})})},t[c.in]=function(e){var t=e.current,n=e.children,u=e.changeState;return[r.default.cloneElement(t,{in:!1,onExited:s(t,"onExited",function(){u(a.ENTERED,r.default.cloneElement(n,{in:!0}))})}),r.default.cloneElement(n,{in:!0})]},t),f=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),u=0;u<n;u++)r[u]=arguments[u];return(t=e.call.apply(e,[this].concat(r))||this).state={status:a.ENTERED,current:null},t.appeared=!1,t.changeState=function(e,n){void 0===n&&(n=t.state.current),t.setState({status:e,current:n})},t}(0,n.default)(t,e);var u=t.prototype;return u.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===a.ENTERING&&e.mode===c.in?{status:a.ENTERING}:t.current&&l(t.current,e.children)?{status:a.EXITING}:{current:r.default.cloneElement(e.children,{in:!0})}},u.render=function(){var e,t=this.props,n=t.children,u=t.mode,i=this.state,l=i.status,c=i.current,s={children:n,current:c,changeState:this.changeState,status:l};switch(l){case a.ENTERING:e=E[u](s);break;case a.EXITING:e=d[u](s);break;case a.ENTERED:e=c}return r.default.createElement(o.default.Provider,{value:{isMounting:!this.appeared}},e)},t}(r.default.Component);f.propTypes={},f.defaultProps={mode:c.out};var p=f;exports.default=p;
},{"@babel/runtime/helpers/esm/inheritsLoose":"S11h","react":"n8MK","prop-types":"D9Od","./Transition":"eTro","./TransitionGroupContext":"FWuc"}],"ORBw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"CSSTransition",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"ReplaceTransition",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"SwitchTransition",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"TransitionGroup",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"Transition",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"config",{enumerable:!0,get:function(){return u.default}});var e=o(require("./CSSTransition")),r=o(require("./ReplaceTransition")),t=o(require("./SwitchTransition")),n=o(require("./TransitionGroup")),i=o(require("./Transition")),u=o(require("./config"));function o(e){return e&&e.__esModule?e:{default:e}}
},{"./CSSTransition":"dtHp","./ReplaceTransition":"P6nY","./SwitchTransition":"dEWS","./TransitionGroup":"Mfmy","./Transition":"eTro","./config":"k2aB"}],"wqoB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),t=u(require("prop-types")),r=u(require("clsx")),i=u(require("../utils/useEventCallback"));function u(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=i?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(r,u,a):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}var l="undefined"==typeof window?e.useEffect:e.useLayoutEffect;function o(t){var u=t.classes,n=t.pulsate,a=void 0!==n&&n,o=t.rippleX,f=t.rippleY,p=t.rippleSize,s=t.in,c=t.onExited,d=void 0===c?function(){}:c,v=t.timeout,y=e.useState(!1),b=y[0],O=y[1],h=(0,r.default)(u.ripple,u.rippleVisible,a&&u.ripplePulsate),P={width:p,height:p,top:-p/2+f,left:-p/2+o},j=(0,r.default)(u.child,b&&u.childLeaving,a&&u.childPulsate),m=(0,i.default)(d);return l(function(){if(!s){O(!0);var e=setTimeout(m,v);return function(){clearTimeout(e)}}},[m,s,v]),e.createElement("span",{className:h,style:P},e.createElement("span",{className:j}))}var f=o;exports.default=f;
},{"react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../utils/useEventCallback":"AH47"}],"gOR6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=exports.DELAY_RIPPLE=void 0;var e=p(require("@babel/runtime/helpers/esm/extends")),t=p(require("@babel/runtime/helpers/esm/toConsumableArray")),r=p(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=c(require("react")),i=p(require("prop-types")),a=require("react-transition-group"),u=p(require("clsx")),o=p(require("../styles/withStyles")),l=p(require("./Ripple"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}var f=550,d=80;exports.DELAY_RIPPLE=d;var h=function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(f,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(f,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}};exports.styles=h;var m=n.forwardRef(function(i,o){var s=i.center,c=void 0!==s&&s,p=i.classes,h=i.className,m=(0,r.default)(i,["center","classes","className"]),b=n.useState([]),y=b[0],v=b[1],g=n.useRef(0),M=n.useRef(null);n.useEffect(function(){M.current&&(M.current(),M.current=null)},[y]);var w=n.useRef(!1),x=n.useRef(null),R=n.useRef(null),k=n.useRef(null);n.useEffect(function(){return function(){clearTimeout(x.current)}},[]);var P=n.useCallback(function(e){var r=e.pulsate,i=e.rippleX,a=e.rippleY,u=e.rippleSize,o=e.cb;v(function(e){return[].concat((0,t.default)(e),[n.createElement(l.default,{key:g.current,classes:p,timeout:f,pulsate:r,rippleX:i,rippleY:a,rippleSize:u})])}),g.current+=1,M.current=o},[p]),O=n.useCallback(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=t.pulsate,i=void 0!==n&&n,a=t.center,u=void 0===a?c||t.pulsate:a,o=t.fakeElement,l=void 0!==o&&o;if("mousedown"===e.type&&w.current)w.current=!1;else{"touchstart"===e.type&&(w.current=!0);var s,p,f,h=l?null:k.current,m=h?h.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(u||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)s=Math.round(m.width/2),p=Math.round(m.height/2);else{var b=e.touches?e.touches[0]:e,y=b.clientX,v=b.clientY;s=Math.round(y-m.left),p=Math.round(v-m.top)}if(u)(f=Math.sqrt((2*Math.pow(m.width,2)+Math.pow(m.height,2))/3))%2==0&&(f+=1);else{var g=2*Math.max(Math.abs((h?h.clientWidth:0)-s),s)+2,M=2*Math.max(Math.abs((h?h.clientHeight:0)-p),p)+2;f=Math.sqrt(Math.pow(g,2)+Math.pow(M,2))}e.touches?null===R.current&&(R.current=function(){P({pulsate:i,rippleX:s,rippleY:p,rippleSize:f,cb:r})},x.current=setTimeout(function(){R.current&&(R.current(),R.current=null)},d)):P({pulsate:i,rippleX:s,rippleY:p,rippleSize:f,cb:r})}},[c,P]),q=n.useCallback(function(){O({},{pulsate:!0})},[O]),E=n.useCallback(function(e,t){if(clearTimeout(x.current),"touchend"===e.type&&R.current)return e.persist(),R.current(),R.current=null,void(x.current=setTimeout(function(){E(e,t)}));R.current=null,v(function(e){return e.length>0?e.slice(1):e}),M.current=t},[]);return n.useImperativeHandle(o,function(){return{pulsate:q,start:O,stop:E}},[q,O,E]),n.createElement("span",(0,e.default)({className:(0,u.default)(p.root,h),ref:k},m),n.createElement(a.TransitionGroup,{component:null,exit:!0},y))}),b=(0,o.default)(h,{flip:!1,name:"MuiTouchRipple"})(n.memo(m));exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/toConsumableArray":"Qv3s","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","react-transition-group":"ORBw","clsx":"WLGK","../styles/withStyles":"awmK","./Ripple":"wqoB"}],"UfHt":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=b(require("@babel/runtime/helpers/esm/extends")),t=b(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=d(require("react")),n=b(require("prop-types")),o=d(require("react-dom")),u=b(require("clsx")),i=require("@material-ui/utils"),a=b(require("../utils/useForkRef")),s=b(require("../utils/useEventCallback")),l=b(require("../styles/withStyles")),c=b(require("../utils/useIsFocusVisible")),p=b(require("./TouchRipple"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function b(e){return e&&e.__esModule?e:{default:e}}var v={root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}};exports.styles=v;var y=r.forwardRef(function(n,i){var l=n.action,f=n.buttonRef,d=n.centerRipple,b=void 0!==d&&d,v=n.children,y=n.classes,h=n.className,m=n.component,g=void 0===m?"button":m,M=n.disabled,R=void 0!==M&&M,T=n.disableRipple,D=void 0!==T&&T,k=n.disableTouchRipple,w=void 0!==k&&k,x=n.focusRipple,q=void 0!==x&&x,P=n.focusVisibleClassName,j=n.onBlur,E=n.onClick,O=n.onFocus,V=n.onFocusVisible,C=n.onKeyDown,F=n.onKeyUp,S=n.onMouseDown,N=n.onMouseLeave,B=n.onMouseUp,I=n.onTouchEnd,K=n.onTouchMove,L=n.onTouchStart,U=n.onDragLeave,_=n.tabIndex,W=void 0===_?0:_,A=n.TouchRippleProps,z=n.type,H=void 0===z?"button":z,$=(0,t.default)(n,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),G=r.useRef(null);var J=r.useRef(null),Q=r.useState(!1),X=Q[0],Y=Q[1];R&&X&&Y(!1);var Z=(0,c.default)(),ee=Z.isFocusVisible,te=Z.onBlurVisible,re=Z.ref;function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w;return(0,s.default)(function(n){return t&&t(n),!r&&J.current&&J.current[e](n),!0})}r.useImperativeHandle(l,function(){return{focusVisible:function(){Y(!0),G.current.focus()}}},[]),r.useEffect(function(){X&&q&&!D&&J.current.pulsate()},[D,q,X]);var oe=ne("start",S),ue=ne("stop",U),ie=ne("stop",B),ae=ne("stop",function(e){X&&e.preventDefault(),N&&N(e)}),se=ne("start",L),le=ne("stop",I),ce=ne("stop",K),pe=ne("stop",function(e){X&&(te(e),Y(!1)),j&&j(e)},!1),fe=(0,s.default)(function(e){G.current||(G.current=e.currentTarget),ee(e)&&(Y(!0),V&&V(e)),O&&O(e)}),de=function(){var e=o.findDOMNode(G.current);return g&&"button"!==g&&!("A"===e.tagName&&e.href)},be=r.useRef(!1),ve=(0,s.default)(function(e){q&&!be.current&&X&&J.current&&" "===e.key&&(be.current=!0,e.persist(),J.current.stop(e,function(){J.current.start(e)})),e.target===e.currentTarget&&de()&&" "===e.key&&e.preventDefault(),C&&C(e),e.target===e.currentTarget&&de()&&"Enter"===e.key&&!R&&(e.preventDefault(),E&&E(e))}),ye=(0,s.default)(function(e){q&&" "===e.key&&J.current&&X&&!e.defaultPrevented&&(be.current=!1,e.persist(),J.current.stop(e,function(){J.current.pulsate(e)})),F&&F(e),E&&e.target===e.currentTarget&&de()&&" "===e.key&&!e.defaultPrevented&&E(e)}),he=g;"button"===he&&$.href&&(he="a");var me={};"button"===he?(me.type=H,me.disabled=R):("a"===he&&$.href||(me.role="button"),me["aria-disabled"]=R);var ge=(0,a.default)(f,i),Me=(0,a.default)(re,G),Re=(0,a.default)(ge,Me),Te=r.useState(!1),De=Te[0],ke=Te[1];r.useEffect(function(){ke(!0)},[]);var we=De&&!D&&!R;return r.createElement(he,(0,e.default)({className:(0,u.default)(y.root,h,X&&[y.focusVisible,P],R&&y.disabled),onBlur:pe,onClick:E,onFocus:fe,onKeyDown:ve,onKeyUp:ye,onMouseDown:oe,onMouseLeave:ae,onMouseUp:ie,onDragLeave:ue,onTouchEnd:le,onTouchMove:ce,onTouchStart:se,ref:Re,tabIndex:R?-1:W},me,$),v,we?r.createElement(p.default,(0,e.default)({ref:J,center:b},A)):null)}),h=(0,l.default)(v,{name:"MuiButtonBase"})(y);exports.default=h;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","react-dom":"NKHc","clsx":"WLGK","@material-ui/utils":"gEhD","../utils/useForkRef":"eYEl","../utils/useEventCallback":"AH47","../styles/withStyles":"awmK","../utils/useIsFocusVisible":"Z9bb","./TouchRipple":"gOR6"}],"VX66":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ButtonBase"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ButtonBase":"UfHt"}],"Dk4Y":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=r;var e=require("@material-ui/utils");function r(r){if("string"!=typeof r)throw new Error((0,e.formatMuiErrorMessage)(7));return r.charAt(0).toUpperCase()+r.slice(1)}
},{"@material-ui/utils":"gEhD"}],"pMiF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=u(require("@babel/runtime/helpers/esm/extends")),r=s(require("react")),o=u(require("prop-types")),a=u(require("clsx")),i=u(require("../styles/withStyles")),n=u(require("../ButtonBase")),d=u(require("../utils/capitalize"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return{root:(0,t.default)({},e.typography.button,{boxSizing:"border-box",minHeight:36,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,boxShadow:e.shadows[6],"&:active":{boxShadow:e.shadows[12]},color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],"&:hover":{backgroundColor:e.palette.grey.A100,"@media (hover: none)":{backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground},textDecoration:"none"},"&$focusVisible":{boxShadow:e.shadows[6]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},primary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},secondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},extended:{borderRadius:24,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48,"&$sizeSmall":{width:"auto",padding:"0 8px",borderRadius:17,minWidth:34,height:34},"&$sizeMedium":{width:"auto",padding:"0 16px",borderRadius:20,minWidth:40,height:40}},focusVisible:{},disabled:{},colorInherit:{color:"inherit"},sizeSmall:{width:40,height:40},sizeMedium:{width:48,height:48}}};exports.styles=c;var p=r.forwardRef(function(o,i){var l=o.children,s=o.classes,u=o.className,c=o.color,p=void 0===c?"default":c,b=o.component,h=void 0===b?"button":b,f=o.disabled,m=void 0!==f&&f,g=o.disableFocusRipple,y=void 0!==g&&g,v=o.focusVisibleClassName,x=o.size,w=void 0===x?"large":x,k=o.variant,C=void 0===k?"round":k,j=(0,e.default)(o,["children","classes","className","color","component","disabled","disableFocusRipple","focusVisibleClassName","size","variant"]);return r.createElement(n.default,(0,t.default)({className:(0,a.default)(s.root,u,"round"!==C&&s.extended,"large"!==w&&s["size".concat((0,d.default)(w))],m&&s.disabled,{primary:s.primary,secondary:s.secondary,inherit:s.colorInherit}[p]),component:h,disabled:m,focusRipple:!y,focusVisibleClassName:(0,a.default)(s.focusVisible,v),ref:i},j),r.createElement("span",{className:s.label},l))}),b=(0,i.default)(c,{name:"MuiFab"})(p);exports.default=b;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../ButtonBase":"VX66","../utils/capitalize":"Dk4Y"}],"ULTl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Fab"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Fab":"pMiF"}],"wHEg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=s(require("@babel/runtime/helpers/esm/extends")),t=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=c(require("react")),o=s(require("prop-types")),i=s(require("clsx")),l=s(require("../styles/withStyles")),n=s(require("../utils/capitalize"));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var l=o?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}};exports.styles=u;var f=r.forwardRef(function(o,l){var a=o.children,c=o.classes,s=o.className,u=o.color,f=void 0===u?"inherit":u,p=o.component,d=void 0===p?"svg":p,m=o.fontSize,y=void 0===m?"default":m,v=o.htmlColor,h=o.titleAccess,S=o.viewBox,b=void 0===S?"0 0 24 24":S,x=(0,t.default)(o,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return r.createElement(d,(0,e.default)({className:(0,i.default)(c.root,s,"inherit"!==f&&c["color".concat((0,n.default)(f))],"default"!==y&&c["fontSize".concat((0,n.default)(y))]),focusable:"false",viewBox:b,color:v,"aria-hidden":!h||void 0,role:h?"img":void 0,ref:l},x),a,h?r.createElement("title",null,h):null)});f.muiName="SvgIcon";var p=(0,l.default)(u,{name:"MuiSvgIcon"})(f);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y"}],"R8TJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./SvgIcon"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./SvgIcon":"wHEg"}],"oFSb":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("@material-ui/core/SvgIcon")),t=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}const a=r=>t.default.createElement(e.default,r,t.default.createElement("path",{d:"M12,2 C6.48,2 2,6.48 2,12 C2,17.52 6.48,22 12,22 C17.52,22 22,17.52 22,12 C22,6.48 17.52,2 12,2 Z M10,16.5 L10,7.5 L16,12 L10,16.5 Z",id:"path-1"}));var u=a;exports.default=u;
},{"@material-ui/core/SvgIcon":"R8TJ","react":"n8MK"}],"j2yx":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var L=t(require("@material-ui/core/SvgIcon")),e=t(require("react"));function t(L){return L&&L.__esModule?L:{default:L}}const r=t=>e.default.createElement(L.default,t,e.default.createElement("path",{d:"M20,8 L17.19,8 C16.74,7.22 16.12,6.55 15.37,6.04 L17,4.41 L15.59,3 L13.42,5.17 C12.96,5.06 12.49,5 12,5 C11.51,5 11.04,5.06 10.59,5.17 L8.41,3 L7,4.41 L8.62,6.04 C7.88,6.55 7.26,7.22 6.81,8 L4,8 L4,10 L6.09,10 C6.04,10.33 6,10.66 6,11 L6,12 L4,12 L4,14 L6,14 L6,15 C6,15.34 6.04,15.67 6.09,16 L4,16 L4,18 L6.81,18 C7.85,19.79 9.78,21 12,21 C14.22,21 16.15,19.79 17.19,18 L20,18 L20,16 L17.91,16 C17.96,15.67 18,15.34 18,15 L18,14 L20,14 L20,12 L18,12 L18,11 C18,10.66 17.96,10.33 17.91,10 L20,10 L20,8 Z M14,16 L10,16 L10,14 L14,14 L14,16 Z M14,12 L10,12 L10,10 L14,10 L14,12 Z",id:"path-1"}));var a=r;exports.default=a;
},{"@material-ui/core/SvgIcon":"R8TJ","react":"n8MK"}],"F9ww":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},a=e;exports.default=a;
},{}],"VaO6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},d=e;exports.default=d;
},{}],"wOXp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},f=e;exports.default=f;
},{}],"rb1J":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},f=e;exports.default=f;
},{}],"PWYi":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},d=e;exports.default=d;
},{}],"cl6f":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},f=e;exports.default=f;
},{}],"wRDc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},f=e;exports.default=f;
},{}],"wx2g":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var f={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"},e=f;exports.default=e;
},{}],"Hys6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var f={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},e=f;exports.default=e;
},{}],"lax9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var f={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},e=f;exports.default=e;
},{}],"VJe7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},d=e;exports.default=d;
},{}],"vVWC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"},c=e;exports.default=c;
},{}],"YrHg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"common",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"red",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"pink",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"purple",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"deepPurple",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"indigo",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"blue",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"lightBlue",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"cyan",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"teal",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"green",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"lightGreen",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(exports,"lime",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(exports,"yellow",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"amber",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(exports,"orange",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(exports,"deepOrange",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(exports,"brown",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"grey",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(exports,"blueGrey",{enumerable:!0,get:function(){return P.default}});var e=j(require("./common")),r=j(require("./red")),t=j(require("./pink")),n=j(require("./purple")),u=j(require("./deepPurple")),o=j(require("./indigo")),i=j(require("./blue")),l=j(require("./lightBlue")),f=j(require("./cyan")),p=j(require("./teal")),a=j(require("./green")),d=j(require("./lightGreen")),b=j(require("./lime")),c=j(require("./yellow")),g=j(require("./amber")),y=j(require("./orange")),m=j(require("./deepOrange")),s=j(require("./brown")),O=j(require("./grey")),P=j(require("./blueGrey"));function j(e){return e&&e.__esModule?e:{default:e}}
},{"./common":"DyYm","./red":"kzD0","./pink":"orzA","./purple":"F9ww","./deepPurple":"VaO6","./indigo":"S7CI","./blue":"qweW","./lightBlue":"wOXp","./cyan":"rb1J","./teal":"PWYi","./green":"fqHu","./lightGreen":"cl6f","./lime":"wRDc","./yellow":"wx2g","./amber":"Hys6","./orange":"VeQ7","./deepOrange":"lax9","./brown":"VJe7","./grey":"jh9N","./blueGrey":"vVWC"}],"ftFk":[function(require,module,exports) {
"use strict";function e(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.reduce(function(e,r){return null==r?e:function(){for(var t=arguments.length,n=new Array(t),u=0;u<t;u++)n[u]=arguments[u];e.apply(this,n),r.apply(this,n)}},function(){})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"VtCQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;var e=u(require("@babel/runtime/helpers/esm/extends")),r=u(require("react")),t=u(require("../SvgIcon"));function u(e){return e&&e.__esModule?e:{default:e}}function a(u,a){var f=function(a,f){return r.default.createElement(t.default,(0,e.default)({ref:f},a),u)};return f.muiName=t.default.muiName,r.default.memo(r.default.forwardRef(f))}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","../SvgIcon":"R8TJ"}],"TiOe":[function(require,module,exports) {
"use strict";function e(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=arguments[u];var i=this;clearTimeout(t),t=setTimeout(function(){e.apply(i,o)},r)}return n.clear=function(){clearTimeout(t)},n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"dy9R":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=n;var e=r(require("react"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=u?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function n(t,r){return e.isValidElement(t)&&-1!==r.indexOf(t.type.muiName)}
},{"react":"n8MK"}],"Xj2I":[function(require,module,exports) {
"use strict";function e(e){return e&&e.ownerDocument||document}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"EE4R":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=t(require("./ownerDocument"));function t(e){return e&&e.__esModule?e:{default:e}}function u(t){return(0,e.default)(t).defaultView||window}
},{"./ownerDocument":"Xj2I"}],"Hmdm":[function(require,module,exports) {
"use strict";function e(e){return function(){return null}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"WHmv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=n;var e=r(require("react"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function n(t){var r=t.controlled,n=t.default,u=(t.name,t.state,e.useRef(void 0!==r).current),o=e.useState(n),a=o[0],f=o[1];return[u?r:a,e.useCallback(function(e){u||f(e)},[])]}
},{"react":"n8MK"}],"yA5c":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=n;var e=r(require("react"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function n(t){var r=e.useState(t),n=r[0],u=r[1],o=t||n;return e.useEffect(function(){null==n&&u("mui-".concat(Math.round(1e5*Math.random())))},[n]),o}
},{"react":"n8MK"}],"TtkM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"capitalize",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"createChainedFunction",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"createSvgIcon",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"debounce",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"deprecatedPropType",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"isMuiElement",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"ownerDocument",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"ownerWindow",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"requirePropFactory",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"setRef",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"unsupportedProp",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(exports,"useControlled",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"useEventCallback",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"useForkRef",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"unstable_useId",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(exports,"useIsFocusVisible",{enumerable:!0,get:function(){return P.default}});var e=y(require("./capitalize")),r=y(require("./createChainedFunction")),t=y(require("./createSvgIcon")),u=y(require("./debounce")),n=y(require("./deprecatedPropType")),o=y(require("./isMuiElement")),i=y(require("./ownerDocument")),c=y(require("./ownerWindow")),a=y(require("./requirePropFactory")),f=y(require("./setRef")),d=y(require("./unsupportedProp")),l=y(require("./useControlled")),p=y(require("./useEventCallback")),s=y(require("./useForkRef")),b=y(require("./unstable_useId")),P=y(require("./useIsFocusVisible"));function y(e){return e&&e.__esModule?e:{default:e}}
},{"./capitalize":"Dk4Y","./createChainedFunction":"ftFk","./createSvgIcon":"VtCQ","./debounce":"TiOe","./deprecatedPropType":"cGcv","./isMuiElement":"dy9R","./ownerDocument":"Xj2I","./ownerWindow":"EE4R","./requirePropFactory":"Hmdm","./setRef":"IV4i","./unsupportedProp":"PmB2","./useControlled":"WHmv","./useEventCallback":"AH47","./useForkRef":"eYEl","./unstable_useId":"yA5c","./useIsFocusVisible":"Z9bb"}],"XSHU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=l;var e=a(require("./arrayWithHoles.js")),r=a(require("./iterableToArray.js")),t=a(require("./unsupportedIterableToArray.js")),u=a(require("./nonIterableRest.js"));function a(e){return e&&e.__esModule?e:{default:e}}function l(a){return(0,e.default)(a)||(0,r.default)(a)||(0,t.default)(a)||(0,u.default)()}
},{"./arrayWithHoles.js":"EbiA","./iterableToArray.js":"bG0g","./unsupportedIterableToArray.js":"AOxl","./nonIterableRest.js":"Kh3j"}],"Q3zR":[function(require,module,exports) {
"use strict";module.exports=require("./cjs/react-is.production.min.js");
},{"./cjs/react-is.production.min.js":"KknP"}],"DLys":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getTransitionProps=t,exports.reflow=void 0;var e=function(e){return e.scrollTop};function t(e,t){var o=e.timeout,r=e.style,n=void 0===r?{}:r;return{duration:n.transitionDuration||"number"==typeof o?o:o[t.mode]||0,delay:n.transitionDelay}}exports.reflow=e;
},{}],"ivfG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=h(require("@babel/runtime/helpers/esm/extends")),t=h(require("@babel/runtime/helpers/esm/slicedToArray")),n=h(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),i=h(require("clsx")),o=h(require("prop-types")),u=require("react-transition-group"),a=h(require("../styles/withStyles")),s=require("../styles/transitions"),l=require("../transitions/utils"),c=h(require("../styles/useTheme")),d=require("../utils");function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function h(e){return e&&e.__esModule?e:{default:e}}var m=function(e){return{container:{height:0,overflow:"hidden",transition:e.transitions.create("height")},entered:{height:"auto",overflow:"visible"},hidden:{visibility:"hidden"},wrapper:{display:"flex"},wrapperInner:{width:"100%"}}};exports.styles=m;var y=r.forwardRef(function(o,a){var f=o.children,p=o.classes,h=o.className,m=o.collapsedHeight,y=void 0===m?"0px":m,v=o.component,g=void 0===v?"div":v,x=o.disableStrictModeCompat,E=void 0!==x&&x,b=o.in,w=o.onEnter,q=o.onEntered,M=o.onEntering,O=o.onExit,P=o.onExited,T=o.onExiting,j=o.style,D=o.timeout,H=void 0===D?s.duration.standard:D,R=o.TransitionComponent,_=void 0===R?u.Transition:R,C=(0,n.default)(o,["children","classes","className","collapsedHeight","component","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),N=(0,c.default)(),A=r.useRef(),S=r.useRef(null),k=r.useRef(),W="number"==typeof y?"".concat(y,"px"):y;r.useEffect(function(){return function(){clearTimeout(A.current)}},[]);var I=N.unstable_strictMode&&!E,F=r.useRef(null),L=(0,d.useForkRef)(a,I?F:void 0),z=function(e){return function(n,r){if(e){var i=I?[F.current,n]:[n,r],o=(0,t.default)(i,2),u=o[0],a=o[1];void 0===a?e(u):e(u,a)}}},B=z(function(e,t){e.style.height=W,w&&w(e,t)}),G=z(function(e,t){var n=S.current?S.current.clientHeight:0,r=(0,l.getTransitionProps)({style:j,timeout:H},{mode:"enter"}).duration;if("auto"===H){var i=N.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(i,"ms"),k.current=i}else e.style.transitionDuration="string"==typeof r?r:"".concat(r,"ms");e.style.height="".concat(n,"px"),M&&M(e,t)}),J=z(function(e,t){e.style.height="auto",q&&q(e,t)}),K=z(function(e){var t=S.current?S.current.clientHeight:0;e.style.height="".concat(t,"px"),O&&O(e)}),Q=z(P),U=z(function(e){var t=S.current?S.current.clientHeight:0,n=(0,l.getTransitionProps)({style:j,timeout:H},{mode:"exit"}).duration;if("auto"===H){var r=N.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(r,"ms"),k.current=r}else e.style.transitionDuration="string"==typeof n?n:"".concat(n,"ms");e.style.height=W,T&&T(e)});return r.createElement(_,(0,e.default)({in:b,onEnter:B,onEntered:J,onEntering:G,onExit:K,onExited:Q,onExiting:U,addEndListener:function(e,t){var n=I?e:t;"auto"===H&&(A.current=setTimeout(n,k.current||0))},nodeRef:I?F:void 0,timeout:"auto"===H?null:H},C),function(t,n){return r.createElement(g,(0,e.default)({className:(0,i.default)(p.container,h,{entered:p.entered,exited:!b&&"0px"===W&&p.hidden}[t]),style:(0,e.default)({minHeight:W},j),ref:L},n),r.createElement("div",{className:p.wrapper,ref:S},r.createElement("div",{className:p.wrapperInner},f)))})});y.muiSupportAuto=!0;var v=(0,a.default)(m,{name:"MuiCollapse"})(y);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","clsx":"WLGK","prop-types":"D9Od","react-transition-group":"ORBw","../styles/withStyles":"awmK","../styles/transitions":"geVf","../transitions/utils":"DLys","../styles/useTheme":"nmB4","../utils":"TtkM"}],"uPhD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Collapse"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Collapse":"ivfG"}],"oZim":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=l(require("@babel/runtime/helpers/esm/extends")),r=s(require("react")),o=l(require("prop-types")),a=l(require("clsx")),n=require("@material-ui/utils"),i=l(require("../styles/withStyles"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=o?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(r,a,n):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var d=function(e){var r={};return e.shadows.forEach(function(e,t){r["elevation".concat(t)]={boxShadow:e}}),(0,t.default)({root:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,transition:e.transitions.create("box-shadow")},rounded:{borderRadius:e.shape.borderRadius},outlined:{border:"1px solid ".concat(e.palette.divider)}},r)};exports.styles=d;var c=r.forwardRef(function(o,n){var i=o.classes,u=o.className,s=o.component,l=void 0===s?"div":s,d=o.square,c=void 0!==d&&d,p=o.elevation,f=void 0===p?1:p,v=o.variant,b=void 0===v?"elevation":v,y=(0,e.default)(o,["classes","className","component","square","elevation","variant"]);return r.createElement(l,(0,t.default)({className:(0,a.default)(i.root,u,"outlined"===b?i.outlined:i["elevation".concat(f)],!c&&i.rounded),ref:n},y))}),p=(0,i.default)(d,{name:"MuiPaper"})(c);exports.default=p;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/withStyles":"awmK"}],"mtQp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Paper"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Paper":"oZim"}],"LwO6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("react"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}var n=e.createContext({});var o=n;exports.default=o;
},{"react":"n8MK"}],"LEPo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=h(require("@babel/runtime/helpers/esm/extends")),r=h(require("@babel/runtime/helpers/esm/toArray")),t=h(require("@babel/runtime/helpers/esm/slicedToArray")),o=h(require("@babel/runtime/helpers/esm/objectWithoutProperties")),a=m(require("react")),i=require("react-is"),n=h(require("prop-types")),d=h(require("clsx")),s=require("@material-ui/utils"),u=h(require("../Collapse")),l=h(require("../Paper")),p=h(require("../styles/withStyles")),c=h(require("./AccordionContext")),f=h(require("../utils/useControlled"));function b(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return b=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=b();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(t,a,i):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function h(e){return e&&e.__esModule?e:{default:e}}var y=function(e){var r={duration:e.transitions.duration.shortest};return{root:{position:"relative",transition:e.transitions.create(["margin"],r),"&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:e.palette.divider,transition:e.transitions.create(["opacity","background-color"],r)},"&:first-child":{"&:before":{display:"none"}},"&$expanded":{margin:"16px 0","&:first-child":{marginTop:0},"&:last-child":{marginBottom:0},"&:before":{opacity:0}},"&$expanded + &":{"&:before":{display:"none"}},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},rounded:{borderRadius:0,"&:first-child":{borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius},"&:last-child":{borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},expanded:{},disabled:{}}};exports.styles=y;var g=a.forwardRef(function(i,n){var s=i.children,p=i.classes,b=i.className,m=i.defaultExpanded,h=void 0!==m&&m,y=i.disabled,g=void 0!==y&&y,v=i.expanded,x=i.onChange,q=i.square,R=void 0!==q&&q,C=i.TransitionComponent,P=void 0===C?u.default:C,O=i.TransitionProps,j=(0,o.default)(i,["children","classes","className","defaultExpanded","disabled","expanded","onChange","square","TransitionComponent","TransitionProps"]),T=(0,f.default)({controlled:v,default:h,name:"Accordion",state:"expanded"}),k=(0,t.default)(T,2),M=k[0],w=k[1],A=a.useCallback(function(e){w(!M),x&&x(e,!M)},[M,x,w]),B=a.Children.toArray(s),E=(0,r.default)(B),_=E[0],L=E.slice(1),N=a.useMemo(function(){return{expanded:M,disabled:g,toggle:A}},[M,g,A]);return a.createElement(l.default,(0,e.default)({className:(0,d.default)(p.root,b,M&&p.expanded,g&&p.disabled,!R&&p.rounded),ref:n,square:R},j),a.createElement(c.default.Provider,{value:N},_),a.createElement(P,(0,e.default)({in:M,timeout:"auto"},O),a.createElement("div",{"aria-labelledby":_.props.id,id:_.props["aria-controls"],role:"region"},L)))}),v=(0,p.default)(y,{name:"MuiAccordion"})(g);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/toArray":"XSHU","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../Collapse":"uPhD","../Paper":"mtQp","../styles/withStyles":"awmK","./AccordionContext":"LwO6","../utils/useControlled":"WHmv"}],"vMe9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Accordion"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Accordion":"LEPo"}],"zuhy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=o(require("react")),n=u(require("prop-types")),s=u(require("clsx")),a=u(require("../styles/withStyles"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var l={root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end"},spacing:{"& > :not(:first-child)":{marginLeft:8}}};exports.styles=l;var c=r.forwardRef(function(n,a){var i=n.classes,o=n.className,u=n.disableSpacing,l=void 0!==u&&u,c=(0,t.default)(n,["classes","className","disableSpacing"]);return r.createElement("div",(0,e.default)({className:(0,s.default)(i.root,o,!l&&i.spacing),ref:a},c))}),f=(0,a.default)(l,{name:"MuiAccordionActions"})(c);exports.default=f;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"sbWD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./AccordionActions"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./AccordionActions":"zuhy"}],"hyQ4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=o(require("react")),s=i(require("prop-types")),n=i(require("clsx")),u=i(require("../styles/withStyles"));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a();if(r&&r.has(e))return r.get(e);var t={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var u=s?Object.getOwnPropertyDescriptor(e,n):null;u&&(u.get||u.set)?Object.defineProperty(t,n,u):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return{root:{display:"flex",padding:e.spacing(1,2,2)}}};exports.styles=l;var f=t.forwardRef(function(s,u){var a=s.classes,o=s.className,i=(0,r.default)(s,["classes","className"]);return t.createElement("div",(0,e.default)({className:(0,n.default)(a.root,o),ref:u},i))}),c=(0,u.default)(l,{name:"MuiAccordionDetails"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"QKcG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./AccordionDetails"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./AccordionDetails":"hyQ4"}],"WIeT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=p(require("@babel/runtime/helpers/esm/extends")),t=p(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),a=p(require("prop-types")),o=p(require("clsx")),i=require("@material-ui/utils"),n=p(require("../styles/withStyles")),l=require("../styles/colorManipulator"),s=p(require("../ButtonBase")),d=p(require("../utils/capitalize"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:e.palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:(0,l.fade)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:e.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,l.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,l.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:e.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}};exports.styles=f;var m=r.forwardRef(function(a,i){var n=a.edge,l=void 0!==n&&n,c=a.children,u=a.classes,p=a.className,f=a.color,m=void 0===f?"default":f,b=a.disabled,y=void 0!==b&&b,g=a.disableFocusRipple,v=void 0!==g&&g,h=a.size,x=void 0===h?"medium":h,O=(0,t.default)(a,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return r.createElement(s.default,(0,e.default)({className:(0,o.default)(u.root,p,"default"!==m&&u["color".concat((0,d.default)(m))],y&&u.disabled,"small"===x&&u["size".concat((0,d.default)(x))],{start:u.edgeStart,end:u.edgeEnd}[l]),centerRipple:!0,focusRipple:!v,disabled:y,ref:i},O),r.createElement("span",{className:u.label},c))}),b=(0,n.default)(f,{name:"MuiIconButton"})(m);exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/withStyles":"awmK","../styles/colorManipulator":"aguB","../ButtonBase":"VX66","../utils/capitalize":"Dk4Y"}],"e0Nd":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./IconButton"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./IconButton":"WIeT"}],"nDBT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),n=c(require("prop-types")),o=c(require("clsx")),a=c(require("../ButtonBase")),i=c(require("../IconButton")),s=c(require("../styles/withStyles")),d=c(require("../Accordion/AccordionContext"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var p=function(e){var t={duration:e.transitions.duration.shortest};return{root:{display:"flex",minHeight:48,transition:e.transitions.create(["min-height","background-color"],t),padding:e.spacing(0,2),"&:hover:not($disabled)":{cursor:"pointer"},"&$expanded":{minHeight:64},"&$focused":{backgroundColor:e.palette.action.focus},"&$disabled":{opacity:e.palette.action.disabledOpacity}},expanded:{},focused:{},disabled:{},content:{display:"flex",flexGrow:1,transition:e.transitions.create(["margin"],t),margin:"12px 0","&$expanded":{margin:"20px 0"}},expandIcon:{transform:"rotate(0deg)",transition:e.transitions.create("transform",t),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"rotate(180deg)"}}}};exports.styles=p;var f=r.forwardRef(function(n,s){var l=n.children,u=n.classes,c=n.className,p=n.expandIcon,f=n.IconButtonProps,x=n.onBlur,b=n.onClick,m=n.onFocusVisible,g=(0,t.default)(n,["children","classes","className","expandIcon","IconButtonProps","onBlur","onClick","onFocusVisible"]),y=r.useState(!1),v=y[0],h=y[1],O=r.useContext(d.default),q=O.disabled,P=void 0!==q&&q,j=O.expanded,k=O.toggle;return r.createElement(a.default,(0,e.default)({focusRipple:!1,disableRipple:!0,disabled:P,component:"div","aria-expanded":j,className:(0,o.default)(u.root,c,P&&u.disabled,j&&u.expanded,v&&u.focused),onFocusVisible:function(e){h(!0),m&&m(e)},onBlur:function(e){h(!1),x&&x(e)},onClick:function(e){k&&k(e),b&&b(e)},ref:s},g),r.createElement("div",{className:(0,o.default)(u.content,j&&u.expanded)},l),p&&r.createElement(i.default,(0,e.default)({className:(0,o.default)(u.expandIcon,j&&u.expanded),edge:"end",component:"div",tabIndex:null,role:null,"aria-hidden":!0},f),p))}),x=(0,s.default)(p,{name:"MuiAccordionSummary"})(f);exports.default=x;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../ButtonBase":"VX66","../IconButton":"e0Nd","../styles/withStyles":"awmK","../Accordion/AccordionContext":"LwO6"}],"FLo1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./AccordionSummary"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./AccordionSummary":"nDBT"}],"XUuQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),o=u(require("prop-types")),i=u(require("clsx")),a=u(require("../styles/withStyles")),n=u(require("../utils/capitalize")),l=u(require("../Paper"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0,"@media print":{position:"absolute"}},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorInherit:{color:"inherit"},colorTransparent:{backgroundColor:"transparent",color:"inherit"}}};exports.styles=c;var f=r.forwardRef(function(o,a){var s=o.classes,p=o.className,u=o.color,c=void 0===u?"primary":u,f=o.position,d=void 0===f?"fixed":f,y=(0,t.default)(o,["classes","className","color","position"]);return r.createElement(l.default,(0,e.default)({square:!0,component:"header",elevation:4,className:(0,i.default)(s.root,s["position".concat((0,n.default)(d))],s["color".concat((0,n.default)(c))],p,"fixed"===d&&"mui-fixed"),ref:a},y))}),d=(0,a.default)(c,{name:"MuiAppBar"})(f);exports.default=d;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y","../Paper":"mtQp"}],"vztC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./AppBar"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./AppBar":"XUuQ"}],"LuYm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"KSVB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=u(require("react")),n=c(require("prop-types")),a=c(require("clsx")),o=require("@material-ui/utils"),i=c(require("../styles/withStyles")),l=c(require("../internal/svg-icons/Person"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(t,a,o):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:e.palette.background.default,backgroundColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},circle:{},circular:{},rounded:{borderRadius:e.shape.borderRadius},square:{borderRadius:0},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4},fallback:{width:"75%",height:"75%"}}};function d(e){var r=e.src,n=e.srcSet,a=t.useState(!1),o=a[0],i=a[1];return t.useEffect(function(){if(r||n){i(!1);var e=!0,t=new Image;return t.src=r,t.srcSet=n,t.onload=function(){e&&i("loaded")},t.onerror=function(){e&&i("error")},function(){e=!1}}},[r,n]),o}exports.styles=f;var p=t.forwardRef(function(n,o){var i=n.alt,s=n.children,u=n.classes,c=n.className,f=n.component,p=void 0===f?"div":f,m=n.imgProps,y=n.sizes,g=n.src,h=n.srcSet,v=n.variant,b=void 0===v?"circle":v,x=(0,r.default)(n,["alt","children","classes","className","component","imgProps","sizes","src","srcSet","variant"]),w=null,S=d({src:g,srcSet:h}),j=g||h,P=j&&"error"!==S;return w=P?t.createElement("img",(0,e.default)({alt:i,src:g,srcSet:h,sizes:y,className:u.img},m)):null!=s?s:j&&i?i[0]:t.createElement(l.default,{className:u.fallback}),t.createElement(p,(0,e.default)({className:(0,a.default)(u.root,u.system,u[b],c,!P&&u.colorDefault),ref:o},x),w)}),m=(0,i.default)(f,{name:"MuiAvatar"})(p);exports.default=m;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/withStyles":"awmK","../internal/svg-icons/Person":"LuYm"}],"NALm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Avatar"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Avatar":"KSVB"}],"g10U":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),t=f(require("@babel/runtime/helpers/esm/slicedToArray")),r=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=c(require("react")),i=f(require("prop-types")),o=require("react-transition-group"),a=require("../styles/transitions"),u=f(require("../styles/useTheme")),s=require("../transitions/utils"),l=f(require("../utils/useForkRef"));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}var p={entering:{opacity:1},entered:{opacity:1}},y={enter:a.duration.enteringScreen,exit:a.duration.leavingScreen},v=n.forwardRef(function(i,a){var d=i.children,c=i.disableStrictModeCompat,f=void 0!==c&&c,v=i.in,b=i.onEnter,m=i.onEntered,E=i.onEntering,g=i.onExit,x=i.onExited,h=i.onExiting,q=i.style,O=i.TransitionComponent,P=void 0===O?o.Transition:O,T=i.timeout,j=void 0===T?y:T,w=(0,r.default)(i,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","TransitionComponent","timeout"]),M=(0,u.default)(),_=M.unstable_strictMode&&!f,k=n.useRef(null),C=(0,l.default)(d.ref,a),R=(0,l.default)(_?k:void 0,C),S=function(e){return function(r,n){if(e){var i=_?[k.current,r]:[r,n],o=(0,t.default)(i,2),a=o[0],u=o[1];void 0===u?e(a):e(a,u)}}},W=S(E),D=S(function(e,t){(0,s.reflow)(e);var r=(0,s.getTransitionProps)({style:q,timeout:j},{mode:"enter"});e.style.webkitTransition=M.transitions.create("opacity",r),e.style.transition=M.transitions.create("opacity",r),b&&b(e,t)}),A=S(m),F=S(h),z=S(function(e){var t=(0,s.getTransitionProps)({style:q,timeout:j},{mode:"exit"});e.style.webkitTransition=M.transitions.create("opacity",t),e.style.transition=M.transitions.create("opacity",t),g&&g(e)}),B=S(x);return n.createElement(P,(0,e.default)({appear:!0,in:v,nodeRef:_?k:void 0,onEnter:D,onEntered:A,onEntering:W,onExit:z,onExited:B,onExiting:F,timeout:j},w),function(t,r){return n.cloneElement(d,(0,e.default)({style:(0,e.default)({opacity:0,visibility:"exited"!==t||v?void 0:"hidden"},p[t],q,d.props.style),ref:R},r))})}),b=v;exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","react-transition-group":"ORBw","../styles/transitions":"geVf","../styles/useTheme":"nmB4","../transitions/utils":"DLys","../utils/useForkRef":"eYEl"}],"yr6S":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Fade"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Fade":"g10U"}],"M9uP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=l(require("react")),n=u(require("prop-types")),i=u(require("clsx")),o=u(require("../styles/withStyles")),a=u(require("../Fade"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var p={root:{zIndex:-1,position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}};exports.styles=p;var f=r.forwardRef(function(n,o){var s=n.children,l=n.classes,u=n.className,p=n.invisible,f=void 0!==p&&p,c=n.open,d=n.transitionDuration,b=n.TransitionComponent,v=void 0===b?a.default:b,y=(0,t.default)(n,["children","classes","className","invisible","open","transitionDuration","TransitionComponent"]);return r.createElement(v,(0,e.default)({in:c,timeout:d},y),r.createElement("div",{className:(0,i.default)(l.root,u,f&&l.invisible),"aria-hidden":!0,ref:o},s))}),c=(0,o.default)(p,{name:"MuiBackdrop"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Fade":"yr6S"}],"iPmI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Backdrop"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Backdrop":"M9uP"}],"AZtf":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var t=c(require("@babel/runtime/helpers/esm/extends")),e=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=s(require("react")),a=c(require("prop-types")),n=c(require("clsx")),i=c(require("../styles/withStyles")),o=c(require("../utils/capitalize"));function l(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return l=function(){return t},t}function s(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=l();if(e&&e.has(t))return e.get(t);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var i=a?Object.getOwnPropertyDescriptor(t,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=t[n]}return r.default=t,e&&e.set(t,r),r}function c(t){return t&&t.__esModule?t:{default:t}}var f=10,d=4,u=function(t){return{root:{position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0},badge:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(12),minWidth:2*f,lineHeight:1,padding:"0 6px",height:2*f,borderRadius:f,zIndex:1,transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.enteringScreen})},colorPrimary:{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText},colorSecondary:{backgroundColor:t.palette.secondary.main,color:t.palette.secondary.contrastText},colorError:{backgroundColor:t.palette.error.main,color:t.palette.error.contrastText},dot:{borderRadius:d,height:2*d,minWidth:2*d,padding:0},anchorOriginTopRightRectangle:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%","&$invisible":{transform:"scale(0) translate(50%, -50%)"}},anchorOriginBottomRightRectangle:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%","&$invisible":{transform:"scale(0) translate(50%, 50%)"}},anchorOriginTopLeftRectangle:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%","&$invisible":{transform:"scale(0) translate(-50%, -50%)"}},anchorOriginBottomLeftRectangle:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%","&$invisible":{transform:"scale(0) translate(-50%, 50%)"}},anchorOriginTopRightCircle:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%","&$invisible":{transform:"scale(0) translate(50%, -50%)"}},anchorOriginBottomRightCircle:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%","&$invisible":{transform:"scale(0) translate(50%, 50%)"}},anchorOriginTopLeftCircle:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%","&$invisible":{transform:"scale(0) translate(-50%, -50%)"}},anchorOriginBottomLeftCircle:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%","&$invisible":{transform:"scale(0) translate(-50%, 50%)"}},invisible:{transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.leavingScreen})}}};exports.styles=u;var p=r.forwardRef(function(a,i){var l=a.anchorOrigin,s=void 0===l?{vertical:"top",horizontal:"right"}:l,c=a.badgeContent,f=a.children,d=a.classes,u=a.className,p=a.color,g=void 0===p?"default":p,m=a.component,h=void 0===m?"span":m,b=a.invisible,v=a.max,y=void 0===v?99:v,O=a.overlap,x=void 0===O?"rectangle":O,R=a.showZero,C=void 0!==R&&R,w=a.variant,j=void 0===w?"standard":w,P=(0,e.default)(a,["anchorOrigin","badgeContent","children","classes","className","color","component","invisible","max","overlap","showZero","variant"]),T=b;null==b&&(0===c&&!C||null==c&&"dot"!==j)&&(T=!0);var W="";return"dot"!==j&&(W=c>y?"".concat(y,"+"):c),r.createElement(h,(0,t.default)({className:(0,n.default)(d.root,u),ref:i},P),f,r.createElement("span",{className:(0,n.default)(d.badge,d["".concat(s.horizontal).concat((0,o.default)(s.vertical),"}")],d["anchorOrigin".concat((0,o.default)(s.vertical)).concat((0,o.default)(s.horizontal)).concat((0,o.default)(x))],"default"!==g&&d["color".concat((0,o.default)(g))],T&&d.invisible,"dot"===j&&d.dot)},W))}),g=(0,i.default)(u,{name:"MuiBadge"})(p);exports.default=g;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y"}],"zSFR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Badge"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Badge":"AZtf"}],"oE4y":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=u(require("react")),o=require("react-is"),n=i(require("prop-types")),a=i(require("clsx")),l=i(require("../styles/withStyles"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=o?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(t,n,a):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function i(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:{display:"flex",justifyContent:"center",height:56,backgroundColor:e.palette.background.paper}}};exports.styles=p;var c=t.forwardRef(function(o,n){var l=o.children,s=o.classes,u=o.className,i=o.component,p=void 0===i?"div":i,c=o.onChange,f=o.showLabels,d=void 0!==f&&f,v=o.value,b=(0,r.default)(o,["children","classes","className","component","onChange","showLabels","value"]);return t.createElement(p,(0,e.default)({className:(0,a.default)(s.root,u),ref:n},b),t.Children.map(l,function(e,r){if(!t.isValidElement(e))return null;var o=void 0===e.props.value?r:e.props.value;return t.cloneElement(e,{selected:o===v,showLabel:void 0!==e.props.showLabel?e.props.showLabel:d,value:o,onChange:c})}))}),f=(0,l.default)(p,{name:"MuiBottomNavigation"})(c);exports.default=f;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"Roco":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./BottomNavigation"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./BottomNavigation":"oE4y"}],"LVUX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=p(require("@babel/runtime/helpers/esm/extends")),t=p(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=c(require("react")),n=p(require("prop-types")),o=p(require("clsx")),a=p(require("../styles/withStyles")),i=p(require("../ButtonBase")),l=p(require("../utils/unsupportedProp"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}var u=function(e){return{root:{transition:e.transitions.create(["color","padding-top"],{duration:e.transitions.duration.short}),padding:"6px 12px 8px",minWidth:80,maxWidth:168,color:e.palette.text.secondary,flex:"1","&$iconOnly":{paddingTop:16},"&$selected":{paddingTop:6,color:e.palette.primary.main}},selected:{},iconOnly:{},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"},label:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(12),opacity:1,transition:"font-size 0.2s, opacity 0.2s",transitionDelay:"0.1s","&$iconOnly":{opacity:0,transitionDelay:"0s"},"&$selected":{fontSize:e.typography.pxToRem(14)}}}};exports.styles=u;var f=r.forwardRef(function(n,a){var l=n.classes,s=n.className,c=n.icon,p=n.label,u=n.onChange,f=n.onClick,d=n.selected,y=n.showLabel,m=n.value,b=(0,t.default)(n,["classes","className","icon","label","onChange","onClick","selected","showLabel","value"]);return r.createElement(i.default,(0,e.default)({ref:a,className:(0,o.default)(l.root,s,d?l.selected:!y&&l.iconOnly),focusRipple:!0,onClick:function(e){u&&u(e,m),f&&f(e)}},b),r.createElement("span",{className:l.wrapper},c,r.createElement("span",{className:(0,o.default)(l.label,d?l.selected:!y&&l.iconOnly)},p)))}),d=(0,a.default)(u,{name:"MuiBottomNavigationAction"})(f);exports.default=d;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../ButtonBase":"VX66","../utils/unsupportedProp":"PmB2"}],"F2hw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./BottomNavigationAction"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./BottomNavigationAction":"LVUX"}],"LgNM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styleFunction=void 0;var e=require("@material-ui/system"),s=t(require("../styles/styled"));function t(e){return e&&e.__esModule?e:{default:e}}var r=(0,e.css)((0,e.compose)(e.borders,e.display,e.flexbox,e.grid,e.positions,e.palette,e.shadows,e.sizing,e.spacing,e.typography));exports.styleFunction=r;var o=(0,s.default)("div")(r,{name:"MuiBox"}),i=o;exports.default=i;
},{"@material-ui/system":"rbKt","../styles/styled":"SN5G"}],"VQeO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"styleFunction",{enumerable:!0,get:function(){return e.styleFunction}});var e=r(require("./Box"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var f=o?Object.getOwnPropertyDescriptor(e,u):null;f&&(f.get||f.set)?Object.defineProperty(n,u,f):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}
},{"./Box":"LgNM"}],"n1pN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var t=y(require("@babel/runtime/helpers/esm/extends")),e=y(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),o=y(require("prop-types")),a=y(require("clsx")),i=y(require("../styles/withStyles")),n=y(require("../utils/capitalize"));function l(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return l=function(){return t},t}function p(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=l();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,e&&e.set(t,r),r}function y(t){return t&&t.__esModule?t:{default:t}}var s=function(t){return{root:{margin:0},body2:t.typography.body2,body1:t.typography.body1,caption:t.typography.caption,button:t.typography.button,h1:t.typography.h1,h2:t.typography.h2,h3:t.typography.h3,h4:t.typography.h4,h5:t.typography.h5,h6:t.typography.h6,subtitle1:t.typography.subtitle1,subtitle2:t.typography.subtitle2,overline:t.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:t.palette.primary.main},colorSecondary:{color:t.palette.secondary.main},colorTextPrimary:{color:t.palette.text.primary},colorTextSecondary:{color:t.palette.text.secondary},colorError:{color:t.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}};exports.styles=s;var u={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},h=r.forwardRef(function(o,i){var l=o.align,p=void 0===l?"inherit":l,y=o.classes,s=o.className,h=o.color,c=void 0===h?"initial":h,d=o.component,g=o.display,f=void 0===g?"initial":g,b=o.gutterBottom,m=void 0!==b&&b,v=o.noWrap,x=void 0!==v&&v,w=o.paragraph,O=void 0!==w&&w,j=o.variant,P=void 0===j?"body1":j,M=o.variantMapping,q=void 0===M?u:M,B=(0,e.default)(o,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),W=d||(O?"p":q[P]||u[P])||"span";return r.createElement(W,(0,t.default)({className:(0,a.default)(y.root,s,"inherit"!==P&&y[P],"initial"!==c&&y["color".concat((0,n.default)(c))],x&&y.noWrap,m&&y.gutterBottom,O&&y.paragraph,"inherit"!==p&&y["align".concat((0,n.default)(p))],"initial"!==f&&y["display".concat((0,n.default)(f))]),ref:i},B))}),c=(0,i.default)(s,{name:"MuiTypography"})(h);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y"}],"pi2F":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Typography"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Typography":"n1pN"}],"BQME":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(r,u,a):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}var u=(0,t.default)(e.createElement("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz");exports.default=u;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"Pf8R":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=s(require("react")),o=c(require("prop-types")),a=c(require("../styles/withStyles")),n=require("../styles/colorManipulator"),u=c(require("../internal/svg-icons/MoreHoriz")),i=c(require("../ButtonBase"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=o?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(t,a,n):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function c(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:{display:"flex",marginLeft:e.spacing(.5),marginRight:e.spacing(.5),backgroundColor:e.palette.grey[100],color:e.palette.grey[700],borderRadius:2,cursor:"pointer","&:hover, &:focus":{backgroundColor:e.palette.grey[200]},"&:active":{boxShadow:e.shadows[0],backgroundColor:(0,n.emphasize)(e.palette.grey[200],.12)}},icon:{width:24,height:16}}};function f(o){var a=o.classes,n=(0,r.default)(o,["classes"]);return t.createElement(i.default,(0,e.default)({component:"li",className:a.root,focusRipple:!0},n),t.createElement(u.default,{className:a.icon}))}var d=(0,a.default)(p,{name:"PrivateBreadcrumbCollapsed"})(f);exports.default=d;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","../styles/withStyles":"awmK","../styles/colorManipulator":"aguB","../internal/svg-icons/MoreHoriz":"BQME","../ButtonBase":"VX66"}],"DymR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),t=f(require("@babel/runtime/helpers/esm/toConsumableArray")),r=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),a=p(require("react")),n=require("react-is"),l=f(require("prop-types")),o=f(require("clsx")),i=f(require("../styles/withStyles")),s=f(require("../Typography")),u=f(require("./BreadcrumbCollapsed"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}var d={root:{},ol:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"},li:{},separator:{display:"flex",userSelect:"none",marginLeft:8,marginRight:8}};function m(e,t,r){return e.reduce(function(n,l,o){return o<e.length-1?n=n.concat(l,a.createElement("li",{"aria-hidden":!0,key:"separator-".concat(o),className:t},r)):n.push(l),n},[])}exports.styles=d;var y=a.forwardRef(function(n,l){var i=n.children,c=n.classes,p=n.className,f=n.component,d=void 0===f?"nav":f,y=n.expandText,h=void 0===y?"Show path":y,b=n.itemsAfterCollapse,v=void 0===b?1:b,x=n.itemsBeforeCollapse,g=void 0===x?1:x,q=n.maxItems,O=void 0===q?8:q,j=n.separator,w=void 0===j?"/":j,C=(0,r.default)(n,["children","classes","className","component","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"]),N=a.useState(!1),P=N[0],S=N[1],k=a.Children.toArray(i).filter(function(e){return a.isValidElement(e)}).map(function(e,t){return a.createElement("li",{className:c.li,key:"child-".concat(t)},e)});return a.createElement(s.default,(0,e.default)({ref:l,component:d,color:"textSecondary",className:(0,o.default)(c.root,p)},C),a.createElement("ol",{className:c.ol},m(P||O&&k.length<=O?k:function(e){return g+v>=e.length?e:[].concat((0,t.default)(e.slice(0,g)),[a.createElement(u.default,{"aria-label":h,key:"ellipsis",onClick:function(e){S(!0);var t=e.currentTarget.parentNode.querySelector("a[href],button,[tabindex]");t&&t.focus()}})],(0,t.default)(e.slice(e.length-v,e.length)))}(k),c.separator,w)))}),h=(0,i.default)(d,{name:"MuiBreadcrumbs"})(y);exports.default=h;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/toConsumableArray":"Qv3s","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Typography":"pi2F","./BreadcrumbCollapsed":"Pf8R"}],"vn4F":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Breadcrumbs"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Breadcrumbs":"DymR"}],"e8Tw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=p(require("@babel/runtime/helpers/esm/objectWithoutProperties")),o=p(require("@babel/runtime/helpers/esm/extends")),a=s(require("react")),t=p(require("prop-types")),r=p(require("clsx")),i=p(require("../styles/withStyles")),n=require("../styles/colorManipulator"),d=p(require("../ButtonBase")),l=p(require("../utils/capitalize"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=c();if(o&&o.has(e))return o.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=t?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(a,r,i):a[r]=e[r]}return a.default=e,o&&o.set(e,a),a}function p(e){return e&&e.__esModule?e:{default:e}}var u=function(e){return{root:(0,o.default)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:(0,n.fade)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,n.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,n.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat((0,n.fade)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:(0,n.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat((0,n.fade)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:(0,n.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}};exports.styles=u;var b=a.forwardRef(function(t,i){var n=t.children,c=t.classes,s=t.className,p=t.color,u=void 0===p?"default":p,b=t.component,m=void 0===b?"button":b,h=t.disabled,f=void 0!==h&&h,y=t.disableElevation,g=void 0!==y&&y,x=t.disableFocusRipple,v=void 0!==x&&x,S=t.endIcon,k=t.focusVisibleClassName,z=t.fullWidth,C=void 0!==z&&z,w=t.size,R=void 0===w?"medium":w,O=t.startIcon,I=t.type,$=void 0===I?"button":I,P=t.variant,j=void 0===P?"text":P,q=(0,e.default)(t,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),N=O&&a.createElement("span",{className:(0,r.default)(c.startIcon,c["iconSize".concat((0,l.default)(R))])},O),T=S&&a.createElement("span",{className:(0,r.default)(c.endIcon,c["iconSize".concat((0,l.default)(R))])},S);return a.createElement(d.default,(0,o.default)({className:(0,r.default)(c.root,c[j],s,"inherit"===u?c.colorInherit:"default"!==u&&c["".concat(j).concat((0,l.default)(u))],"medium"!==R&&[c["".concat(j,"Size").concat((0,l.default)(R))],c["size".concat((0,l.default)(R))]],g&&c.disableElevation,f&&c.disabled,C&&c.fullWidth),component:m,disabled:f,focusRipple:!v,focusVisibleClassName:(0,r.default)(c.focusVisible,k),ref:i,type:$},q),a.createElement("span",{className:c.label},N,n,T))}),m=(0,i.default)(u,{name:"MuiButton"})(b);exports.default=m;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../styles/colorManipulator":"aguB","../ButtonBase":"VX66","../utils/capitalize":"Dk4Y"}],"uzLy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Button"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Button":"e8Tw"}],"x2oX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),o=p(require("react")),r=require("react-is"),i=c(require("prop-types")),a=c(require("clsx")),d=c(require("../utils/capitalize")),l=require("../styles/colorManipulator"),n=c(require("../styles/withStyles")),s=c(require("../Button"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,t&&t.set(e,o),o}function c(e){return e&&e.__esModule?e:{default:e}}s.default.styles;var b=function(e){return{root:{display:"inline-flex",borderRadius:e.shape.borderRadius},contained:{boxShadow:e.shadows[2]},disableElevation:{boxShadow:"none"},disabled:{},fullWidth:{width:"100%"},vertical:{flexDirection:"column"},grouped:{minWidth:40},groupedHorizontal:{"&:not(:first-child)":{borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-child)":{borderTopRightRadius:0,borderBottomRightRadius:0}},groupedVertical:{"&:not(:first-child)":{borderTopRightRadius:0,borderTopLeftRadius:0},"&:not(:last-child)":{borderBottomRightRadius:0,borderBottomLeftRadius:0}},groupedText:{},groupedTextHorizontal:{"&:not(:last-child)":{borderRight:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")}},groupedTextVertical:{"&:not(:last-child)":{borderBottom:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")}},groupedTextPrimary:{"&:not(:last-child)":{borderColor:(0,l.fade)(e.palette.primary.main,.5)}},groupedTextSecondary:{"&:not(:last-child)":{borderColor:(0,l.fade)(e.palette.secondary.main,.5)}},groupedOutlined:{},groupedOutlinedHorizontal:{"&:not(:first-child)":{marginLeft:-1},"&:not(:last-child)":{borderRightColor:"transparent"}},groupedOutlinedVertical:{"&:not(:first-child)":{marginTop:-1},"&:not(:last-child)":{borderBottomColor:"transparent"}},groupedOutlinedPrimary:{"&:hover":{borderColor:e.palette.primary.main}},groupedOutlinedSecondary:{"&:hover":{borderColor:e.palette.secondary.main}},groupedContained:{boxShadow:"none"},groupedContainedHorizontal:{"&:not(:last-child)":{borderRight:"1px solid ".concat(e.palette.grey[400]),"&$disabled":{borderRight:"1px solid ".concat(e.palette.action.disabled)}}},groupedContainedVertical:{"&:not(:last-child)":{borderBottom:"1px solid ".concat(e.palette.grey[400]),"&$disabled":{borderBottom:"1px solid ".concat(e.palette.action.disabled)}}},groupedContainedPrimary:{"&:not(:last-child)":{borderColor:e.palette.primary.dark}},groupedContainedSecondary:{"&:not(:last-child)":{borderColor:e.palette.secondary.dark}}}};exports.styles=b;var f=o.forwardRef(function(r,i){var l=r.children,n=r.classes,s=r.className,u=r.color,p=void 0===u?"default":u,c=r.component,b=void 0===c?"div":c,f=r.disabled,h=void 0!==f&&f,g=r.disableElevation,m=void 0!==g&&g,v=r.disableFocusRipple,y=void 0!==v&&v,R=r.disableRipple,x=void 0!==R&&R,C=r.fullWidth,O=void 0!==C&&C,w=r.orientation,q=void 0===w?"horizontal":w,z=r.size,B=void 0===z?"medium":z,P=r.variant,T=void 0===P?"outlined":P,E=(0,t.default)(r,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"]),W=(0,a.default)(n.grouped,n["grouped".concat((0,d.default)(q))],n["grouped".concat((0,d.default)(T))],n["grouped".concat((0,d.default)(T)).concat((0,d.default)(q))],n["grouped".concat((0,d.default)(T)).concat("default"!==p?(0,d.default)(p):"")],h&&n.disabled);return o.createElement(b,(0,e.default)({role:"group",className:(0,a.default)(n.root,s,O&&n.fullWidth,m&&n.disableElevation,"contained"===T&&n.contained,"vertical"===q&&n.vertical),ref:i},E),o.Children.map(l,function(e){return o.isValidElement(e)?o.cloneElement(e,{className:(0,a.default)(W,e.props.className),color:e.props.color||p,disabled:e.props.disabled||h,disableElevation:e.props.disableElevation||m,disableFocusRipple:y,disableRipple:x,fullWidth:O,size:e.props.size||B,variant:e.props.variant||T}):null}))}),h=(0,n.default)(b,{name:"MuiButtonGroup"})(f);exports.default=h;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","../utils/capitalize":"Dk4Y","../styles/colorManipulator":"aguB","../styles/withStyles":"awmK","../Button":"uzLy"}],"TCPp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ButtonGroup"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ButtonGroup":"x2oX"}],"SsYK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=l(require("react")),a=i(require("prop-types")),s=i(require("clsx")),u=i(require("../Paper")),o=i(require("../styles/withStyles"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var u=a?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(t,s,u):t[s]=e[s]}return t.default=e,r&&r.set(e,t),t}function i(e){return e&&e.__esModule?e:{default:e}}var f={root:{overflow:"hidden"}};exports.styles=f;var c=t.forwardRef(function(a,o){var n=a.classes,l=a.className,i=a.raised,f=void 0!==i&&i,c=(0,r.default)(a,["classes","className","raised"]);return t.createElement(u.default,(0,e.default)({className:(0,s.default)(n.root,l),elevation:f?8:1,ref:o},c))}),p=(0,o.default)(f,{name:"MuiCard"})(c);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../Paper":"mtQp","../styles/withStyles":"awmK"}],"Ws94":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Card"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Card":"SsYK"}],"cvV9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),t=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),i=l(require("prop-types")),o=l(require("clsx")),s=l(require("../styles/withStyles")),a=l(require("../ButtonBase"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return{root:{display:"block",textAlign:"inherit",width:"100%","&:hover $focusHighlight":{opacity:e.palette.action.hoverOpacity},"&$focusVisible $focusHighlight":{opacity:.12}},focusVisible:{},focusHighlight:{overflow:"hidden",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:"inherit",opacity:0,backgroundColor:"currentcolor",transition:e.transitions.create("opacity",{duration:e.transitions.duration.short})}}};exports.styles=c;var f=r.forwardRef(function(i,s){var n=i.children,u=i.classes,l=i.className,c=i.focusVisibleClassName,f=(0,t.default)(i,["children","classes","className","focusVisibleClassName"]);return r.createElement(a.default,(0,e.default)({className:(0,o.default)(u.root,l),focusVisibleClassName:(0,o.default)(c,u.focusVisible),ref:s},f),n,r.createElement("span",{className:u.focusHighlight}))}),p=(0,s.default)(c,{name:"MuiCardActionArea"})(f);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../ButtonBase":"VX66"}],"Z0ud":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./CardActionArea"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./CardActionArea":"cvV9"}],"wx1E":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=o(require("react")),a=u(require("prop-types")),s=u(require("clsx")),n=u(require("../styles/withStyles"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=a?Object.getOwnPropertyDescriptor(e,s):null;n&&(n.get||n.set)?Object.defineProperty(r,s,n):r[s]=e[s]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var l={root:{display:"flex",alignItems:"center",padding:8},spacing:{"& > :not(:first-child)":{marginLeft:8}}};exports.styles=l;var c=r.forwardRef(function(a,n){var i=a.disableSpacing,o=void 0!==i&&i,u=a.classes,l=a.className,c=(0,t.default)(a,["disableSpacing","classes","className"]);return r.createElement("div",(0,e.default)({className:(0,s.default)(u.root,l,!o&&u.spacing),ref:n},c))}),f=(0,n.default)(l,{name:"MuiCardActions"})(c);exports.default=f;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"xvMz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./CardActions"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./CardActions":"wx1E"}],"pKz2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),t=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),o=l(require("prop-types")),n=l(require("clsx")),a=l(require("../styles/withStyles"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=o?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var i={root:{padding:16,"&:last-child":{paddingBottom:24}}};exports.styles=i;var f=r.forwardRef(function(o,a){var s=o.classes,u=o.className,l=o.component,i=void 0===l?"div":l,f=(0,t.default)(o,["classes","className","component"]);return r.createElement(i,(0,e.default)({className:(0,n.default)(s.root,u),ref:a},f))}),c=(0,a.default)(i,{name:"MuiCardContent"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"FWEV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./CardContent"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./CardContent":"pKz2"}],"KK2Q":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=i(require("react")),a=u(require("prop-types")),o=u(require("clsx")),l=u(require("../styles/withStyles")),n=u(require("../Typography"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var p={root:{display:"flex",alignItems:"center",padding:16},avatar:{flex:"0 0 auto",marginRight:16},action:{flex:"0 0 auto",alignSelf:"flex-start",marginTop:-8,marginRight:-8},content:{flex:"1 1 auto"},title:{},subheader:{}};exports.styles=p;var c=r.forwardRef(function(a,l){var s=a.action,i=a.avatar,u=a.classes,p=a.className,c=a.component,d=void 0===c?"div":c,f=a.disableTypography,y=void 0!==f&&f,m=a.subheader,b=a.subheaderTypographyProps,v=a.title,h=a.titleTypographyProps,g=(0,t.default)(a,["action","avatar","classes","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"]),x=v;null==x||x.type===n.default||y||(x=r.createElement(n.default,(0,e.default)({variant:i?"body2":"h5",className:u.title,component:"span",display:"block"},h),x));var P=m;return null==P||P.type===n.default||y||(P=r.createElement(n.default,(0,e.default)({variant:i?"body2":"body1",className:u.subheader,color:"textSecondary",component:"span",display:"block"},b),P)),r.createElement(d,(0,e.default)({className:(0,o.default)(u.root,p),ref:l},g),i&&r.createElement("div",{className:u.avatar},i),r.createElement("div",{className:u.content},x,P),s&&r.createElement("div",{className:u.action},s))}),d=(0,l.default)(p,{name:"MuiCardHeader"})(c);exports.default=d;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Typography":"pi2F"}],"PugE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./CardHeader"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./CardHeader":"KK2Q"}],"ggxT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=s(require("react")),i=c(require("prop-types")),a=c(require("clsx")),o=c(require("../styles/withStyles")),n=require("@material-ui/utils");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u();if(r&&r.has(e))return r.get(e);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(t,a,o):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function c(e){return e&&e.__esModule?e:{default:e}}var l={root:{display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},media:{width:"100%"},img:{objectFit:"cover"}};exports.styles=l;var d=["video","audio","picture","iframe","img"],f=t.forwardRef(function(i,o){var n=i.children,u=i.classes,s=i.className,c=i.component,l=void 0===c?"div":c,f=i.image,p=i.src,m=i.style,y=(0,r.default)(i,["children","classes","className","component","image","src","style"]),b=-1!==d.indexOf(l),v=!b&&f?(0,e.default)({backgroundImage:'url("'.concat(f,'")')},m):m;return t.createElement(l,(0,e.default)({className:(0,a.default)(u.root,s,b&&u.media,-1!=="picture img".indexOf(l)&&u.img),ref:o,style:v,src:b?f||p:void 0},y),n)}),p=(0,o.default)(l,{name:"MuiCardMedia"})(f);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","@material-ui/utils":"gEhD"}],"Zbt6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./CardMedia"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./CardMedia":"ggxT"}],"kAd3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useFormControl=o,exports.default=void 0;var e=r(require("react"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}var n=e.createContext();function o(){return e.useContext(n)}var u=n;exports.default=u;
},{"react":"n8MK"}],"SKV5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=o(require("react")),t=r(require("./FormControlContext"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var f=o?Object.getOwnPropertyDescriptor(e,u):null;f&&(f.get||f.set)?Object.defineProperty(r,u,f):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function u(){return e.useContext(t.default)}
},{"react":"n8MK","./FormControlContext":"kAd3"}],"NfPH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=p(require("@babel/runtime/helpers/esm/extends")),t=p(require("@babel/runtime/helpers/esm/slicedToArray")),r=p(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=f(require("react")),o=p(require("prop-types")),a=p(require("clsx")),u=require("@material-ui/utils"),i=p(require("../utils/useControlled")),l=p(require("../FormControl/useFormControl")),d=p(require("../styles/withStyles")),s=p(require("../IconButton"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}var h={root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}};exports.styles=h;var b=n.forwardRef(function(o,u){var d=o.autoFocus,c=o.checked,f=o.checkedIcon,p=o.classes,h=o.className,b=o.defaultChecked,y=o.disabled,m=o.icon,v=o.id,k=o.inputProps,q=o.inputRef,x=o.name,g=o.onBlur,O=o.onChange,F=o.onFocus,P=o.readOnly,w=o.required,B=o.tabIndex,C=o.type,j=o.value,I=(0,r.default)(o,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),_=(0,i.default)({controlled:c,default:Boolean(b),name:"SwitchBase",state:"checked"}),M=(0,t.default)(_,2),N=M[0],R=M[1],S=(0,l.default)(),W=y;S&&void 0===W&&(W=S.disabled);var D="checkbox"===C||"radio"===C;return n.createElement(s.default,(0,e.default)({component:"span",className:(0,a.default)(p.root,h,N&&p.checked,W&&p.disabled),disabled:W,tabIndex:null,role:void 0,onFocus:function(e){F&&F(e),S&&S.onFocus&&S.onFocus(e)},onBlur:function(e){g&&g(e),S&&S.onBlur&&S.onBlur(e)},ref:u},I),n.createElement("input",(0,e.default)({autoFocus:d,checked:c,defaultChecked:b,className:p.input,disabled:W,id:D&&v,name:x,onChange:function(e){var t=e.target.checked;R(t),O&&O(e,t)},readOnly:P,ref:q,required:w,tabIndex:B,type:C,value:j},k)),N?f:m)}),y=(0,d.default)(h,{name:"PrivateSwitchBase"})(b);exports.default=y;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../utils/useControlled":"WHmv","../FormControl/useFormControl":"SKV5","../styles/withStyles":"awmK","../IconButton":"e0Nd"}],"SciI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"rQqm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var c=u?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(r,o,c):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"xBZ0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"SOkh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=v(require("@babel/runtime/helpers/esm/extends")),t=v(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=m(require("react")),o=v(require("prop-types")),n=v(require("clsx")),i=require("@material-ui/utils"),a=v(require("../internal/SwitchBase")),l=v(require("../internal/svg-icons/CheckBoxOutlineBlank")),c=v(require("../internal/svg-icons/CheckBox")),d=require("../styles/colorManipulator"),s=v(require("../internal/svg-icons/IndeterminateCheckBox")),u=v(require("../utils/capitalize")),p=v(require("../styles/withStyles"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function v(e){return e&&e.__esModule?e:{default:e}}var y=function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,d.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,d.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}};exports.styles=y;var h=r.createElement(c.default,null),b=r.createElement(l.default,null),k=r.createElement(s.default,null),q=r.forwardRef(function(o,i){var l=o.checkedIcon,c=void 0===l?h:l,d=o.classes,s=o.color,p=void 0===s?"secondary":s,f=o.icon,m=void 0===f?b:f,v=o.indeterminate,y=void 0!==v&&v,q=o.indeterminateIcon,x=void 0===q?k:q,O=o.inputProps,g=o.size,P=void 0===g?"medium":g,z=(0,t.default)(o,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),S=y?x:m,j=y?x:c;return r.createElement(a.default,(0,e.default)({type:"checkbox",classes:{root:(0,n.default)(d.root,d["color".concat((0,u.default)(p))],y&&d.indeterminate),checked:d.checked,disabled:d.disabled},color:p,inputProps:(0,e.default)({"data-indeterminate":y},O),icon:r.cloneElement(S,{fontSize:void 0===S.props.fontSize&&"small"===P?P:S.props.fontSize}),checkedIcon:r.cloneElement(j,{fontSize:void 0===j.props.fontSize&&"small"===P?P:j.props.fontSize}),ref:i},z))}),x=(0,p.default)(y,{name:"MuiCheckbox"})(q);exports.default=x;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../internal/SwitchBase":"NfPH","../internal/svg-icons/CheckBoxOutlineBlank":"SciI","../internal/svg-icons/CheckBox":"rQqm","../styles/colorManipulator":"aguB","../internal/svg-icons/IndeterminateCheckBox":"xBZ0","../utils/capitalize":"Dk4Y","../styles/withStyles":"awmK"}],"HVXn":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Checkbox"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Checkbox":"SOkh"}],"pJ3C":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"PxfP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),a=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=m(require("react")),r=f(require("prop-types")),o=f(require("clsx")),l=f(require("../internal/svg-icons/Cancel")),n=f(require("../styles/withStyles")),i=require("../styles/colorManipulator"),c=f(require("../utils/useForkRef")),d=f(require("../utils/unsupportedProp")),p=f(require("../utils/capitalize")),s=f(require("../ButtonBase"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=u();if(a&&a.has(e))return a.get(e);var t={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var l=r?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(t,o,l):t[o]=e[o]}return t.default=e,a&&a.set(e,t),t}function f(e){return e&&e.__esModule?e:{default:e}}var y=function(e){var a="light"===e.palette.type?e.palette.grey[300]:e.palette.grey[700],t=(0,i.fade)(e.palette.text.primary,.26);return{root:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:e.palette.getContrastText(a),backgroundColor:a,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:0,textDecoration:"none",border:"none",padding:0,verticalAlign:"middle",boxSizing:"border-box","&$disabled":{opacity:.5,pointerEvents:"none"},"& $avatar":{marginLeft:5,marginRight:-6,width:24,height:24,color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],fontSize:e.typography.pxToRem(12)},"& $avatarColorPrimary":{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark},"& $avatarColorSecondary":{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.dark},"& $avatarSmall":{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)}},sizeSmall:{height:24},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},disabled:{},clickable:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover, &:focus":{backgroundColor:(0,i.emphasize)(a,.08)},"&:active":{boxShadow:e.shadows[1]}},clickableColorPrimary:{"&:hover, &:focus":{backgroundColor:(0,i.emphasize)(e.palette.primary.main,.08)}},clickableColorSecondary:{"&:hover, &:focus":{backgroundColor:(0,i.emphasize)(e.palette.secondary.main,.08)}},deletable:{"&:focus":{backgroundColor:(0,i.emphasize)(a,.08)}},deletableColorPrimary:{"&:focus":{backgroundColor:(0,i.emphasize)(e.palette.primary.main,.2)}},deletableColorSecondary:{"&:focus":{backgroundColor:(0,i.emphasize)(e.palette.secondary.main,.2)}},outlined:{backgroundColor:"transparent",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,i.fade)(e.palette.text.primary,e.palette.action.hoverOpacity)},"& $avatar":{marginLeft:4},"& $avatarSmall":{marginLeft:2},"& $icon":{marginLeft:4},"& $iconSmall":{marginLeft:2},"& $deleteIcon":{marginRight:5},"& $deleteIconSmall":{marginRight:3}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,i.fade)(e.palette.primary.main,e.palette.action.hoverOpacity)}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(e.palette.secondary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,i.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity)}},avatar:{},avatarSmall:{},avatarColorPrimary:{},avatarColorSecondary:{},icon:{color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],marginLeft:5,marginRight:-6},iconSmall:{width:18,height:18,marginLeft:4,marginRight:-4},iconColorPrimary:{color:"inherit"},iconColorSecondary:{color:"inherit"},label:{overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},labelSmall:{paddingLeft:8,paddingRight:8},deleteIcon:{WebkitTapHighlightColor:"transparent",color:t,height:22,width:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:(0,i.fade)(t,.4)}},deleteIconSmall:{height:16,width:16,marginRight:4,marginLeft:-4},deleteIconColorPrimary:{color:(0,i.fade)(e.palette.primary.contrastText,.7),"&:hover, &:active":{color:e.palette.primary.contrastText}},deleteIconColorSecondary:{color:(0,i.fade)(e.palette.secondary.contrastText,.7),"&:hover, &:active":{color:e.palette.secondary.contrastText}},deleteIconOutlinedColorPrimary:{color:(0,i.fade)(e.palette.primary.main,.7),"&:hover, &:active":{color:e.palette.primary.main}},deleteIconOutlinedColorSecondary:{color:(0,i.fade)(e.palette.secondary.main,.7),"&:hover, &:active":{color:e.palette.secondary.main}}}};function g(e){return"Backspace"===e.key||"Delete"===e.key}exports.styles=y;var b=t.forwardRef(function(r,n){var i=r.avatar,d=r.classes,u=r.className,m=r.clickable,f=r.color,y=void 0===f?"default":f,b=r.component,h=r.deleteIcon,v=r.disabled,C=void 0!==v&&v,k=r.icon,x=r.label,S=r.onClick,w=r.onDelete,$=r.onKeyDown,P=r.onKeyUp,I=r.size,O=void 0===I?"medium":I,R=r.variant,T=void 0===R?"default":R,z=(0,a.default)(r,["avatar","classes","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant"]),q=t.useRef(null),E=(0,c.default)(q,n),L=function(e){e.stopPropagation(),w&&w(e)},N=!(!1===m||!S)||m,D="small"===O,j=b||(N?s.default:"div"),M=j===s.default?{component:"div"}:{},K=null;if(w){var _=(0,o.default)("default"!==y&&("default"===T?d["deleteIconColor".concat((0,p.default)(y))]:d["deleteIconOutlinedColor".concat((0,p.default)(y))]),D&&d.deleteIconSmall);K=h&&t.isValidElement(h)?t.cloneElement(h,{className:(0,o.default)(h.props.className,d.deleteIcon,_),onClick:L}):t.createElement(l.default,{className:(0,o.default)(d.deleteIcon,_),onClick:L})}var W=null;i&&t.isValidElement(i)&&(W=t.cloneElement(i,{className:(0,o.default)(d.avatar,i.props.className,D&&d.avatarSmall,"default"!==y&&d["avatarColor".concat((0,p.default)(y))])}));var B=null;return k&&t.isValidElement(k)&&(B=t.cloneElement(k,{className:(0,o.default)(d.icon,k.props.className,D&&d.iconSmall,"default"!==y&&d["iconColor".concat((0,p.default)(y))])})),t.createElement(j,(0,e.default)({role:N||w?"button":void 0,className:(0,o.default)(d.root,u,"default"!==y&&[d["color".concat((0,p.default)(y))],N&&d["clickableColor".concat((0,p.default)(y))],w&&d["deletableColor".concat((0,p.default)(y))]],"default"!==T&&[d.outlined,{primary:d.outlinedPrimary,secondary:d.outlinedSecondary}[y]],C&&d.disabled,D&&d.sizeSmall,N&&d.clickable,w&&d.deletable),"aria-disabled":!!C||void 0,tabIndex:N||w?0:void 0,onClick:S,onKeyDown:function(e){e.currentTarget===e.target&&g(e)&&e.preventDefault(),$&&$(e)},onKeyUp:function(e){e.currentTarget===e.target&&(w&&g(e)?w(e):"Escape"===e.key&&q.current&&q.current.blur()),P&&P(e)},ref:E},M,z),W||B,t.createElement("span",{className:(0,o.default)(d.label,D&&d.labelSmall)},x),K)}),h=(0,n.default)(y,{name:"MuiChip"})(b);exports.default=h;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../internal/svg-icons/Cancel":"pJ3C","../styles/withStyles":"awmK","../styles/colorManipulator":"aguB","../utils/useForkRef":"eYEl","../utils/unsupportedProp":"PmB2","../utils/capitalize":"Dk4Y","../ButtonBase":"VX66"}],"zfmF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Chip"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Chip":"PxfP"}],"WFBt":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=l(require("react")),a=u(require("prop-types")),i=u(require("clsx")),s=require("@material-ui/utils"),n=u(require("../styles/withStyles")),o=u(require("../utils/capitalize"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var f=44,d=function(e){return{root:{display:"inline-block"},static:{transition:e.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},determinate:{transition:e.transitions.create("transform")},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:e.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},circleDeterminate:{transition:e.transitions.create("stroke-dashoffset")},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}};exports.styles=d;var p=r.forwardRef(function(a,s){var n=a.classes,c=a.className,l=a.color,u=void 0===l?"primary":l,d=a.disableShrink,p=void 0!==d&&d,m=a.size,y=void 0===m?40:m,h=a.style,v=a.thickness,k=void 0===v?3.6:v,x=a.value,b=void 0===x?0:x,D=a.variant,g=void 0===D?"indeterminate":D,O=(0,t.default)(a,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),P={},w={},j={};if("determinate"===g||"static"===g){var q=2*Math.PI*((f-k)/2);P.strokeDasharray=q.toFixed(3),j["aria-valuenow"]=Math.round(b),P.strokeDashoffset="".concat(((100-b)/100*q).toFixed(3),"px"),w.transform="rotate(-90deg)"}return r.createElement("div",(0,e.default)({className:(0,i.default)(n.root,c,"inherit"!==u&&n["color".concat((0,o.default)(u))],{determinate:n.determinate,indeterminate:n.indeterminate,static:n.static}[g]),style:(0,e.default)({width:y,height:y},w,h),ref:s,role:"progressbar"},j,O),r.createElement("svg",{className:n.svg,viewBox:"".concat(f/2," ").concat(f/2," ").concat(f," ").concat(f)},r.createElement("circle",{className:(0,i.default)(n.circle,p&&n.circleDisableShrink,{determinate:n.circleDeterminate,indeterminate:n.circleIndeterminate,static:n.circleStatic}[g]),style:P,cx:f,cy:f,r:(f-k)/2,fill:"none",strokeWidth:k})))}),m=(0,n.default)(d,{name:"MuiCircularProgress",flip:!1})(p);exports.default=m;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y"}],"mb4G":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./CircularProgress"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./CircularProgress":"WFBt"}],"PKq2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),t=a(require("react-dom")),r=i(require("prop-types")),n=i(require("../utils/ownerDocument")),u=i(require("../utils/useForkRef")),o=i(require("../utils/useEventCallback")),c=require("@material-ui/utils");function i(e){return e&&e.__esModule?e:{default:e}}function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=n?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function l(e){return e.substring(2).toLowerCase()}function s(e){return document.documentElement.clientWidth<e.clientX||document.documentElement.clientHeight<e.clientY}function d(r){var c=r.children,i=r.disableReactTree,f=void 0!==i&&i,a=r.mouseEvent,d=void 0===a?"onClick":a,v=r.onClickAway,p=r.touchEvent,m=void 0===p?"onTouchEnd":p,E=e.useRef(!1),y=e.useRef(null),b=e.useRef(!1),h=e.useRef(!1);e.useEffect(function(){return setTimeout(function(){b.current=!0},0),function(){b.current=!1}},[]);var O=e.useCallback(function(e){y.current=t.findDOMNode(e)},[]),g=(0,u.default)(c.ref,O),P=(0,o.default)(function(e){var t=h.current;if(h.current=!1,b.current&&y.current&&!s(e))if(E.current)E.current=!1;else{var r;if(e.composedPath)r=e.composedPath().indexOf(y.current)>-1;else r=!(0,n.default)(y.current).documentElement.contains(e.target)||y.current.contains(e.target);r||!f&&t||v(e)}}),j=function(e){return function(t){h.current=!0;var r=c.props[e];r&&r(t)}},k={ref:g};return!1!==m&&(k[m]=j(m)),e.useEffect(function(){if(!1!==m){var e=l(m),t=(0,n.default)(y.current),r=function(){E.current=!0};return t.addEventListener(e,P),t.addEventListener("touchmove",r),function(){t.removeEventListener(e,P),t.removeEventListener("touchmove",r)}}},[P,m]),!1!==d&&(k[d]=j(d)),e.useEffect(function(){if(!1!==d){var e=l(d),t=(0,n.default)(y.current);return t.addEventListener(e,P),function(){t.removeEventListener(e,P)}}},[P,d]),e.createElement(e.Fragment,null,e.cloneElement(c,k))}var v=d;exports.default=v;
},{"react":"n8MK","react-dom":"NKHc","prop-types":"D9Od","../utils/ownerDocument":"Xj2I","../utils/useForkRef":"eYEl","../utils/useEventCallback":"AH47","@material-ui/utils":"gEhD"}],"YjtO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ClickAwayListener"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ClickAwayListener":"PKq2"}],"XVV5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),t=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=l(require("@babel/runtime/helpers/esm/defineProperty")),a=d(require("react")),i=l(require("prop-types")),s=l(require("clsx")),n=l(require("../styles/withStyles")),u=l(require("../utils/capitalize"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=a?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:(0,r.default)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),display:"block"},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),disableGutters:{paddingLeft:0,paddingRight:0},fixed:Object.keys(e.breakpoints.values).reduce(function(t,r){var a=e.breakpoints.values[r];return 0!==a&&(t[e.breakpoints.up(r)]={maxWidth:a}),t},{}),maxWidthXs:(0,r.default)({},e.breakpoints.up("xs"),{maxWidth:Math.max(e.breakpoints.values.xs,444)}),maxWidthSm:(0,r.default)({},e.breakpoints.up("sm"),{maxWidth:e.breakpoints.values.sm}),maxWidthMd:(0,r.default)({},e.breakpoints.up("md"),{maxWidth:e.breakpoints.values.md}),maxWidthLg:(0,r.default)({},e.breakpoints.up("lg"),{maxWidth:e.breakpoints.values.lg}),maxWidthXl:(0,r.default)({},e.breakpoints.up("xl"),{maxWidth:e.breakpoints.values.xl})}};exports.styles=p;var f=a.forwardRef(function(r,i){var n=r.classes,o=r.className,d=r.component,l=void 0===d?"div":d,p=r.disableGutters,f=void 0!==p&&p,c=r.fixed,b=void 0!==c&&c,m=r.maxWidth,x=void 0===m?"lg":m,h=(0,t.default)(r,["classes","className","component","disableGutters","fixed","maxWidth"]);return a.createElement(l,(0,e.default)({className:(0,s.default)(n.root,o,b&&n.fixed,f&&n.disableGutters,!1!==x&&n["maxWidth".concat((0,u.default)(String(x)))]),ref:i},h))}),c=(0,n.default)(p,{name:"MuiContainer"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y"}],"jygZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Container"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Container":"XVV5"}],"UhzB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=exports.body=exports.html=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),t=i(require("react")),r=l(require("prop-types")),o=l(require("../styles/withStyles")),n=require("@material-ui/utils");function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var u={WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box"};exports.html=u;var s=function(t){return(0,e.default)({color:t.palette.text.primary},t.typography.body2,{backgroundColor:t.palette.background.default,"@media print":{backgroundColor:t.palette.common.white}})};exports.body=s;var p=function(t){return{"@global":{html:u,"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:(0,e.default)({margin:0},s(t),{"&::backdrop":{backgroundColor:t.palette.background.default}})}}};function f(e){var r=e.children,o=void 0===r?null:r;e.classes;return t.createElement(t.Fragment,null,o)}exports.styles=p;var d=(0,o.default)(p,{name:"MuiCssBaseline"})(f);exports.default=d;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","../styles/withStyles":"awmK","@material-ui/utils":"gEhD"}],"cmOJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./CssBaseline"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./CssBaseline":"UhzB"}],"mVof":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("react")),t=l(require("react-dom")),r=i(require("prop-types")),n=require("@material-ui/utils"),u=i(require("../utils/setRef")),o=i(require("../utils/useForkRef"));function i(e){return e&&e.__esModule?e:{default:e}}function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=n?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function a(e){return e="function"==typeof e?e():e,t.findDOMNode(e)}var c="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,d=e.forwardRef(function(r,n){var i=r.children,f=r.container,l=r.disablePortal,d=void 0!==l&&l,s=r.onRendered,p=e.useState(null),y=p[0],v=p[1],O=(0,o.default)(e.isValidElement(i)?i.ref:null,n);return c(function(){d||v(a(f)||document.body)},[f,d]),c(function(){if(y&&!d)return(0,u.default)(n,y),function(){(0,u.default)(n,null)}},[n,y,d]),c(function(){s&&(y||d)&&s()},[s,y,d]),d?e.isValidElement(i)?e.cloneElement(i,{ref:O}):i:y?t.createPortal(i,y):y});var s=d;exports.default=s;
},{"react":"n8MK","react-dom":"NKHc","prop-types":"D9Od","@material-ui/utils":"gEhD","../utils/setRef":"IV4i","../utils/useForkRef":"eYEl"}],"ZN8Z":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Portal"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Portal":"mVof"}],"iFpT":[function(require,module,exports) {
"use strict";function e(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"ECMY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ariaHidden=s,exports.default=void 0;var e=l(require("@babel/runtime/helpers/esm/classCallCheck")),t=l(require("@babel/runtime/helpers/esm/createClass")),n=l(require("@babel/runtime/helpers/esm/toConsumableArray")),r=l(require("../utils/getScrollbarSize")),i=l(require("../utils/ownerDocument")),o=l(require("../utils/ownerWindow"));function l(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=(0,i.default)(e);return t.body===e?(0,o.default)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function s(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function d(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function u(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0,l=[t,r].concat((0,n.default)(i)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,function(e){1===e.nodeType&&-1===l.indexOf(e)&&-1===a.indexOf(e.tagName)&&s(e,o)})}function c(e,t){var n=-1;return e.some(function(e,r){return!!t(e)&&(n=r,!0)}),n}function f(e,t){var n,o=[],l=[],s=e.container;if(!t.disableScrollLock){if(a(s)){var u=(0,r.default)();o.push({value:s.style.paddingRight,key:"padding-right",el:s}),s.style["padding-right"]="".concat(d(s)+u,"px"),n=(0,i.default)(s).querySelectorAll(".mui-fixed"),[].forEach.call(n,function(e){l.push(e.style.paddingRight),e.style.paddingRight="".concat(d(e)+u,"px")})}var c=s.parentElement,f="HTML"===c.nodeName&&"scroll"===window.getComputedStyle(c)["overflow-y"]?c:s;o.push({value:f.style.overflow,key:"overflow",el:f}),f.style.overflow="hidden"}return function(){n&&[].forEach.call(n,function(e,t){l[t]?e.style.paddingRight=l[t]:e.style.removeProperty("padding-right")}),o.forEach(function(e){var t=e.value,n=e.el,r=e.key;t?n.style.setProperty(r,t):n.style.removeProperty(r)})}}function h(e){var t=[];return[].forEach.call(e.children,function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)}),t}var m=function(){function n(){(0,e.default)(this,n),this.modals=[],this.containers=[]}return(0,t.default)(n,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&s(e.modalRef,!1);var r=h(t);u(t,e.mountNode,e.modalRef,r,!0);var i=c(this.containers,function(e){return e.container===t});return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(e,t){var n=c(this.containers,function(t){return-1!==t.modals.indexOf(e)}),r=this.containers[n];r.restore||(r.restore=f(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=c(this.containers,function(t){return-1!==t.modals.indexOf(e)}),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&s(e.modalRef,!0),u(r.container,e.mountNode,e.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var i=r.modals[r.modals.length-1];i.modalRef&&s(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),n}();exports.default=m;
},{"@babel/runtime/helpers/esm/classCallCheck":"VEjx","@babel/runtime/helpers/esm/createClass":"l5p4","@babel/runtime/helpers/esm/toConsumableArray":"Qv3s","../utils/getScrollbarSize":"iFpT","../utils/ownerDocument":"Xj2I","../utils/ownerWindow":"EE4R"}],"ovWs":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("react")),t=a(require("react-dom")),r=o(require("prop-types")),n=o(require("../utils/ownerDocument")),u=o(require("../utils/useForkRef")),c=require("@material-ui/utils");function o(e){return e&&e.__esModule?e:{default:e}}function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var c=n?Object.getOwnPropertyDescriptor(e,u):null;c&&(c.get||c.set)?Object.defineProperty(r,u,c):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function f(r){var c=r.children,o=r.disableAutoFocus,i=void 0!==o&&o,a=r.disableEnforceFocus,f=void 0!==a&&a,s=r.disableRestoreFocus,l=void 0!==s&&s,d=r.getDoc,v=r.isEnabled,p=r.open,b=e.useRef(),E=e.useRef(null),y=e.useRef(null),m=e.useRef(),O=e.useRef(null),w=e.useCallback(function(e){O.current=t.findDOMNode(e)},[]),R=(0,u.default)(c.ref,w),j=e.useRef();return e.useEffect(function(){j.current=p},[p]),!j.current&&p&&"undefined"!=typeof window&&(m.current=d().activeElement),e.useEffect(function(){if(p){var e=(0,n.default)(O.current);i||!O.current||O.current.contains(e.activeElement)||(O.current.hasAttribute("tabIndex")||O.current.setAttribute("tabIndex",-1),O.current.focus());var t=function(){null!==O.current&&(e.hasFocus()&&!f&&v()&&!b.current?O.current&&!O.current.contains(e.activeElement)&&O.current.focus():b.current=!1)},r=function(t){!f&&v()&&9===t.keyCode&&e.activeElement===O.current&&(b.current=!0,t.shiftKey?y.current.focus():E.current.focus())};e.addEventListener("focus",t,!0),e.addEventListener("keydown",r,!0);var u=setInterval(function(){t()},50);return function(){clearInterval(u),e.removeEventListener("focus",t,!0),e.removeEventListener("keydown",r,!0),l||(m.current&&m.current.focus&&m.current.focus(),m.current=null)}}},[i,f,l,v,p]),e.createElement(e.Fragment,null,e.createElement("div",{tabIndex:0,ref:E,"data-test":"sentinelStart"}),e.cloneElement(c,{ref:R}),e.createElement("div",{tabIndex:0,ref:y,"data-test":"sentinelEnd"}))}var s=f;exports.default=s;
},{"react":"n8MK","react-dom":"NKHc","prop-types":"D9Od","../utils/ownerDocument":"Xj2I","../utils/useForkRef":"eYEl","@material-ui/utils":"gEhD"}],"LDYe":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Unstable_TrapFocus"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Unstable_TrapFocus":"ovWs"}],"Bl09":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=i(require("react")),o=u(require("prop-types"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var u=o?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(r,i,u):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var a={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}};exports.styles=a;var l=r.forwardRef(function(o,n){var i=o.invisible,u=void 0!==i&&i,l=o.open,s=(0,t.default)(o,["invisible","open"]);return l?r.createElement("div",(0,e.default)({"aria-hidden":!0,ref:n},s,{style:(0,e.default)({},a.root,u?a.invisible:{},s.style)})):null}),s=l;exports.default=s;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od"}],"pDET":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=y(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=y(require("@babel/runtime/helpers/esm/extends")),t=m(require("react")),o=m(require("react-dom")),n=y(require("prop-types")),i=require("@material-ui/styles"),u=require("@material-ui/utils"),a=y(require("../utils/ownerDocument")),l=y(require("../Portal")),d=y(require("../utils/createChainedFunction")),c=y(require("../utils/useForkRef")),s=y(require("../utils/useEventCallback")),f=y(require("../styles/zIndex")),p=m(require("./ModalManager")),b=y(require("../Unstable_TrapFocus")),k=y(require("./SimpleBackdrop"));function v(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return v=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=v();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function y(e){return e&&e.__esModule?e:{default:e}}function E(e){return e="function"==typeof e?e():e,o.findDOMNode(e)}function h(e){return!!e.children&&e.children.props.hasOwnProperty("in")}var q=new p.default,x=function(e){return{root:{position:"fixed",zIndex:e.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}};exports.styles=x;var P=t.forwardRef(function(o,n){var u=(0,i.useTheme)(),v=(0,i.getThemeProps)({name:"MuiModal",props:(0,r.default)({},o),theme:u}),m=v.BackdropComponent,y=void 0===m?k.default:m,P=v.BackdropProps,w=v.children,C=v.closeAfterTransition,g=void 0!==C&&C,M=v.container,F=v.disableAutoFocus,B=void 0!==F&&F,D=v.disableBackdropClick,O=void 0!==D&&D,R=v.disableEnforceFocus,j=void 0!==R&&R,T=v.disableEscapeKeyDown,I=void 0!==T&&T,_=v.disablePortal,K=void 0!==_&&_,A=v.disableRestoreFocus,S=void 0!==A&&A,z=v.disableScrollLock,L=void 0!==z&&z,W=v.hideBackdrop,N=void 0!==W&&W,H=v.keepMounted,U=void 0!==H&&H,G=v.manager,J=void 0===G?q:G,Q=v.onBackdropClick,V=v.onClose,X=v.onEscapeKeyDown,Y=v.onRendered,Z=v.open,$=(0,e.default)(v,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),ee=t.useState(!0),re=ee[0],te=ee[1],oe=t.useRef({}),ne=t.useRef(null),ie=t.useRef(null),ue=(0,c.default)(ie,n),ae=h(v),le=function(){return(0,a.default)(ne.current)},de=function(){return oe.current.modalRef=ie.current,oe.current.mountNode=ne.current,oe.current},ce=function(){J.mount(de(),{disableScrollLock:L}),ie.current.scrollTop=0},se=(0,s.default)(function(){var e=E(M)||le().body;J.add(de(),e),ie.current&&ce()}),fe=t.useCallback(function(){return J.isTopModal(de())},[J]),pe=(0,s.default)(function(e){ne.current=e,e&&(Y&&Y(),Z&&fe()?ce():(0,p.ariaHidden)(ie.current,!0))}),be=t.useCallback(function(){J.remove(de())},[J]);if(t.useEffect(function(){return function(){be()}},[be]),t.useEffect(function(){Z?se():ae&&g||be()},[Z,be,ae,g,se]),!U&&!Z&&(!ae||re))return null;var ke=x(u||{zIndex:f.default}),ve={};return void 0===w.props.tabIndex&&(ve.tabIndex=w.props.tabIndex||"-1"),ae&&(ve.onEnter=(0,d.default)(function(){te(!1)},w.props.onEnter),ve.onExited=(0,d.default)(function(){te(!0),g&&be()},w.props.onExited)),t.createElement(l.default,{ref:pe,container:M,disablePortal:K},t.createElement("div",(0,r.default)({ref:ue,onKeyDown:function(e){"Escape"===e.key&&fe()&&(X&&X(e),I||(e.stopPropagation(),V&&V(e,"escapeKeyDown")))},role:"presentation"},$,{style:(0,r.default)({},ke.root,!Z&&re?ke.hidden:{},$.style)}),N?null:t.createElement(y,(0,r.default)({open:Z,onClick:function(e){e.target===e.currentTarget&&(Q&&Q(e),!O&&V&&V(e,"backdropClick"))}},P)),t.createElement(b.default,{disableEnforceFocus:j,disableAutoFocus:B,disableRestoreFocus:S,getDoc:le,isEnabled:fe,open:Z},t.cloneElement(w,ve))))}),w=P;exports.default=w;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","react-dom":"NKHc","prop-types":"D9Od","@material-ui/styles":"thJn","@material-ui/utils":"gEhD","../utils/ownerDocument":"Xj2I","../Portal":"ZN8Z","../utils/createChainedFunction":"ftFk","../utils/useForkRef":"eYEl","../utils/useEventCallback":"AH47","../styles/zIndex":"ROtz","./ModalManager":"ECMY","../Unstable_TrapFocus":"LDYe","./SimpleBackdrop":"Bl09"}],"IBPk":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"ModalManager",{enumerable:!0,get:function(){return r.default}});var e=t(require("./Modal")),r=t(require("./ModalManager"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Modal":"pDET","./ModalManager":"ECMY"}],"TEgC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=b(require("@babel/runtime/helpers/esm/extends")),r=b(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=b(require("@babel/runtime/helpers/esm/defineProperty")),a=m(require("react")),o=b(require("prop-types")),i=b(require("clsx")),n=b(require("../styles/withStyles")),l=b(require("../utils/capitalize")),p=b(require("../Modal")),d=b(require("../Backdrop")),s=b(require("../Fade")),c=require("../styles/transitions"),u=b(require("../Paper"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(t,o,i):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function b(e){return e&&e.__esModule?e:{default:e}}var x=function(e){return{root:{"@media print":{position:"absolute !important"}},scrollPaper:{display:"flex",justifyContent:"center",alignItems:"center"},scrollBody:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}},container:{height:"100%","@media print":{height:"auto"},outline:0},paper:{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},paperScrollPaper:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},paperScrollBody:{display:"inline-block",verticalAlign:"middle",textAlign:"left"},paperWidthFalse:{maxWidth:"calc(100% - 64px)"},paperWidthXs:{maxWidth:Math.max(e.breakpoints.values.xs,444),"&$paperScrollBody":(0,t.default)({},e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64),{maxWidth:"calc(100% - 64px)"})},paperWidthSm:{maxWidth:e.breakpoints.values.sm,"&$paperScrollBody":(0,t.default)({},e.breakpoints.down(e.breakpoints.values.sm+64),{maxWidth:"calc(100% - 64px)"})},paperWidthMd:{maxWidth:e.breakpoints.values.md,"&$paperScrollBody":(0,t.default)({},e.breakpoints.down(e.breakpoints.values.md+64),{maxWidth:"calc(100% - 64px)"})},paperWidthLg:{maxWidth:e.breakpoints.values.lg,"&$paperScrollBody":(0,t.default)({},e.breakpoints.down(e.breakpoints.values.lg+64),{maxWidth:"calc(100% - 64px)"})},paperWidthXl:{maxWidth:e.breakpoints.values.xl,"&$paperScrollBody":(0,t.default)({},e.breakpoints.down(e.breakpoints.values.xl+64),{maxWidth:"calc(100% - 64px)"})},paperFullWidth:{width:"calc(100% - 64px)"},paperFullScreen:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,"&$paperScrollBody":{margin:0,maxWidth:"100%"}}}};exports.styles=x;var h={enter:c.duration.enteringScreen,exit:c.duration.leavingScreen},v=a.forwardRef(function(t,o){var n=t.BackdropProps,c=t.children,f=t.classes,m=t.className,b=t.disableBackdropClick,x=void 0!==b&&b,v=t.disableEscapeKeyDown,y=void 0!==v&&v,g=t.fullScreen,k=void 0!==g&&g,W=t.fullWidth,E=void 0!==W&&W,w=t.maxWidth,P=void 0===w?"sm":w,S=t.onBackdropClick,B=t.onClose,C=t.onEnter,D=t.onEntered,q=t.onEntering,M=t.onEscapeKeyDown,j=t.onExit,O=t.onExited,F=t.onExiting,K=t.open,N=t.PaperComponent,T=void 0===N?u.default:N,$=t.PaperProps,_=void 0===$?{}:$,A=t.scroll,R=void 0===A?"paper":A,X=t.TransitionComponent,Y=void 0===X?s.default:X,H=t.transitionDuration,z=void 0===H?h:H,I=t.TransitionProps,L=t["aria-describedby"],U=t["aria-labelledby"],G=(0,r.default)(t,["BackdropProps","children","classes","className","disableBackdropClick","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","onEnter","onEntered","onEntering","onEscapeKeyDown","onExit","onExited","onExiting","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps","aria-describedby","aria-labelledby"]),J=a.useRef();return a.createElement(p.default,(0,e.default)({className:(0,i.default)(f.root,m),BackdropComponent:d.default,BackdropProps:(0,e.default)({transitionDuration:z},n),closeAfterTransition:!0,disableBackdropClick:x,disableEscapeKeyDown:y,onEscapeKeyDown:M,onClose:B,open:K,ref:o},G),a.createElement(Y,(0,e.default)({appear:!0,in:K,timeout:z,onEnter:C,onEntering:q,onEntered:D,onExit:j,onExiting:F,onExited:O,role:"none presentation"},I),a.createElement("div",{className:(0,i.default)(f.container,f["scroll".concat((0,l.default)(R))]),onMouseUp:function(e){e.target===e.currentTarget&&e.target===J.current&&(J.current=null,S&&S(e),!x&&B&&B(e,"backdropClick"))},onMouseDown:function(e){J.current=e.target}},a.createElement(T,(0,e.default)({elevation:24,role:"dialog","aria-describedby":L,"aria-labelledby":U},_,{className:(0,i.default)(f.paper,f["paperScroll".concat((0,l.default)(R))],f["paperWidth".concat((0,l.default)(String(P)))],_.className,k&&f.paperFullScreen,E&&f.paperFullWidth)}),c))))}),y=(0,n.default)(x,{name:"MuiDialog"})(v);exports.default=y;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y","../Modal":"IBPk","../Backdrop":"iPmI","../Fade":"yr6S","../styles/transitions":"geVf","../Paper":"mtQp"}],"zNDQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Dialog"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Dialog":"TEgC"}],"Zy7A":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),t=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=o(require("react")),a=l(require("prop-types")),n=l(require("clsx")),s=l(require("../styles/withStyles"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=a?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(r,n,s):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var u={root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},spacing:{"& > :not(:first-child)":{marginLeft:8}}};exports.styles=u;var f=r.forwardRef(function(a,s){var i=a.disableSpacing,o=void 0!==i&&i,l=a.classes,u=a.className,f=(0,t.default)(a,["disableSpacing","classes","className"]);return r.createElement("div",(0,e.default)({className:(0,n.default)(l.root,u,!o&&l.spacing),ref:s},f))}),c=(0,s.default)(u,{name:"MuiDialogActions"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"dDut":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./DialogActions"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./DialogActions":"Zy7A"}],"Uc0V":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),r=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=s(require("react")),o=u(require("prop-types")),i=u(require("clsx")),a=u(require("../styles/withStyles"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(t,i,a):t[i]=e[i]}return t.default=e,r&&r.set(e,t),t}function u(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return{root:{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"8px 24px","&:first-child":{paddingTop:20}},dividers:{padding:"16px 24px",borderTop:"1px solid ".concat(e.palette.divider),borderBottom:"1px solid ".concat(e.palette.divider)}}};exports.styles=l;var d=t.forwardRef(function(o,a){var n=o.classes,s=o.className,u=o.dividers,l=void 0!==u&&u,d=(0,r.default)(o,["classes","className","dividers"]);return t.createElement("div",(0,e.default)({className:(0,i.default)(n.root,s,l&&n.dividers),ref:a},d))}),p=(0,a.default)(l,{name:"MuiDialogContent"})(d);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"lTXJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./DialogContent"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./DialogContent":"Uc0V"}],"Q5Ko":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),t=a(require("react")),r=i(require("prop-types")),o=i(require("../styles/withStyles")),n=i(require("../Typography"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=o?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function i(e){return e&&e.__esModule?e:{default:e}}var f={root:{marginBottom:12}};exports.styles=f;var l=t.forwardRef(function(r,o){return t.createElement(n.default,(0,e.default)({component:"p",variant:"body1",color:"textSecondary",ref:o},r))}),p=(0,o.default)(f,{name:"MuiDialogContentText"})(l);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","../styles/withStyles":"awmK","../Typography":"pi2F"}],"Gmh9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./DialogContentText"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./DialogContentText":"Q5Ko"}],"X8Z3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=s(require("react")),a=i(require("prop-types")),o=i(require("clsx")),n=i(require("../styles/withStyles")),u=i(require("../Typography"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=a?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(t,o,n):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function i(e){return e&&e.__esModule?e:{default:e}}var p={root:{margin:0,padding:"16px 24px",flex:"0 0 auto"}};exports.styles=p;var f=t.forwardRef(function(a,n){var l=a.children,s=a.classes,i=a.className,p=a.disableTypography,f=void 0!==p&&p,c=(0,r.default)(a,["children","classes","className","disableTypography"]);return t.createElement("div",(0,e.default)({className:(0,o.default)(s.root,i),ref:n},c),f?l:t.createElement(u.default,{component:"h2",variant:"h6"},l))}),c=(0,n.default)(p,{name:"MuiDialogTitle"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Typography":"pi2F"}],"Dg7a":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./DialogTitle"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./DialogTitle":"X8Z3"}],"E6N5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=s(require("@babel/runtime/helpers/esm/extends")),t=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),o=s(require("prop-types")),i=s(require("clsx")),a=s(require("../styles/withStyles")),l=require("../styles/colorManipulator");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function s(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:{height:1,margin:0,border:"none",flexShrink:0,backgroundColor:e.palette.divider},absolute:{position:"absolute",bottom:0,left:0,width:"100%"},inset:{marginLeft:72},light:{backgroundColor:(0,l.fade)(e.palette.divider,.08)},middle:{marginLeft:e.spacing(2),marginRight:e.spacing(2)},vertical:{height:"100%",width:1},flexItem:{alignSelf:"stretch",height:"auto"}}};exports.styles=f;var d=r.forwardRef(function(o,a){var l=o.absolute,n=void 0!==l&&l,u=o.classes,s=o.className,f=o.component,d=void 0===f?"hr":f,c=o.flexItem,p=void 0!==c&&c,v=o.light,h=void 0!==v&&v,b=o.orientation,g=void 0===b?"horizontal":b,m=o.role,y=void 0===m?"hr"!==d?"separator":void 0:m,x=o.variant,O=void 0===x?"fullWidth":x,j=(0,t.default)(o,["absolute","classes","className","component","flexItem","light","orientation","role","variant"]);return r.createElement(d,(0,e.default)({className:(0,i.default)(u.root,s,"fullWidth"!==O&&u[O],n&&u.absolute,p&&u.flexItem,h&&u.light,"vertical"===g&&u.vertical),role:y,ref:a},j))}),c=(0,a.default)(f,{name:"MuiDivider"})(d);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../styles/colorManipulator":"aguB"}],"pRXd":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Divider"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Divider":"E6N5"}],"QNjr":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setTranslateValue=m,exports.default=void 0;var e=y(require("@babel/runtime/helpers/esm/extends")),t=y(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=p(require("react")),r=y(require("prop-types")),i=p(require("react-dom")),o=y(require("../utils/debounce")),a=require("react-transition-group"),s=require("@material-ui/utils"),u=y(require("../utils/useForkRef")),l=y(require("../styles/useTheme")),f=require("../styles/transitions"),c=require("../transitions/utils");function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function y(e){return e&&e.__esModule?e:{default:e}}function g(e,t){var n,r=t.getBoundingClientRect();if(t.fakeTransform)n=t.fakeTransform;else{var i=window.getComputedStyle(t);n=i.getPropertyValue("-webkit-transform")||i.getPropertyValue("transform")}var o=0,a=0;if(n&&"none"!==n&&"string"==typeof n){var s=n.split("(")[1].split(")")[0].split(",");o=parseInt(s[4],10),a=parseInt(s[5],10)}return"left"===e?"translateX(".concat(window.innerWidth,"px) translateX(").concat(o-r.left,"px)"):"right"===e?"translateX(-".concat(r.left+r.width-o,"px)"):"up"===e?"translateY(".concat(window.innerHeight,"px) translateY(").concat(a-r.top,"px)"):"translateY(-".concat(r.top+r.height-a,"px)")}function m(e,t){var n=g(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}var v={enter:f.duration.enteringScreen,exit:f.duration.leavingScreen},w=n.forwardRef(function(r,s){var f=r.children,d=r.direction,p=void 0===d?"down":d,y=r.in,g=r.onEnter,w=r.onEntered,b=r.onEntering,E=r.onExit,x=r.onExited,h=r.onExiting,k=r.style,T=r.timeout,q=void 0===T?v:T,O=r.TransitionComponent,P=void 0===O?a.Transition:O,j=(0,t.default)(r,["children","direction","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),C=(0,l.default)(),M=n.useRef(null),_=n.useCallback(function(e){M.current=i.findDOMNode(e)},[]),R=(0,u.default)(f.ref,_),W=(0,u.default)(R,s),D=function(e){return function(t){e&&(void 0===t?e(M.current):e(M.current,t))}},S=D(function(e,t){m(p,e),(0,c.reflow)(e),g&&g(e,t)}),V=D(function(t,n){var r=(0,c.getTransitionProps)({timeout:q,style:k},{mode:"enter"});t.style.webkitTransition=C.transitions.create("-webkit-transform",(0,e.default)({},r,{easing:C.transitions.easing.easeOut})),t.style.transition=C.transitions.create("transform",(0,e.default)({},r,{easing:C.transitions.easing.easeOut})),t.style.webkitTransform="none",t.style.transform="none",b&&b(t,n)}),X=D(w),Y=D(h),z=D(function(t){var n=(0,c.getTransitionProps)({timeout:q,style:k},{mode:"exit"});t.style.webkitTransition=C.transitions.create("-webkit-transform",(0,e.default)({},n,{easing:C.transitions.easing.sharp})),t.style.transition=C.transitions.create("transform",(0,e.default)({},n,{easing:C.transitions.easing.sharp})),m(p,t),E&&E(t)}),I=D(function(e){e.style.webkitTransition="",e.style.transition="",x&&x(e)}),L=n.useCallback(function(){M.current&&m(p,M.current)},[p]);return n.useEffect(function(){if(!y&&"down"!==p&&"right"!==p){var e=(0,o.default)(function(){M.current&&m(p,M.current)});return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}},[p,y]),n.useEffect(function(){y||L()},[y,L]),n.createElement(P,(0,e.default)({nodeRef:M,onEnter:S,onEntered:X,onEntering:V,onExit:z,onExited:I,onExiting:Y,appear:!0,in:y,timeout:q},j),function(t,r){return n.cloneElement(f,(0,e.default)({ref:W,style:(0,e.default)({visibility:"exited"!==t||y?void 0:"hidden"},k,f.props.style)},r))})}),b=w;exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","react-dom":"NKHc","../utils/debounce":"TiOe","react-transition-group":"ORBw","@material-ui/utils":"gEhD","../utils/useForkRef":"eYEl","../styles/useTheme":"nmB4","../styles/transitions":"geVf","../transitions/utils":"DLys"}],"lCN9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Slide"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Slide":"QNjr"}],"I32u":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isHorizontal=g,exports.getAnchor=y,exports.default=exports.styles=void 0;var e=m(require("@babel/runtime/helpers/esm/extends")),t=m(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=h(require("react")),o=m(require("prop-types")),a=m(require("clsx")),i=m(require("../Modal")),n=m(require("../Backdrop")),l=m(require("../styles/withStyles")),p=m(require("../Slide")),u=m(require("../Paper")),d=m(require("../utils/capitalize")),c=require("../styles/transitions"),s=m(require("../styles/useTheme"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function m(e){return e&&e.__esModule?e:{default:e}}var v=function(e){return{root:{},docked:{flex:"0 0 auto"},paper:{overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:e.zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},paperAnchorLeft:{left:0,right:"auto"},paperAnchorRight:{left:"auto",right:0},paperAnchorTop:{top:0,left:0,bottom:"auto",right:0,height:"auto",maxHeight:"100%"},paperAnchorBottom:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},paperAnchorDockedLeft:{borderRight:"1px solid ".concat(e.palette.divider)},paperAnchorDockedTop:{borderBottom:"1px solid ".concat(e.palette.divider)},paperAnchorDockedRight:{borderLeft:"1px solid ".concat(e.palette.divider)},paperAnchorDockedBottom:{borderTop:"1px solid ".concat(e.palette.divider)},modal:{}}};exports.styles=v;var x={left:"right",right:"left",top:"down",bottom:"up"};function g(e){return-1!==["left","right"].indexOf(e)}function y(e,t){return"rtl"===e.direction&&g(t)?x[t]:t}var P={enter:c.duration.enteringScreen,exit:c.duration.leavingScreen},b=r.forwardRef(function(o,l){var c=o.anchor,f=void 0===c?"left":c,h=o.BackdropProps,m=o.children,v=o.classes,g=o.className,b=o.elevation,k=void 0===b?16:b,q=o.ModalProps,D=(q=void 0===q?{}:q).BackdropProps,w=(0,t.default)(q,["BackdropProps"]),A=o.onClose,O=o.open,B=void 0!==O&&O,M=o.PaperProps,j=void 0===M?{}:M,N=o.SlideProps,S=o.TransitionComponent,C=void 0===S?p.default:S,E=o.transitionDuration,T=void 0===E?P:E,_=o.variant,R=void 0===_?"temporary":_,z=(0,t.default)(o,["anchor","BackdropProps","children","classes","className","elevation","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"]),W=(0,s.default)(),H=r.useRef(!1);r.useEffect(function(){H.current=!0},[]);var L=y(W,f),I=r.createElement(u.default,(0,e.default)({elevation:"temporary"===R?k:0,square:!0},j,{className:(0,a.default)(v.paper,v["paperAnchor".concat((0,d.default)(L))],j.className,"temporary"!==R&&v["paperAnchorDocked".concat((0,d.default)(L))])}),m);if("permanent"===R)return r.createElement("div",(0,e.default)({className:(0,a.default)(v.root,v.docked,g),ref:l},z),I);var Y=r.createElement(C,(0,e.default)({in:B,direction:x[L],timeout:T,appear:H.current},N),I);return"persistent"===R?r.createElement("div",(0,e.default)({className:(0,a.default)(v.root,v.docked,g),ref:l},z),Y):r.createElement(i.default,(0,e.default)({BackdropProps:(0,e.default)({},h,D,{transitionDuration:T}),BackdropComponent:n.default,className:(0,a.default)(v.root,v.modal,g),open:B,onClose:A,ref:l},z,w),Y)}),k=(0,l.default)(v,{name:"MuiDrawer",flip:!1})(b);exports.default=k;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../Modal":"IBPk","../Backdrop":"iPmI","../styles/withStyles":"awmK","../Slide":"lCN9","../Paper":"mtQp","../utils/capitalize":"Dk4Y","../styles/transitions":"geVf","../styles/useTheme":"nmB4"}],"vyf6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Drawer"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Drawer":"I32u"}],"VaPH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=h(require("@babel/runtime/helpers/esm/extends")),r=h(require("@babel/runtime/helpers/esm/toArray")),t=h(require("@babel/runtime/helpers/esm/slicedToArray")),a=h(require("@babel/runtime/helpers/esm/objectWithoutProperties")),o=m(require("react")),i=require("react-is"),n=h(require("prop-types")),d=h(require("clsx")),s=require("@material-ui/utils"),l=h(require("../Collapse")),u=h(require("../Paper")),p=h(require("../styles/withStyles")),c=h(require("./ExpansionPanelContext")),f=h(require("../utils/useControlled"));function b(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return b=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=b();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(t,o,i):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function h(e){return e&&e.__esModule?e:{default:e}}var y=function(e){var r={duration:e.transitions.duration.shortest};return{root:{position:"relative",transition:e.transitions.create(["margin"],r),"&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:e.palette.divider,transition:e.transitions.create(["opacity","background-color"],r)},"&:first-child":{"&:before":{display:"none"}},"&$expanded":{margin:"16px 0","&:first-child":{marginTop:0},"&:last-child":{marginBottom:0},"&:before":{opacity:0}},"&$expanded + &":{"&:before":{display:"none"}},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},rounded:{borderRadius:0,"&:first-child":{borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius},"&:last-child":{borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},expanded:{},disabled:{}}};exports.styles=y;var g=!1,x=o.forwardRef(function(i,n){var s=i.children,p=i.classes,b=i.className,m=i.defaultExpanded,h=void 0!==m&&m,y=i.disabled,g=void 0!==y&&y,x=i.expanded,v=i.onChange,q=i.square,R=void 0!==q&&q,P=i.TransitionComponent,C=void 0===P?l.default:P,E=i.TransitionProps,O=(0,a.default)(i,["children","classes","className","defaultExpanded","disabled","expanded","onChange","square","TransitionComponent","TransitionProps"]),j=(0,f.default)({controlled:x,default:h,name:"ExpansionPanel",state:"expanded"}),T=(0,t.default)(j,2),k=T[0],M=T[1],w=o.useCallback(function(e){M(!k),v&&v(e,!k)},[k,v,M]),B=o.Children.toArray(s),_=(0,r.default)(B),A=_[0],L=_.slice(1),N=o.useMemo(function(){return{expanded:k,disabled:g,toggle:w}},[k,g,w]);return o.createElement(u.default,(0,e.default)({className:(0,d.default)(p.root,b,k&&p.expanded,g&&p.disabled,!R&&p.rounded),ref:n,square:R},O),o.createElement(c.default.Provider,{value:N},A),o.createElement(C,(0,e.default)({in:k,timeout:"auto"},E),o.createElement("div",{"aria-labelledby":A.props.id,id:A.props["aria-controls"],role:"region"},L)))}),v=(0,p.default)(y,{name:"MuiExpansionPanel"})(x);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/toArray":"XSHU","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../Collapse":"uPhD","../Paper":"mtQp","../styles/withStyles":"awmK","./ExpansionPanelContext":"LwO6","../utils/useControlled":"WHmv"}],"VT0G":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ExpansionPanel"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ExpansionPanel":"VaPH"}],"KTtm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),t=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=o(require("react")),n=l(require("prop-types")),s=l(require("clsx")),a=l(require("../styles/withStyles"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var u={root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end"},spacing:{"& > :not(:first-child)":{marginLeft:8}}};exports.styles=u;var f=!1,c=r.forwardRef(function(n,a){var i=n.classes,o=n.className,l=n.disableSpacing,u=void 0!==l&&l,f=(0,t.default)(n,["classes","className","disableSpacing"]);return r.createElement("div",(0,e.default)({className:(0,s.default)(i.root,o,!u&&i.spacing),ref:a},f))}),p=(0,a.default)(u,{name:"MuiExpansionPanelActions"})(c);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"qFdA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ExpansionPanelActions"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ExpansionPanelActions":"KTtm"}],"K1R9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),r=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=o(require("react")),n=l(require("prop-types")),s=l(require("clsx")),a=l(require("../styles/withStyles"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(t,s,a):t[s]=e[s]}return t.default=e,r&&r.set(e,t),t}function l(e){return e&&e.__esModule?e:{default:e}}var i=function(e){return{root:{display:"flex",padding:e.spacing(1,2,2)}}};exports.styles=i;var f=!1,p=t.forwardRef(function(n,a){var u=n.classes,o=n.className,l=(0,r.default)(n,["classes","className"]);return t.createElement("div",(0,e.default)({className:(0,s.default)(u.root,o),ref:a},l))}),c=(0,a.default)(i,{name:"MuiExpansionPanelDetails"})(p);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"gInR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ExpansionPanelDetails"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ExpansionPanelDetails":"K1R9"}],"k5HL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=u(require("react")),r=c(require("prop-types")),a=c(require("clsx")),o=c(require("../ButtonBase")),i=c(require("../IconButton")),s=c(require("../styles/withStyles")),d=c(require("../ExpansionPanel/ExpansionPanelContext"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=r?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}function c(e){return e&&e.__esModule?e:{default:e}}var p=function(e){var t={duration:e.transitions.duration.shortest};return{root:{display:"flex",minHeight:48,transition:e.transitions.create(["min-height","background-color"],t),padding:e.spacing(0,2),"&:hover:not($disabled)":{cursor:"pointer"},"&$expanded":{minHeight:64},"&$focused":{backgroundColor:e.palette.action.focus},"&$disabled":{opacity:e.palette.action.disabledOpacity}},expanded:{},focused:{},disabled:{},content:{display:"flex",flexGrow:1,transition:e.transitions.create(["margin"],t),margin:"12px 0","&$expanded":{margin:"20px 0"}},expandIcon:{transform:"rotate(0deg)",transition:e.transitions.create("transform",t),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"rotate(180deg)"}}}};exports.styles=p;var f=!1,x=n.forwardRef(function(r,s){var l=r.children,u=r.classes,c=r.className,p=r.expandIcon,f=r.IconButtonProps,x=r.onBlur,b=r.onClick,m=r.onFocusVisible,g=(0,t.default)(r,["children","classes","className","expandIcon","IconButtonProps","onBlur","onClick","onFocusVisible"]),y=n.useState(!1),v=y[0],h=y[1],P=n.useContext(d.default),O=P.disabled,q=void 0!==O&&O,j=P.expanded,k=P.toggle;return n.createElement(o.default,(0,e.default)({focusRipple:!1,disableRipple:!0,disabled:q,component:"div","aria-expanded":j,className:(0,a.default)(u.root,c,q&&u.disabled,j&&u.expanded,v&&u.focused),onFocusVisible:function(e){h(!0),m&&m(e)},onBlur:function(e){h(!1),x&&x(e)},onClick:function(e){k&&k(e),b&&b(e)},ref:s},g),n.createElement("div",{className:(0,a.default)(u.content,j&&u.expanded)},l),p&&n.createElement(i.default,(0,e.default)({className:(0,a.default)(u.expandIcon,j&&u.expanded),edge:"end",component:"div",tabIndex:null,role:null,"aria-hidden":!0},f),p))}),b=(0,s.default)(p,{name:"MuiExpansionPanelSummary"})(x);exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../ButtonBase":"VX66","../IconButton":"e0Nd","../styles/withStyles":"awmK","../ExpansionPanel/ExpansionPanelContext":"LwO6"}],"MGbU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./ExpansionPanelSummary"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./ExpansionPanelSummary":"k5HL"}],"xTaA":[function(require,module,exports) {
"use strict";function e(e){var r=e.props,t=e.states,o=e.muiFormControl;return t.reduce(function(e,t){return e[t]=r[t],o&&void 0===r[t]&&(e[t]=o[t]),e},{})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"D3bu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),t=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=l(require("react")),n=i(require("prop-types")),u=i(require("../utils/debounce")),o=i(require("../utils/useForkRef"));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=n?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t){return parseInt(e[t],10)||0}var f="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,d={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}},c=r.forwardRef(function(n,a){var l=n.onChange,i=n.rows,c=n.rowsMax,p=n.rowsMin,h=void 0===p?1:p,v=n.style,w=n.value,b=(0,t.default)(n,["onChange","rows","rowsMax","rowsMin","style","value"]),y=i||h,m=r.useRef(null!=w).current,g=r.useRef(null),x=(0,o.default)(a,g),M=r.useRef(null),O=r.useRef(0),E=r.useState({}),j=E[0],P=E[1],q=r.useCallback(function(){var e=g.current,t=window.getComputedStyle(e),r=M.current;r.style.width=t.width,r.value=e.value||n.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");var u=t["box-sizing"],o=s(t,"padding-bottom")+s(t,"padding-top"),a=s(t,"border-bottom-width")+s(t,"border-top-width"),l=r.scrollHeight-o;r.value="x";var i=r.scrollHeight-o,f=l;y&&(f=Math.max(Number(y)*i,f)),c&&(f=Math.min(Number(c)*i,f));var d=(f=Math.max(f,i))+("border-box"===u?o+a:0),p=Math.abs(f-l)<=1;P(function(e){return O.current<20&&(d>0&&Math.abs((e.outerHeightStyle||0)-d)>1||e.overflow!==p)?(O.current+=1,{overflow:p,outerHeightStyle:d}):e})},[c,y,n.placeholder]);r.useEffect(function(){var e=(0,u.default)(function(){O.current=0,q()});return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}},[q]),f(function(){q()}),r.useEffect(function(){O.current=0},[w]);return r.createElement(r.Fragment,null,r.createElement("textarea",(0,e.default)({value:w,onChange:function(e){O.current=0,m||q(),l&&l(e)},ref:x,rows:y,style:(0,e.default)({height:j.outerHeightStyle,overflow:j.overflow?"hidden":null},v)},b)),r.createElement("textarea",{"aria-hidden":!0,className:n.className,readOnly:!0,ref:M,tabIndex:-1,style:(0,e.default)({},d.shadow,v)}))}),p=c;exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","../utils/debounce":"TiOe","../utils/useForkRef":"eYEl"}],"bwIl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TextareaAutosize"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TextareaAutosize":"D3bu"}],"Abg1":[function(require,module,exports) {
"use strict";function e(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function t(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t&&(e(t.value)&&""!==t.value||r&&e(t.defaultValue)&&""!==t.defaultValue)}function r(e){return e.startAdornment}Object.defineProperty(exports,"__esModule",{value:!0}),exports.hasValue=e,exports.isFilled=t,exports.isAdornedStart=r;
},{}],"IH5E":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=b(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=b(require("@babel/runtime/helpers/esm/extends")),r=require("@material-ui/utils"),o=m(require("react")),n=b(require("prop-types")),a=b(require("clsx")),i=b(require("../FormControl/formControlState")),l=m(require("../FormControl/FormControlContext")),u=b(require("../styles/withStyles")),d=b(require("../utils/capitalize")),s=b(require("../utils/useForkRef")),c=b(require("../TextareaAutosize")),p=require("./utils");function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=o?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function b(e){return e&&e.__esModule?e:{default:e}}var y=function(e){var r="light"===e.palette.type,o={color:"currentColor",opacity:r?.42:.5,transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},n={opacity:"0 !important"},a={opacity:r?.42:.5};return{"@global":{"@keyframes mui-auto-fill":{},"@keyframes mui-auto-fill-cancel":{}},root:(0,t.default)({},e.typography.body1,{color:e.palette.text.primary,lineHeight:"1.1876em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center","&$disabled":{color:e.palette.text.disabled,cursor:"default"}}),formControl:{},focused:{},disabled:{},adornedStart:{},adornedEnd:{},error:{},marginDense:{},multiline:{padding:"".concat(6,"px 0 ").concat(7,"px"),"&$marginDense":{paddingTop:3}},colorSecondary:{},fullWidth:{width:"100%"},input:{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"".concat(6,"px 0 ").concat(7,"px"),border:0,boxSizing:"content-box",background:"none",height:"1.1876em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{"-webkit-appearance":"none"},"label[data-shrink=false] + $formControl &":{"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus::-webkit-input-placeholder":a,"&:focus::-moz-placeholder":a,"&:focus:-ms-input-placeholder":a,"&:focus::-ms-input-placeholder":a},"&$disabled":{opacity:1},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},inputMarginDense:{paddingTop:3},inputMultiline:{height:"auto",resize:"none",padding:0},inputTypeSearch:{"-moz-appearance":"textfield","-webkit-appearance":"textfield"},inputAdornedStart:{},inputAdornedEnd:{},inputHiddenLabel:{}}};exports.styles=y;var h="undefined"==typeof window?o.useEffect:o.useLayoutEffect,g=o.forwardRef(function(n,u){var f=n["aria-describedby"],m=n.autoComplete,b=n.autoFocus,y=n.classes,g=n.className,v=(n.color,n.defaultValue),w=n.disabled,x=n.endAdornment,C=(n.error,n.fullWidth),k=void 0!==C&&C,F=n.id,S=n.inputComponent,M=void 0===S?"input":S,q=n.inputProps,E=void 0===q?{}:q,A=n.inputRef,D=(n.margin,n.multiline),O=void 0!==D&&D,P=n.name,z=n.onBlur,B=n.onChange,W=n.onClick,j=n.onFocus,N=n.onKeyDown,R=n.onKeyUp,T=n.placeholder,K=n.readOnly,_=n.renderSuffix,L=n.rows,H=n.rowsMax,$=n.rowsMin,U=n.startAdornment,V=n.type,I=void 0===V?"text":V,G=n.value,J=(0,e.default)(n,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","startAdornment","type","value"]),Q=null!=E.value?E.value:G,X=o.useRef(null!=Q).current,Y=o.useRef(),Z=o.useCallback(function(e){0},[]),ee=(0,s.default)(E.ref,Z),te=(0,s.default)(A,ee),re=(0,s.default)(Y,te),oe=o.useState(!1),ne=oe[0],ae=oe[1],ie=(0,l.useFormControl)();var le=(0,i.default)({props:n,muiFormControl:ie,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});le.focused=ie?ie.focused:ne,o.useEffect(function(){!ie&&w&&ne&&(ae(!1),z&&z())},[ie,w,ne,z]);var ue=ie&&ie.onFilled,de=ie&&ie.onEmpty,se=o.useCallback(function(e){(0,p.isFilled)(e)?ue&&ue():de&&de()},[ue,de]);h(function(){X&&se({value:Q})},[Q,se,X]);o.useEffect(function(){se(Y.current)},[]);var ce=M,pe=(0,t.default)({},E,{ref:re});"string"!=typeof ce?pe=(0,t.default)({inputRef:re,type:I},pe,{ref:null}):O?!L||H||$?(pe=(0,t.default)({rows:L,rowsMax:H},pe),ce=c.default):ce="textarea":pe=(0,t.default)({type:I},pe);return o.useEffect(function(){ie&&ie.setAdornedStart(Boolean(U))},[ie,U]),o.createElement("div",(0,t.default)({className:(0,a.default)(y.root,y["color".concat((0,d.default)(le.color||"primary"))],g,le.disabled&&y.disabled,le.error&&y.error,k&&y.fullWidth,le.focused&&y.focused,ie&&y.formControl,O&&y.multiline,U&&y.adornedStart,x&&y.adornedEnd,"dense"===le.margin&&y.marginDense),onClick:function(e){Y.current&&e.currentTarget===e.target&&Y.current.focus(),W&&W(e)},ref:u},J),U,o.createElement(l.default.Provider,{value:null},o.createElement(ce,(0,t.default)({"aria-invalid":le.error,"aria-describedby":f,autoComplete:m,autoFocus:b,defaultValue:v,disabled:le.disabled,id:F,onAnimationStart:function(e){se("mui-auto-fill-cancel"===e.animationName?Y.current:{value:"x"})},name:P,placeholder:T,readOnly:K,required:le.required,rows:L,value:Q,onKeyDown:N,onKeyUp:R},pe,{className:(0,a.default)(y.input,E.className,le.disabled&&y.disabled,O&&y.inputMultiline,le.hiddenLabel&&y.inputHiddenLabel,U&&y.inputAdornedStart,x&&y.inputAdornedEnd,"search"===I&&y.inputTypeSearch,"dense"===le.margin&&y.inputMarginDense),onBlur:function(e){z&&z(e),E.onBlur&&E.onBlur(e),ie&&ie.onBlur?ie.onBlur(e):ae(!1)},onChange:function(e){if(!X){var t=e.target||Y.current;if(null==t)throw new Error((0,r.formatMuiErrorMessage)(1));se({value:t.value})}for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];E.onChange&&E.onChange.apply(E,[e].concat(n)),B&&B.apply(void 0,[e].concat(n))},onFocus:function(e){le.disabled?e.stopPropagation():(j&&j(e),E.onFocus&&E.onFocus(e),ie&&ie.onFocus?ie.onFocus(e):ae(!0))}}))),x,_?_((0,t.default)({},le,{startAdornment:U})):null)}),v=(0,u.default)(y,{name:"MuiInputBase"})(g);exports.default=v;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","@material-ui/utils":"gEhD","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../FormControl/formControlState":"xTaA","../FormControl/FormControlContext":"kAd3","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y","../utils/useForkRef":"eYEl","../TextareaAutosize":"bwIl","./utils":"Abg1"}],"UXeJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./InputBase"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./InputBase":"IH5E"}],"u2vQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=s(require("react")),o=u(require("prop-types")),n=u(require("clsx")),i=require("@material-ui/utils"),a=u(require("../InputBase")),d=u(require("../styles/withStyles"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var p=function(e){var t="light"===e.palette.type,r=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)";return{root:{position:"relative",backgroundColor:o,borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:t?"rgba(0, 0, 0, 0.13)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:o}},"&$focused":{backgroundColor:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)"},"&$disabled":{backgroundColor:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(r),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:before":{borderBottom:"1px solid ".concat(e.palette.text.primary)},"&$disabled:before":{borderBottomStyle:"dotted"}},focused:{},disabled:{},adornedStart:{paddingLeft:12},adornedEnd:{paddingRight:12},error:{},marginDense:{},multiline:{padding:"27px 12px 10px","&$marginDense":{paddingTop:23,paddingBottom:6}},input:{padding:"27px 12px 10px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},inputMarginDense:{paddingTop:23,paddingBottom:6},inputHiddenLabel:{paddingTop:18,paddingBottom:19,"&$inputMarginDense":{paddingTop:10,paddingBottom:11}},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}};exports.styles=p;var f=r.forwardRef(function(o,i){var d=o.disableUnderline,l=o.classes,s=o.fullWidth,u=void 0!==s&&s,p=o.inputComponent,f=void 0===p?"input":p,b=o.multiline,c=void 0!==b&&b,g=o.type,m=void 0===g?"text":g,h=(0,t.default)(o,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return r.createElement(a.default,(0,e.default)({classes:(0,e.default)({},l,{root:(0,n.default)(l.root,!d&&l.underline),underline:null}),fullWidth:u,inputComponent:f,multiline:c,ref:i,type:m},h))});f.muiName="Input";var b=(0,d.default)(p,{name:"MuiFilledInput"})(f);exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../InputBase":"UXeJ","../styles/withStyles":"awmK"}],"wWb1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./FilledInput"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./FilledInput":"u2vQ"}],"EbbJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),r=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=c(require("react")),i=f(require("prop-types")),n=f(require("clsx")),o=require("../InputBase/utils"),a=f(require("../styles/withStyles")),l=f(require("../utils/capitalize")),u=f(require("../utils/isMuiElement")),d=f(require("./FormControlContext"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s();if(r&&r.has(e))return r.get(e);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(t,n,o):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function f(e){return e&&e.__esModule?e:{default:e}}var p={root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}};exports.styles=p;var m=t.forwardRef(function(i,a){var s,c=i.children,f=i.classes,p=i.className,m=i.color,v=void 0===m?"primary":m,h=i.component,b=void 0===h?"div":h,g=i.disabled,y=void 0!==g&&g,q=i.error,x=void 0!==q&&q,S=i.fullWidth,O=void 0!==S&&S,W=i.focused,j=i.hiddenLabel,P=void 0!==j&&j,w=i.margin,C=void 0===w?"none":w,E=i.required,M=void 0!==E&&E,_=i.size,F=i.variant,k=void 0===F?"standard":F,B=(0,r.default)(i,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),D=t.useState(function(){var e=!1;return c&&t.Children.forEach(c,function(r){if((0,u.default)(r,["Input","Select"])){var t=(0,u.default)(r,["Select"])?r.props.input:r;t&&(0,o.isAdornedStart)(t.props)&&(e=!0)}}),e}),N=D[0],z=D[1],A=t.useState(function(){var e=!1;return c&&t.Children.forEach(c,function(r){(0,u.default)(r,["Input","Select"])&&(0,o.isFilled)(r.props,!0)&&(e=!0)}),e}),I=A[0],L=A[1],T=t.useState(!1),R=T[0],G=T[1],H=void 0!==W?W:R;y&&H&&G(!1);var J=t.useCallback(function(){L(!0)},[]),K={adornedStart:N,setAdornedStart:z,color:v,disabled:y,error:x,filled:I,focused:H,fullWidth:O,hiddenLabel:P,margin:("small"===_?"dense":void 0)||C,onBlur:function(){G(!1)},onEmpty:t.useCallback(function(){L(!1)},[]),onFilled:J,onFocus:function(){G(!0)},registerEffect:s,required:M,variant:k};return t.createElement(d.default.Provider,{value:K},t.createElement(b,(0,e.default)({className:(0,n.default)(f.root,p,"none"!==C&&f["margin".concat((0,l.default)(C))],O&&f.fullWidth),ref:a},B),c))}),v=(0,a.default)(p,{name:"MuiFormControl"})(m);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../InputBase/utils":"Abg1","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y","../utils/isMuiElement":"dy9R","./FormControlContext":"kAd3"}],"eFUT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"useFormControl",{enumerable:!0,get:function(){return r.default}});var e=t(require("./FormControl")),r=t(require("./useFormControl"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./FormControl":"EbbJ","./useFormControl":"SKV5"}],"AQpH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),t=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=d(require("react")),l=f(require("prop-types")),a=f(require("clsx")),n=require("@material-ui/utils"),i=require("../FormControl"),o=f(require("../styles/withStyles")),s=f(require("../Typography")),u=f(require("../utils/capitalize"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=l?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(r,a,n):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,"&$disabled":{cursor:"default"}},labelPlacementStart:{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},labelPlacementTop:{flexDirection:"column-reverse",marginLeft:16},labelPlacementBottom:{flexDirection:"column",marginLeft:16},disabled:{},label:{"&$disabled":{color:e.palette.text.disabled}}}};exports.styles=p;var b=r.forwardRef(function(l,n){l.checked;var o=l.classes,c=l.className,d=l.control,f=l.disabled,p=(l.inputRef,l.label),b=l.labelPlacement,m=void 0===b?"end":b,v=(l.name,l.onChange,l.value,(0,t.default)(l,["checked","classes","className","control","disabled","inputRef","label","labelPlacement","name","onChange","value"])),g=(0,i.useFormControl)(),h=f;void 0===h&&void 0!==d.props.disabled&&(h=d.props.disabled),void 0===h&&g&&(h=g.disabled);var y={disabled:h};return["checked","name","onChange","value","inputRef"].forEach(function(e){void 0===d.props[e]&&void 0!==l[e]&&(y[e]=l[e])}),r.createElement("label",(0,e.default)({className:(0,a.default)(o.root,c,"end"!==m&&o["labelPlacement".concat((0,u.default)(m))],h&&o.disabled),ref:n},v),r.cloneElement(d,y),r.createElement(s.default,{component:"span",className:(0,a.default)(o.label,h&&o.disabled)},p))}),m=(0,o.default)(p,{name:"MuiFormControlLabel"})(b);exports.default=m;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../FormControl":"eFUT","../styles/withStyles":"awmK","../Typography":"pi2F","../utils/capitalize":"Dk4Y"}],"SR7c":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./FormControlLabel"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./FormControlLabel":"AQpH"}],"g71m":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=n(require("@babel/runtime/helpers/esm/extends")),r=n(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=l(require("react")),o=n(require("prop-types")),u=n(require("clsx")),s=n(require("../styles/withStyles"));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var s=o?Object.getOwnPropertyDescriptor(e,u):null;s&&(s.get||s.set)?Object.defineProperty(t,u,s):t[u]=e[u]}return t.default=e,r&&r.set(e,t),t}function n(e){return e&&e.__esModule?e:{default:e}}var i={root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}};exports.styles=i;var f=t.forwardRef(function(o,s){var a=o.classes,l=o.className,n=o.row,i=void 0!==n&&n,f=(0,r.default)(o,["classes","className","row"]);return t.createElement("div",(0,e.default)({className:(0,u.default)(a.root,l,i&&a.row),ref:s},f))}),c=(0,s.default)(i,{name:"MuiFormGroup"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"QPPT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./FormGroup"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./FormGroup":"g71m"}],"TPKa":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=d(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=d(require("@babel/runtime/helpers/esm/extends")),t=u(require("react")),o=d(require("prop-types")),a=d(require("clsx")),n=d(require("../FormControl/formControlState")),i=d(require("../FormControl/useFormControl")),l=d(require("../styles/withStyles"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=o?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(t,a,n):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function d(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:(0,r.default)({color:e.palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}};exports.styles=f;var c=t.forwardRef(function(o,l){var s=o.children,u=o.classes,d=o.className,f=o.component,c=void 0===f?"p":f,p=(o.disabled,o.error,o.filled,o.focused,o.margin,o.required,o.variant,(0,e.default)(o,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"])),m=(0,i.default)(),b=(0,n.default)({props:o,muiFormControl:m,states:["variant","margin","disabled","error","filled","focused","required"]});return t.createElement(c,(0,r.default)({className:(0,a.default)(u.root,("filled"===b.variant||"outlined"===b.variant)&&u.contained,d,b.disabled&&u.disabled,b.error&&u.error,b.filled&&u.filled,b.focused&&u.focused,b.required&&u.required,"dense"===b.margin&&u.marginDense),ref:l},p)," "===s?t.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}}):s)}),p=(0,l.default)(f,{name:"MuiFormHelperText"})(c);exports.default=p;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../FormControl/formControlState":"xTaA","../FormControl/useFormControl":"SKV5","../styles/withStyles":"awmK"}],"iw6n":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./FormHelperText"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./FormHelperText":"TPKa"}],"q5Vj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=c(require("@babel/runtime/helpers/esm/extends")),t=n(require("react")),o=c(require("prop-types")),l=c(require("clsx")),a=c(require("../FormControl/formControlState")),i=c(require("../FormControl/useFormControl")),s=c(require("../utils/capitalize")),d=c(require("../styles/withStyles"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var a=o?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(t,l,a):t[l]=e[l]}return t.default=e,r&&r.set(e,t),t}function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:(0,r.default)({color:e.palette.text.secondary},e.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),colorSecondary:{"&$focused":{color:e.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:e.palette.error.main}}}};exports.styles=f;var p=t.forwardRef(function(o,d){var u=o.children,n=o.classes,c=o.className,f=(o.color,o.component),p=void 0===f?"label":f,m=(o.disabled,o.error,o.filled,o.focused,o.required,(0,e.default)(o,["children","classes","className","color","component","disabled","error","filled","focused","required"])),b=(0,i.default)(),y=(0,a.default)({props:o,muiFormControl:b,states:["color","required","focused","disabled","error","filled"]});return t.createElement(p,(0,r.default)({className:(0,l.default)(n.root,n["color".concat((0,s.default)(y.color||"primary"))],c,y.disabled&&n.disabled,y.error&&n.error,y.filled&&n.filled,y.focused&&n.focused,y.required&&n.required),ref:d},m),u,y.required&&t.createElement("span",{"aria-hidden":!0,className:(0,l.default)(n.asterisk,y.error&&n.error)}," ","*"))}),m=(0,d.default)(f,{name:"MuiFormLabel"})(p);exports.default=m;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../FormControl/formControlState":"xTaA","../FormControl/useFormControl":"SKV5","../utils/capitalize":"Dk4Y","../styles/withStyles":"awmK"}],"khD4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./FormLabel"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./FormLabel":"q5Vj"}],"hjYL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=l(require("@babel/runtime/helpers/esm/extends")),n=c(require("react")),r=l(require("prop-types")),i=l(require("clsx")),a=l(require("../styles/withStyles")),o=l(require("../utils/requirePropFactory"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function l(e){return e&&e.__esModule?e:{default:e}}var u=[0,1,2,3,4,5,6,7,8,9,10],f=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function d(e,n,r){var i={};f.forEach(function(e){var t="grid-".concat(r,"-").concat(e);if(!0!==e)if("auto"!==e){var n="".concat(Math.round(e/12*1e8)/1e6,"%");i[t]={flexBasis:n,flexGrow:0,maxWidth:n}}else i[t]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};else i[t]={flexBasis:0,flexGrow:1,maxWidth:"100%"}}),"xs"===r?(0,t.default)(e,i):e[n.breakpoints.up(r)]=i}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseFloat(e);return"".concat(n/t).concat(String(e).replace(String(n),"")||"px")}function p(e,t){var n={};return u.forEach(function(r){var i=e.spacing(r);0!==i&&(n["spacing-".concat(t,"-").concat(r)]={margin:"-".concat(x(i,2)),width:"calc(100% + ".concat(x(i),")"),"& > $item":{padding:x(i,2)}})}),n}var g=function(e){return(0,t.default)({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-xs-center":{justifyContent:"center"},"justify-xs-flex-end":{justifyContent:"flex-end"},"justify-xs-space-between":{justifyContent:"space-between"},"justify-xs-space-around":{justifyContent:"space-around"},"justify-xs-space-evenly":{justifyContent:"space-evenly"}},p(e,"xs"),e.breakpoints.keys.reduce(function(t,n){return d(t,e,n),t},{}))};exports.styles=g;var m,v=n.forwardRef(function(r,a){var o=r.alignContent,s=void 0===o?"stretch":o,c=r.alignItems,l=void 0===c?"stretch":c,u=r.classes,f=r.className,d=r.component,x=void 0===d?"div":d,p=r.container,g=void 0!==p&&p,m=r.direction,v=void 0===m?"row":m,y=r.item,w=void 0!==y&&y,b=r.justify,h=void 0===b?"flex-start":b,j=r.lg,S=void 0!==j&&j,W=r.md,C=void 0!==W&&W,M=r.sm,O=void 0!==M&&M,q=r.spacing,P=void 0===q?0:q,z=r.wrap,I=void 0===z?"wrap":z,_=r.xl,k=void 0!==_&&_,D=r.xs,G=void 0!==D&&D,B=r.zeroMinWidth,E=void 0!==B&&B,N=(0,e.default)(r,["alignContent","alignItems","classes","className","component","container","direction","item","justify","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),F=(0,i.default)(u.root,f,g&&[u.container,0!==P&&u["spacing-xs-".concat(String(P))]],w&&u.item,E&&u.zeroMinWidth,"row"!==v&&u["direction-xs-".concat(String(v))],"wrap"!==I&&u["wrap-xs-".concat(String(I))],"stretch"!==l&&u["align-items-xs-".concat(String(l))],"stretch"!==s&&u["align-content-xs-".concat(String(s))],"flex-start"!==h&&u["justify-xs-".concat(String(h))],!1!==G&&u["grid-xs-".concat(String(G))],!1!==O&&u["grid-sm-".concat(String(O))],!1!==C&&u["grid-md-".concat(String(C))],!1!==S&&u["grid-lg-".concat(String(S))],!1!==k&&u["grid-xl-".concat(String(k))]);return n.createElement(x,(0,t.default)({className:F,ref:a},N))}),y=(0,a.default)(g,{name:"MuiGrid"})(v),w=y;exports.default=w;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/requirePropFactory":"Hmdm"}],"xZhg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Grid"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Grid":"hjYL"}],"cUwp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=a(require("react")),l=require("react-is"),o=u(require("prop-types")),n=u(require("clsx")),s=u(require("../styles/withStyles"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=l?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(r,o,n):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var c={root:{display:"flex",flexWrap:"wrap",overflowY:"auto",listStyle:"none",padding:0,WebkitOverflowScrolling:"touch"}};exports.styles=c;var p=r.forwardRef(function(l,o){var s=l.cellHeight,i=void 0===s?180:s,a=l.children,u=l.classes,c=l.className,p=l.cols,f=void 0===p?2:p,d=l.component,y=void 0===d?"ul":d,v=l.spacing,h=void 0===v?4:v,m=l.style,b=(0,t.default)(l,["cellHeight","children","classes","className","cols","component","spacing","style"]);return r.createElement(y,(0,e.default)({className:(0,n.default)(u.root,c),ref:o,style:(0,e.default)({margin:-h/2},m)},b),r.Children.map(a,function(t){if(!r.isValidElement(t))return null;var l=t.props.cols||1,o=t.props.rows||1;return r.cloneElement(t,{style:(0,e.default)({width:"".concat(100/f*l,"%"),height:"auto"===i?"auto":i*o+h,padding:h/2},t.props.style)})}))}),f=(0,s.default)(c,{name:"MuiGridList"})(p);exports.default=f;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"IDL3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./GridList"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./GridList":"cUwp"}],"nxiz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=c(require("@babel/runtime/helpers/esm/toConsumableArray")),i=f(require("react")),l=c(require("prop-types")),n=c(require("clsx")),s=c(require("../utils/debounce")),o=c(require("../styles/withStyles")),a=c(require("../utils/isMuiElement"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=i?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=e[l]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var d={root:{boxSizing:"border-box",flexShrink:0},tile:{position:"relative",display:"block",height:"100%",overflow:"hidden"},imgFullHeight:{height:"100%",transform:"translateX(-50%)",position:"relative",left:"50%"},imgFullWidth:{width:"100%",position:"relative",transform:"translateY(-50%)",top:"50%"}};exports.styles=d;var p=function(e,t){var i,l,n,s;e&&e.complete&&(e.width/e.height>e.parentElement.offsetWidth/e.parentElement.offsetHeight?((i=e.classList).remove.apply(i,(0,r.default)(t.imgFullWidth.split(" "))),(l=e.classList).add.apply(l,(0,r.default)(t.imgFullHeight.split(" ")))):((n=e.classList).remove.apply(n,(0,r.default)(t.imgFullHeight.split(" "))),(s=e.classList).add.apply(s,(0,r.default)(t.imgFullWidth.split(" ")))))};function m(e,t){e&&(e.complete?p(e,t):e.addEventListener("load",function(){p(e,t)}))}var h=i.forwardRef(function(r,l){var o=r.children,u=r.classes,f=r.className,c=(r.cols,r.component),d=void 0===c?"li":c,h=(r.rows,(0,t.default)(r,["children","classes","className","cols","component","rows"])),v=i.useRef(null);return i.useEffect(function(){m(v.current,u)}),i.useEffect(function(){var e=(0,s.default)(function(){p(v.current,u)});return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}},[u]),i.createElement(d,(0,e.default)({className:(0,n.default)(u.root,f),ref:l},h),i.createElement("div",{className:u.tile},i.Children.map(o,function(e){return i.isValidElement(e)?"img"===e.type||(0,a.default)(e,["Image"])?i.cloneElement(e,{ref:v}):e:null})))}),v=(0,o.default)(d,{name:"MuiGridListTile"})(h);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/toConsumableArray":"Qv3s","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../utils/debounce":"TiOe","../styles/withStyles":"awmK","../utils/isMuiElement":"dy9R"}],"PY3v":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./GridListTile"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./GridListTile":"nxiz"}],"jyeo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var t=s(require("@babel/runtime/helpers/esm/extends")),e=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),i=a(require("react")),o=s(require("prop-types")),r=s(require("clsx")),l=s(require("../styles/withStyles"));function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function a(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var l=o?Object.getOwnPropertyDescriptor(t,r):null;l&&(l.get||l.set)?Object.defineProperty(i,r,l):i[r]=t[r]}return i.default=t,e&&e.set(t,i),i}function s(t){return t&&t.__esModule?t:{default:t}}var c=function(t){return{root:{position:"absolute",left:0,right:0,height:48,background:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",fontFamily:t.typography.fontFamily},titlePositionBottom:{bottom:0},titlePositionTop:{top:0},rootSubtitle:{height:68},titleWrap:{flexGrow:1,marginLeft:16,marginRight:16,color:t.palette.common.white,overflow:"hidden"},titleWrapActionPosLeft:{marginLeft:0},titleWrapActionPosRight:{marginRight:0},title:{fontSize:t.typography.pxToRem(16),lineHeight:"24px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},subtitle:{fontSize:t.typography.pxToRem(12),lineHeight:1,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},actionIcon:{},actionIconActionPosLeft:{order:-1}}};exports.styles=c;var u=i.forwardRef(function(o,l){var n=o.actionIcon,a=o.actionPosition,s=void 0===a?"right":a,c=o.classes,u=o.className,f=o.subtitle,p=o.title,d=o.titlePosition,m=void 0===d?"bottom":d,h=(0,e.default)(o,["actionIcon","actionPosition","classes","className","subtitle","title","titlePosition"]),g=n&&s;return i.createElement("div",(0,t.default)({className:(0,r.default)(c.root,u,"top"===m?c.titlePositionTop:c.titlePositionBottom,f&&c.rootSubtitle),ref:l},h),i.createElement("div",{className:(0,r.default)(c.titleWrap,{left:c.titleWrapActionPosLeft,right:c.titleWrapActionPosRight}[g])},i.createElement("div",{className:c.title},p),f?i.createElement("div",{className:c.subtitle},f):null),n?i.createElement("div",{className:(0,r.default)(c.actionIcon,"left"===g&&c.actionIconActionPosLeft)},n):null)}),f=(0,l.default)(c,{name:"MuiGridListTileBar"})(u);exports.default=f;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"B5WC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./GridListTileBar"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./GridListTileBar":"jyeo"}],"fhRv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/slicedToArray")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=d(require("react")),i=c(require("prop-types")),o=require("react-transition-group"),u=c(require("../styles/useTheme")),a=require("../transitions/utils"),s=c(require("../utils/useForkRef"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}function f(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var p={entering:{opacity:1,transform:f(1)},entered:{opacity:1,transform:"none"}},y=n.forwardRef(function(i,l){var d=i.children,c=i.disableStrictModeCompat,y=void 0!==c&&c,m=i.in,v=i.onEnter,E=i.onEntered,g=i.onEntering,b=i.onExit,h=i.onExited,x=i.onExiting,j=i.style,q=i.timeout,M=void 0===q?"auto":q,O=i.TransitionComponent,P=void 0===O?o.Transition:O,T=(0,r.default)(i,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),w=n.useRef(),_=n.useRef(),R=(0,u.default)(),A=R.unstable_strictMode&&!y,C=n.useRef(null),D=(0,s.default)(d.ref,l),H=(0,s.default)(A?C:void 0,D),k=function(e){return function(r,n){if(e){var i=A?[C.current,r]:[r,n],o=(0,t.default)(i,2),u=o[0],a=o[1];void 0===a?e(u):e(u,a)}}},S=k(g),W=k(function(e,t){(0,a.reflow)(e);var r,n=(0,a.getTransitionProps)({style:j,timeout:M},{mode:"enter"}),i=n.duration,o=n.delay;"auto"===M?(r=R.transitions.getAutoHeightDuration(e.clientHeight),_.current=r):r=i,e.style.transition=[R.transitions.create("opacity",{duration:r,delay:o}),R.transitions.create("transform",{duration:.666*r,delay:o})].join(","),v&&v(e,t)}),F=k(E),L=k(x),z=k(function(e){var t,r=(0,a.getTransitionProps)({style:j,timeout:M},{mode:"exit"}),n=r.duration,i=r.delay;"auto"===M?(t=R.transitions.getAutoHeightDuration(e.clientHeight),_.current=t):t=n,e.style.transition=[R.transitions.create("opacity",{duration:t,delay:i}),R.transitions.create("transform",{duration:.666*t,delay:i||.333*t})].join(","),e.style.opacity="0",e.style.transform=f(.75),b&&b(e)}),B=k(h);return n.useEffect(function(){return function(){clearTimeout(w.current)}},[]),n.createElement(P,(0,e.default)({appear:!0,in:m,nodeRef:A?C:void 0,onEnter:W,onEntered:F,onEntering:S,onExit:z,onExited:B,onExiting:L,addEndListener:function(e,t){var r=A?e:t;"auto"===M&&(w.current=setTimeout(r,_.current||0))},timeout:"auto"===M?null:M},T),function(t,r){return n.cloneElement(d,(0,e.default)({style:(0,e.default)({opacity:0,transform:f(.75),visibility:"exited"!==t||m?void 0:"hidden"},p[t],j,d.props.style),ref:H},r))})});y.muiSupportAuto=!0;var m=y;exports.default=m;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","react-transition-group":"ORBw","../styles/useTheme":"nmB4","../transitions/utils":"DLys","../utils/useForkRef":"eYEl"}],"vuXQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Grow"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Grow":"fhRv"}],"aMbh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;var e=u(require("@babel/runtime/helpers/esm/extends")),t=i(require("react")),r=require("@material-ui/styles");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=i?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(r,u,a):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}function a(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=(0,r.useTheme)(),a=(0,r.getThemeProps)({theme:u,name:"MuiUseMediaQuery",props:{}});var o="function"==typeof n?n(u):n;o=o.replace(/^@media( ?)/m,"");var f="undefined"!=typeof window&&void 0!==window.matchMedia,c=(0,e.default)({},a,i),s=c.defaultMatches,d=void 0!==s&&s,l=c.matchMedia,p=void 0===l?f?window.matchMedia:null:l,v=c.noSsr,m=void 0!==v&&v,h=c.ssrMatchMedia,y=void 0===h?null:h,M=t.useState(function(){return m&&f?p(o).matches:y?y(o).matches:d}),w=M[0],b=M[1];return t.useEffect(function(){var e=!0;if(f){var t=p(o),r=function(){e&&b(t.matches)};return r(),t.addListener(r),function(){e=!1,t.removeListener(r)}}},[o,p,f]),w}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","@material-ui/styles":"thJn"}],"EWA0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./useMediaQuery"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./useMediaQuery":"aMbh"}],"hmtW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.isWidthDown=exports.isWidthUp=void 0;var e=p(require("@babel/runtime/helpers/esm/extends")),t=p(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=l(require("react")),i=p(require("prop-types")),n=require("@material-ui/utils"),u=require("@material-ui/styles"),o=p(require("hoist-non-react-statics")),s=p(require("../styles/useTheme")),a=require("../styles/createBreakpoints"),d=p(require("../useMediaQuery"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var u=i?Object.getOwnPropertyDescriptor(e,n):null;u&&(u.get||u.set)?Object.defineProperty(r,n,u):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}var c=function(e,t){return!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?a.keys.indexOf(e)<=a.keys.indexOf(t):a.keys.indexOf(e)<a.keys.indexOf(t)};exports.isWidthUp=c;var h=function(e,t){return!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?a.keys.indexOf(t)<=a.keys.indexOf(e):a.keys.indexOf(t)<a.keys.indexOf(e)};exports.isWidthDown=h;var y="undefined"==typeof window?r.useEffect:r.useLayoutEffect,v=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){var a=i.withTheme,f=void 0!==a&&a,l=i.noSSR,p=void 0!==l&&l,c=i.initialWidth;function h(i){var o=(0,s.default)(),a=i.theme||o,l=(0,u.getThemeProps)({theme:a,name:"MuiWithWidth",props:(0,e.default)({},i)}),h=l.initialWidth,v=l.width,O=(0,t.default)(l,["initialWidth","width"]),x=r.useState(!1),b=x[0],k=x[1];y(function(){k(!0)},[]);var m=a.breakpoints.keys.slice().reverse().reduce(function(e,t){var r=(0,d.default)(a.breakpoints.up(t));return!e&&r?t:e},null),w=(0,e.default)({width:v||(b||p?m:void 0)||h||c},f?{theme:a}:{},O);return void 0===w.width?null:r.createElement(n,w)}return(0,o.default)(h,n),h}},O=v;exports.default=O;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","@material-ui/utils":"gEhD","@material-ui/styles":"thJn","hoist-non-react-statics":"ElIr","../styles/useTheme":"nmB4","../styles/createBreakpoints":"GWqs","../useMediaQuery":"EWA0"}],"tyfK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={};Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t.default}});var t=n(require("./withWidth"));function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var f=o?Object.getOwnPropertyDescriptor(e,u):null;f&&(f.get||f.set)?Object.defineProperty(n,u,f):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}Object.keys(t).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||r in exports&&exports[r]===t[r]||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return t[r]}}))});
},{"./withWidth":"hmtW"}],"Nm88":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("prop-types")),t=require("@material-ui/utils"),r=n(require("../withWidth")),l=a(require("../styles/useTheme"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=l?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function a(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=e.children,o=e.only,n=e.width,a=(0,l.default)(),u=!0;if(o)if(Array.isArray(o))for(var f=0;f<o.length;f+=1){if(n===o[f]){u=!1;break}}else o&&n===o&&(u=!1);if(u)for(var i=0;i<a.breakpoints.keys.length;i+=1){var d=a.breakpoints.keys[i],s=e["".concat(d,"Up")],p=e["".concat(d,"Down")];if(s&&(0,r.isWidthUp)(d,n)||p&&(0,r.isWidthDown)(d,n)){u=!1;break}}return u?t:null}u.propTypes={children:e.default.node,className:e.default.string,implementation:e.default.oneOf(["js","css"]),initialWidth:e.default.oneOf(["xs","sm","md","lg","xl"]),lgDown:e.default.bool,lgUp:e.default.bool,mdDown:e.default.bool,mdUp:e.default.bool,only:e.default.oneOfType([e.default.oneOf(["xs","sm","md","lg","xl"]),e.default.arrayOf(e.default.oneOf(["xs","sm","md","lg","xl"]))]),smDown:e.default.bool,smUp:e.default.bool,width:e.default.string.isRequired,xlDown:e.default.bool,xlUp:e.default.bool,xsDown:e.default.bool,xsUp:e.default.bool};var f=(0,r.default)()(u);exports.default=f;
},{"prop-types":"D9Od","@material-ui/utils":"gEhD","../withWidth":"tyfK","../styles/useTheme":"nmB4"}],"JkGw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=c(require("@babel/runtime/helpers/esm/defineProperty")),r=i(require("react")),n=c(require("prop-types")),a=c(require("../utils/capitalize")),o=c(require("../styles/withStyles")),u=c(require("../styles/useTheme"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var l=function(e){var r={display:"none"};return e.breakpoints.keys.reduce(function(n,o){return n["only".concat((0,a.default)(o))]=(0,t.default)({},e.breakpoints.only(o),r),n["".concat(o,"Up")]=(0,t.default)({},e.breakpoints.up(o),r),n["".concat(o,"Down")]=(0,t.default)({},e.breakpoints.down(o),r),n},{})};function p(t){var n=t.children,o=t.classes,s=t.className,i=t.only,c=((0,e.default)(t,["children","classes","className","only"]),(0,u.default)()),l=[];s&&l.push(s);for(var p=0;p<c.breakpoints.keys.length;p+=1){var f=c.breakpoints.keys[p],d=t["".concat(f,"Up")],y=t["".concat(f,"Down")];d&&l.push(o["".concat(f,"Up")]),y&&l.push(o["".concat(f,"Down")])}i&&(Array.isArray(i)?i:[i]).forEach(function(e){l.push(o["only".concat((0,a.default)(e))])});return r.createElement("div",{className:l.join(" ")},n)}var f=(0,o.default)(l,{name:"PrivateHiddenCss"})(p);exports.default=f;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","react":"n8MK","prop-types":"D9Od","../utils/capitalize":"Dk4Y","../styles/withStyles":"awmK","../styles/useTheme":"nmB4"}],"uPti":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),o=u(require("prop-types")),n=u(require("./HiddenJs")),i=u(require("./HiddenCss"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}function s(o){var l=o.implementation,p=void 0===l?"js":l,u=o.lgDown,s=void 0!==u&&u,d=o.lgUp,a=void 0!==d&&d,f=o.mdDown,m=void 0!==f&&f,w=o.mdUp,c=void 0!==w&&w,D=o.smDown,v=void 0!==D&&D,x=o.smUp,U=void 0!==x&&x,b=o.xlDown,g=void 0!==b&&b,y=o.xlUp,j=void 0!==y&&y,O=o.xsDown,P=void 0!==O&&O,q=o.xsUp,_=void 0!==q&&q,h=(0,t.default)(o,["implementation","lgDown","lgUp","mdDown","mdUp","smDown","smUp","xlDown","xlUp","xsDown","xsUp"]);return"js"===p?r.createElement(n.default,(0,e.default)({lgDown:s,lgUp:a,mdDown:m,mdUp:c,smDown:v,smUp:U,xlDown:g,xlUp:j,xsDown:P,xsUp:_},h)):r.createElement(i.default,(0,e.default)({lgDown:s,lgUp:a,mdDown:m,mdUp:c,smDown:v,smUp:U,xlDown:g,xlUp:j,xsDown:P,xsUp:_},h))}var d=s;exports.default=d;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","./HiddenJs":"Nm88","./HiddenCss":"JkGw"}],"Sxgj":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Hidden"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Hidden":"uPti"}],"HH0P":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=c(require("react")),o=u(require("prop-types")),n=u(require("clsx")),a=u(require("../styles/withStyles")),i=u(require("../utils/capitalize"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=o?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return{root:{userSelect:"none",fontSize:e.typography.pxToRem(24),width:"1em",height:"1em",overflow:"hidden",flexShrink:0},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(36)}}};exports.styles=s;var f=r.forwardRef(function(o,a){var l=o.classes,c=o.className,u=o.color,s=void 0===u?"inherit":u,f=o.component,p=void 0===f?"span":f,d=o.fontSize,m=void 0===d?"default":d,y=(0,t.default)(o,["classes","className","color","component","fontSize"]);return r.createElement(p,(0,e.default)({className:(0,n.default)("material-icons",l.root,c,"inherit"!==s&&l["color".concat((0,i.default)(s))],"default"!==m&&l["fontSize".concat((0,i.default)(m))]),"aria-hidden":!0,ref:a},y))});f.muiName="Icon";var p=(0,a.default)(s,{name:"MuiIcon"})(f);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y"}],"YGXd":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Icon"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Icon":"HH0P"}],"Oytn":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=d(require("@babel/runtime/helpers/esm/extends")),t=d(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),o=d(require("prop-types")),n=d(require("clsx")),i=require("@material-ui/utils"),a=d(require("../InputBase")),l=d(require("../styles/withStyles"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function d(e){return e&&e.__esModule?e:{default:e}}var p=function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{position:"relative"},formControl:{"label + &":{marginTop:16}},focused:{},disabled:{},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(t),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):before":{borderBottom:"2px solid ".concat(e.palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(t)}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{},marginDense:{},multiline:{},fullWidth:{},input:{},inputMarginDense:{},inputMultiline:{},inputTypeSearch:{}}};exports.styles=p;var f=r.forwardRef(function(o,i){var l=o.disableUnderline,s=o.classes,u=o.fullWidth,d=void 0!==u&&u,p=o.inputComponent,f=void 0===p?"input":p,c=o.multiline,m=void 0!==c&&c,b=o.type,y=void 0===b?"text":b,v=(0,t.default)(o,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return r.createElement(a.default,(0,e.default)({classes:(0,e.default)({},s,{root:(0,n.default)(s.root,!l&&s.underline),underline:null}),fullWidth:d,inputComponent:f,multiline:m,ref:i,type:y},v))});f.muiName="Input";var c=(0,l.default)(p,{name:"MuiInput"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../InputBase":"UXeJ","../styles/withStyles":"awmK"}],"CaNl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Input"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Input":"Oytn"}],"P5TR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=d(require("react")),n=u(require("prop-types")),i=u(require("clsx")),o=u(require("../Typography")),a=u(require("../styles/withStyles")),s=d(require("../FormControl/FormControlContext"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var p={root:{display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap"},filled:{"&$positionStart:not($hiddenLabel)":{marginTop:16}},positionStart:{marginRight:8},positionEnd:{marginLeft:8},disablePointerEvents:{pointerEvents:"none"},hiddenLabel:{},marginDense:{}};exports.styles=p;var f=r.forwardRef(function(n,a){var l=n.children,d=n.classes,u=n.className,p=n.component,f=void 0===p?"div":p,c=n.disablePointerEvents,m=void 0!==c&&c,v=n.disableTypography,y=void 0!==v&&v,b=n.position,h=n.variant,g=(0,t.default)(n,["children","classes","className","component","disablePointerEvents","disableTypography","position","variant"]),P=(0,s.useFormControl)()||{},x=h;return h&&P.variant,P&&!x&&(x=P.variant),r.createElement(s.default.Provider,{value:null},r.createElement(f,(0,e.default)({className:(0,i.default)(d.root,u,m&&d.disablePointerEvents,P.hiddenLabel&&d.hiddenLabel,"filled"===x&&d.filled,{start:d.positionStart,end:d.positionEnd}[b],"dense"===P.margin&&d.marginDense),ref:a},g),"string"!=typeof l||y?l:r.createElement(o.default,{color:"textSecondary"},l)))}),c=(0,a.default)(p,{name:"MuiInputAdornment"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../Typography":"pi2F","../styles/withStyles":"awmK","../FormControl/FormControlContext":"kAd3"}],"lydx":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./InputAdornment"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./InputAdornment":"P5TR"}],"oVuB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=d(require("@babel/runtime/helpers/esm/extends")),r=d(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=f(require("react")),a=d(require("prop-types")),n=d(require("clsx")),s=d(require("../FormControl/formControlState")),o=d(require("../FormControl/useFormControl")),i=d(require("../styles/withStyles")),l=d(require("../FormLabel"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=a?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(t,n,s):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function d(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}};exports.styles=p;var c=t.forwardRef(function(a,i){var u=a.classes,f=a.className,d=a.disableAnimation,p=void 0!==d&&d,c=(a.margin,a.shrink),m=(a.variant,(0,r.default)(a,["classes","className","disableAnimation","margin","shrink","variant"])),x=(0,o.default)(),b=c;void 0===b&&x&&(b=x.filled||x.focused||x.adornedStart);var v=(0,s.default)({props:a,muiFormControl:x,states:["margin","variant"]});return t.createElement(l.default,(0,e.default)({"data-shrink":b,className:(0,n.default)(u.root,f,x&&u.formControl,!p&&u.animated,b&&u.shrink,"dense"===v.margin&&u.marginDense,{filled:u.filled,outlined:u.outlined}[v.variant]),classes:{focused:u.focused,disabled:u.disabled,error:u.error,required:u.required,asterisk:u.asterisk},ref:i},m))}),m=(0,i.default)(p,{name:"MuiInputLabel"})(c);exports.default=m;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../FormControl/formControlState":"xTaA","../FormControl/useFormControl":"SKV5","../styles/withStyles":"awmK","../FormLabel":"khD4"}],"pS8F":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./InputLabel"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./InputLabel":"oVuB"}],"roKe":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=d(require("react")),a=c(require("prop-types")),n=c(require("clsx")),i=c(require("../utils/capitalize")),o=c(require("../styles/withStyles")),l=require("../styles/colorManipulator"),u=c(require("../styles/useTheme"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function c(e){return e&&e.__esModule?e:{default:e}}var f=4,m=function(e){var r=function(r){return"light"===e.palette.type?(0,l.lighten)(r,.62):(0,l.darken)(r,.5)},t=r(e.palette.primary.main),a=r(e.palette.secondary.main);return{root:{position:"relative",overflow:"hidden",height:4,"@media print":{colorAdjust:"exact"}},colorPrimary:{backgroundColor:t},colorSecondary:{backgroundColor:a},determinate:{},indeterminate:{},buffer:{backgroundColor:"transparent"},query:{transform:"rotate(180deg)"},dashed:{position:"absolute",marginTop:0,height:"100%",width:"100%",animation:"$buffer 3s infinite linear"},dashedColorPrimary:{backgroundImage:"radial-gradient(".concat(t," 0%, ").concat(t," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},dashedColorSecondary:{backgroundImage:"radial-gradient(".concat(a," 0%, ").concat(a," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},bar:{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},barColorPrimary:{backgroundColor:e.palette.primary.main},barColorSecondary:{backgroundColor:e.palette.secondary.main},bar1Indeterminate:{width:"auto",animation:"$indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"},bar1Determinate:{transition:"transform .".concat(f,"s linear")},bar1Buffer:{zIndex:1,transition:"transform .".concat(f,"s linear")},bar2Indeterminate:{width:"auto",animation:"$indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite"},bar2Buffer:{transition:"transform .".concat(f,"s linear")},"@keyframes indeterminate1":{"0%":{left:"-35%",right:"100%"},"60%":{left:"100%",right:"-90%"},"100%":{left:"100%",right:"-90%"}},"@keyframes indeterminate2":{"0%":{left:"-200%",right:"100%"},"60%":{left:"107%",right:"-8%"},"100%":{left:"107%",right:"-8%"}},"@keyframes buffer":{"0%":{opacity:1,backgroundPosition:"0 -23px"},"50%":{opacity:0,backgroundPosition:"0 -23px"},"100%":{opacity:1,backgroundPosition:"-200px -23px"}}}};exports.styles=m;var b=t.forwardRef(function(a,o){var l=a.classes,s=a.className,d=a.color,c=void 0===d?"primary":d,f=a.value,m=a.valueBuffer,b=a.variant,p=void 0===b?"indeterminate":b,y=(0,r.default)(a,["classes","className","color","value","valueBuffer","variant"]),g=(0,u.default)(),v={},h={bar1:{},bar2:{}};if("determinate"===p||"buffer"===p)if(void 0!==f){v["aria-valuenow"]=Math.round(f),v["aria-valuemin"]=0,v["aria-valuemax"]=100;var k=f-100;"rtl"===g.direction&&(k=-k),h.bar1.transform="translateX(".concat(k,"%)")}else 0;if("buffer"===p)if(void 0!==m){var x=(m||0)-100;"rtl"===g.direction&&(x=-x),h.bar2.transform="translateX(".concat(x,"%)")}else 0;return t.createElement("div",(0,e.default)({className:(0,n.default)(l.root,l["color".concat((0,i.default)(c))],s,{determinate:l.determinate,indeterminate:l.indeterminate,buffer:l.buffer,query:l.query}[p]),role:"progressbar"},v,{ref:o},y),"buffer"===p?t.createElement("div",{className:(0,n.default)(l.dashed,l["dashedColor".concat((0,i.default)(c))])}):null,t.createElement("div",{className:(0,n.default)(l.bar,l["barColor".concat((0,i.default)(c))],("indeterminate"===p||"query"===p)&&l.bar1Indeterminate,{determinate:l.bar1Determinate,buffer:l.bar1Buffer}[p]),style:h.bar1}),"determinate"===p?null:t.createElement("div",{className:(0,n.default)(l.bar,("indeterminate"===p||"query"===p)&&l.bar2Indeterminate,"buffer"===p?[l["color".concat((0,i.default)(c))],l.bar2Buffer]:l["barColor".concat((0,i.default)(c))]),style:h.bar2}))}),p=(0,o.default)(m,{name:"MuiLinearProgress"})(b);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../utils/capitalize":"Dk4Y","../styles/withStyles":"awmK","../styles/colorManipulator":"aguB","../styles/useTheme":"nmB4"}],"knAy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./LinearProgress"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./LinearProgress":"roKe"}],"oxr9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),r=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=d(require("react")),o=f(require("prop-types")),n=f(require("clsx")),i=f(require("../utils/capitalize")),u=f(require("../styles/withStyles")),a=require("@material-ui/utils"),s=f(require("../utils/useIsFocusVisible")),l=f(require("../utils/useForkRef")),c=f(require("../Typography"));function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=p();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(t,n,i):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function f(e){return e&&e.__esModule?e:{default:e}}var b={root:{},underlineNone:{textDecoration:"none"},underlineHover:{textDecoration:"none","&:hover":{textDecoration:"underline"}},underlineAlways:{textDecoration:"underline"},button:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none","&::-moz-focus-inner":{borderStyle:"none"},"&$focusVisible":{outline:"auto"}},focusVisible:{}};exports.styles=b;var y=t.forwardRef(function(o,u){var a=o.classes,p=o.className,d=o.color,f=void 0===d?"primary":d,b=o.component,y=void 0===b?"a":b,v=o.onBlur,m=o.onFocus,h=o.TypographyClasses,g=o.underline,q=void 0===g?"hover":g,x=o.variant,O=void 0===x?"inherit":x,j=(0,r.default)(o,["classes","className","color","component","onBlur","onFocus","TypographyClasses","underline","variant"]),w=(0,s.default)(),k=w.isFocusVisible,P=w.onBlurVisible,D=w.ref,F=t.useState(!1),M=F[0],V=F[1],_=(0,l.default)(u,D);return t.createElement(c.default,(0,e.default)({className:(0,n.default)(a.root,a["underline".concat((0,i.default)(q))],p,M&&a.focusVisible,"button"===y&&a.button),classes:h,color:f,component:y,onBlur:function(e){M&&(P(),V(!1)),v&&v(e)},onFocus:function(e){k(e)&&V(!0),m&&m(e)},ref:_,variant:O},j))}),v=(0,u.default)(b,{name:"MuiLink"})(y);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../utils/capitalize":"Dk4Y","../styles/withStyles":"awmK","@material-ui/utils":"gEhD","../utils/useIsFocusVisible":"Z9bb","../utils/useForkRef":"eYEl","../Typography":"pi2F"}],"C9Eg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Link"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Link":"oxr9"}],"w0mV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=d(require("@babel/runtime/helpers/esm/extends")),t=d(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),n=d(require("prop-types")),a=d(require("clsx")),s=d(require("../styles/withStyles")),o=d(require("./ListContext"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=n?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function d(e){return e&&e.__esModule?e:{default:e}}var l={root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}};exports.styles=l;var p=r.forwardRef(function(n,s){var i=n.children,u=n.classes,d=n.className,l=n.component,p=void 0===l?"ul":l,c=n.dense,f=void 0!==c&&c,b=n.disablePadding,v=void 0!==b&&b,y=n.subheader,m=(0,t.default)(n,["children","classes","className","component","dense","disablePadding","subheader"]),g=r.useMemo(function(){return{dense:f}},[f]);return r.createElement(o.default.Provider,{value:g},r.createElement(p,(0,e.default)({className:(0,a.default)(u.root,d,f&&u.dense,!v&&u.padding,y&&u.subheader),ref:s},m),y,i))}),c=(0,s.default)(l,{name:"MuiList"})(p);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","./ListContext":"LwO6"}],"HMJ1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./List"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./List":"w0mV"}],"KI6u":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=m(require("@babel/runtime/helpers/esm/extends")),t=m(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),o=m(require("prop-types")),i=m(require("clsx")),n=require("@material-ui/utils"),a=m(require("../styles/withStyles")),s=m(require("../ButtonBase")),l=m(require("../utils/isMuiElement")),d=m(require("../utils/useForkRef")),u=m(require("../List/ListContext")),c=p(require("react-dom"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=o?Object.getOwnPropertyDescriptor(e,i):null;n&&(n.get||n.set)?Object.defineProperty(r,i,n):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function m(e){return e&&e.__esModule?e:{default:e}}var b=function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:e.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:e.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}};exports.styles=b;var v="undefined"==typeof window?r.useEffect:r.useLayoutEffect,g=r.forwardRef(function(o,n){var a=o.alignItems,f=void 0===a?"center":a,p=o.autoFocus,m=void 0!==p&&p,b=o.button,g=void 0!==b&&b,y=o.children,x=o.classes,h=o.className,C=o.component,q=o.ContainerComponent,P=void 0===q?"li":q,k=o.ContainerProps,N=(k=void 0===k?{}:k).className,O=(0,t.default)(k,["className"]),j=o.dense,w=void 0!==j&&j,I=o.disabled,E=void 0!==I&&I,M=o.disableGutters,L=void 0!==M&&M,V=o.divider,_=void 0!==V&&V,A=o.focusVisibleClassName,B=o.selected,D=void 0!==B&&B,F=(0,t.default)(o,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),R=r.useContext(u.default),S={dense:w||R.dense||!1,alignItems:f},$=r.useRef(null);v(function(){m&&$.current&&$.current.focus()},[m]);var W=r.Children.toArray(y),G=W.length&&(0,l.default)(W[W.length-1],["ListItemSecondaryAction"]),T=r.useCallback(function(e){$.current=c.findDOMNode(e)},[]),z=(0,d.default)(T,n),H=(0,e.default)({className:(0,i.default)(x.root,h,S.dense&&x.dense,!L&&x.gutters,_&&x.divider,E&&x.disabled,g&&x.button,"center"!==f&&x.alignItemsFlexStart,G&&x.secondaryAction,D&&x.selected),disabled:E},F),J=C||"li";return g&&(H.component=C||"div",H.focusVisibleClassName=(0,i.default)(x.focusVisible,A),J=s.default),G?(J=H.component||C?J:"div","li"===P&&("li"===J?J="div":"li"===H.component&&(H.component="div")),r.createElement(u.default.Provider,{value:S},r.createElement(P,(0,e.default)({className:(0,i.default)(x.container,N),ref:z},O),r.createElement(J,H,W),W.pop()))):r.createElement(u.default.Provider,{value:S},r.createElement(J,(0,e.default)({ref:z},H),W))}),y=(0,a.default)(b,{name:"MuiListItem"})(g);exports.default=y;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/withStyles":"awmK","../ButtonBase":"VX66","../utils/isMuiElement":"dy9R","../utils/useForkRef":"eYEl","../List/ListContext":"LwO6","react-dom":"NKHc"}],"vro7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ListItem"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ListItem":"KI6u"}],"Ew4J":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=o(require("@babel/runtime/helpers/esm/extends")),t=o(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=l(require("react")),s=o(require("prop-types")),a=o(require("clsx")),n=o(require("../styles/withStyles")),u=o(require("../List/ListContext"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=s?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(r,a,n):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function o(e){return e&&e.__esModule?e:{default:e}}var f={root:{minWidth:56,flexShrink:0},alignItemsFlexStart:{marginTop:8}};exports.styles=f;var c=r.forwardRef(function(s,n){var i=s.classes,l=s.className,o=(0,t.default)(s,["classes","className"]),f=r.useContext(u.default);return r.createElement("div",(0,e.default)({className:(0,a.default)(i.root,l,"flex-start"===f.alignItems&&i.alignItemsFlexStart),ref:n},o))}),p=(0,n.default)(f,{name:"MuiListItemAvatar"})(c);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../List/ListContext":"LwO6"}],"rot7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ListItemAvatar"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ListItemAvatar":"Ew4J"}],"Cjd8":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=o(require("react")),n=u(require("prop-types")),a=u(require("clsx")),s=u(require("../styles/withStyles")),i=u(require("../List/ListContext"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=n?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:{minWidth:56,color:e.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}};exports.styles=f;var c=r.forwardRef(function(n,s){var l=n.classes,o=n.className,u=(0,t.default)(n,["classes","className"]),f=r.useContext(i.default);return r.createElement("div",(0,e.default)({className:(0,a.default)(l.root,o,"flex-start"===f.alignItems&&l.alignItemsFlexStart),ref:s},u))}),p=(0,s.default)(f,{name:"MuiListItemIcon"})(c);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../List/ListContext":"LwO6"}],"lJBu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ListItemIcon"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ListItemIcon":"Cjd8"}],"asd9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),t=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),o=i(require("prop-types")),s=i(require("clsx")),a=i(require("../styles/withStyles"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=o?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}return r.default=e,t&&t.set(e,r),r}function i(e){return e&&e.__esModule?e:{default:e}}var l={root:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"}};exports.styles=l;var f=r.forwardRef(function(o,a){var n=o.classes,u=o.className,i=(0,t.default)(o,["classes","className"]);return r.createElement("div",(0,e.default)({className:(0,s.default)(n.root,u),ref:a},i))});f.muiName="ListItemSecondaryAction";var c=(0,a.default)(l,{name:"MuiListItemSecondaryAction"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"CiZX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ListItemSecondaryAction"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ListItemSecondaryAction":"asd9"}],"Wzzi":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),r=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=p(require("react")),a=u(require("prop-types")),o=u(require("clsx")),n=u(require("../styles/withStyles")),s=u(require("../Typography")),i=u(require("../List/ListContext"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=a?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(t,o,n):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function u(e){return e&&e.__esModule?e:{default:e}}var d={root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}};exports.styles=d;var y=t.forwardRef(function(a,n){var l=a.children,p=a.classes,u=a.className,d=a.disableTypography,y=void 0!==d&&d,c=a.inset,f=void 0!==c&&c,m=a.primary,b=a.primaryTypographyProps,v=a.secondary,g=a.secondaryTypographyProps,h=(0,r.default)(a,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),x=t.useContext(i.default).dense,P=null!=m?m:l;null==P||P.type===s.default||y||(P=t.createElement(s.default,(0,e.default)({variant:x?"body2":"body1",className:p.primary,component:"span",display:"block"},b),P));var T=v;return null==T||T.type===s.default||y||(T=t.createElement(s.default,(0,e.default)({variant:"body2",className:p.secondary,color:"textSecondary",display:"block"},g),T)),t.createElement("div",(0,e.default)({className:(0,o.default)(p.root,u,x&&p.dense,f&&p.inset,P&&T&&p.multiline),ref:n},h),P,T)}),c=(0,n.default)(d,{name:"MuiListItemText"})(y);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Typography":"pi2F","../List/ListContext":"LwO6"}],"FcKO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ListItemText"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ListItemText":"Wzzi"}],"ErzH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=l(require("react")),o=u(require("prop-types")),i=u(require("clsx")),n=u(require("../styles/withStyles")),a=u(require("../utils/capitalize"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=o?Object.getOwnPropertyDescriptor(e,i):null;n&&(n.get||n.set)?Object.defineProperty(r,i,n):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return{root:{boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:e.palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},colorPrimary:{color:e.palette.primary.main},colorInherit:{color:"inherit"},gutters:{paddingLeft:16,paddingRight:16},inset:{paddingLeft:72},sticky:{position:"sticky",top:0,zIndex:1,backgroundColor:"inherit"}}};exports.styles=c;var p=r.forwardRef(function(o,n){var s=o.classes,l=o.className,u=o.color,c=void 0===u?"default":u,p=o.component,d=void 0===p?"li":p,f=o.disableGutters,y=void 0!==f&&f,b=o.disableSticky,g=void 0!==b&&b,m=o.inset,h=void 0!==m&&m,v=(0,t.default)(o,["classes","className","color","component","disableGutters","disableSticky","inset"]);return r.createElement(d,(0,e.default)({className:(0,i.default)(s.root,l,"default"!==c&&s["color".concat((0,a.default)(c))],h&&s.inset,!g&&s.sticky,!y&&s.gutters),ref:n},v))}),d=(0,n.default)(c,{name:"MuiListSubheader"})(p);exports.default=d;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y"}],"wSFK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./ListSubheader"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./ListSubheader":"ErzH"}],"a596":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getOffsetTop=E,exports.getOffsetLeft=b,exports.default=exports.styles=void 0;var e=g(require("@babel/runtime/helpers/esm/extends")),t=g(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=m(require("react")),n=g(require("prop-types")),o=m(require("react-dom")),i=require("@material-ui/utils"),a=g(require("../utils/debounce")),l=g(require("clsx")),u=g(require("../utils/ownerDocument")),c=g(require("../utils/ownerWindow")),f=g(require("../utils/createChainedFunction")),s=g(require("../styles/withStyles")),d=g(require("../Modal")),p=g(require("../Grow")),v=g(require("../Paper"));function h(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return h=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=h();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function g(e){return e&&e.__esModule?e:{default:e}}function E(e,t){var r=0;return"number"==typeof t?r=t:"center"===t?r=e.height/2:"bottom"===t&&(r=e.height),r}function b(e,t){var r=0;return"number"==typeof t?r=t:"center"===t?r=e.width/2:"right"===t&&(r=e.width),r}function x(e){return[e.horizontal,e.vertical].map(function(e){return"number"==typeof e?"".concat(e,"px"):e}).join(" ")}function y(e,t){for(var r=t,n=0;r&&r!==e;)n+=(r=r.parentElement).scrollTop;return n}function w(e){return"function"==typeof e?e():e}var O={root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}};exports.styles=O;var P=r.forwardRef(function(n,i){var s=n.action,h=n.anchorEl,m=n.anchorOrigin,g=void 0===m?{vertical:"top",horizontal:"left"}:m,O=n.anchorPosition,P=n.anchorReference,q=void 0===P?"anchorEl":P,z=n.children,C=n.classes,M=n.className,T=n.container,j=n.elevation,k=void 0===j?8:j,W=n.getContentAnchorEl,D=n.marginThreshold,H=void 0===D?16:D,N=n.onEnter,_=n.onEntered,R=n.onEntering,A=n.onExit,L=n.onExited,B=n.onExiting,S=n.open,F=n.PaperProps,G=void 0===F?{}:F,I=n.transformOrigin,X=void 0===I?{vertical:"top",horizontal:"left"}:I,Y=n.TransitionComponent,J=void 0===Y?p.default:Y,K=n.transitionDuration,Q=void 0===K?"auto":K,U=n.TransitionProps,V=void 0===U?{}:U,Z=(0,t.default)(n,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),$=r.useRef(),ee=r.useCallback(function(e){if("anchorPosition"===q)return O;var t=w(h),r=t&&1===t.nodeType?t:(0,u.default)($.current).body,n=r.getBoundingClientRect(),o=0===e?g.vertical:"center";return{top:n.top+E(n,o),left:n.left+b(n,g.horizontal)}},[h,g.horizontal,g.vertical,O,q]),te=r.useCallback(function(e){var t=0;if(W&&"anchorEl"===q){var r=W(e);if(r&&e.contains(r)){var n=y(e,r);t=r.offsetTop+r.clientHeight/2-n||0}0}return t},[g.vertical,q,W]),re=r.useCallback(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:E(e,X.vertical)+t,horizontal:b(e,X.horizontal)}},[X.horizontal,X.vertical]),ne=r.useCallback(function(e){var t=te(e),r={width:e.offsetWidth,height:e.offsetHeight},n=re(r,t);if("none"===q)return{top:null,left:null,transformOrigin:x(n)};var o=ee(t),i=o.top-n.vertical,a=o.left-n.horizontal,l=i+r.height,u=a+r.width,f=(0,c.default)(w(h)),s=f.innerHeight-H,d=f.innerWidth-H;if(i<H){var p=i-H;i-=p,n.vertical+=p}else if(l>s){var v=l-s;i-=v,n.vertical+=v}if(a<H){var m=a-H;a-=m,n.horizontal+=m}else if(u>d){var g=u-d;a-=g,n.horizontal+=g}return{top:"".concat(Math.round(i),"px"),left:"".concat(Math.round(a),"px"),transformOrigin:x(n)}},[h,q,ee,te,re,H]),oe=r.useCallback(function(){var e=$.current;if(e){var t=ne(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}},[ne]),ie=r.useCallback(function(e){$.current=o.findDOMNode(e)},[]);r.useEffect(function(){S&&oe()}),r.useImperativeHandle(s,function(){return S?{updatePosition:function(){oe()}}:null},[S,oe]),r.useEffect(function(){if(S){var e=(0,a.default)(function(){oe()});return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}},[S,oe]);var ae=Q;"auto"!==Q||J.muiSupportAuto||(ae=void 0);var le=T||(h?(0,u.default)(w(h)).body:void 0);return r.createElement(d.default,(0,e.default)({container:le,open:S,ref:i,BackdropProps:{invisible:!0},className:(0,l.default)(C.root,M)},Z),r.createElement(J,(0,e.default)({appear:!0,in:S,onEnter:N,onEntered:_,onExit:A,onExited:L,onExiting:B,timeout:ae},V,{onEntering:(0,f.default)(function(e,t){R&&R(e,t),oe()},V.onEntering)}),r.createElement(v.default,(0,e.default)({elevation:k,ref:ie},G,{className:(0,l.default)(C.paper,G.className)}),z)))}),q=(0,s.default)(O,{name:"MuiPopover"})(P);exports.default=q;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","react-dom":"NKHc","@material-ui/utils":"gEhD","../utils/debounce":"TiOe","clsx":"WLGK","../utils/ownerDocument":"Xj2I","../utils/ownerWindow":"EE4R","../utils/createChainedFunction":"ftFk","../styles/withStyles":"awmK","../Modal":"IBPk","../Grow":"vuXQ","../Paper":"mtQp"}],"HEXW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Popover"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Popover":"a596"}],"C44I":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),t=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=d(require("react")),n=require("react-is"),i=f(require("prop-types")),u=d(require("react-dom")),a=f(require("../utils/ownerDocument")),l=f(require("../List")),o=f(require("../utils/getScrollbarSize")),s=f(require("../utils/useForkRef"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var u=n?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(r,i,u):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function v(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function b(e,t){if(void 0===t)return!0;var r=e.innerText;return void 0===r&&(r=e.textContent),0!==(r=r.trim().toLowerCase()).length&&(t.repeating?r[0]===t.keys[0]:0===r.indexOf(t.keys.join("")))}function y(e,t,r,n,i,u){for(var a=!1,l=i(e,t,!!t&&r);l;){if(l===e.firstChild){if(a)return;a=!0}var o=!n&&(l.disabled||"true"===l.getAttribute("aria-disabled"));if(l.hasAttribute("tabindex")&&b(l,u)&&!o)return void l.focus();l=i(e,l,r)}}var h="undefined"==typeof window?r.useEffect:r.useLayoutEffect,m=r.forwardRef(function(n,i){var c=n.actions,d=n.autoFocus,f=void 0!==d&&d,m=n.autoFocusItem,g=void 0!==m&&m,w=n.children,x=n.className,D=n.disabledItemsFocusable,M=void 0!==D&&D,k=n.disableListWrap,C=void 0!==k&&k,E=n.onKeyDown,O=n.variant,j=void 0===O?"selectedMenu":O,q=(0,t.default)(n,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),F=r.useRef(null),I=r.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});h(function(){f&&F.current.focus()},[f]),r.useImperativeHandle(c,function(){return{adjustStyleForScrollbar:function(e,t){var r=!F.current.style.width;if(e.clientHeight<F.current.clientHeight&&r){var n="".concat((0,o.default)(!0),"px");F.current.style["rtl"===t.direction?"paddingLeft":"paddingRight"]=n,F.current.style.width="calc(100% + ".concat(n,")")}return F.current}}},[]);var S=r.useCallback(function(e){F.current=u.findDOMNode(e)},[]),K=(0,s.default)(S,i),L=-1;r.Children.forEach(w,function(e,t){r.isValidElement(e)&&(e.props.disabled||("selectedMenu"===j&&e.props.selected?L=t:-1===L&&(L=t)))});var P=r.Children.map(w,function(e,t){if(t===L){var n={};return g&&(n.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===j&&(n.tabIndex=0),r.cloneElement(e,n)}return e});return r.createElement(l.default,(0,e.default)({role:"menu",ref:K,className:x,onKeyDown:function(e){var t=F.current,r=e.key,n=(0,a.default)(t).activeElement;if("ArrowDown"===r)e.preventDefault(),y(t,n,C,M,p);else if("ArrowUp"===r)e.preventDefault(),y(t,n,C,M,v);else if("Home"===r)e.preventDefault(),y(t,null,C,M,p);else if("End"===r)e.preventDefault(),y(t,null,C,M,v);else if(1===r.length){var i=I.current,u=r.toLowerCase(),l=performance.now();i.keys.length>0&&(l-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&u!==i.keys[0]&&(i.repeating=!1)),i.lastTime=l,i.keys.push(u);var o=n&&!i.repeating&&b(n,i);i.previousKeyMatched&&(o||y(t,n,!1,M,p,i))?e.preventDefault():i.previousKeyMatched=!1}E&&E(e)},tabIndex:f?0:-1},q),P)}),g=m;exports.default=g;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","react-dom":"NKHc","../utils/ownerDocument":"Xj2I","../List":"HMJ1","../utils/getScrollbarSize":"iFpT","../utils/useForkRef":"eYEl"}],"LIS1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./MenuList"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./MenuList":"C44I"}],"dn7M":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=m(require("@babel/runtime/helpers/esm/extends")),t=m(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=v(require("react")),n=require("react-is"),o=m(require("prop-types")),i=m(require("clsx")),u=require("@material-ui/utils"),a=m(require("../styles/withStyles")),s=m(require("../Popover")),l=m(require("../MenuList")),c=v(require("react-dom")),f=m(require("../utils/setRef")),p=m(require("../styles/useTheme"));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function v(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function m(e){return e&&e.__esModule?e:{default:e}}var y={vertical:"top",horizontal:"right"},b={vertical:"top",horizontal:"left"},h={paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}};exports.styles=h;var P=r.forwardRef(function(n,o){var u=n.autoFocus,a=void 0===u||u,d=n.children,v=n.classes,m=n.disableAutoFocusItem,h=void 0!==m&&m,P=n.MenuListProps,g=void 0===P?{}:P,q=n.onClose,O=n.onEntering,M=n.open,j=n.PaperProps,w=void 0===j?{}:j,x=n.PopoverClasses,D=n.transitionDuration,C=void 0===D?"auto":D,E=n.variant,F=void 0===E?"selectedMenu":E,_=(0,t.default)(n,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","variant"]),k=(0,p.default)(),R=a&&!h&&M,S=r.useRef(null),W=r.useRef(null),A=-1;r.Children.map(d,function(e,t){r.isValidElement(e)&&(e.props.disabled||("menu"!==F&&e.props.selected?A=t:-1===A&&(A=t)))});var I=r.Children.map(d,function(e,t){return t===A?r.cloneElement(e,{ref:function(t){W.current=c.findDOMNode(t),(0,f.default)(e.ref,t)}}):e});return r.createElement(s.default,(0,e.default)({getContentAnchorEl:function(){return W.current},classes:x,onClose:q,onEntering:function(e,t){S.current&&S.current.adjustStyleForScrollbar(e,k),O&&O(e,t)},anchorOrigin:"rtl"===k.direction?y:b,transformOrigin:"rtl"===k.direction?y:b,PaperProps:(0,e.default)({},w,{classes:(0,e.default)({},w.classes,{root:v.paper})}),open:M,ref:o,transitionDuration:C},_),r.createElement(l.default,(0,e.default)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),q&&q(e,"tabKeyDown"))},actions:S,autoFocus:a&&(-1===A||h),autoFocusItem:R,variant:F},g,{className:(0,i.default)(v.list,g.className)}),I))}),g=(0,a.default)(h,{name:"MuiMenu"})(P);exports.default=g;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/withStyles":"awmK","../Popover":"HEXW","../MenuList":"LIS1","react-dom":"NKHc","../utils/setRef":"IV4i","../styles/useTheme":"nmB4"}],"AKYS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Menu"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Menu":"dn7M"}],"t1nz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=d(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=d(require("@babel/runtime/helpers/esm/defineProperty")),r=d(require("@babel/runtime/helpers/esm/extends")),s=l(require("react")),o=d(require("prop-types")),n=d(require("clsx")),a=d(require("../styles/withStyles")),u=d(require("../ListItem"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=s?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(r,o,n):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function d(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:(0,r.default)({},e.typography.body1,(0,t.default)({minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",width:"auto",overflow:"hidden",whiteSpace:"nowrap"},e.breakpoints.up("sm"),{minHeight:"auto"})),gutters:{},selected:{},dense:(0,r.default)({},e.typography.body2,{minHeight:"auto"})}};exports.styles=p;var f=s.forwardRef(function(t,o){var a,i=t.classes,l=t.className,d=t.component,p=void 0===d?"li":d,f=t.disableGutters,c=void 0!==f&&f,b=t.ListItemClasses,m=t.role,y=void 0===m?"menuitem":m,v=t.selected,h=t.tabIndex,g=(0,e.default)(t,["classes","className","component","disableGutters","ListItemClasses","role","selected","tabIndex"]);return t.disabled||(a=void 0!==h?h:-1),s.createElement(u.default,(0,r.default)({button:!0,role:y,tabIndex:a,component:p,selected:v,disableGutters:c,classes:(0,r.default)({dense:i.dense},b),className:(0,n.default)(i.root,l,v&&i.selected,!c&&i.gutters),ref:o},g))}),c=(0,a.default)(p,{name:"MuiMenuItem"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../ListItem":"vro7"}],"dYSc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./MenuItem"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./MenuItem":"t1nz"}],"Rerg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/toConsumableArray")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),o=d(require("react")),a=c(require("prop-types")),i=c(require("clsx")),n=c(require("../styles/withStyles")),s=c(require("../Paper")),l=c(require("../utils/capitalize")),u=c(require("../LinearProgress"));function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=p();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",background:e.palette.background.default,padding:8},positionBottom:{position:"fixed",bottom:0,left:0,right:0,zIndex:e.zIndex.mobileStepper},positionTop:{position:"fixed",top:0,left:0,right:0,zIndex:e.zIndex.mobileStepper},positionStatic:{},dots:{display:"flex",flexDirection:"row"},dot:{backgroundColor:e.palette.action.disabled,borderRadius:"50%",width:8,height:8,margin:"0 2px"},dotActive:{backgroundColor:e.palette.primary.main},progress:{width:"50%"}}};exports.styles=f;var m=o.forwardRef(function(a,n){var p=a.activeStep,d=void 0===p?0:p,c=a.backButton,f=a.classes,m=a.className,b=a.LinearProgressProps,v=a.nextButton,y=a.position,g=void 0===y?"bottom":y,x=a.steps,h=a.variant,P=void 0===h?"dots":h,w=(0,r.default)(a,["activeStep","backButton","classes","className","LinearProgressProps","nextButton","position","steps","variant"]);return o.createElement(s.default,(0,e.default)({square:!0,elevation:0,className:(0,i.default)(f.root,f["position".concat((0,l.default)(g))],m),ref:n},w),c,"text"===P&&o.createElement(o.Fragment,null,d+1," / ",x),"dots"===P&&o.createElement("div",{className:f.dots},(0,t.default)(new Array(x)).map(function(e,t){return o.createElement("div",{key:t,className:(0,i.default)(f.dot,t===d&&f.dotActive)})})),"progress"===P&&o.createElement(u.default,(0,e.default)({className:f.progress,variant:"determinate",value:Math.ceil(d/(x-1)*100)},b)),v)}),b=(0,n.default)(f,{name:"MuiMobileStepper"})(m);exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/toConsumableArray":"Qv3s","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Paper":"mtQp","../utils/capitalize":"Dk4Y","../LinearProgress":"knAy"}],"HvIv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./MobileStepper"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./MobileStepper":"Rerg"}],"z1Fo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("@babel/runtime/helpers/esm/extends")),t=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=o(require("react")),a=s(require("prop-types")),n=s(require("clsx")),l=require("@material-ui/utils"),u=s(require("../utils/capitalize"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function s(e){return e&&e.__esModule?e:{default:e}}var c=r.forwardRef(function(a,l){var i=a.classes,o=a.className,s=a.disabled,c=a.IconComponent,f=a.inputRef,d=a.variant,p=void 0===d?"standard":d,b=(0,t.default)(a,["classes","className","disabled","IconComponent","inputRef","variant"]);return r.createElement(r.Fragment,null,r.createElement("select",(0,e.default)({className:(0,n.default)(i.root,i.select,i[p],o,s&&i.disabled),disabled:s,ref:f||l},b)),a.multiple?null:r.createElement(c,{className:(0,n.default)(i.icon,i["icon".concat((0,u.default)(p))],s&&i.disabled)}))}),f=c;exports.default=f;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../utils/capitalize":"Dk4Y"}],"xqr3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(r,u,a):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}var u=(0,t.default)(e.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");exports.default=u;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"oCj7":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=d(require("react")),o=c(require("prop-types")),n=c(require("./NativeSelectInput")),i=c(require("../styles/withStyles")),a=c(require("../FormControl/formControlState")),l=c(require("../FormControl/useFormControl")),u=c(require("../internal/svg-icons/ArrowDropDown")),p=c(require("../Input"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:e.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:e.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",minHeight:"1.1876em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:e.palette.action.active,"&$disabled":{color:e.palette.action.disabled}},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7},nativeInput:{bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%"}}};exports.styles=f;var b=r.createElement(p.default,null),m=r.forwardRef(function(o,i){var p=o.children,s=o.classes,d=o.IconComponent,c=void 0===d?u.default:d,f=o.input,m=void 0===f?b:f,v=o.inputProps,h=(o.variant,(0,t.default)(o,["children","classes","IconComponent","input","inputProps","variant"])),g=(0,l.default)(),y=(0,a.default)({props:o,muiFormControl:g,states:["variant"]});return r.cloneElement(m,(0,e.default)({inputComponent:n.default,inputProps:(0,e.default)({children:p,classes:s,IconComponent:c,variant:y.variant,type:void 0},v,m?m.props.inputProps:{}),ref:i},h))});m.muiName="Select";var v=(0,i.default)(f,{name:"MuiNativeSelect"})(m);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","./NativeSelectInput":"z1Fo","../styles/withStyles":"awmK","../FormControl/formControlState":"xTaA","../FormControl/useFormControl":"SKV5","../internal/svg-icons/ArrowDropDown":"xqr3","../Input":"CaNl"}],"S2QE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./NativeSelect"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./NativeSelect":"oCj7"}],"cOhF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),t=n(require("prop-types")),r=require("@material-ui/utils");function n(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var f=n?Object.getOwnPropertyDescriptor(e,o):null;f&&(f.get||f.set)?Object.defineProperty(r,o,f):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var f="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function i(t){var r=t.children,n=t.defer,u=void 0!==n&&n,o=t.fallback,i=void 0===o?null:o,a=e.useState(!1),c=a[0],l=a[1];return f(function(){u||l(!0)},[u]),e.useEffect(function(){u&&l(!0)},[u]),e.createElement(e.Fragment,null,c?r:i)}var a=i;exports.default=a;
},{"react":"n8MK","prop-types":"D9Od","@material-ui/utils":"gEhD"}],"qvOT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./NoSsr"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./NoSsr":"cOhF"}],"Tvmo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/defineProperty")),t=c(require("@babel/runtime/helpers/esm/extends")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=u(require("react")),i=c(require("prop-types")),a=c(require("clsx")),l=c(require("../styles/withStyles")),s=c(require("../styles/useTheme")),d=c(require("../utils/capitalize"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{root:{position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden"},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}};exports.styles=f;var p=n.forwardRef(function(i,l){i.children;var o=i.classes,u=i.className,c=i.label,f=i.labelWidth,p=i.notched,h=i.style,g=(0,r.default)(i,["children","classes","className","label","labelWidth","notched","style"]),m="rtl"===(0,s.default)().direction?"right":"left";if(void 0!==c)return n.createElement("fieldset",(0,t.default)({"aria-hidden":!0,className:(0,a.default)(o.root,u),ref:l,style:h},g),n.createElement("legend",{className:(0,a.default)(o.legendLabelled,p&&o.legendNotched)},c?n.createElement("span",null,c):n.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}})));var y=f>0?.75*f+8:.01;return n.createElement("fieldset",(0,t.default)({"aria-hidden":!0,style:(0,t.default)((0,e.default)({},"padding".concat((0,d.default)(m)),8),h),className:(0,a.default)(o.root,u),ref:l},g),n.createElement("legend",{className:o.legend,style:{width:p?y:.01}},n.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}})))}),h=(0,l.default)(f,{name:"PrivateNotchedOutline"})(p);exports.default=h;
},{"@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../styles/useTheme":"nmB4","../utils/capitalize":"Dk4Y"}],"LGE3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=s(require("@babel/runtime/helpers/esm/extends")),t=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),n=s(require("prop-types")),o=s(require("clsx")),i=require("@material-ui/utils"),l=s(require("../InputBase")),d=s(require("./NotchedOutline")),a=s(require("../styles/withStyles"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function s(e){return e&&e.__esModule?e:{default:e}}var f=function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:e.shape.borderRadius,"&:hover $notchedOutline":{borderColor:e.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:e.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}};exports.styles=f;var c=r.forwardRef(function(n,i){var a=n.classes,u=n.fullWidth,p=void 0!==u&&u,s=n.inputComponent,f=void 0===s?"input":s,c=n.label,h=n.labelWidth,b=void 0===h?0:h,m=n.multiline,g=void 0!==m&&m,y=n.notched,v=n.type,O=void 0===v?"text":v,x=(0,t.default)(n,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return r.createElement(l.default,(0,e.default)({renderSuffix:function(e){return r.createElement(d.default,{className:a.notchedOutline,label:c,labelWidth:b,notched:void 0!==y?y:Boolean(e.startAdornment||e.filled||e.focused)})},classes:(0,e.default)({},a,{root:(0,o.default)(a.root,a.underline),notchedOutline:null}),fullWidth:p,inputComponent:f,multiline:g,ref:i,type:O},x))});c.muiName="Input";var h=(0,a.default)(f,{name:"MuiOutlinedInput"})(c);exports.default=h;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../InputBase":"UXeJ","./NotchedOutline":"Tvmo","../styles/withStyles":"awmK"}],"Z2x8":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./OutlinedInput"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./OutlinedInput":"LGE3"}],"loUd":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,n=function(){for(var e=["Edge","Trident","Firefox"],n=0;n<e.length;n+=1)if(t&&navigator.userAgent.indexOf(e[n])>=0)return 1;return 0}();function r(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function o(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},n))}}var i=t&&window.Promise,a=i?r:o;function s(e){return e&&"[object Function]"==={}.toString.call(e)}function f(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function p(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=f(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:l(p(e))}function u(e){return e&&e.referenceNode?e.referenceNode:e}var d=t&&!(!window.MSInputMethodContext||!document.documentMode),c=t&&/MSIE 10/.test(navigator.userAgent);function h(e){return 11===e?d:10===e?c:d||c}function m(e){if(!e)return document.documentElement;for(var t=h(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===f(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function v(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function g(e){return null!==e.parentNode?g(e.parentNode):e}function b(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return v(a)?a:m(a);var s=g(e);return s.host?b(s.host,t):b(e,g(t).host)}function w(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[t]}return e[t]}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=w(t,"top"),o=w(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function E(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function x(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],h(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function O(e){var t=e.body,n=e.documentElement,r=h(10)&&getComputedStyle(n);return{height:x("Height",t,n,r),width:x("Width",t,n,r)}}var L=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),M=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function C(e){return N({},e,{right:e.left+e.width,bottom:e.top+e.height})}function D(e){var t={};try{if(h(10)){t=e.getBoundingClientRect();var n=w(e,"top"),r=w(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(d){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?O(e.ownerDocument):{},a=i.width||e.clientWidth||o.width,s=i.height||e.clientHeight||o.height,p=e.offsetWidth-a,l=e.offsetHeight-s;if(p||l){var u=f(e);p-=E(u,"x"),l-=E(u,"y"),o.width-=p,o.height-=l}return C(o)}function F(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=h(10),o="HTML"===t.nodeName,i=D(e),a=D(t),s=l(e),p=f(t),u=parseFloat(p.borderTopWidth),d=parseFloat(p.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var c=C({top:i.top-a.top-u,left:i.left-a.left-d,width:i.width,height:i.height});if(c.marginTop=0,c.marginLeft=0,!r&&o){var m=parseFloat(p.marginTop),v=parseFloat(p.marginLeft);c.top-=u-m,c.bottom-=u-m,c.left-=d-v,c.right-=d-v,c.marginTop=m,c.marginLeft=v}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(c=y(c,t)),c}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=F(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:w(n),s=t?0:w(n,"left");return C({top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:o,height:i})}function W(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===f(e,"position"))return!0;var n=p(e);return!!n&&W(n)}function k(e){if(!e||!e.parentElement||h())return document.documentElement;for(var t=e.parentElement;t&&"none"===f(t,"transform");)t=t.parentElement;return t||document.documentElement}function H(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?k(e):b(e,u(t));if("viewport"===r)i=S(a,o);else{var s=void 0;"scrollParent"===r?"BODY"===(s=l(p(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var f=F(s,a,o);if("HTML"!==s.nodeName||W(a))i=f;else{var d=O(e.ownerDocument),c=d.height,h=d.width;i.top+=f.top-f.marginTop,i.bottom=c+f.top,i.left+=f.left-f.marginLeft,i.right=h+f.left}}var m="number"==typeof(n=n||0);return i.left+=m?n:n.left||0,i.top+=m?n:n.top||0,i.right-=m?n:n.right||0,i.bottom-=m?n:n.bottom||0,i}function P(e){return e.width*e.height}function B(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=H(n,r,i,o),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},f=Object.keys(s).map(function(e){return N({key:e},s[e],{area:P(s[e])})}).sort(function(e,t){return t.area-e.area}),p=f.filter(function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight}),l=p.length>0?p[0].key:f[0].key,u=e.split("-")[1];return l+(u?"-"+u:"")}function A(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return F(n,r?k(t):b(t,u(n)),r)}function I(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function j(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function R(e,t,n){n=n.split("-")[0];var r=I(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",s=i?"left":"top",f=i?"height":"width",p=i?"width":"height";return o[a]=t[a]+t[f]/2-r[f]/2,o[s]=n===s?t[s]-r[p]:t[j(s)],o}function U(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function Y(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var r=U(e,function(e){return e[t]===n});return e.indexOf(r)}function V(e,t,n){return(void 0===n?e:e.slice(0,Y(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&s(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))}),t}function q(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=A(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=B(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=R(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=V(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function K(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function _(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var o=t[r],i=o?""+o+n:e;if(void 0!==document.body.style[i])return i}return null}function z(){return this.state.isDestroyed=!0,K(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[_("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function G(e){var t=e.ownerDocument;return t?t.defaultView:window}function X(e,t,n,r){var o="BODY"===e.nodeName,i=o?e.ownerDocument.defaultView:e;i.addEventListener(t,n,{passive:!0}),o||X(l(i.parentNode),t,n,r),r.push(i)}function J(e,t,n,r){n.updateBound=r,G(e).addEventListener("resize",n.updateBound,{passive:!0});var o=l(e);return X(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function Q(){this.state.eventsEnabled||(this.state=J(this.reference,this.options,this.state,this.scheduleUpdate))}function Z(e,t){return G(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function $(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=Z(this.reference,this.state))}function ee(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function te(e,t){Object.keys(t).forEach(function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&ee(t[n])&&(r="px"),e.style[n]=t[n]+r})}function ne(e,t){Object.keys(t).forEach(function(n){!1!==t[n]?e.setAttribute(n,t[n]):e.removeAttribute(n)})}function re(e){return te(e.instance.popper,e.styles),ne(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&te(e.arrowElement,e.arrowStyles),e}function oe(e,t,n,r,o){var i=A(o,t,e,n.positionFixed),a=B(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),te(t,{position:n.positionFixed?"fixed":"absolute"}),n}function ie(e,t){var n=e.offsets,r=n.popper,o=n.reference,i=Math.round,a=Math.floor,s=function(e){return e},f=i(o.width),p=i(r.width),l=-1!==["left","right"].indexOf(e.placement),u=-1!==e.placement.indexOf("-"),d=t?l||u||f%2==p%2?i:a:s,c=t?i:s;return{left:d(f%2==1&&p%2==1&&!u&&t?r.left-1:r.left),top:c(r.top),bottom:c(r.bottom),right:d(r.right)}}var ae=t&&/Firefox/i.test(navigator.userAgent);function se(e,t){var n=t.x,r=t.y,o=e.offsets.popper,i=U(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,s=m(e.instance.popper),f=D(s),p={position:o.position},l=ie(e,window.devicePixelRatio<2||!ae),u="bottom"===n?"top":"bottom",d="right"===r?"left":"right",c=_("transform"),h=void 0,v=void 0;if(v="bottom"===u?"HTML"===s.nodeName?-s.clientHeight+l.bottom:-f.height+l.bottom:l.top,h="right"===d?"HTML"===s.nodeName?-s.clientWidth+l.right:-f.width+l.right:l.left,a&&c)p[c]="translate3d("+h+"px, "+v+"px, 0)",p[u]=0,p[d]=0,p.willChange="transform";else{var g="bottom"===u?-1:1,b="right"===d?-1:1;p[u]=v*g,p[d]=h*b,p.willChange=u+", "+d}var w={"x-placement":e.placement};return e.attributes=N({},w,e.attributes),e.styles=N({},p,e.styles),e.arrowStyles=N({},e.offsets.arrow,e.arrowStyles),e}function fe(e,t,n){var r=U(e,function(e){return e.name===t}),o=!!r&&e.some(function(e){return e.name===n&&e.enabled&&e.order<r.order});if(!o){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return o}function pe(e,t){var n;if(!fe(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,a=i.popper,s=i.reference,p=-1!==["left","right"].indexOf(o),l=p?"height":"width",u=p?"Top":"Left",d=u.toLowerCase(),c=p?"left":"top",h=p?"bottom":"right",m=I(r)[l];s[h]-m<a[d]&&(e.offsets.popper[d]-=a[d]-(s[h]-m)),s[d]+m>a[h]&&(e.offsets.popper[d]+=s[d]+m-a[h]),e.offsets.popper=C(e.offsets.popper);var v=s[d]+s[l]/2-m/2,g=f(e.instance.popper),b=parseFloat(g["margin"+u]),w=parseFloat(g["border"+u+"Width"]),y=v-e.offsets.popper[d]-b-w;return y=Math.max(Math.min(a[l]-m,y),0),e.arrowElement=r,e.offsets.arrow=(M(n={},d,Math.round(y)),M(n,c,""),n),e}function le(e){return"end"===e?"start":"start"===e?"end":e}var ue=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],de=ue.slice(3);function ce(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=de.indexOf(e),r=de.slice(n+1).concat(de.slice(0,n));return t?r.reverse():r}var he={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function me(e,t){if(K(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=H(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=j(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case he.FLIP:a=[r,o];break;case he.CLOCKWISE:a=ce(r);break;case he.COUNTERCLOCKWISE:a=ce(r,!0);break;default:a=t.behavior}return a.forEach(function(s,f){if(r!==s||a.length===f+1)return e;r=e.placement.split("-")[0],o=j(r);var p=e.offsets.popper,l=e.offsets.reference,u=Math.floor,d="left"===r&&u(p.right)>u(l.left)||"right"===r&&u(p.left)<u(l.right)||"top"===r&&u(p.bottom)>u(l.top)||"bottom"===r&&u(p.top)<u(l.bottom),c=u(p.left)<u(n.left),h=u(p.right)>u(n.right),m=u(p.top)<u(n.top),v=u(p.bottom)>u(n.bottom),g="left"===r&&c||"right"===r&&h||"top"===r&&m||"bottom"===r&&v,b=-1!==["top","bottom"].indexOf(r),w=!!t.flipVariations&&(b&&"start"===i&&c||b&&"end"===i&&h||!b&&"start"===i&&m||!b&&"end"===i&&v),y=!!t.flipVariationsByContent&&(b&&"start"===i&&h||b&&"end"===i&&c||!b&&"start"===i&&v||!b&&"end"===i&&m),E=w||y;(d||g||E)&&(e.flipped=!0,(d||g)&&(r=a[f+1]),E&&(i=le(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=N({},e.offsets.popper,R(e.instance.popper,e.offsets.reference,e.placement)),e=V(e.instance.modifiers,e,"flip"))}),e}function ve(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),s=a?"right":"bottom",f=a?"left":"top",p=a?"width":"height";return n[s]<i(r[f])&&(e.offsets.popper[f]=i(r[f])-n[p]),n[f]>i(r[s])&&(e.offsets.popper[f]=i(r[s])),e}function ge(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return C(s)[t]/100*i}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i}return i}function be(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=a.indexOf(U(a,function(e){return-1!==e.search(/,|\s/)}));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var f=/\s*,\s*|\s+/,p=-1!==s?[a.slice(0,s).concat([a[s].split(f)[0]]),[a[s].split(f)[1]].concat(a.slice(s+1))]:[a];return(p=p.map(function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)},[]).map(function(e){return ge(e,o,t,n)})})).forEach(function(e,t){e.forEach(function(n,r){ee(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))})}),o}function we(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],f=void 0;return f=ee(+n)?[+n,0]:be(n,i,a,s),"left"===s?(i.top+=f[0],i.left-=f[1]):"right"===s?(i.top+=f[0],i.left+=f[1]):"top"===s?(i.left+=f[0],i.top-=f[1]):"bottom"===s&&(i.left+=f[0],i.top+=f[1]),e.popper=i,e}function ye(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var r=_("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[r];o.top="",o.left="",o[r]="";var f=H(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=s,t.boundaries=f;var p=t.priority,l=e.offsets.popper,u={primary:function(e){var n=l[e];return l[e]<f[e]&&!t.escapeWithReference&&(n=Math.max(l[e],f[e])),M({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=l[n];return l[e]>f[e]&&!t.escapeWithReference&&(r=Math.min(l[n],f[e]-("right"===e?l.width:l.height))),M({},n,r)}};return p.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";l=N({},l,u[t](e))}),e.offsets.popper=l,e}function Ee(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=-1!==["bottom","top"].indexOf(n),f=s?"left":"top",p=s?"width":"height",l={start:M({},f,i[f]),end:M({},f,i[f]+i[p]-a[p])};e.offsets.popper=N({},a,l[r])}return e}function xe(e){if(!fe(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=U(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}function Oe(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(s?o[a?"width":"height"]:0),e.placement=j(t),e.offsets.popper=C(o),e}var Le={shift:{order:100,enabled:!0,fn:Ee},offset:{order:200,enabled:!0,fn:we,offset:0},preventOverflow:{order:300,enabled:!0,fn:ye,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:ve},arrow:{order:500,enabled:!0,fn:pe,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:me,behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:Oe},hide:{order:800,enabled:!0,fn:xe},computeStyle:{order:850,enabled:!0,fn:se,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:re,onLoad:oe,gpuAcceleration:void 0}},Te={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Le},Me=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};L(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=a(this.update.bind(this)),this.options=N({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(N({},e.Defaults.modifiers,o.modifiers)).forEach(function(t){r.options.modifiers[t]=N({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return N({name:e},r.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&s(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return T(e,[{key:"update",value:function(){return q.call(this)}},{key:"destroy",value:function(){return z.call(this)}},{key:"enableEventListeners",value:function(){return Q.call(this)}},{key:"disableEventListeners",value:function(){return $.call(this)}}]),e}();Me.Utils=("undefined"!=typeof window?window:e).PopperUtils,Me.placements=ue,Me.Defaults=Te;var Ne=Me;exports.default=Ne;
},{}],"TJmo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=d(require("@babel/runtime/helpers/esm/extends")),t=d(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),n=d(require("prop-types")),u=d(require("popper.js")),o=require("@material-ui/utils"),i=require("@material-ui/styles"),a=d(require("../Portal")),f=d(require("../utils/createChainedFunction")),l=d(require("../utils/setRef")),c=d(require("../utils/useForkRef"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=n?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function d(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function b(e){return"function"==typeof e?e():e}var v="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,y={},h=r.forwardRef(function(n,o){var s=n.anchorEl,p=n.children,d=n.container,h=n.disablePortal,w=void 0!==h&&h,E=n.keepMounted,O=void 0!==E&&E,P=n.modifiers,q=n.open,j=n.placement,R=void 0===j?"bottom":j,k=n.popperOptions,M=void 0===k?y:k,x=n.popperRef,_=n.style,C=n.transition,g=void 0!==C&&C,W=(0,t.default)(n,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),D=r.useRef(null),F=(0,c.default)(D,o),S=r.useRef(null),T=(0,c.default)(S,x),U=r.useRef(T);v(function(){U.current=T},[T]),r.useImperativeHandle(x,function(){return S.current},[]);var H=r.useState(!0),I=H[0],L=H[1],z=m(R,(0,i.useTheme)()),A=r.useState(z),B=A[0],G=A[1];r.useEffect(function(){S.current&&S.current.update()});var J=r.useCallback(function(){if(D.current&&s&&q){S.current&&(S.current.destroy(),U.current(null));var t=function(e){G(e.placement)},r=(b(s),new u.default(b(s),D.current,(0,e.default)({placement:z},M,{modifiers:(0,e.default)({},w?{}:{preventOverflow:{boundariesElement:"window"}},P,M.modifiers),onCreate:(0,f.default)(t,M.onCreate),onUpdate:(0,f.default)(t,M.onUpdate)})));U.current(r)}},[s,w,P,q,z,M]),K=r.useCallback(function(e){(0,l.default)(F,e),J()},[F,J]),N=function(){S.current&&(S.current.destroy(),U.current(null))};if(r.useEffect(function(){return function(){N()}},[]),r.useEffect(function(){q||g||N()},[q,g]),!O&&!q&&(!g||I))return null;var Q={placement:B};return g&&(Q.TransitionProps={in:q,onEnter:function(){L(!1)},onExited:function(){L(!0),N()}}),r.createElement(a.default,{disablePortal:w,container:d},r.createElement("div",(0,e.default)({ref:K,role:"tooltip"},W,{style:(0,e.default)({position:"fixed",top:0,left:0,display:q||!O||g?null:"none"},_)}),"function"==typeof p?p(Q):p))}),w=h;exports.default=w;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","popper.js":"loUd","@material-ui/utils":"gEhD","@material-ui/styles":"thJn","../Portal":"ZN8Z","../utils/createChainedFunction":"ftFk","../utils/setRef":"IV4i","../utils/useForkRef":"eYEl"}],"PkJy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Popper"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Popper":"TJmo"}],"JsS4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"God9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"n6i6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("react")),t=i(require("prop-types")),r=i(require("clsx")),n=i(require("../internal/svg-icons/RadioButtonUnchecked")),a=i(require("../internal/svg-icons/RadioButtonChecked")),o=i(require("../styles/withStyles"));function i(e){return e&&e.__esModule?e:{default:e}}function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}var c=function(e){return{root:{position:"relative",display:"flex","&$checked $layer":{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}},layer:{left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},checked:{}}};function l(t){var o=t.checked,i=t.classes,s=t.fontSize;return e.createElement("div",{className:(0,r.default)(i.root,o&&i.checked)},e.createElement(n.default,{fontSize:s}),e.createElement(a.default,{fontSize:s,className:i.layer}))}exports.styles=c;var f=(0,o.default)(c,{name:"PrivateRadioButtonIcon"})(l);exports.default=f;
},{"react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../internal/svg-icons/RadioButtonUnchecked":"JsS4","../internal/svg-icons/RadioButtonChecked":"God9","../styles/withStyles":"awmK"}],"FmmT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("react"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}var n=e.createContext();var o=n;exports.default=o;
},{"react":"n8MK"}],"zrJR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=o;var e=u(require("react")),t=r(require("./RadioGroupContext"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var f=u?Object.getOwnPropertyDescriptor(e,o):null;f&&(f.get||f.set)?Object.defineProperty(r,o,f):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function o(){return e.useContext(t.default)}
},{"react":"n8MK","./RadioGroupContext":"FmmT"}],"T7Ov":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=h(require("@babel/runtime/helpers/esm/extends")),r=h(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=m(require("react")),o=h(require("prop-types")),a=h(require("clsx")),l=require("@material-ui/utils"),n=h(require("../internal/SwitchBase")),i=h(require("./RadioButtonIcon")),c=require("../styles/colorManipulator"),u=h(require("../utils/capitalize")),d=h(require("../utils/createChainedFunction")),s=h(require("../styles/withStyles")),p=h(require("../RadioGroup/useRadioGroup"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(t,a,l):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function h(e){return e&&e.__esModule?e:{default:e}}var y=function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,c.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,c.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}};exports.styles=y;var b=t.createElement(i.default,{checked:!0}),v=t.createElement(i.default,null),k=t.forwardRef(function(o,l){var i=o.checked,c=o.classes,s=o.color,f=void 0===s?"secondary":s,m=o.name,h=o.onChange,y=o.size,k=void 0===y?"medium":y,q=(0,r.default)(o,["checked","classes","color","name","onChange","size"]),g=(0,p.default)(),O=i,C=(0,d.default)(h,g&&g.onChange),j=m;return g&&(void 0===O&&(O=g.value===o.value),void 0===j&&(j=g.name)),t.createElement(n.default,(0,e.default)({color:f,type:"radio",icon:t.cloneElement(v,{fontSize:"small"===k?"small":"default"}),checkedIcon:t.cloneElement(b,{fontSize:"small"===k?"small":"default"}),classes:{root:(0,a.default)(c.root,c["color".concat((0,u.default)(f))]),checked:c.checked,disabled:c.disabled},name:j,checked:O,onChange:C,ref:l},q))}),q=(0,s.default)(y,{name:"MuiRadio"})(k);exports.default=q;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../internal/SwitchBase":"NfPH","./RadioButtonIcon":"n6i6","../styles/colorManipulator":"aguB","../utils/capitalize":"Dk4Y","../utils/createChainedFunction":"ftFk","../styles/withStyles":"awmK","../RadioGroup/useRadioGroup":"zrJR"}],"BG1G":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Radio"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Radio":"T7Ov"}],"hGTw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("@babel/runtime/helpers/esm/extends")),r=s(require("@babel/runtime/helpers/esm/slicedToArray")),t=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),u=c(require("react")),n=s(require("prop-types")),a=s(require("../FormGroup")),o=s(require("../utils/useForkRef")),l=s(require("../utils/useControlled")),i=s(require("./RadioGroupContext")),f=s(require("../utils/unstable_useId"));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=d();if(r&&r.has(e))return r.get(e);var t={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=u?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(t,n,a):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function s(e){return e&&e.__esModule?e:{default:e}}var p=u.forwardRef(function(n,d){var c=n.actions,s=n.children,p=n.name,v=n.value,b=n.onChange,m=(0,t.default)(n,["actions","children","name","value","onChange"]),y=u.useRef(null),h=(0,l.default)({controlled:v,default:n.defaultValue,name:"RadioGroup"}),q=(0,r.default)(h,2),g=q[0],O=q[1];u.useImperativeHandle(c,function(){return{focus:function(){var e=y.current.querySelector("input:not(:disabled):checked");e||(e=y.current.querySelector("input:not(:disabled)")),e&&e.focus()}}},[]);var j=(0,o.default)(d,y),P=(0,f.default)(p);return u.createElement(i.default.Provider,{value:{name:P,onChange:function(e){O(e.target.value),b&&b(e,e.target.value)},value:g}},u.createElement(a.default,(0,e.default)({role:"radiogroup",ref:j},m),s))}),v=p;exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","../FormGroup":"QPPT","../utils/useForkRef":"eYEl","../utils/useControlled":"WHmv","./RadioGroupContext":"FmmT","../utils/unstable_useId":"yA5c"}],"k1RN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"useRadioGroup",{enumerable:!0,get:function(){return r.default}});var e=t(require("./RadioGroup")),r=t(require("./useRadioGroup"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./RadioGroup":"hGTw","./useRadioGroup":"zrJR"}],"NT06":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=r;var e=t(require("./setPrototypeOf.js"));function t(e){return e&&e.__esModule?e:{default:e}}function r(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&(0,e.default)(t,r)}
},{"./setPrototypeOf.js":"hewo"}],"b9XL":[function(require,module,exports) {
function o(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(module.exports=o=function(o){return typeof o},module.exports.default=module.exports,module.exports.__esModule=!0):(module.exports=o=function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},module.exports.default=module.exports,module.exports.__esModule=!0),o(e)}module.exports=o,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"aBEI":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=r(require("@babel/runtime/helpers/typeof")),t=r(require("./assertThisInitialized.js"));function r(e){return e&&e.__esModule?e:{default:e}}function u(r,u){return!u||"object"!==(0,e.default)(u)&&"function"!=typeof u?(0,t.default)(r):u}
},{"@babel/runtime/helpers/typeof":"b9XL","./assertThisInitialized.js":"bk0i"}],"QQCW":[function(require,module,exports) {
"use strict";function t(e){return exports.default=t=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;
},{}],"Cy12":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=p(require("@babel/runtime/helpers/esm/classCallCheck")),t=p(require("@babel/runtime/helpers/esm/createClass")),r=p(require("@babel/runtime/helpers/esm/inherits")),n=p(require("@babel/runtime/helpers/esm/possibleConstructorReturn")),u=p(require("@babel/runtime/helpers/esm/getPrototypeOf")),o=c(require("react")),i=c(require("react-dom")),f=p(require("prop-types")),l=require("@material-ui/utils"),s=p(require("../utils/setRef"));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=n?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}function d(e){var t=h();return function(){var r,o=(0,u.default)(e);if(t){var i=(0,u.default)(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return(0,n.default)(this,r)}}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}var y=function(n){(0,r.default)(o,n);var u=d(o);function o(){return(0,e.default)(this,o),u.apply(this,arguments)}return(0,t.default)(o,[{key:"componentDidMount",value:function(){this.ref=i.findDOMNode(this),(0,s.default)(this.props.rootRef,this.ref)}},{key:"componentDidUpdate",value:function(e){var t=i.findDOMNode(this);e.rootRef===this.props.rootRef&&this.ref===t||(e.rootRef!==this.props.rootRef&&(0,s.default)(e.rootRef,null),this.ref=t,(0,s.default)(this.props.rootRef,this.ref))}},{key:"componentWillUnmount",value:function(){this.ref=null,(0,s.default)(this.props.rootRef,null)}},{key:"render",value:function(){return this.props.children}}]),o}(o.Component);var v=y;exports.default=v;
},{"@babel/runtime/helpers/esm/classCallCheck":"VEjx","@babel/runtime/helpers/esm/createClass":"l5p4","@babel/runtime/helpers/esm/inherits":"NT06","@babel/runtime/helpers/esm/possibleConstructorReturn":"aBEI","@babel/runtime/helpers/esm/getPrototypeOf":"QQCW","react":"n8MK","react-dom":"NKHc","prop-types":"D9Od","@material-ui/utils":"gEhD","../utils/setRef":"IV4i"}],"IJ01":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./RootRef"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./RootRef":"Cy12"}],"nviy":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=b(require("@babel/runtime/helpers/esm/extends")),r=b(require("@babel/runtime/helpers/esm/slicedToArray")),t=b(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=b(require("@babel/runtime/helpers/esm/typeof")),a=require("@material-ui/utils"),l=y(require("react")),u=require("react-is"),o=b(require("prop-types")),i=b(require("clsx")),s=b(require("../utils/ownerDocument")),p=b(require("../utils/capitalize")),c=b(require("../Menu/Menu")),d=require("../InputBase/utils"),f=b(require("../utils/useForkRef")),v=b(require("../utils/useControlled"));function m(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return m=function(){return e},e}function y(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=m();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(t,a,l):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function b(e){return e&&e.__esModule?e:{default:e}}function h(e,r){return"object"===(0,n.default)(r)&&null!==r?e===r:String(e)===String(r)}function P(e){return null==e||"string"==typeof e&&!e.trim()}var E=l.forwardRef(function(n,u){var o=n["aria-label"],m=n.autoFocus,y=n.autoWidth,b=n.children,E=n.classes,O=n.className,g=n.defaultValue,M=n.disabled,q=n.displayEmpty,w=n.IconComponent,x=n.inputRef,j=n.labelId,C=n.MenuProps,I=void 0===C?{}:C,D=n.multiple,k=n.name,A=n.onBlur,S=n.onChange,F=n.onClose,W=n.onFocus,_=n.onOpen,B=n.open,L=n.readOnly,R=n.renderValue,N=n.SelectDisplayProps,V=void 0===N?{}:N,K=n.tabIndex,U=(n.type,n.value),H=n.variant,T=void 0===H?"standard":H,z=(0,t.default)(n,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),G=(0,v.default)({controlled:U,default:g,name:"Select"}),J=(0,r.default)(G,2),Q=J[0],X=J[1],Y=l.useRef(null),Z=l.useState(null),$=Z[0],ee=Z[1],re=l.useRef(null!=B).current,te=l.useState(),ne=te[0],ae=te[1],le=l.useState(!1),ue=le[0],oe=le[1],ie=(0,f.default)(u,x);l.useImperativeHandle(ie,function(){return{focus:function(){$.focus()},node:Y.current,value:Q}},[$,Q]),l.useEffect(function(){m&&$&&$.focus()},[m,$]),l.useEffect(function(){if($){var e=(0,s.default)($).getElementById(j);if(e){var r=function(){getSelection().isCollapsed&&$.focus()};return e.addEventListener("click",r),function(){e.removeEventListener("click",r)}}}},[j,$]);var se,pe,ce=function(e,r){e?_&&_(r):F&&F(r),re||(ae(y?null:$.clientWidth),oe(e))},de=l.Children.toArray(b),fe=function(e){return function(r){var t;if(D||ce(!1,r),D){t=Array.isArray(Q)?Q.slice():[];var n=Q.indexOf(e.props.value);-1===n?t.push(e.props.value):t.splice(n,1)}else t=e.props.value;e.props.onClick&&e.props.onClick(r),Q!==t&&(X(t),S&&(r.persist(),Object.defineProperty(r,"target",{writable:!0,value:{value:t,name:k}}),S(r,e)))}},ve=null!==$&&(re?B:ue);delete z["aria-invalid"];var me=[],ye=!1;((0,d.isFilled)({value:Q})||q)&&(R?se=R(Q):ye=!0);var be=de.map(function(e){if(!l.isValidElement(e))return null;var r;if(D){if(!Array.isArray(Q))throw new Error((0,a.formatMuiErrorMessage)(2));(r=Q.some(function(r){return h(r,e.props.value)}))&&ye&&me.push(e.props.children)}else(r=h(Q,e.props.value))&&ye&&(pe=e.props.children);return r&&!0,l.cloneElement(e,{"aria-selected":r?"true":void 0,onClick:fe(e),onKeyUp:function(r){" "===r.key&&r.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(r)},role:"option",selected:r,value:void 0,"data-value":e.props.value})});ye&&(se=D?me.join(", "):pe);var he,Pe=ne;!y&&re&&$&&(Pe=$.clientWidth),he=void 0!==K?K:M?null:0;var Ee=V.id||(k?"mui-component-select-".concat(k):void 0);return l.createElement(l.Fragment,null,l.createElement("div",(0,e.default)({className:(0,i.default)(E.root,E.select,E.selectMenu,E[T],O,M&&E.disabled),ref:ee,tabIndex:he,role:"button","aria-disabled":M?"true":void 0,"aria-expanded":ve?"true":void 0,"aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[j,Ee].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){L||-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),ce(!0,e))},onMouseDown:M||L?null:function(e){0===e.button&&(e.preventDefault(),$.focus(),ce(!0,e))},onBlur:function(e){!ve&&A&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:Q,name:k}}),A(e))},onFocus:W},V,{id:Ee}),P(se)?l.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}}):se),l.createElement("input",(0,e.default)({value:Array.isArray(Q)?Q.join(","):Q,name:k,ref:Y,"aria-hidden":!0,onChange:function(e){var r=de.map(function(e){return e.props.value}).indexOf(e.target.value);if(-1!==r){var t=de[r];X(t.props.value),S&&S(e,t)}},tabIndex:-1,className:E.nativeInput,autoFocus:m},z)),l.createElement(w,{className:(0,i.default)(E.icon,E["icon".concat((0,p.default)(T))],ve&&E.iconOpen,M&&E.disabled)}),l.createElement(c.default,(0,e.default)({id:"menu-".concat(k||""),anchorEl:$,open:ve,onClose:function(e){ce(!1,e)}},I,{MenuListProps:(0,e.default)({"aria-labelledby":j,role:"listbox",disableListWrap:!0},I.MenuListProps),PaperProps:(0,e.default)({},I.PaperProps,{style:(0,e.default)({minWidth:Pe},null!=I.PaperProps?I.PaperProps.style:null)})}),be))}),O=E;exports.default=O;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/typeof":"xLw6","@material-ui/utils":"gEhD","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","../utils/ownerDocument":"Xj2I","../utils/capitalize":"Dk4Y","../Menu/Menu":"dn7M","../InputBase/utils":"Abg1","../utils/useForkRef":"eYEl","../utils/useControlled":"WHmv"}],"Qc4R":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=b(require("@babel/runtime/helpers/esm/extends")),t=b(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=y(require("react")),l=b(require("prop-types")),n=require("@material-ui/styles"),o=b(require("./SelectInput")),a=b(require("../FormControl/formControlState")),i=b(require("../FormControl/useFormControl")),u=b(require("../styles/withStyles")),s=b(require("../internal/svg-icons/ArrowDropDown")),p=b(require("../Input")),d=require("../NativeSelect/NativeSelect"),c=b(require("../NativeSelect/NativeSelectInput")),f=b(require("../FilledInput")),v=b(require("../OutlinedInput"));function m(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return m=function(){return e},e}function y(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=m();if(t&&t.has(e))return t.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=l?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function b(e){return e&&e.__esModule?e:{default:e}}var P=d.styles;exports.styles=P;var C=r.createElement(p.default,null),h=r.createElement(f.default,null),q=r.forwardRef(function l(u,p){var d=u.autoWidth,f=void 0!==d&&d,m=u.children,y=u.classes,b=u.displayEmpty,P=void 0!==b&&b,q=u.IconComponent,O=void 0===q?s.default:q,S=u.id,I=u.input,w=u.inputProps,M=u.label,W=u.labelId,j=u.labelWidth,D=void 0===j?0:j,E=u.MenuProps,g=u.multiple,x=void 0!==g&&g,_=u.native,F=void 0!==_&&_,N=u.onClose,V=u.onOpen,k=u.open,A=u.renderValue,R=u.SelectDisplayProps,z=u.variant,B=void 0===z?"standard":z,G=(0,t.default)(u,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),H=F?c.default:o.default,J=(0,i.default)(),K=(0,a.default)({props:u,muiFormControl:J,states:["variant"]}).variant||B,L=I||{standard:C,outlined:r.createElement(v.default,{label:M,labelWidth:D}),filled:h}[K];return r.cloneElement(L,(0,e.default)({inputComponent:H,inputProps:(0,e.default)({children:m,IconComponent:O,variant:K,type:void 0,multiple:x},F?{id:S}:{autoWidth:f,displayEmpty:P,labelId:W,MenuProps:E,onClose:N,onOpen:V,open:k,renderValue:A,SelectDisplayProps:(0,e.default)({id:S},R)},w,{classes:w?(0,n.mergeClasses)({baseClasses:y,newClasses:w.classes,Component:l}):y},I?I.props.inputProps:{}),ref:p},G))});q.muiName="Select";var O=(0,u.default)(P,{name:"MuiSelect"})(q);exports.default=O;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","@material-ui/styles":"thJn","./SelectInput":"nviy","../FormControl/formControlState":"xTaA","../FormControl/useFormControl":"SKV5","../styles/withStyles":"awmK","../internal/svg-icons/ArrowDropDown":"xqr3","../Input":"CaNl","../NativeSelect/NativeSelect":"oCj7","../NativeSelect/NativeSelectInput":"z1Fo","../FilledInput":"wWb1","../OutlinedInput":"Z2x8"}],"NCwz":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Select"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Select":"Qc4R"}],"tTkO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("@babel/runtime/helpers/esm/extends")),t=o(require("react")),r=s(require("clsx")),a=s(require("../styles/withStyles"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function s(e){return e&&e.__esModule?e:{default:e}}var l=function(t){return{thumb:{"&$open":{"& $offset":{transform:"scale(1) translateY(-10px)"}}},open:{},offset:(0,e.default)({zIndex:1},t.typography.body2,{fontSize:t.typography.pxToRem(12),lineHeight:1.2,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),top:-34,transformOrigin:"bottom center",transform:"scale(0)",position:"absolute"}),circle:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"currentColor",transform:"rotate(-45deg)"},label:{color:t.palette.primary.contrastText,transform:"rotate(45deg)"}}};function i(e){var a=e.children,n=e.classes,o=e.className,s=e.open,l=e.value,i=e.valueLabelDisplay;return"off"===i?a:t.cloneElement(a,{className:(0,r.default)(a.props.className,(s||"on"===i)&&n.open,n.thumb)},t.createElement("span",{className:(0,r.default)(n.offset,o)},t.createElement("span",{className:n.circle},t.createElement("span",{className:n.label},l))))}var u=(0,a.default)(l,{name:"PrivateValueLabel"})(i);exports.default=u;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","clsx":"WLGK","../styles/withStyles":"awmK"}],"JAF4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=y(require("@babel/runtime/helpers/esm/toConsumableArray")),t=y(require("@babel/runtime/helpers/esm/slicedToArray")),r=y(require("@babel/runtime/helpers/esm/objectWithoutProperties")),a=y(require("@babel/runtime/helpers/esm/extends")),n=x(require("react")),o=y(require("prop-types")),i=y(require("clsx")),l=require("@material-ui/utils"),u=y(require("../styles/withStyles")),c=y(require("../styles/useTheme")),s=require("../styles/colorManipulator"),d=y(require("../utils/useIsFocusVisible")),v=y(require("../utils/ownerDocument")),f=y(require("../utils/useEventCallback")),m=y(require("../utils/useForkRef")),p=y(require("../utils/capitalize")),b=y(require("../utils/useControlled")),h=y(require("./ValueLabel"));function g(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return g=function(){return e},e}function x(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=g();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function y(e){return e&&e.__esModule?e:{default:e}}function w(e,t){return e-t}function k(e,t,r){return Math.min(Math.max(t,e),r)}function L(e,t){return e.reduce(function(e,r,a){var n=Math.abs(t-r);return null===e||n<e.distance||n===e.distance?{distance:n,index:a}:e},null).index}function E(e,t){if(void 0!==t.current&&e.changedTouches){for(var r=0;r<e.changedTouches.length;r+=1){var a=e.changedTouches[r];if(a.identifier===t.current)return{x:a.clientX,y:a.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function A(e,t,r){return 100*(e-t)/(r-t)}function C(e,t,r){return(r-t)*e+t}function V(e){if(Math.abs(e)<1){var t=e.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}var a=e.toString().split(".")[1];return a?a.length:0}function q(e,t,r){var a=Math.round((e-r)/t)*t+r;return Number(a.toFixed(V(t)))}function R(e){var t=e.values,r=e.source,a=e.newValue,n=e.index;if(t[n]===a)return r;var o=t.slice();return o[n]=a,o}function S(e){var t=e.sliderRef,r=e.activeIndex,a=e.setActive;t.current.contains(document.activeElement)&&Number(document.activeElement.getAttribute("data-index"))===r||t.current.querySelector('[role="slider"][data-index="'.concat(r,'"]')).focus(),a&&a(r)}var $={horizontal:{offset:function(e){return{left:"".concat(e,"%")}},leap:function(e){return{width:"".concat(e,"%")}}},"horizontal-reverse":{offset:function(e){return{right:"".concat(e,"%")}},leap:function(e){return{width:"".concat(e,"%")}}},vertical:{offset:function(e){return{bottom:"".concat(e,"%")}},leap:function(e){return{height:"".concat(e,"%")}}}},M=function(e){return e},O=function(e){return{root:{height:2,width:"100%",boxSizing:"content-box",padding:"13px 0",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:e.palette.primary.main,WebkitTapHighlightColor:"transparent","&$disabled":{pointerEvents:"none",cursor:"default",color:e.palette.grey[400]},"&$vertical":{width:2,height:"100%",padding:"0 13px"},"@media (pointer: coarse)":{padding:"20px 0","&$vertical":{padding:"0 20px"}},"@media print":{colorAdjust:"exact"}},colorPrimary:{},colorSecondary:{color:e.palette.secondary.main},marked:{marginBottom:20,"&$vertical":{marginBottom:"auto",marginRight:20}},vertical:{},disabled:{},rail:{display:"block",position:"absolute",width:"100%",height:2,borderRadius:1,backgroundColor:"currentColor",opacity:.38,"$vertical &":{height:"100%",width:2}},track:{display:"block",position:"absolute",height:2,borderRadius:1,backgroundColor:"currentColor","$vertical &":{width:2}},trackFalse:{"& $track":{display:"none"}},trackInverted:{"& $track":{backgroundColor:"light"===e.palette.type?(0,s.lighten)(e.palette.primary.main,.62):(0,s.darken)(e.palette.primary.main,.5)},"& $rail":{opacity:1}},thumb:{position:"absolute",width:12,height:12,marginLeft:-6,marginTop:-5,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow"],{duration:e.transitions.duration.shortest}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",left:-15,top:-15,right:-15,bottom:-15},"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat((0,s.fade)(e.palette.primary.main,.16)),"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:"0px 0px 0px 14px ".concat((0,s.fade)(e.palette.primary.main,.16))},"&$disabled":{width:8,height:8,marginLeft:-4,marginTop:-3,"&:hover":{boxShadow:"none"}},"$vertical &":{marginLeft:-5,marginBottom:-6},"$vertical &$disabled":{marginLeft:-3,marginBottom:-4}},thumbColorPrimary:{},thumbColorSecondary:{"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat((0,s.fade)(e.palette.secondary.main,.16))},"&$active":{boxShadow:"0px 0px 0px 14px ".concat((0,s.fade)(e.palette.secondary.main,.16))}},active:{},focusVisible:{},valueLabel:{left:"calc(-50% - 4px)"},mark:{position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},markActive:{backgroundColor:e.palette.background.paper,opacity:.8},markLabel:(0,a.default)({},e.typography.body2,{color:e.palette.text.secondary,position:"absolute",top:26,transform:"translateX(-50%)",whiteSpace:"nowrap","$vertical &":{top:"auto",left:26,transform:"translateY(50%)"},"@media (pointer: coarse)":{top:40,"$vertical &":{left:31}}}),markLabelActive:{color:e.palette.text.primary}}};exports.styles=O;var T=n.forwardRef(function(o,l){var u=o["aria-label"],s=o["aria-labelledby"],g=o["aria-valuetext"],x=o.classes,y=o.className,V=o.color,O=void 0===V?"primary":V,T=o.component,D=void 0===T?"span":T,I=o.defaultValue,N=o.disabled,j=void 0!==N&&N,F=o.getAriaLabel,P=o.getAriaValueText,B=o.marks,z=void 0!==B&&B,_=o.max,W=void 0===_?100:_,X=o.min,Y=void 0===X?0:X,H=o.name,U=o.onChange,K=o.onChangeCommitted,G=o.onMouseDown,J=o.orientation,Q=void 0===J?"horizontal":J,Z=o.scale,ee=void 0===Z?M:Z,te=o.step,re=void 0===te?1:te,ae=o.ThumbComponent,ne=void 0===ae?"span":ae,oe=o.track,ie=void 0===oe?"normal":oe,le=o.value,ue=o.ValueLabelComponent,ce=void 0===ue?h.default:ue,se=o.valueLabelDisplay,de=void 0===se?"off":se,ve=o.valueLabelFormat,fe=void 0===ve?M:ve,me=(0,r.default)(o,["aria-label","aria-labelledby","aria-valuetext","classes","className","color","component","defaultValue","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","onMouseDown","orientation","scale","step","ThumbComponent","track","value","ValueLabelComponent","valueLabelDisplay","valueLabelFormat"]),pe=(0,c.default)(),be=n.useRef(),he=n.useState(-1),ge=he[0],xe=he[1],ye=n.useState(-1),we=ye[0],ke=ye[1],Le=(0,b.default)({controlled:le,default:I,name:"Slider"}),Ee=(0,t.default)(Le,2),Ae=Ee[0],Ce=Ee[1],Ve=Array.isArray(Ae),qe=Ve?Ae.slice().sort(w):[Ae];qe=qe.map(function(e){return k(e,Y,W)});var Re=!0===z&&null!==re?(0,e.default)(Array(Math.floor((W-Y)/re)+1)).map(function(e,t){return{value:Y+re*t}}):z||[],Se=(0,d.default)(),$e=Se.isFocusVisible,Me=Se.onBlurVisible,Oe=Se.ref,Te=n.useState(-1),De=Te[0],Ie=Te[1],Ne=n.useRef(),je=(0,m.default)(Oe,Ne),Fe=(0,m.default)(l,je),Pe=(0,f.default)(function(e){var t=Number(e.currentTarget.getAttribute("data-index"));$e(e)&&Ie(t),ke(t)}),Be=(0,f.default)(function(){-1!==De&&(Ie(-1),Me()),ke(-1)}),ze=(0,f.default)(function(e){var t=Number(e.currentTarget.getAttribute("data-index"));ke(t)}),_e=(0,f.default)(function(){ke(-1)}),We="rtl"===pe.direction,Xe=(0,f.default)(function(e){var t,r=Number(e.currentTarget.getAttribute("data-index")),a=qe[r],n=(W-Y)/10,o=Re.map(function(e){return e.value}),i=o.indexOf(a),l=We?"ArrowLeft":"ArrowRight",u=We?"ArrowRight":"ArrowLeft";switch(e.key){case"Home":t=Y;break;case"End":t=W;break;case"PageUp":re&&(t=a+n);break;case"PageDown":re&&(t=a-n);break;case l:case"ArrowUp":t=re?a+re:o[i+1]||o[o.length-1];break;case u:case"ArrowDown":t=re?a-re:o[i-1]||o[0];break;default:return}if(e.preventDefault(),re&&(t=q(t,re,Y)),t=k(t,Y,W),Ve){var c=t;t=R({values:qe,source:Ae,newValue:t,index:r}).sort(w),S({sliderRef:Ne,activeIndex:t.indexOf(c)})}Ce(t),Ie(r),U&&U(e,t),K&&K(e,t)}),Ye=n.useRef(),He=Q;We&&"vertical"!==Q&&(He+="-reverse");var Ue=function(e){var t,r,a=e.finger,n=e.move,o=void 0!==n&&n,i=e.values,l=e.source,u=Ne.current.getBoundingClientRect(),c=u.width,s=u.height,d=u.bottom,v=u.left;if(t=0===He.indexOf("vertical")?(d-a.y)/s:(a.x-v)/c,-1!==He.indexOf("-reverse")&&(t=1-t),r=C(t,Y,W),re)r=q(r,re,Y);else{var f=Re.map(function(e){return e.value});r=f[L(f,r)]}r=k(r,Y,W);var m=0;if(Ve){var p=r;m=(r=R({values:i,source:l,newValue:r,index:m=o?Ye.current:L(i,r)}).sort(w)).indexOf(p),Ye.current=m}return{newValue:r,activeIndex:m}},Ke=(0,f.default)(function(e){var t=E(e,be);if(t){var r=Ue({finger:t,move:!0,values:qe,source:Ae}),a=r.newValue,n=r.activeIndex;S({sliderRef:Ne,activeIndex:n,setActive:xe}),Ce(a),U&&U(e,a)}}),Ge=(0,f.default)(function(e){var t=E(e,be);if(t){var r=Ue({finger:t,values:qe,source:Ae}).newValue;xe(-1),"touchend"===e.type&&ke(-1),K&&K(e,r),be.current=void 0;var a=(0,v.default)(Ne.current);a.removeEventListener("mousemove",Ke),a.removeEventListener("mouseup",Ge),a.removeEventListener("touchmove",Ke),a.removeEventListener("touchend",Ge)}}),Je=(0,f.default)(function(e){e.preventDefault();var t=e.changedTouches[0];null!=t&&(be.current=t.identifier);var r=E(e,be),a=Ue({finger:r,values:qe,source:Ae}),n=a.newValue,o=a.activeIndex;S({sliderRef:Ne,activeIndex:o,setActive:xe}),Ce(n),U&&U(e,n);var i=(0,v.default)(Ne.current);i.addEventListener("touchmove",Ke),i.addEventListener("touchend",Ge)});n.useEffect(function(){var e=Ne.current;e.addEventListener("touchstart",Je);var t=(0,v.default)(e);return function(){e.removeEventListener("touchstart",Je),t.removeEventListener("mousemove",Ke),t.removeEventListener("mouseup",Ge),t.removeEventListener("touchmove",Ke),t.removeEventListener("touchend",Ge)}},[Ge,Ke,Je]);var Qe=(0,f.default)(function(e){G&&G(e),e.preventDefault();var t=E(e,be),r=Ue({finger:t,values:qe,source:Ae}),a=r.newValue,n=r.activeIndex;S({sliderRef:Ne,activeIndex:n,setActive:xe}),Ce(a),U&&U(e,a);var o=(0,v.default)(Ne.current);o.addEventListener("mousemove",Ke),o.addEventListener("mouseup",Ge)}),Ze=A(Ve?qe[0]:Y,Y,W),et=A(qe[qe.length-1],Y,W)-Ze,tt=(0,a.default)({},$[He].offset(Ze),$[He].leap(et));return n.createElement(D,(0,a.default)({ref:Fe,className:(0,i.default)(x.root,x["color".concat((0,p.default)(O))],y,j&&x.disabled,Re.length>0&&Re.some(function(e){return e.label})&&x.marked,!1===ie&&x.trackFalse,"vertical"===Q&&x.vertical,"inverted"===ie&&x.trackInverted),onMouseDown:Qe},me),n.createElement("span",{className:x.rail}),n.createElement("span",{className:x.track,style:tt}),n.createElement("input",{value:qe.join(","),name:H,type:"hidden"}),Re.map(function(e,t){var r,a=A(e.value,Y,W),o=$[He].offset(a);return r=!1===ie?-1!==qe.indexOf(e.value):"normal"===ie&&(Ve?e.value>=qe[0]&&e.value<=qe[qe.length-1]:e.value<=qe[0])||"inverted"===ie&&(Ve?e.value<=qe[0]||e.value>=qe[qe.length-1]:e.value>=qe[0]),n.createElement(n.Fragment,{key:e.value},n.createElement("span",{style:o,"data-index":t,className:(0,i.default)(x.mark,r&&x.markActive)}),null!=e.label?n.createElement("span",{"aria-hidden":!0,"data-index":t,style:o,className:(0,i.default)(x.markLabel,r&&x.markLabelActive)},e.label):null)}),qe.map(function(e,t){var r=A(e,Y,W),a=$[He].offset(r);return n.createElement(ce,{key:t,valueLabelFormat:fe,valueLabelDisplay:de,className:x.valueLabel,value:"function"==typeof fe?fe(ee(e),t):fe,index:t,open:we===t||ge===t||"on"===de,disabled:j},n.createElement(ne,{className:(0,i.default)(x.thumb,x["thumbColor".concat((0,p.default)(O))],ge===t&&x.active,j&&x.disabled,De===t&&x.focusVisible),tabIndex:j?null:0,role:"slider",style:a,"data-index":t,"aria-label":F?F(t):u,"aria-labelledby":s,"aria-orientation":Q,"aria-valuemax":ee(W),"aria-valuemin":ee(Y),"aria-valuenow":ee(e),"aria-valuetext":P?P(ee(e),t):g,onKeyDown:Xe,onFocus:Pe,onBlur:Be,onMouseOver:ze,onMouseLeave:_e}))}))}),D=(0,u.default)(O,{name:"MuiSlider"})(T);exports.default=D;
},{"@babel/runtime/helpers/esm/toConsumableArray":"Qv3s","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/withStyles":"awmK","../styles/useTheme":"nmB4","../styles/colorManipulator":"aguB","../utils/useIsFocusVisible":"Z9bb","../utils/ownerDocument":"Xj2I","../utils/useEventCallback":"AH47","../utils/useForkRef":"eYEl","../utils/capitalize":"Dk4Y","../utils/useControlled":"WHmv","./ValueLabel":"tTkO"}],"v42q":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Slider"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Slider":"JAF4"}],"vbyb":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=f(require("@babel/runtime/helpers/esm/defineProperty")),r=f(require("@babel/runtime/helpers/esm/extends")),a=p(require("react")),l=f(require("prop-types")),n=f(require("clsx")),s=f(require("../styles/withStyles")),o=f(require("../Paper")),i=require("../styles/colorManipulator");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=a?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=e[l]}return r.default=e,t&&t.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}var c=function(e){var a="light"===e.palette.type?.8:.98,l=(0,i.emphasize)(e.palette.background.default,a);return{root:(0,r.default)({},e.typography.body2,(0,t.default)({color:e.palette.getContrastText(l),backgroundColor:l,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:e.shape.borderRadius,flexGrow:1},e.breakpoints.up("sm"),{flexGrow:"initial",minWidth:288})),message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}};exports.styles=c;var d=a.forwardRef(function(t,l){var s=t.action,i=t.classes,u=t.className,p=t.message,f=t.role,c=void 0===f?"alert":f,d=(0,e.default)(t,["action","classes","className","message","role"]);return a.createElement(o.default,(0,r.default)({role:c,square:!0,elevation:6,className:(0,n.default)(i.root,u),ref:l},d),a.createElement("div",{className:i.message},p),s?a.createElement("div",{className:i.action},s):null)}),m=(0,s.default)(c,{name:"MuiSnackbarContent"})(d);exports.default=m;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Paper":"mtQp","../styles/colorManipulator":"aguB"}],"ECNl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./SnackbarContent"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./SnackbarContent":"vbyb"}],"NviV":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=b(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=b(require("@babel/runtime/helpers/esm/defineProperty")),n=b(require("@babel/runtime/helpers/esm/extends")),r=v(require("react")),o=b(require("prop-types")),i=b(require("clsx")),a=b(require("../styles/withStyles")),u=require("../styles/transitions"),l=b(require("../ClickAwayListener")),s=b(require("../utils/useEventCallback")),f=b(require("../utils/capitalize")),c=b(require("../utils/createChainedFunction")),d=b(require("../Grow")),p=b(require("../SnackbarContent"));function m(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return m=function(){return e},e}function v(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=m();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function b(e){return e&&e.__esModule?e:{default:e}}var g=function(e){var r={top:8},o={bottom:8},i={justifyContent:"flex-end"},a={justifyContent:"flex-start"},u={top:24},l={bottom:24},s={right:24},f={left:24},c={left:"50%",right:"auto",transform:"translateX(-50%)"};return{root:{zIndex:e.zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},anchorOriginTopCenter:(0,n.default)({},r,(0,t.default)({},e.breakpoints.up("sm"),(0,n.default)({},u,c))),anchorOriginBottomCenter:(0,n.default)({},o,(0,t.default)({},e.breakpoints.up("sm"),(0,n.default)({},l,c))),anchorOriginTopRight:(0,n.default)({},r,i,(0,t.default)({},e.breakpoints.up("sm"),(0,n.default)({left:"auto"},u,s))),anchorOriginBottomRight:(0,n.default)({},o,i,(0,t.default)({},e.breakpoints.up("sm"),(0,n.default)({left:"auto"},l,s))),anchorOriginTopLeft:(0,n.default)({},r,a,(0,t.default)({},e.breakpoints.up("sm"),(0,n.default)({right:"auto"},u,f))),anchorOriginBottomLeft:(0,n.default)({},o,a,(0,t.default)({},e.breakpoints.up("sm"),(0,n.default)({right:"auto"},l,f)))}};exports.styles=g;var E=r.forwardRef(function(t,o){var a=t.action,m=t.anchorOrigin,v=(m=void 0===m?{vertical:"bottom",horizontal:"center"}:m).vertical,b=m.horizontal,g=t.autoHideDuration,E=void 0===g?null:g,h=t.children,y=t.classes,w=t.className,x=t.ClickAwayListenerProps,C=t.ContentProps,k=t.disableWindowBlurListener,O=void 0!==k&&k,q=t.message,L=t.onClose,P=t.onEnter,M=t.onEntered,j=t.onEntering,T=t.onExit,D=t.onExited,S=t.onExiting,_=t.onMouseEnter,z=t.onMouseLeave,B=t.open,W=t.resumeHideDuration,A=t.TransitionComponent,H=void 0===A?d.default:A,R=t.transitionDuration,I=void 0===R?{enter:u.duration.enteringScreen,exit:u.duration.leavingScreen}:R,N=t.TransitionProps,F=(0,e.default)(t,["action","anchorOrigin","autoHideDuration","children","classes","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onClose","onEnter","onEntered","onEntering","onExit","onExited","onExiting","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"]),G=r.useRef(),X=r.useState(!0),J=X[0],K=X[1],Q=(0,s.default)(function(){L&&L.apply(void 0,arguments)}),U=(0,s.default)(function(e){L&&null!=e&&(clearTimeout(G.current),G.current=setTimeout(function(){Q(null,"timeout")},e))});r.useEffect(function(){return B&&U(E),function(){clearTimeout(G.current)}},[B,E,U]);var V=function(){clearTimeout(G.current)},Y=r.useCallback(function(){null!=E&&U(null!=W?W:.5*E)},[E,W,U]);return r.useEffect(function(){if(!O&&B)return window.addEventListener("focus",Y),window.addEventListener("blur",V),function(){window.removeEventListener("focus",Y),window.removeEventListener("blur",V)}},[O,Y,B]),!B&&J?null:r.createElement(l.default,(0,n.default)({onClickAway:function(e){L&&L(e,"clickaway")}},x),r.createElement("div",(0,n.default)({className:(0,i.default)(y.root,y["anchorOrigin".concat((0,f.default)(v)).concat((0,f.default)(b))],w),onMouseEnter:function(e){_&&_(e),V()},onMouseLeave:function(e){z&&z(e),Y()},ref:o},F),r.createElement(H,(0,n.default)({appear:!0,in:B,onEnter:(0,c.default)(function(){K(!1)},P),onEntered:M,onEntering:j,onExit:T,onExited:(0,c.default)(function(){K(!0)},D),onExiting:S,timeout:I,direction:"top"===v?"down":"up"},N),h||r.createElement(p.default,(0,n.default)({message:q,action:a},C)))))}),h=(0,a.default)(g,{flip:!1,name:"MuiSnackbar"})(E);exports.default=h;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../styles/transitions":"geVf","../ClickAwayListener":"YjtO","../utils/useEventCallback":"AH47","../utils/capitalize":"Dk4Y","../utils/createChainedFunction":"ftFk","../Grow":"vuXQ","../SnackbarContent":"ECNl"}],"gpsY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Snackbar"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Snackbar":"NviV"}],"n5GJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=s(require("@babel/runtime/helpers/esm/extends")),t=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=d(require("react")),a=require("react-is"),n=s(require("prop-types")),l=s(require("clsx")),i=s(require("../styles/withStyles"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function s(e){return e&&e.__esModule?e:{default:e}}var u={root:{},horizontal:{paddingLeft:8,paddingRight:8},vertical:{},alternativeLabel:{flex:1,position:"relative"},completed:{}};exports.styles=u;var c=r.forwardRef(function(a,n){var i=a.active,o=void 0!==i&&i,d=a.alternativeLabel,s=a.children,u=a.classes,c=a.className,p=a.completed,f=void 0!==p&&p,v=a.connector,b=a.disabled,m=void 0!==b&&b,y=a.expanded,x=void 0!==y&&y,h=a.index,O=a.last,g=a.orientation,j=(0,t.default)(a,["active","alternativeLabel","children","classes","className","completed","connector","disabled","expanded","index","last","orientation"]),q=v?r.cloneElement(v,{orientation:g,alternativeLabel:d,index:h,active:o,completed:f,disabled:m}):null,L=r.createElement("div",(0,e.default)({className:(0,l.default)(u.root,u[g],c,d&&u.alternativeLabel,f&&u.completed),ref:n},j),q&&d&&0!==h?q:null,r.Children.map(s,function(t){return r.isValidElement(t)?r.cloneElement(t,(0,e.default)({active:o,alternativeLabel:d,completed:f,disabled:m,expanded:x,last:O,icon:h+1,orientation:g},t.props)):null}));return q&&!d&&0!==h?r.createElement(r.Fragment,null,q,L):L}),p=(0,i.default)(u,{name:"MuiStep"})(c);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"bhLS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Step"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Step":"n5GJ"}],"tkEP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z"}),"CheckCircle");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"pcyx":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=u?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var o=(0,t.default)(e.createElement("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");exports.default=o;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"wUIQ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("react")),t=l(require("prop-types")),r=l(require("clsx")),o=l(require("../internal/svg-icons/CheckCircle")),a=l(require("../internal/svg-icons/Warning")),n=l(require("../styles/withStyles")),i=l(require("../SvgIcon"));function l(e){return e&&e.__esModule?e:{default:e}}function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=o?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(r,a,n):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}var p=function(e){return{root:{display:"block",color:e.palette.text.disabled,"&$completed":{color:e.palette.primary.main},"&$active":{color:e.palette.primary.main},"&$error":{color:e.palette.error.main}},text:{fill:e.palette.primary.contrastText,fontSize:e.typography.caption.fontSize,fontFamily:e.typography.fontFamily},active:{},completed:{},error:{}}};exports.styles=p;var s=e.createElement("circle",{cx:"12",cy:"12",r:"12"}),f=e.forwardRef(function(t,n){var l=t.completed,c=void 0!==l&&l,u=t.icon,p=t.active,f=void 0!==p&&p,d=t.error,y=void 0!==d&&d,m=t.classes;if("number"==typeof u||"string"==typeof u){var v=(0,r.default)(m.root,f&&m.active,y&&m.error,c&&m.completed);return y?e.createElement(a.default,{className:v,ref:n}):c?e.createElement(o.default,{className:v,ref:n}):e.createElement(i.default,{className:v,ref:n},s,e.createElement("text",{className:m.text,x:"12",y:"16",textAnchor:"middle"},u))}return u}),d=(0,n.default)(p,{name:"MuiStepIcon"})(f);exports.default=d;
},{"react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../internal/svg-icons/CheckCircle":"tkEP","../internal/svg-icons/Warning":"pcyx","../styles/withStyles":"awmK","../SvgIcon":"R8TJ"}],"gJfS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./StepIcon"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./StepIcon":"wUIQ"}],"ZVlc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=p(require("@babel/runtime/helpers/esm/extends")),t=p(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=s(require("react")),a=p(require("prop-types")),l=p(require("clsx")),o=p(require("../styles/withStyles")),n=p(require("../Typography")),i=p(require("../StepIcon"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var o=a?Object.getOwnPropertyDescriptor(e,l):null;o&&(o.get||o.set)?Object.defineProperty(r,l,o):r[l]=e[l]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}var d=function(e){return{root:{display:"flex",alignItems:"center","&$alternativeLabel":{flexDirection:"column"},"&$disabled":{cursor:"default"}},horizontal:{},vertical:{},label:{color:e.palette.text.secondary,"&$active":{color:e.palette.text.primary,fontWeight:500},"&$completed":{color:e.palette.text.primary,fontWeight:500},"&$alternativeLabel":{textAlign:"center",marginTop:16},"&$error":{color:e.palette.error.main}},active:{},completed:{},error:{},disabled:{},iconContainer:{flexShrink:0,display:"flex",paddingRight:8,"&$alternativeLabel":{paddingRight:0}},alternativeLabel:{},labelContainer:{width:"100%"}}};exports.styles=d;var u=r.forwardRef(function(a,o){var c=a.active,s=void 0!==c&&c,p=a.alternativeLabel,d=void 0!==p&&p,u=a.children,f=a.classes,v=a.className,b=a.completed,m=void 0!==b&&b,y=a.disabled,h=void 0!==y&&y,x=a.error,g=void 0!==x&&x,L=(a.expanded,a.icon),O=(a.last,a.optional),P=a.orientation,S=void 0===P?"horizontal":P,j=a.StepIconComponent,q=a.StepIconProps,w=(0,t.default)(a,["active","alternativeLabel","children","classes","className","completed","disabled","error","expanded","icon","last","optional","orientation","StepIconComponent","StepIconProps"]),N=j;return L&&!N&&(N=i.default),r.createElement("span",(0,e.default)({className:(0,l.default)(f.root,f[S],v,h&&f.disabled,d&&f.alternativeLabel,g&&f.error),ref:o},w),L||N?r.createElement("span",{className:(0,l.default)(f.iconContainer,d&&f.alternativeLabel)},r.createElement(N,(0,e.default)({completed:m,active:s,error:g,icon:L},q))):null,r.createElement("span",{className:f.labelContainer},u?r.createElement(n.default,{variant:"body2",component:"span",display:"block",className:(0,l.default)(f.label,d&&f.alternativeLabel,m&&f.completed,s&&f.active,g&&f.error)},u):null,O))});u.muiName="StepLabel";var f=(0,o.default)(d,{name:"MuiStepLabel"})(u);exports.default=f;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Typography":"pi2F","../StepIcon":"gJfS"}],"tnFH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./StepLabel"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./StepLabel":"ZVlc"}],"yhCH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),a=c(require("prop-types")),i=c(require("clsx")),l=c(require("../styles/withStyles")),n=c(require("../ButtonBase")),o=c(require("../StepLabel")),s=c(require("../utils/isMuiElement"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var d={root:{width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},horizontal:{},vertical:{justifyContent:"flex-start",padding:"8px",margin:"-8px"},touchRipple:{color:"rgba(0, 0, 0, 0.3)"}};exports.styles=d;var f=r.forwardRef(function(a,l){var u=a.active,p=a.alternativeLabel,c=a.children,d=a.classes,f=a.className,b=a.completed,m=a.disabled,v=(a.expanded,a.icon),x=(a.last,a.optional),y=a.orientation,h=(0,t.default)(a,["active","alternativeLabel","children","classes","className","completed","disabled","expanded","icon","last","optional","orientation"]),g={active:u,alternativeLabel:p,completed:b,disabled:m,icon:v,optional:x,orientation:y},j=(0,s.default)(c,["StepLabel"])?r.cloneElement(c,g):r.createElement(o.default,g,c);return r.createElement(n.default,(0,e.default)({focusRipple:!0,disabled:m,TouchRippleProps:{className:d.touchRipple},className:(0,i.default)(d.root,d[y],f),ref:l},h),j)}),b=(0,l.default)(d,{name:"MuiStepButton"})(f);exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../ButtonBase":"VX66","../StepLabel":"tnFH","../utils/isMuiElement":"dy9R"}],"s0nP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./StepButton"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./StepButton":"yhCH"}],"saB2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=s(require("@babel/runtime/helpers/esm/extends")),t=s(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=n(require("react")),a=s(require("prop-types")),l=s(require("clsx")),i=s(require("../styles/withStyles"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function n(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var i=a?Object.getOwnPropertyDescriptor(e,l):null;i&&(i.get||i.set)?Object.defineProperty(r,l,i):r[l]=e[l]}return r.default=e,t&&t.set(e,r),r}function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return{root:{flex:"1 1 auto"},horizontal:{},vertical:{marginLeft:12,padding:"0 0 8px"},alternativeLabel:{position:"absolute",top:12,left:"calc(-50% + 20px)",right:"calc(50% + 20px)"},active:{},completed:{},disabled:{},line:{display:"block",borderColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},lineHorizontal:{borderTopStyle:"solid",borderTopWidth:1},lineVertical:{borderLeftStyle:"solid",borderLeftWidth:1,minHeight:24}}};exports.styles=c;var d=r.forwardRef(function(a,i){var o=a.active,n=a.alternativeLabel,s=void 0!==n&&n,c=a.classes,d=a.className,u=a.completed,p=a.disabled,f=(a.index,a.orientation),b=void 0===f?"horizontal":f,v=(0,t.default)(a,["active","alternativeLabel","classes","className","completed","disabled","index","orientation"]);return r.createElement("div",(0,e.default)({className:(0,l.default)(c.root,c[b],d,s&&c.alternativeLabel,o&&c.active,u&&c.completed,p&&c.disabled),ref:i},v),r.createElement("span",{className:(0,l.default)(c.line,{horizontal:c.lineHorizontal,vertical:c.lineVertical}[b])}))}),u=(0,i.default)(c,{name:"MuiStepConnector"})(d);exports.default=u;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"wGYe":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./StepConnector"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./StepConnector":"saB2"}],"emLD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=s(require("react")),n=u(require("prop-types")),a=u(require("clsx")),o=u(require("../Collapse")),i=u(require("../styles/withStyles"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:{marginTop:8,marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:"1px solid ".concat("light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600])},last:{borderLeft:"none"},transition:{}}};exports.styles=p;var d=r.forwardRef(function(n,i){var l=n.active,s=(n.alternativeLabel,n.children),u=n.classes,p=n.className,d=(n.completed,n.expanded),c=n.last,f=(n.optional,n.orientation,n.TransitionComponent),m=void 0===f?o.default:f,v=n.transitionDuration,y=void 0===v?"auto":v,b=n.TransitionProps,g=(0,t.default)(n,["active","alternativeLabel","children","classes","className","completed","expanded","last","optional","orientation","TransitionComponent","transitionDuration","TransitionProps"]);var x=y;return"auto"!==y||m.muiSupportAuto||(x=void 0),r.createElement("div",(0,e.default)({className:(0,a.default)(u.root,p,c&&u.last),ref:i},g),r.createElement(m,(0,e.default)({in:l||d,className:u.transition,timeout:x,unmountOnExit:!0},b),s))}),c=(0,i.default)(p,{name:"MuiStepContent"})(d);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../Collapse":"uPhD","../styles/withStyles":"awmK"}],"JA1V":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./StepContent"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./StepContent":"emLD"}],"Z8tU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=s(require("react")),n=c(require("prop-types")),a=c(require("clsx")),l=c(require("../styles/withStyles")),i=c(require("../Paper")),o=c(require("../StepConnector"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var d={root:{display:"flex",padding:24},horizontal:{flexDirection:"row",alignItems:"center"},vertical:{flexDirection:"column"},alternativeLabel:{alignItems:"flex-start"}};exports.styles=d;var f=r.createElement(o.default,null),p=r.forwardRef(function(n,l){var o=n.activeStep,u=void 0===o?0:o,s=n.alternativeLabel,c=void 0!==s&&s,d=n.children,p=n.classes,v=n.className,b=n.connector,m=void 0===b?f:b,y=n.nonLinear,h=void 0!==y&&y,x=n.orientation,q=void 0===x?"horizontal":x,O=(0,t.default)(n,["activeStep","alternativeLabel","children","classes","className","connector","nonLinear","orientation"]),g=r.isValidElement(m)?r.cloneElement(m,{orientation:q}):null,j=r.Children.toArray(d),P=j.map(function(t,n){var a={index:n,active:!1,completed:!1,disabled:!1};return u===n?a.active=!0:!h&&u>n?a.completed=!0:!h&&u<n&&(a.disabled=!0),r.cloneElement(t,(0,e.default)({alternativeLabel:c,connector:g,last:n+1===j.length,orientation:q},a,t.props))});return r.createElement(i.default,(0,e.default)({square:!0,elevation:0,className:(0,a.default)(p.root,p[q],v,c&&p.alternativeLabel),ref:l},O),P)}),v=(0,l.default)(d,{name:"MuiStepper"})(p);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Paper":"mtQp","../StepConnector":"wGYe"}],"i3xK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Stepper"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Stepper":"Z8tU"}],"o1Fi":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/defineProperty")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),o=f(require("react")),a=c(require("prop-types")),i=c(require("clsx")),n=c(require("../styles/withStyles")),u=c(require("../utils/capitalize")),s=require("../Drawer/Drawer");function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:{position:"fixed",top:0,left:0,bottom:0,zIndex:e.zIndex.drawer-1},anchorLeft:{right:"auto"},anchorRight:{left:"auto",right:0},anchorTop:{bottom:"auto",right:0},anchorBottom:{top:"auto",bottom:0,right:0}}};exports.styles=p;var d=o.forwardRef(function(a,n){var l=a.anchor,f=a.classes,c=a.className,p=a.width,d=(0,r.default)(a,["anchor","classes","className","width"]);return o.createElement("div",(0,e.default)({className:(0,i.default)(f.root,f["anchor".concat((0,u.default)(l))],c),ref:n,style:(0,t.default)({},(0,s.isHorizontal)(l)?"width":"height",p)},d))}),h=(0,n.default)(p,{name:"PrivateSwipeArea"})(d);exports.default=h;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y","../Drawer/Drawer":"I32u"}],"PhE2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reset=b,exports.default=void 0;var e=g(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=g(require("@babel/runtime/helpers/esm/extends")),t=m(require("react")),n=g(require("prop-types")),i=m(require("react-dom")),a=require("@material-ui/utils"),u=require("@material-ui/styles"),o=m(require("../Drawer/Drawer")),c=g(require("../utils/ownerDocument")),s=g(require("../utils/useEventCallback")),l=require("../styles/transitions"),f=g(require("../styles/useTheme")),d=require("../transitions/utils"),p=g(require("../NoSsr")),v=g(require("./SwipeArea"));function h(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return h=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=h();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(t,i,a):t[i]=e[i]}return t.default=e,r&&r.set(e,t),t}function g(e){return e&&e.__esModule?e:{default:e}}var y=3,w=null;function b(){w=null}function P(e,r){return"right"===e?document.body.offsetWidth-r[0].pageX:r[0].pageX}function T(e,r){return"bottom"===e?window.innerHeight-r[0].clientY:r[0].clientY}function S(e,r){return e?r.clientWidth:r.clientHeight}function E(e,r,t,n){return Math.min(Math.max(t?r-e:n+r-e,0),n)}function H(e,r){for(var t=[];e&&e!==r;){var n=window.getComputedStyle(e);"absolute"===n.getPropertyValue("position")||"hidden"===n.getPropertyValue("overflow-x")?t=[]:(e.clientWidth>0&&e.scrollWidth>e.clientWidth||e.clientHeight>0&&e.scrollHeight>e.clientHeight)&&t.push(e),e=e.parentElement}return t}function M(e){var r=e.domTreeShapes,t=e.start,n=e.current,i=e.anchor,a={x:"scrollLeft",y:"scrollTop"},u={x:"scrollWidth",y:"scrollHeight"},o={x:"clientWidth",y:"clientHeight"};return r.some(function(e){var r=n>=t;"top"!==i&&"left"!==i||(r=!r);var c="left"===i||"right"===i?"x":"y",s=e[a[c]],l=s>0,f=s+e[o[c]]<e[u[c]];return r&&f||!r&&l?e:null})}var x="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent),k={enter:l.duration.enteringScreen,exit:l.duration.leavingScreen},q="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,O=t.forwardRef(function(n,a){var l=(0,f.default)(),h=(0,u.getThemeProps)({name:"MuiSwipeableDrawer",props:(0,r.default)({},n),theme:l}),m=h.anchor,g=void 0===m?"left":m,b=h.disableBackdropTransition,O=void 0!==b&&b,D=h.disableDiscovery,W=void 0!==D&&D,X=h.disableSwipeToOpen,Y=void 0===X?x:X,A=h.hideBackdrop,j=h.hysteresis,L=void 0===j?.52:j,B=h.minFlingVelocity,C=void 0===B?450:B,R=h.ModalProps,_=(R=void 0===R?{}:R).BackdropProps,z=(0,e.default)(R,["BackdropProps"]),V=h.onClose,F=h.onOpen,N=h.open,G=h.PaperProps,I=void 0===G?{}:G,J=h.SwipeAreaProps,K=h.swipeAreaWidth,Q=void 0===K?20:K,U=h.transitionDuration,Z=void 0===U?k:U,$=h.variant,ee=void 0===$?"temporary":$,re=(0,e.default)(h,["anchor","disableBackdropTransition","disableDiscovery","disableSwipeToOpen","hideBackdrop","hysteresis","minFlingVelocity","ModalProps","onClose","onOpen","open","PaperProps","SwipeAreaProps","swipeAreaWidth","transitionDuration","variant"]),te=t.useState(!1),ne=te[0],ie=te[1],ae=t.useRef({isSwiping:null}),ue=t.useRef(),oe=t.useRef(),ce=t.useRef(),se=t.useRef(!1),le=t.useRef();q(function(){le.current=null},[N]);var fe=t.useCallback(function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.mode,n=void 0===t?null:t,i=r.changeTransition,a=void 0===i||i,u=(0,o.getAnchor)(l,g),c=-1!==["right","bottom"].indexOf(u)?1:-1,s=(0,o.isHorizontal)(g),f=s?"translate(".concat(c*e,"px, 0)"):"translate(0, ".concat(c*e,"px)"),p=ce.current.style;p.webkitTransform=f,p.transform=f;var v="";if(n&&(v=l.transitions.create("all",(0,d.getTransitionProps)({timeout:Z},{mode:n}))),a&&(p.webkitTransition=v,p.transition=v),!O&&!A){var h=oe.current.style;h.opacity=1-e/S(s,ce.current),a&&(h.webkitTransition=v,h.transition=v)}},[g,O,A,l,Z]),de=(0,s.default)(function(e){if(se.current)if(w=null,se.current=!1,ie(!1),ae.current.isSwiping){ae.current.isSwiping=null;var r,t=(0,o.getAnchor)(l,g),n=(0,o.isHorizontal)(g);r=n?P(t,e.changedTouches):T(t,e.changedTouches);var i=n?ae.current.startX:ae.current.startY,a=S(n,ce.current),u=E(r,i,N,a),c=u/a;Math.abs(ae.current.velocity)>C&&(le.current=1e3*Math.abs((a-u)/ae.current.velocity)),N?ae.current.velocity>C||c>L?V():fe(0,{mode:"exit"}):ae.current.velocity<-C||1-c>L?F():fe(S(n,ce.current),{mode:"enter"})}else ae.current.isSwiping=null}),pe=(0,s.default)(function(e){if(ce.current&&se.current&&(null==w||w===ae.current)){var r=(0,o.getAnchor)(l,g),t=(0,o.isHorizontal)(g),n=P(r,e.touches),i=T(r,e.touches);if(N&&ce.current.contains(e.target)&&null==w){var a=M({domTreeShapes:H(e.target,ce.current),start:t?ae.current.startX:ae.current.startY,current:t?n:i,anchor:g});if(a)return void(w=a);w=ae.current}if(null==ae.current.isSwiping){var u=Math.abs(n-ae.current.startX),c=Math.abs(i-ae.current.startY);u>c&&e.cancelable&&e.preventDefault();var s=t?u>c&&u>y:c>u&&c>y;if(!0===s||(t?c>y:u>y)){if(ae.current.isSwiping=s,!s)return void de(e);ae.current.startX=n,ae.current.startY=i,W||N||(t?ae.current.startX-=Q:ae.current.startY-=Q)}}if(ae.current.isSwiping){var f=S(t,ce.current),d=t?ae.current.startX:ae.current.startY;N&&!ae.current.paperHit&&(d=Math.min(d,f));var p=E(t?n:i,d,N,f);if(N)if(ae.current.paperHit)0===p&&(ae.current.startX=n,ae.current.startY=i);else{if(!(t?n<f:i<f))return;ae.current.paperHit=!0,ae.current.startX=n,ae.current.startY=i}null===ae.current.lastTranslate&&(ae.current.lastTranslate=p,ae.current.lastTime=performance.now()+1);var v=(p-ae.current.lastTranslate)/(performance.now()-ae.current.lastTime)*1e3;ae.current.velocity=.4*ae.current.velocity+.6*v,ae.current.lastTranslate=p,ae.current.lastTime=performance.now(),e.cancelable&&e.preventDefault(),fe(p)}}}),ve=(0,s.default)(function(e){if(!e.defaultPrevented&&!e.muiHandled&&(!N||oe.current.contains(e.target)||ce.current.contains(e.target))){var r=(0,o.getAnchor)(l,g),t=(0,o.isHorizontal)(g),n=P(r,e.touches),i=T(r,e.touches);if(!N){if(Y||e.target!==ue.current)return;if(t){if(n>Q)return}else if(i>Q)return}e.muiHandled=!0,w=null,ae.current.startX=n,ae.current.startY=i,ie(!0),!N&&ce.current&&fe(S(t,ce.current)+(W?20:-Q),{changeTransition:!1}),ae.current.velocity=0,ae.current.lastTime=null,ae.current.lastTranslate=null,ae.current.paperHit=!1,se.current=!0}});t.useEffect(function(){if("temporary"===ee){var e=(0,c.default)(ce.current);return e.addEventListener("touchstart",ve),e.addEventListener("touchmove",pe,{passive:!1}),e.addEventListener("touchend",de),function(){e.removeEventListener("touchstart",ve),e.removeEventListener("touchmove",pe,{passive:!1}),e.removeEventListener("touchend",de)}}},[ee,ve,pe,de]),t.useEffect(function(){return function(){w===ae.current&&(w=null)}},[]),t.useEffect(function(){N||ie(!1)},[N]);var he=t.useCallback(function(e){oe.current=i.findDOMNode(e)},[]);return t.createElement(t.Fragment,null,t.createElement(o.default,(0,r.default)({open:!("temporary"!==ee||!ne)||N,variant:ee,ModalProps:(0,r.default)({BackdropProps:(0,r.default)({},_,{ref:he})},z),PaperProps:(0,r.default)({},I,{style:(0,r.default)({pointerEvents:"temporary"!==ee||N?"":"none"},I.style),ref:ce}),anchor:g,transitionDuration:le.current||Z,onClose:V,ref:a},re)),!Y&&"temporary"===ee&&t.createElement(p.default,null,t.createElement(v.default,(0,r.default)({anchor:g,ref:ue,width:Q},J))))}),D=O;exports.default=D;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","react-dom":"NKHc","@material-ui/utils":"gEhD","@material-ui/styles":"thJn","../Drawer/Drawer":"I32u","../utils/ownerDocument":"Xj2I","../utils/useEventCallback":"AH47","../styles/transitions":"geVf","../styles/useTheme":"nmB4","../transitions/utils":"DLys","../NoSsr":"qvOT","./SwipeArea":"o1Fi"}],"zU4M":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./SwipeableDrawer"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./SwipeableDrawer":"PhE2"}],"RAqm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=p(require("react")),a=u(require("prop-types")),o=u(require("clsx")),i=require("@material-ui/utils"),l=u(require("../styles/withStyles")),n=require("../styles/colorManipulator"),c=u(require("../utils/capitalize")),d=u(require("../internal/SwitchBase"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var h=function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(20px)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,n.fade)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,n.fade)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4,"&$checked":{transform:"translateX(16px)"}}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"},track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}};exports.styles=h;var m=r.forwardRef(function(a,i){var l=a.classes,n=a.className,s=a.color,p=void 0===s?"secondary":s,u=a.edge,h=void 0!==u&&u,m=a.size,g=void 0===m?"medium":m,y=(0,t.default)(a,["classes","className","color","edge","size"]),f=r.createElement("span",{className:l.thumb});return r.createElement("span",{className:(0,o.default)(l.root,n,{start:l.edgeStart,end:l.edgeEnd}[h],"small"===g&&l["size".concat((0,c.default)(g))])},r.createElement(d.default,(0,e.default)({type:"checkbox",icon:f,checkedIcon:f,classes:{root:(0,o.default)(l.switchBase,l["color".concat((0,c.default)(p))]),input:l.input,checked:l.checked,disabled:l.disabled},ref:i},y)),r.createElement("span",{className:l.track}))}),g=(0,l.default)(h,{name:"MuiSwitch"})(m);exports.default=g;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/withStyles":"awmK","../styles/colorManipulator":"aguB","../utils/capitalize":"Dk4Y","../internal/SwitchBase":"NfPH"}],"GFmN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Switch"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Switch":"RAqm"}],"gAin":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=p(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=p(require("@babel/runtime/helpers/esm/defineProperty")),r=p(require("@babel/runtime/helpers/esm/extends")),l=c(require("react")),o=p(require("prop-types")),i=p(require("clsx")),a=p(require("../styles/withStyles")),n=p(require("../ButtonBase")),s=p(require("../utils/capitalize")),d=p(require("../utils/unsupportedProp"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=l?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}var f=function(e){var l;return{root:(0,r.default)({},e.typography.button,(l={maxWidth:264,minWidth:72,position:"relative",boxSizing:"border-box",minHeight:48,flexShrink:0,padding:"6px 12px"},(0,t.default)(l,e.breakpoints.up("sm"),{padding:"6px 24px"}),(0,t.default)(l,"overflow","hidden"),(0,t.default)(l,"whiteSpace","normal"),(0,t.default)(l,"textAlign","center"),(0,t.default)(l,e.breakpoints.up("sm"),{minWidth:160}),l)),labelIcon:{minHeight:72,paddingTop:9,"& $wrapper > *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled}},textColorSecondary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:e.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}};exports.styles=f;var b=l.forwardRef(function(t,o){var a=t.classes,d=t.className,u=t.disabled,c=void 0!==u&&u,p=t.disableFocusRipple,f=void 0!==p&&p,b=t.fullWidth,x=t.icon,h=t.indicator,m=t.label,y=t.onChange,v=t.onClick,w=t.onFocus,g=t.selected,C=t.selectionFollowsFocus,W=t.textColor,q=void 0===W?"inherit":W,P=t.value,j=t.wrapped,k=void 0!==j&&j,F=(0,e.default)(t,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"]);return l.createElement(n.default,(0,r.default)({focusRipple:!f,className:(0,i.default)(a.root,a["textColor".concat((0,s.default)(q))],d,c&&a.disabled,g&&a.selected,m&&x&&a.labelIcon,b&&a.fullWidth,k&&a.wrapped),ref:o,role:"tab","aria-selected":g,disabled:c,onClick:function(e){y&&y(e,P),v&&v(e)},onFocus:function(e){C&&!g&&y&&y(e,P),w&&w(e)},tabIndex:g?0:-1},F),l.createElement("span",{className:a.wrapper},x,m),h)}),x=(0,a.default)(f,{name:"MuiTab"})(b);exports.default=x;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../ButtonBase":"VX66","../utils/capitalize":"Dk4Y","../utils/unsupportedProp":"PmB2"}],"DtdH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Tab"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Tab":"gAin"}],"zbjU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=u(require("@babel/runtime/helpers/esm/extends")),r=s(require("react")),a=u(require("prop-types")),o=u(require("clsx")),n=u(require("../styles/withStyles")),i=u(require("./TableContext"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=a?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(r,o,n):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var d=function(e){return{root:{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":(0,t.default)({},e.typography.body2,{padding:e.spacing(2),color:e.palette.text.secondary,textAlign:"left",captionSide:"bottom"})},stickyHeader:{borderCollapse:"separate"}}};exports.styles=d;var c="table",p=r.forwardRef(function(a,n){var l=a.classes,s=a.className,u=a.component,d=void 0===u?c:u,p=a.padding,f=void 0===p?"default":p,y=a.size,b=void 0===y?"medium":y,v=a.stickyHeader,m=void 0!==v&&v,g=(0,e.default)(a,["classes","className","component","padding","size","stickyHeader"]),x=r.useMemo(function(){return{padding:f,size:b,stickyHeader:m}},[f,b,m]);return r.createElement(i.default.Provider,{value:x},r.createElement(d,(0,t.default)({role:d===c?null:"table",ref:n,className:(0,o.default)(l.root,s,m&&l.stickyHeader)},g)))}),f=(0,n.default)(d,{name:"MuiTable"})(p);exports.default=f;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","./TableContext":"FmmT"}],"Amxx":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Table"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Table":"zbjU"}],"HZfJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=s(require("react")),o=i(require("prop-types")),a=i(require("clsx")),l=i(require("../styles/withStyles")),u=i(require("../Table/Tablelvl2Context"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(t,a,l):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function i(e){return e&&e.__esModule?e:{default:e}}var f={root:{display:"table-row-group"}};exports.styles=f;var p={variant:"body"},c="tbody",d=t.forwardRef(function(o,l){var n=o.classes,s=o.className,i=o.component,f=void 0===i?c:i,d=(0,r.default)(o,["classes","className","component"]);return t.createElement(u.default.Provider,{value:p},t.createElement(f,(0,e.default)({className:(0,a.default)(n.root,s),ref:l,role:f===c?null:"rowgroup"},d)))}),y=(0,l.default)(f,{name:"MuiTableBody"})(d);exports.default=y;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Table/Tablelvl2Context":"FmmT"}],"cmi3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TableBody"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TableBody":"HZfJ"}],"Im4G":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=u(require("@babel/runtime/helpers/esm/extends")),i=c(require("react")),r=u(require("prop-types")),a=u(require("clsx")),n=u(require("../styles/withStyles")),l=u(require("../utils/capitalize")),o=require("../styles/colorManipulator"),d=u(require("../Table/TableContext")),p=u(require("../Table/Tablelvl2Context"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=r?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(i,a,n):i[a]=e[a]}return i.default=e,t&&t.set(e,i),i}function u(e){return e&&e.__esModule?e:{default:e}}var g=function(e){return{root:(0,t.default)({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:"1px solid\n    ".concat("light"===e.palette.type?(0,o.lighten)((0,o.fade)(e.palette.divider,1),.88):(0,o.darken)((0,o.fade)(e.palette.divider,1),.68)),textAlign:"left",padding:16}),head:{color:e.palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},body:{color:e.palette.text.primary},footer:{color:e.palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},sizeSmall:{padding:"6px 24px 6px 16px","&:last-child":{paddingRight:16},"&$paddingCheckbox":{width:24,padding:"0 12px 0 16px","&:last-child":{paddingLeft:12,paddingRight:16},"& > *":{padding:0}}},paddingCheckbox:{width:48,padding:"0 0 0 4px","&:last-child":{paddingLeft:0,paddingRight:4}},paddingNone:{padding:0,"&:last-child":{padding:0}},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right",flexDirection:"row-reverse"},alignJustify:{textAlign:"justify"},stickyHeader:{position:"sticky",top:0,left:0,zIndex:2,backgroundColor:e.palette.background.default}}};exports.styles=g;var f=i.forwardRef(function(r,n){var o,s,c=r.align,u=void 0===c?"inherit":c,g=r.classes,f=r.className,y=r.component,h=r.padding,x=r.scope,b=r.size,m=r.sortDirection,v=r.variant,k=(0,e.default)(r,["align","classes","className","component","padding","scope","size","sortDirection","variant"]),q=i.useContext(d.default),j=i.useContext(p.default),w=j&&"head"===j.variant;y?(s=y,o=w?"columnheader":"cell"):s=w?"th":"td";var z=x;!z&&w&&(z="col");var C=h||(q&&q.padding?q.padding:"default"),O=b||(q&&q.size?q.size:"medium"),M=v||j&&j.variant,R=null;return m&&(R="asc"===m?"ascending":"descending"),i.createElement(s,(0,t.default)({ref:n,className:(0,a.default)(g.root,g[M],f,"inherit"!==u&&g["align".concat((0,l.default)(u))],"default"!==C&&g["padding".concat((0,l.default)(C))],"medium"!==O&&g["size".concat((0,l.default)(O))],"head"===M&&q&&q.stickyHeader&&g.stickyHeader),"aria-sort":R,role:o,scope:z},k))}),y=(0,n.default)(g,{name:"MuiTableCell"})(f);exports.default=y;
},{"@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y","../styles/colorManipulator":"aguB","../Table/TableContext":"FmmT","../Table/Tablelvl2Context":"FmmT"}],"lprt":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TableCell"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TableCell":"Im4G"}],"YrTc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),t=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=s(require("react")),o=l(require("prop-types")),n=l(require("clsx")),u=l(require("../styles/withStyles"));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var u=o?Object.getOwnPropertyDescriptor(e,n):null;u&&(u.get||u.set)?Object.defineProperty(r,n,u):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var i={root:{width:"100%",overflowX:"auto"}};exports.styles=i;var f=r.forwardRef(function(o,u){var a=o.classes,s=o.className,l=o.component,i=void 0===l?"div":l,f=(0,t.default)(o,["classes","className","component"]);return r.createElement(i,(0,e.default)({ref:u,className:(0,n.default)(a.root,s)},f))}),c=(0,u.default)(i,{name:"MuiTableContainer"})(f);exports.default=c;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"qdnS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TableContainer"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TableContainer":"YrTc"}],"b5B3":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=s(require("react")),o=i(require("prop-types")),a=i(require("clsx")),l=i(require("../styles/withStyles")),u=i(require("../Table/Tablelvl2Context"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(t,a,l):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function i(e){return e&&e.__esModule?e:{default:e}}var f={root:{display:"table-footer-group"}};exports.styles=f;var p={variant:"footer"},c="tfoot",d=t.forwardRef(function(o,l){var n=o.classes,s=o.className,i=o.component,f=void 0===i?c:i,d=(0,r.default)(o,["classes","className","component"]);return t.createElement(u.default.Provider,{value:p},t.createElement(f,(0,e.default)({className:(0,a.default)(n.root,s),ref:l,role:f===c?null:"rowgroup"},d)))}),b=(0,l.default)(f,{name:"MuiTableFooter"})(d);exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Table/Tablelvl2Context":"FmmT"}],"ZLWC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TableFooter"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TableFooter":"b5B3"}],"sGe6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),r=i(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=s(require("react")),a=i(require("prop-types")),o=i(require("clsx")),l=i(require("../styles/withStyles")),u=i(require("../Table/Tablelvl2Context"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(t,o,l):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function i(e){return e&&e.__esModule?e:{default:e}}var f={root:{display:"table-header-group"}};exports.styles=f;var p={variant:"head"},c="thead",d=t.forwardRef(function(a,l){var n=a.classes,s=a.className,i=a.component,f=void 0===i?c:i,d=(0,r.default)(a,["classes","className","component"]);return t.createElement(u.default.Provider,{value:p},t.createElement(f,(0,e.default)({className:(0,o.default)(n.root,s),ref:l,role:f===c?null:"rowgroup"},d)))}),b=(0,l.default)(f,{name:"MuiTableHead"})(d);exports.default=b;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Table/Tablelvl2Context":"FmmT"}],"BYgd":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TableHead"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TableHead":"sGe6"}],"rShL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=l(require("@babel/runtime/helpers/esm/extends")),t=l(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=l(require("@babel/runtime/helpers/esm/defineProperty")),n=u(require("react")),a=l(require("prop-types")),i=l(require("clsx")),s=l(require("../styles/withStyles"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function l(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:(0,r.default)({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}};exports.styles=p;var f=n.forwardRef(function(r,a){var s=r.classes,o=r.className,u=r.component,l=void 0===u?"div":u,p=r.disableGutters,f=void 0!==p&&p,d=r.variant,c=void 0===d?"regular":d,g=(0,t.default)(r,["classes","className","component","disableGutters","variant"]);return n.createElement(l,(0,e.default)({className:(0,i.default)(s.root,s[c],o,!f&&s.gutters),ref:a},g))}),d=(0,s.default)(p,{name:"MuiToolbar"})(f);exports.default=d;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK"}],"OGx2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./Toolbar"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./Toolbar":"rShL"}],"JV9T":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(r,u,a):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}var u=(0,t.default)(e.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft");exports.default=u;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"vC46":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(r,u,a):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}var u=(0,t.default)(e.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");exports.default=u;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"iUPD":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),t=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=c(require("react")),n=f(require("prop-types")),o=f(require("../internal/svg-icons/KeyboardArrowLeft")),u=f(require("../internal/svg-icons/KeyboardArrowRight")),a=f(require("../styles/useTheme")),l=f(require("../IconButton"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}var s=r.createElement(u.default,null),d=r.createElement(o.default,null),p=r.createElement(o.default,null),b=r.createElement(u.default,null),P=r.forwardRef(function(n,o){var u=n.backIconButtonProps,i=n.count,c=n.nextIconButtonProps,f=n.onChangePage,P=n.page,g=n.rowsPerPage,y=(0,t.default)(n,["backIconButtonProps","count","nextIconButtonProps","onChangePage","page","rowsPerPage"]),v=(0,a.default)();return r.createElement("div",(0,e.default)({ref:o},y),r.createElement(l.default,(0,e.default)({onClick:function(e){f(e,P-1)},disabled:0===P,color:"inherit"},u),"rtl"===v.direction?s:d),r.createElement(l.default,(0,e.default)({onClick:function(e){f(e,P+1)},disabled:-1!==i&&P>=Math.ceil(i/g)-1,color:"inherit"},c),"rtl"===v.direction?p:b))}),g=P;exports.default=g;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","../internal/svg-icons/KeyboardArrowLeft":"JV9T","../internal/svg-icons/KeyboardArrowRight":"vC46","../styles/useTheme":"nmB4","../IconButton":"e0Nd"}],"VxTq":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=b(require("@babel/runtime/helpers/esm/extends")),t=b(require("@babel/runtime/helpers/esm/objectWithoutProperties")),a=P(require("react")),o=b(require("prop-types")),r=require("@material-ui/utils"),n=b(require("clsx")),l=b(require("../styles/withStyles")),i=b(require("../InputBase")),u=b(require("../MenuItem")),c=b(require("../Select")),s=b(require("../TableCell")),p=b(require("../Toolbar")),f=b(require("../Typography")),d=b(require("./TablePaginationActions")),g=b(require("../utils/unstable_useId"));function m(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return m=function(){return e},e}function P(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=m();if(t&&t.has(e))return t.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=o?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}function b(e){return e&&e.__esModule?e:{default:e}}var v=function(e){return{root:{color:e.palette.text.primary,fontSize:e.typography.pxToRem(14),overflow:"auto","&:last-child":{padding:0}},toolbar:{minHeight:52,paddingRight:2},spacer:{flex:"1 1 100%"},caption:{flexShrink:0},selectRoot:{marginRight:32,marginLeft:8},select:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"},selectIcon:{},input:{color:"inherit",fontSize:"inherit",flexShrink:0},menuItem:{},actions:{flexShrink:0,marginLeft:20}}};exports.styles=v;var h=function(e){var t=e.from,a=e.to,o=e.count;return"".concat(t,"-").concat(a," of ").concat(-1!==o?o:"more than ".concat(a))},x=[10,25,50,100],y=a.forwardRef(function(o,r){var l,m=o.ActionsComponent,P=void 0===m?d.default:m,b=o.backIconButtonProps,v=o.backIconButtonText,y=void 0===v?"Previous page":v,w=o.classes,I=o.className,q=o.colSpan,R=o.component,S=void 0===R?s.default:R,k=o.count,B=o.labelDisplayedRows,N=void 0===B?h:B,O=o.labelRowsPerPage,T=void 0===O?"Rows per page:":O,C=o.nextIconButtonProps,E=o.nextIconButtonText,j=void 0===E?"Next page":E,M=o.onChangePage,_=o.onChangeRowsPerPage,A=o.page,D=o.rowsPerPage,L=o.rowsPerPageOptions,W=void 0===L?x:L,z=o.SelectProps,H=void 0===z?{}:z,F=(0,t.default)(o,["ActionsComponent","backIconButtonProps","backIconButtonText","classes","className","colSpan","component","count","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","nextIconButtonText","onChangePage","onChangeRowsPerPage","page","rowsPerPage","rowsPerPageOptions","SelectProps"]);S!==s.default&&"td"!==S||(l=q||1e3);var G=(0,g.default)(),J=(0,g.default)(),K=H.native?"option":u.default;return a.createElement(S,(0,e.default)({className:(0,n.default)(w.root,I),colSpan:l,ref:r},F),a.createElement(p.default,{className:w.toolbar},a.createElement("div",{className:w.spacer}),W.length>1&&a.createElement(f.default,{color:"inherit",variant:"body2",className:w.caption,id:J},T),W.length>1&&a.createElement(c.default,(0,e.default)({classes:{select:w.select,icon:w.selectIcon},input:a.createElement(i.default,{className:(0,n.default)(w.input,w.selectRoot)}),value:D,onChange:_,id:G,labelId:J},H),W.map(function(e){return a.createElement(K,{className:w.menuItem,key:e.value?e.value:e,value:e.value?e.value:e},e.label?e.label:e)})),a.createElement(f.default,{color:"inherit",variant:"body2",className:w.caption},N({from:0===k?0:A*D+1,to:-1!==k?Math.min(k,(A+1)*D):(A+1)*D,count:-1===k?-1:k,page:A})),a.createElement(P,{className:w.actions,backIconButtonProps:(0,e.default)({title:y,"aria-label":y},b),count:k,nextIconButtonProps:(0,e.default)({title:j,"aria-label":j},C),onChangePage:M,page:A,rowsPerPage:D})))}),w=(0,l.default)(v,{name:"MuiTablePagination"})(y);exports.default=w;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","@material-ui/utils":"gEhD","clsx":"WLGK","../styles/withStyles":"awmK","../InputBase":"UXeJ","../MenuItem":"dYSc","../Select":"NCwz","../TableCell":"lprt","../Toolbar":"OGx2","../Typography":"pi2F","./TablePaginationActions":"iUPD","../utils/unstable_useId":"yA5c"}],"YhGx":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TablePagination"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TablePagination":"VxTq"}],"wXEN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=i(require("react")),o=c(require("prop-types")),l=c(require("clsx")),a=c(require("../styles/withStyles")),n=c(require("../Table/Tablelvl2Context")),s=require("../styles/colorManipulator");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var a=o?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(r,l,a):r[l]=e[l]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var d=function(e){return{root:{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,"&$hover:hover":{backgroundColor:e.palette.action.hover},"&$selected, &$selected:hover":{backgroundColor:(0,s.fade)(e.palette.secondary.main,e.palette.action.selectedOpacity)}},selected:{},hover:{},head:{},footer:{}}};exports.styles=d;var f="tr",p=r.forwardRef(function(o,a){var s=o.classes,u=o.className,i=o.component,c=void 0===i?f:i,d=o.hover,p=void 0!==d&&d,v=o.selected,y=void 0!==v&&v,b=(0,t.default)(o,["classes","className","component","hover","selected"]),h=r.useContext(n.default);return r.createElement(c,(0,e.default)({ref:a,className:(0,l.default)(s.root,u,h&&{head:s.head,footer:s.footer}[h.variant],p&&s.hover,y&&s.selected),role:c===f?null:"row"},b))}),v=(0,a.default)(d,{name:"MuiTableRow"})(p);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../Table/Tablelvl2Context":"FmmT","../styles/colorManipulator":"aguB"}],"kIQr":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TableRow"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TableRow":"wXEN"}],"x58U":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("react")),t=r(require("../../utils/createSvgIcon"));function r(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(r,u,a):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}var u=(0,t.default)(e.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");exports.default=u;
},{"react":"n8MK","../../utils/createSvgIcon":"VtCQ"}],"Xswp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=f(require("@babel/runtime/helpers/esm/extends")),t=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react")),o=f(require("prop-types")),n=f(require("clsx")),i=f(require("../internal/svg-icons/ArrowDownward")),a=f(require("../styles/withStyles")),c=f(require("../ButtonBase")),s=f(require("../utils/capitalize"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{root:{cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:e.palette.text.secondary},"&:hover":{color:e.palette.text.secondary,"& $icon":{opacity:.5}},"&$active":{color:e.palette.text.primary,"&& $icon":{opacity:1,color:e.palette.text.secondary}}},active:{},icon:{fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none"},iconDirectionDesc:{transform:"rotate(0deg)"},iconDirectionAsc:{transform:"rotate(180deg)"}}};exports.styles=p;var d=r.forwardRef(function(o,a){var l=o.active,u=void 0!==l&&l,f=o.children,p=o.classes,d=o.className,y=o.direction,v=void 0===y?"asc":y,m=o.hideSortIcon,b=void 0!==m&&m,h=o.IconComponent,x=void 0===h?i.default:h,g=(0,t.default)(o,["active","children","classes","className","direction","hideSortIcon","IconComponent"]);return r.createElement(c.default,(0,e.default)({className:(0,n.default)(p.root,d,u&&p.active),component:"span",disableRipple:!0,ref:a},g),f,b&&!u?null:r.createElement(x,{className:(0,n.default)(p.icon,p["iconDirection".concat((0,s.default)(v))])}))}),y=(0,a.default)(p,{name:"MuiTableSortLabel"})(d);exports.default=y;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../internal/svg-icons/ArrowDownward":"x58U","../styles/withStyles":"awmK","../ButtonBase":"VX66","../utils/capitalize":"Dk4Y"}],"Ptm9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TableSortLabel"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TableSortLabel":"Xswp"}],"vnlt":[function(require,module,exports) {
"use strict";var e;function t(){if(e)return e;var t=document.createElement("div"),l=document.createElement("div");return l.style.width="10px",l.style.height="1px",t.appendChild(l),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),e="reverse",t.scrollLeft>0?e="default":(t.scrollLeft=1,0===t.scrollLeft&&(e="negative")),document.body.removeChild(t),e}function l(e,l){var r=e.scrollLeft;if("rtl"!==l)return r;switch(t()){case"negative":return e.scrollWidth-e.clientWidth+r;case"reverse":return e.scrollWidth-e.clientWidth-r;default:return r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.detectScrollType=t,exports.getNormalizedScrollLeft=l;
},{}],"dVqu":[function(require,module,exports) {
"use strict";function e(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function n(n,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},a=r.ease,u=void 0===a?e:a,l=r.duration,s=void 0===l?300:l,c=null,d=t[n],f=!1,m=function(){f=!0};return d===i?(o(new Error("Element already at target position")),m):(requestAnimationFrame(function e(r){if(f)o(new Error("Animation cancelled"));else{null===c&&(c=r);var a=Math.min(1,(r-c)/s);t[n]=u(a)*(i-d)+d,a>=1?requestAnimationFrame(function(){o(null)}):requestAnimationFrame(e)}}),m)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=n;
},{}],"wPe5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;var e=f(require("@babel/runtime/helpers/esm/extends")),t=f(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=i(require("react")),n=f(require("prop-types")),u=f(require("../utils/debounce"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=n?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(r,u,i):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function f(e){return e&&e.__esModule?e:{default:e}}var c={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function a(n){var o=n.onChange,i=(0,t.default)(n,["onChange"]),f=r.useRef(),a=r.useRef(null),l=function(){f.current=a.current.offsetHeight-a.current.clientHeight};return r.useEffect(function(){var e=(0,u.default)(function(){var e=f.current;l(),e!==f.current&&o(f.current)});return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}},[o]),r.useEffect(function(){l(),o(f.current)},[o]),r.createElement("div",(0,e.default)({style:c,ref:a},i))}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","../utils/debounce":"TiOe"}],"O8qv":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=u(require("@babel/runtime/helpers/esm/extends")),t=u(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=s(require("react")),o=u(require("prop-types")),a=u(require("clsx")),i=u(require("../styles/withStyles")),n=u(require("../utils/capitalize"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}};exports.styles=c;var f=r.forwardRef(function(o,i){var l=o.classes,s=o.className,u=o.color,c=o.orientation,f=(0,t.default)(o,["classes","className","color","orientation"]);return r.createElement("span",(0,e.default)({className:(0,a.default)(l.root,l["color".concat((0,n.default)(u))],s,"vertical"===c&&l.vertical),ref:i},f))}),p=(0,i.default)(c,{name:"PrivateTabIndicator"})(f);exports.default=p;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y"}],"QTAh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=d(require("@babel/runtime/helpers/esm/extends")),t=d(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=c(require("react")),a=d(require("prop-types")),i=d(require("clsx")),l=d(require("../internal/svg-icons/KeyboardArrowLeft")),n=d(require("../internal/svg-icons/KeyboardArrowRight")),o=d(require("../styles/withStyles")),s=d(require("../ButtonBase"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function d(e){return e&&e.__esModule?e:{default:e}}var f={root:{width:40,flexShrink:0,opacity:.8,"&$disabled":{opacity:0}},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}},disabled:{}};exports.styles=f;var p=r.createElement(l.default,{fontSize:"small"}),b=r.createElement(n.default,{fontSize:"small"}),y=r.forwardRef(function(a,l){var n=a.classes,o=a.className,u=a.direction,c=a.orientation,d=a.disabled,f=(0,t.default)(a,["classes","className","direction","orientation","disabled"]);return r.createElement(s.default,(0,e.default)({component:"div",className:(0,i.default)(n.root,o,d&&n.disabled,"vertical"===c&&n.vertical),ref:l,role:null,tabIndex:null},f),"left"===u?p:b)}),v=(0,o.default)(f,{name:"MuiTabScrollButton"})(y);exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../internal/svg-icons/KeyboardArrowLeft":"JV9T","../internal/svg-icons/KeyboardArrowRight":"vC46","../styles/withStyles":"awmK","../ButtonBase":"VX66"}],"LZng":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TabScrollButton"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TabScrollButton":"QTAh"}],"SxT8":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=y(require("@babel/runtime/helpers/esm/extends")),t=y(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=y(require("@babel/runtime/helpers/esm/defineProperty")),l=w(require("react")),o=require("react-is"),n=y(require("prop-types")),i=y(require("clsx")),a=require("@material-ui/utils"),c=y(require("../utils/debounce")),s=y(require("../utils/ownerWindow")),u=require("../utils/scrollLeft"),f=y(require("../internal/animate")),d=y(require("./ScrollbarSize")),v=y(require("../styles/withStyles")),p=y(require("./TabIndicator")),b=y(require("../TabScrollButton")),h=y(require("../utils/useEventCallback")),m=y(require("../styles/useTheme"));function g(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return g=function(){return e},e}function w(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=g();if(t&&t.has(e))return t.get(e);var r={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=l?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(r,o,n):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function y(e){return e&&e.__esModule?e:{default:e}}var C=function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:(0,r.default)({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}};exports.styles=C;var S=l.forwardRef(function(o,n){var a=o["aria-label"],v=o["aria-labelledby"],g=o.action,w=o.centered,y=void 0!==w&&w,C=o.children,S=o.classes,x=o.className,B=o.component,E=void 0===B?"div":B,k=o.indicatorColor,q=void 0===k?"secondary":k,N=o.onChange,W=o.orientation,L=void 0===W?"horizontal":W,M=o.ScrollButtonComponent,T=void 0===M?b.default:M,P=o.scrollButtons,z=void 0===P?"auto":P,D=o.selectionFollowsFocus,O=o.TabIndicatorProps,j=void 0===O?{}:O,A=o.TabScrollButtonProps,R=o.textColor,F=void 0===R?"inherit":R,H=o.value,_=o.variant,I=void 0===_?"standard":_,V=(0,t.default)(o,["aria-label","aria-labelledby","action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant"]),X=(0,m.default)(),K="scrollable"===I,U="rtl"===X.direction,G="vertical"===L,J=G?"scrollTop":"scrollLeft",Q=G?"top":"left",Y=G?"bottom":"right",Z=G?"clientHeight":"clientWidth",$=G?"height":"width";var ee=l.useState(!1),te=ee[0],re=ee[1],le=l.useState({}),oe=le[0],ne=le[1],ie=l.useState({start:!1,end:!1}),ae=ie[0],ce=ie[1],se=l.useState({overflow:"hidden",marginBottom:null}),ue=se[0],fe=se[1],de=new Map,ve=l.useRef(null),pe=l.useRef(null),be=function(){var e,t,r=ve.current;if(r){var l=r.getBoundingClientRect();e={clientWidth:r.clientWidth,scrollLeft:r.scrollLeft,scrollTop:r.scrollTop,scrollLeftNormalized:(0,u.getNormalizedScrollLeft)(r,X.direction),scrollWidth:r.scrollWidth,top:l.top,bottom:l.bottom,left:l.left,right:l.right}}if(r&&!1!==H){var o=pe.current.children;if(o.length>0){var n=o[de.get(H)];0,t=n?n.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},he=(0,h.default)(function(){var e,t=be(),l=t.tabsMeta,o=t.tabMeta,n=0;if(o&&l)if(G)n=o.top-l.top+l.scrollTop;else{var i=U?l.scrollLeftNormalized+l.clientWidth-l.scrollWidth:l.scrollLeft;n=o.left-l.left+i}var a=(e={},(0,r.default)(e,Q,n),(0,r.default)(e,$,o?o[$]:0),e);if(isNaN(oe[Q])||isNaN(oe[$]))ne(a);else{var c=Math.abs(oe[Q]-a[Q]),s=Math.abs(oe[$]-a[$]);(c>=1||s>=1)&&ne(a)}}),me=function(e){(0,f.default)(J,ve.current,e)},ge=function(e){var t=ve.current[J];G?t+=e:(t+=e*(U?-1:1),t*=U&&"reverse"===(0,u.detectScrollType)()?-1:1),me(t)},we=function(){ge(-ve.current[Z])},ye=function(){ge(ve.current[Z])},Ce=l.useCallback(function(e){fe({overflow:null,marginBottom:-e})},[]),Se=(0,h.default)(function(){var e=be(),t=e.tabsMeta,r=e.tabMeta;if(r&&t)if(r[Q]<t[Q]){var l=t[J]+(r[Q]-t[Q]);me(l)}else if(r[Y]>t[Y]){var o=t[J]+(r[Y]-t[Y]);me(o)}}),xe=(0,h.default)(function(){if(K&&"off"!==z){var e,t,r=ve.current,l=r.scrollTop,o=r.scrollHeight,n=r.clientHeight,i=r.scrollWidth,a=r.clientWidth;if(G)e=l>1,t=l<o-n-1;else{var c=(0,u.getNormalizedScrollLeft)(ve.current,X.direction);e=U?c<i-a-1:c>1,t=U?c>1:c<i-a-1}e===ae.start&&t===ae.end||ce({start:e,end:t})}});l.useEffect(function(){var e=(0,c.default)(function(){he(),xe()}),t=(0,s.default)(ve.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}},[he,xe]);var Be=l.useCallback((0,c.default)(function(){xe()}));l.useEffect(function(){return function(){Be.clear()}},[Be]),l.useEffect(function(){re(!0)},[]),l.useEffect(function(){he(),xe()}),l.useEffect(function(){Se()},[Se,oe]),l.useImperativeHandle(g,function(){return{updateIndicator:he,updateScrollButtons:xe}},[he,xe]);var Ee=l.createElement(p.default,(0,e.default)({className:S.indicator,orientation:L,color:q},j,{style:(0,e.default)({},oe,j.style)})),ke=0,qe=l.Children.map(C,function(e){if(!l.isValidElement(e))return null;var t=void 0===e.props.value?ke:e.props.value;de.set(t,ke);var r=t===H;return ke+=1,l.cloneElement(e,{fullWidth:"fullWidth"===I,indicator:r&&!te&&Ee,selected:r,selectionFollowsFocus:D,onChange:N,textColor:F,value:t})}),Ne=function(){var t={};t.scrollbarSizeListener=K?l.createElement(d.default,{className:S.scrollable,onChange:Ce}):null;var r=ae.start||ae.end,o=K&&("auto"===z&&r||"desktop"===z||"on"===z);return t.scrollButtonStart=o?l.createElement(T,(0,e.default)({orientation:L,direction:U?"right":"left",onClick:we,disabled:!ae.start,className:(0,i.default)(S.scrollButtons,"on"!==z&&S.scrollButtonsDesktop)},A)):null,t.scrollButtonEnd=o?l.createElement(T,(0,e.default)({orientation:L,direction:U?"left":"right",onClick:ye,disabled:!ae.end,className:(0,i.default)(S.scrollButtons,"on"!==z&&S.scrollButtonsDesktop)},A)):null,t}();return l.createElement(E,(0,e.default)({className:(0,i.default)(S.root,x,G&&S.vertical),ref:n},V),Ne.scrollButtonStart,Ne.scrollbarSizeListener,l.createElement("div",{className:(0,i.default)(S.scroller,K?S.scrollable:S.fixed),style:ue,ref:ve,onScroll:Be},l.createElement("div",{"aria-label":a,"aria-labelledby":v,className:(0,i.default)(S.flexContainer,G&&S.flexContainerVertical,y&&!K&&S.centered),onKeyDown:function(e){var t=e.target;if("tab"===t.getAttribute("role")){var r=null,l="vertical"!==L?"ArrowLeft":"ArrowUp",o="vertical"!==L?"ArrowRight":"ArrowDown";switch("vertical"!==L&&"rtl"===X.direction&&(l="ArrowRight",o="ArrowLeft"),e.key){case l:r=t.previousElementSibling||pe.current.lastChild;break;case o:r=t.nextElementSibling||pe.current.firstChild;break;case"Home":r=pe.current.firstChild;break;case"End":r=pe.current.lastChild}null!==r&&(r.focus(),e.preventDefault())}},ref:pe,role:"tablist"},qe),te&&Ee),Ne.scrollButtonEnd)}),x=(0,v.default)(C,{name:"MuiTabs"})(S);exports.default=x;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","react":"n8MK","react-is":"Q3zR","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../utils/debounce":"TiOe","../utils/ownerWindow":"EE4R","../utils/scrollLeft":"vnlt","../internal/animate":"dVqu","./ScrollbarSize":"wPe5","../styles/withStyles":"awmK","./TabIndicator":"O8qv","../TabScrollButton":"LZng","../utils/useEventCallback":"AH47","../styles/useTheme":"nmB4"}],"PzIu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Tabs"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Tabs":"SxT8"}],"zCJA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var e=m(require("@babel/runtime/helpers/esm/extends")),r=m(require("@babel/runtime/helpers/esm/objectWithoutProperties")),t=b(require("react")),l=m(require("prop-types")),a=m(require("clsx")),o=require("@material-ui/utils"),u=m(require("../Input")),i=m(require("../FilledInput")),n=m(require("../OutlinedInput")),d=m(require("../InputLabel")),s=m(require("../FormControl")),p=m(require("../FormHelperText")),c=m(require("../Select")),f=m(require("../styles/withStyles"));function v(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return v=function(){return e},e}function b(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=v();if(r&&r.has(e))return r.get(e);var t={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=l?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(t,a,o):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function m(e){return e&&e.__esModule?e:{default:e}}var h={standard:u.default,filled:i.default,outlined:n.default},y={root:{}};exports.styles=y;var q=t.forwardRef(function(l,o){var u=l.autoComplete,i=l.autoFocus,n=void 0!==i&&i,f=l.children,v=l.classes,b=l.className,m=l.color,y=void 0===m?"primary":m,q=l.defaultValue,P=l.disabled,x=void 0!==P&&P,F=l.error,w=void 0!==F&&F,O=l.FormHelperTextProps,I=l.fullWidth,M=void 0!==I&&I,g=l.helperText,j=l.hiddenLabel,C=l.id,W=l.InputLabelProps,E=l.inputProps,L=l.InputProps,T=l.inputRef,_=l.label,k=l.multiline,R=void 0!==k&&k,S=l.name,B=l.onBlur,H=l.onChange,N=l.onFocus,V=l.placeholder,D=l.required,z=void 0!==D&&D,A=l.rows,G=l.rowsMax,J=l.select,K=void 0!==J&&J,Q=l.SelectProps,U=l.type,X=l.value,Y=l.variant,Z=void 0===Y?"standard":Y,$=(0,r.default)(l,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","select","SelectProps","type","value","variant"]);var ee={};if("outlined"===Z&&(W&&void 0!==W.shrink&&(ee.notched=W.shrink),_)){var re,te=null!==(re=null==W?void 0:W.required)&&void 0!==re?re:z;ee.label=t.createElement(t.Fragment,null,_,te&&" *")}K&&(Q&&Q.native||(ee.id=void 0),ee["aria-describedby"]=void 0);var le=g&&C?"".concat(C,"-helper-text"):void 0,ae=_&&C?"".concat(C,"-label"):void 0,oe=h[Z],ue=t.createElement(oe,(0,e.default)({"aria-describedby":le,autoComplete:u,autoFocus:n,defaultValue:q,fullWidth:M,multiline:R,name:S,rows:A,rowsMax:G,type:U,value:X,id:C,inputRef:T,onBlur:B,onChange:H,onFocus:N,placeholder:V,inputProps:E},ee,L));return t.createElement(s.default,(0,e.default)({className:(0,a.default)(v.root,b),disabled:x,error:w,fullWidth:M,hiddenLabel:j,ref:o,required:z,color:y,variant:Z},$),_&&t.createElement(d.default,(0,e.default)({htmlFor:C,id:ae},W),_),K?t.createElement(c.default,(0,e.default)({"aria-describedby":le,id:C,labelId:ae,value:X,input:ue},Q),f):ue,g&&t.createElement(p.default,(0,e.default)({id:le},O),g))}),P=(0,f.default)(y,{name:"MuiTextField"})(q);exports.default=P;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../Input":"CaNl","../FilledInput":"wWb1","../OutlinedInput":"Z2x8","../InputLabel":"pS8F","../FormControl":"eFUT","../FormHelperText":"iw6n","../Select":"NCwz","../styles/withStyles":"awmK"}],"JZs9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./TextField"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./TextField":"zCJA"}],"u1yh":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.testReset=L,exports.default=exports.styles=void 0;var e=w(require("@babel/runtime/helpers/esm/extends")),t=w(require("@babel/runtime/helpers/esm/slicedToArray")),r=w(require("@babel/runtime/helpers/esm/objectWithoutProperties")),o=w(require("@babel/runtime/helpers/esm/defineProperty")),n=x(require("react")),i=x(require("react-dom")),a=w(require("prop-types")),u=w(require("clsx")),l=require("@material-ui/utils"),s=require("../styles/colorManipulator"),p=w(require("../styles/withStyles")),c=w(require("../utils/capitalize")),m=w(require("../Grow")),f=w(require("../Popper")),d=w(require("../utils/useForkRef")),g=w(require("../utils/unstable_useId")),h=w(require("../utils/setRef")),v=w(require("../utils/useIsFocusVisible")),b=w(require("../utils/useControlled")),T=w(require("../styles/useTheme"));function y(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return y=function(){return e},e}function x(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=y();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function w(e){return e&&e.__esModule?e:{default:e}}function O(e){return Math.round(1e5*e)/1e5}function P(){return{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}}}var q=function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none"},popperInteractive:{pointerEvents:"auto"},popperArrow:P(),tooltip:{backgroundColor:(0,s.fade)(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(O(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},tooltipArrow:{position:"relative",margin:"0"},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:(0,s.fade)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(O(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:(0,o.default)({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:(0,o.default)({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:(0,o.default)({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:(0,o.default)({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}};exports.styles=q;var M=!1,R=null;function L(){M=!1,clearTimeout(R)}var D=n.forwardRef(function(o,a){var s=o.arrow,p=void 0!==s&&s,y=o.children,x=o.classes,w=o.disableFocusListener,O=void 0!==w&&w,P=o.disableHoverListener,q=void 0!==P&&P,L=o.disableTouchListener,D=void 0!==L&&L,E=o.enterDelay,k=void 0===E?100:E,F=o.enterNextDelay,C=void 0===F?0:F,S=o.enterTouchDelay,B=void 0===S?700:S,N=o.id,W=o.interactive,j=void 0!==W&&W,_=o.leaveDelay,z=void 0===_?0:_,A=o.leaveTouchDelay,I=void 0===A?1500:A,H=o.onClose,$=o.onOpen,V=o.open,G=o.placement,J=void 0===G?"bottom":G,K=o.PopperComponent,Q=void 0===K?f.default:K,U=o.PopperProps,X=o.title,Y=o.TransitionComponent,Z=void 0===Y?m.default:Y,ee=o.TransitionProps,te=(0,r.default)(o,["arrow","children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","title","TransitionComponent","TransitionProps"]),re=(0,T.default)(),oe=n.useState(),ne=oe[0],ie=oe[1],ae=n.useState(null),ue=ae[0],le=ae[1],se=n.useRef(!1),pe=n.useRef(),ce=n.useRef(),me=n.useRef(),fe=n.useRef(),de=(0,b.default)({controlled:V,default:!1,name:"Tooltip",state:"open"}),ge=(0,t.default)(de,2),he=ge[0],ve=ge[1],be=he,Te=(0,g.default)(N);n.useEffect(function(){return function(){clearTimeout(pe.current),clearTimeout(ce.current),clearTimeout(me.current),clearTimeout(fe.current)}},[]);var ye=function(e){clearTimeout(R),M=!0,ve(!0),$&&$(e)},xe=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var r=y.props;"mouseover"===t.type&&r.onMouseOver&&e&&r.onMouseOver(t),se.current&&"touchstart"!==t.type||(ne&&ne.removeAttribute("title"),clearTimeout(ce.current),clearTimeout(me.current),k||M&&C?(t.persist(),ce.current=setTimeout(function(){ye(t)},M?C:k)):ye(t))}},we=(0,v.default)(),Oe=we.isFocusVisible,Pe=we.onBlurVisible,qe=we.ref,Me=n.useState(!1),Re=Me[0],Le=Me[1],De=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){ne||ie(t.currentTarget),Oe(t)&&(Le(!0),xe()(t));var r=y.props;r.onFocus&&e&&r.onFocus(t)}},Ee=function(e){clearTimeout(R),R=setTimeout(function(){M=!1},800+z),ve(!1),H&&H(e),clearTimeout(pe.current),pe.current=setTimeout(function(){se.current=!1},re.transitions.duration.shortest)},ke=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var r=y.props;"blur"===t.type&&(r.onBlur&&e&&r.onBlur(t),Re&&(Le(!1),Pe())),"mouseleave"===t.type&&r.onMouseLeave&&t.currentTarget===ne&&r.onMouseLeave(t),clearTimeout(ce.current),clearTimeout(me.current),t.persist(),me.current=setTimeout(function(){Ee(t)},z)}},Fe=function(e){se.current=!0;var t=y.props;t.onTouchStart&&t.onTouchStart(e)},Ce=(0,d.default)(ie,a),Se=(0,d.default)(qe,Ce),Be=n.useCallback(function(e){(0,h.default)(Se,i.findDOMNode(e))},[Se]),Ne=(0,d.default)(y.ref,Be);""===X&&(be=!1);var We=!be&&!q,je=(0,e.default)({"aria-describedby":be?Te:null,title:We&&"string"==typeof X?X:null},te,y.props,{className:(0,u.default)(te.className,y.props.className),onTouchStart:Fe,ref:Ne}),_e={};D||(je.onTouchStart=function(e){Fe(e),clearTimeout(me.current),clearTimeout(pe.current),clearTimeout(fe.current),e.persist(),fe.current=setTimeout(function(){xe()(e)},B)},je.onTouchEnd=function(e){y.props.onTouchEnd&&y.props.onTouchEnd(e),clearTimeout(fe.current),clearTimeout(me.current),e.persist(),me.current=setTimeout(function(){Ee(e)},I)}),q||(je.onMouseOver=xe(),je.onMouseLeave=ke(),j&&(_e.onMouseOver=xe(!1),_e.onMouseLeave=ke(!1))),O||(je.onFocus=De(),je.onBlur=ke(),j&&(_e.onFocus=De(!1),_e.onBlur=ke(!1)));var ze=n.useMemo(function(){return(0,l.deepmerge)({popperOptions:{modifiers:{arrow:{enabled:Boolean(ue),element:ue}}}},U)},[ue,U]);return n.createElement(n.Fragment,null,n.cloneElement(y,je),n.createElement(Q,(0,e.default)({className:(0,u.default)(x.popper,j&&x.popperInteractive,p&&x.popperArrow),placement:J,anchorEl:ne,open:!!ne&&be,id:je["aria-describedby"],transition:!0},_e,ze),function(t){var r=t.placement,o=t.TransitionProps;return n.createElement(Z,(0,e.default)({timeout:re.transitions.duration.shorter},o,ee),n.createElement("div",{className:(0,u.default)(x.tooltip,x["tooltipPlacement".concat((0,c.default)(r.split("-")[0]))],se.current&&x.touch,p&&x.tooltipArrow)},X,p?n.createElement("span",{className:x.arrow,ref:le}):null))}))}),E=(0,p.default)(q,{name:"MuiTooltip",flip:!1})(D);exports.default=E;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","@babel/runtime/helpers/esm/defineProperty":"gpd2","react":"n8MK","react-dom":"NKHc","prop-types":"D9Od","clsx":"WLGK","@material-ui/utils":"gEhD","../styles/colorManipulator":"aguB","../styles/withStyles":"awmK","../utils/capitalize":"Dk4Y","../Grow":"vuXQ","../Popper":"PkJy","../utils/useForkRef":"eYEl","../utils/unstable_useId":"yA5c","../utils/setRef":"IV4i","../utils/useIsFocusVisible":"Z9bb","../utils/useControlled":"WHmv","../styles/useTheme":"nmB4"}],"FWNA":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Tooltip"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Tooltip":"u1yh"}],"E1It":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;var e=o(require("@babel/runtime/helpers/esm/extends")),t=o(require("@babel/runtime/helpers/esm/objectWithoutProperties")),r=u(require("react"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=u?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=t.disableHysteresis,n=void 0!==r&&r,u=t.threshold,o=void 0===u?100:u,i=t.target,f=e.current;return i&&(e.current=void 0!==i.pageYOffset?i.pageYOffset:i.scrollTop),!(!n&&void 0!==f&&e.current<f)&&e.current>o}var f="undefined"!=typeof window?window:null;function a(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=n.getTrigger,o=void 0===u?i:u,a=n.target,s=void 0===a?f:a,c=(0,t.default)(n,["getTrigger","target"]),l=r.useRef(),d=r.useState(function(){return o(l,c)}),p=d[0],v=d[1];return r.useEffect(function(){var t=function(){v(o(l,(0,e.default)({target:s},c)))};return t(),s.addEventListener("scroll",t),function(){s.removeEventListener("scroll",t)}},[s,o,JSON.stringify(c)]),p}
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK"}],"nQlU":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("./useScrollTrigger"));function r(e){return e&&e.__esModule?e:{default:e}}
},{"./useScrollTrigger":"E1It"}],"Jqne":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("@babel/runtime/helpers/esm/extends")),t=o(require("react")),r=i(require("prop-types")),n=o(require("../withWidth"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function i(e){return e&&e.__esModule?e:{default:e}}var f=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(u){var o=r.breakpoint,i=void 0===o?"sm":o;function f(r){return t.createElement(u,(0,e.default)({fullScreen:(0,n.isWidthDown)(i,r.width)},r))}return(0,n.default)()(f)}},a=f;exports.default=a;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","react":"n8MK","prop-types":"D9Od","../withWidth":"tyfK"}],"xOow":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./withMobileDialog"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./withMobileDialog":"Jqne"}],"JhR4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("@babel/runtime/helpers/esm/extends")),t=c(require("@babel/runtime/helpers/esm/slicedToArray")),r=c(require("@babel/runtime/helpers/esm/objectWithoutProperties")),n=d(require("react")),i=c(require("prop-types")),o=require("react-transition-group"),s=require("../styles/transitions"),a=c(require("../styles/useTheme")),u=require("../transitions/utils"),l=c(require("../utils/useForkRef"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}var p={entering:{transform:"none"},entered:{transform:"none"}},m={enter:s.duration.enteringScreen,exit:s.duration.leavingScreen},y=n.forwardRef(function(i,s){var f=i.children,d=i.disableStrictModeCompat,c=void 0!==d&&d,y=i.in,v=i.onEnter,b=i.onEntered,E=i.onEntering,g=i.onExit,x=i.onExited,h=i.onExiting,q=i.style,O=i.timeout,P=void 0===O?m:O,T=i.TransitionComponent,j=void 0===T?o.Transition:T,w=(0,r.default)(i,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),M=(0,a.default)(),_=M.unstable_strictMode&&!c,k=n.useRef(null),C=(0,l.default)(f.ref,s),R=(0,l.default)(_?k:void 0,C),S=function(e){return function(r,n){if(e){var i=_?[k.current,r]:[r,n],o=(0,t.default)(i,2),s=o[0],a=o[1];void 0===a?e(s):e(s,a)}}},W=S(E),D=S(function(e,t){(0,u.reflow)(e);var r=(0,u.getTransitionProps)({style:q,timeout:P},{mode:"enter"});e.style.webkitTransition=M.transitions.create("transform",r),e.style.transition=M.transitions.create("transform",r),v&&v(e,t)}),A=S(b),F=S(h),z=S(function(e){var t=(0,u.getTransitionProps)({style:q,timeout:P},{mode:"exit"});e.style.webkitTransition=M.transitions.create("transform",t),e.style.transition=M.transitions.create("transform",t),g&&g(e)}),B=S(x);return n.createElement(j,(0,e.default)({appear:!0,in:y,nodeRef:_?k:void 0,onEnter:D,onEntered:A,onEntering:W,onExit:z,onExited:B,onExiting:F,timeout:P},w),function(t,r){return n.cloneElement(f,(0,e.default)({style:(0,e.default)({transform:"scale(0)",visibility:"exited"!==t||y?void 0:"hidden"},p[t],q,f.props.style),ref:R},r))})}),v=y;exports.default=v;
},{"@babel/runtime/helpers/esm/extends":"SpjQ","@babel/runtime/helpers/esm/slicedToArray":"T12H","@babel/runtime/helpers/esm/objectWithoutProperties":"tuNH","react":"n8MK","prop-types":"D9Od","react-transition-group":"ORBw","../styles/transitions":"geVf","../styles/useTheme":"nmB4","../transitions/utils":"DLys","../utils/useForkRef":"eYEl"}],"DTuf":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=t(require("./Zoom"));function t(e){return e&&e.__esModule?e:{default:e}}
},{"./Zoom":"JhR4"}],"dT3j":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={colors:!0,Accordion:!0,AccordionActions:!0,AccordionDetails:!0,AccordionSummary:!0,AppBar:!0,Avatar:!0,Backdrop:!0,Badge:!0,BottomNavigation:!0,BottomNavigationAction:!0,Box:!0,Breadcrumbs:!0,Button:!0,ButtonBase:!0,ButtonGroup:!0,Card:!0,CardActionArea:!0,CardActions:!0,CardContent:!0,CardHeader:!0,CardMedia:!0,Checkbox:!0,Chip:!0,CircularProgress:!0,ClickAwayListener:!0,Collapse:!0,Container:!0,CssBaseline:!0,Dialog:!0,DialogActions:!0,DialogContent:!0,DialogContentText:!0,DialogTitle:!0,Divider:!0,Drawer:!0,ExpansionPanel:!0,ExpansionPanelActions:!0,ExpansionPanelDetails:!0,ExpansionPanelSummary:!0,Fab:!0,Fade:!0,FilledInput:!0,FormControl:!0,FormControlLabel:!0,FormGroup:!0,FormHelperText:!0,FormLabel:!0,Grid:!0,GridList:!0,GridListTile:!0,GridListTileBar:!0,Grow:!0,Hidden:!0,Icon:!0,IconButton:!0,Input:!0,InputAdornment:!0,InputBase:!0,InputLabel:!0,LinearProgress:!0,Link:!0,List:!0,ListItem:!0,ListItemAvatar:!0,ListItemIcon:!0,ListItemSecondaryAction:!0,ListItemText:!0,ListSubheader:!0,Menu:!0,MenuItem:!0,MenuList:!0,MobileStepper:!0,Modal:!0,NativeSelect:!0,NoSsr:!0,OutlinedInput:!0,Paper:!0,Popover:!0,Popper:!0,Portal:!0,Radio:!0,RadioGroup:!0,RootRef:!0,Select:!0,Slide:!0,Slider:!0,Snackbar:!0,SnackbarContent:!0,Step:!0,StepButton:!0,StepConnector:!0,StepContent:!0,StepIcon:!0,StepLabel:!0,Stepper:!0,SvgIcon:!0,SwipeableDrawer:!0,Switch:!0,Tab:!0,Table:!0,TableBody:!0,TableCell:!0,TableContainer:!0,TableFooter:!0,TableHead:!0,TablePagination:!0,TableRow:!0,TableSortLabel:!0,Tabs:!0,TabScrollButton:!0,TextField:!0,TextareaAutosize:!0,Toolbar:!0,Tooltip:!0,Typography:!0,Unstable_TrapFocus:!0,useMediaQuery:!0,useScrollTrigger:!0,withMobileDialog:!0,withWidth:!0,Zoom:!0};Object.defineProperty(exports,"Accordion",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"AccordionActions",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"AccordionDetails",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"AccordionSummary",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"AppBar",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"Backdrop",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"BottomNavigation",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"BottomNavigationAction",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(exports,"Box",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(exports,"Breadcrumbs",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(exports,"ButtonBase",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(exports,"ButtonGroup",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(exports,"CardActionArea",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(exports,"CardActions",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(exports,"CardContent",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(exports,"CardHeader",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(exports,"CardMedia",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(exports,"Chip",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(exports,"CircularProgress",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(exports,"ClickAwayListener",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(exports,"Container",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(exports,"CssBaseline",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(exports,"Dialog",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(exports,"DialogActions",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(exports,"DialogContent",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(exports,"DialogContentText",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(exports,"DialogTitle",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(exports,"ExpansionPanel",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(exports,"ExpansionPanelActions",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(exports,"ExpansionPanelDetails",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(exports,"ExpansionPanelSummary",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(exports,"Fab",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(exports,"Fade",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(exports,"FilledInput",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(exports,"FormControl",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(exports,"FormControlLabel",{enumerable:!0,get:function(){return Z.default}}),Object.defineProperty(exports,"FormGroup",{enumerable:!0,get:function(){return J.default}}),Object.defineProperty(exports,"FormHelperText",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(exports,"FormLabel",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(exports,"GridList",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(exports,"GridListTile",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(exports,"GridListTileBar",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(exports,"Grow",{enumerable:!0,get:function(){return te.default}}),Object.defineProperty(exports,"Hidden",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(exports,"Icon",{enumerable:!0,get:function(){return oe.default}}),Object.defineProperty(exports,"IconButton",{enumerable:!0,get:function(){return ne.default}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(exports,"InputAdornment",{enumerable:!0,get:function(){return ae.default}}),Object.defineProperty(exports,"InputBase",{enumerable:!0,get:function(){return pe.default}}),Object.defineProperty(exports,"InputLabel",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(exports,"LinearProgress",{enumerable:!0,get:function(){return ie.default}}),Object.defineProperty(exports,"Link",{enumerable:!0,get:function(){return le.default}}),Object.defineProperty(exports,"List",{enumerable:!0,get:function(){return fe.default}}),Object.defineProperty(exports,"ListItem",{enumerable:!0,get:function(){return se.default}}),Object.defineProperty(exports,"ListItemAvatar",{enumerable:!0,get:function(){return be.default}}),Object.defineProperty(exports,"ListItemIcon",{enumerable:!0,get:function(){return de.default}}),Object.defineProperty(exports,"ListItemSecondaryAction",{enumerable:!0,get:function(){return ye.default}}),Object.defineProperty(exports,"ListItemText",{enumerable:!0,get:function(){return Oe.default}}),Object.defineProperty(exports,"ListSubheader",{enumerable:!0,get:function(){return xe.default}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return je.default}}),Object.defineProperty(exports,"MenuItem",{enumerable:!0,get:function(){return Pe.default}}),Object.defineProperty(exports,"MenuList",{enumerable:!0,get:function(){return me.default}}),Object.defineProperty(exports,"MobileStepper",{enumerable:!0,get:function(){return ge.default}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return he.default}}),Object.defineProperty(exports,"NativeSelect",{enumerable:!0,get:function(){return _e.default}}),Object.defineProperty(exports,"NoSsr",{enumerable:!0,get:function(){return ve.default}}),Object.defineProperty(exports,"OutlinedInput",{enumerable:!0,get:function(){return we.default}}),Object.defineProperty(exports,"Paper",{enumerable:!0,get:function(){return Me.default}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return ke.default}}),Object.defineProperty(exports,"Popper",{enumerable:!0,get:function(){return Ee.default}}),Object.defineProperty(exports,"Portal",{enumerable:!0,get:function(){return qe.default}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return Se.default}}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:function(){return Te.default}}),Object.defineProperty(exports,"RootRef",{enumerable:!0,get:function(){return Ce.default}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return Le.default}}),Object.defineProperty(exports,"Slide",{enumerable:!0,get:function(){return Ae.default}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return Be.default}}),Object.defineProperty(exports,"Snackbar",{enumerable:!0,get:function(){return Ie.default}}),Object.defineProperty(exports,"SnackbarContent",{enumerable:!0,get:function(){return De.default}}),Object.defineProperty(exports,"Step",{enumerable:!0,get:function(){return Fe.default}}),Object.defineProperty(exports,"StepButton",{enumerable:!0,get:function(){return Ge.default}}),Object.defineProperty(exports,"StepConnector",{enumerable:!0,get:function(){return Re.default}}),Object.defineProperty(exports,"StepContent",{enumerable:!0,get:function(){return He.default}}),Object.defineProperty(exports,"StepIcon",{enumerable:!0,get:function(){return Ne.default}}),Object.defineProperty(exports,"StepLabel",{enumerable:!0,get:function(){return We.default}}),Object.defineProperty(exports,"Stepper",{enumerable:!0,get:function(){return ze.default}}),Object.defineProperty(exports,"SvgIcon",{enumerable:!0,get:function(){return Qe.default}}),Object.defineProperty(exports,"SwipeableDrawer",{enumerable:!0,get:function(){return Ue.default}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return Ze.default}}),Object.defineProperty(exports,"Tab",{enumerable:!0,get:function(){return Je.default}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return Ke.default}}),Object.defineProperty(exports,"TableBody",{enumerable:!0,get:function(){return Ve.default}}),Object.defineProperty(exports,"TableCell",{enumerable:!0,get:function(){return Xe.default}}),Object.defineProperty(exports,"TableContainer",{enumerable:!0,get:function(){return Ye.default}}),Object.defineProperty(exports,"TableFooter",{enumerable:!0,get:function(){return $e.default}}),Object.defineProperty(exports,"TableHead",{enumerable:!0,get:function(){return et.default}}),Object.defineProperty(exports,"TablePagination",{enumerable:!0,get:function(){return tt.default}}),Object.defineProperty(exports,"TableRow",{enumerable:!0,get:function(){return rt.default}}),Object.defineProperty(exports,"TableSortLabel",{enumerable:!0,get:function(){return ot.default}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return nt.default}}),Object.defineProperty(exports,"TabScrollButton",{enumerable:!0,get:function(){return ut.default}}),Object.defineProperty(exports,"TextField",{enumerable:!0,get:function(){return at.default}}),Object.defineProperty(exports,"TextareaAutosize",{enumerable:!0,get:function(){return pt.default}}),Object.defineProperty(exports,"Toolbar",{enumerable:!0,get:function(){return ct.default}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return it.default}}),Object.defineProperty(exports,"Typography",{enumerable:!0,get:function(){return lt.default}}),Object.defineProperty(exports,"Unstable_TrapFocus",{enumerable:!0,get:function(){return ft.default}}),Object.defineProperty(exports,"useMediaQuery",{enumerable:!0,get:function(){return st.default}}),Object.defineProperty(exports,"useScrollTrigger",{enumerable:!0,get:function(){return bt.default}}),Object.defineProperty(exports,"withMobileDialog",{enumerable:!0,get:function(){return dt.default}}),Object.defineProperty(exports,"withWidth",{enumerable:!0,get:function(){return yt.default}}),Object.defineProperty(exports,"Zoom",{enumerable:!0,get:function(){return Ot.default}}),exports.colors=void 0;var t=jt(require("./colors"));exports.colors=t;var r=require("./styles");Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===r[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return r[t]}}))});var o=require("./utils");Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===o[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return o[t]}}))});var n=jt(require("./Accordion"));Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===n[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return n[t]}}))});var u=jt(require("./AccordionActions"));Object.keys(u).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===u[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return u[t]}}))});var a=jt(require("./AccordionDetails"));Object.keys(a).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===a[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return a[t]}}))});var p=jt(require("./AccordionSummary"));Object.keys(p).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===p[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return p[t]}}))});var c=jt(require("./AppBar"));Object.keys(c).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===c[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return c[t]}}))});var i=jt(require("./Avatar"));Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===i[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return i[t]}}))});var l=jt(require("./Backdrop"));Object.keys(l).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===l[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return l[t]}}))});var f=jt(require("./Badge"));Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===f[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return f[t]}}))});var s=jt(require("./BottomNavigation"));Object.keys(s).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===s[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return s[t]}}))});var b=jt(require("./BottomNavigationAction"));Object.keys(b).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===b[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return b[t]}}))});var d=jt(require("./Box"));Object.keys(d).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===d[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return d[t]}}))});var y=jt(require("./Breadcrumbs"));Object.keys(y).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===y[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return y[t]}}))});var O=jt(require("./Button"));Object.keys(O).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===O[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return O[t]}}))});var x=jt(require("./ButtonBase"));Object.keys(x).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===x[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return x[t]}}))});var j=jt(require("./ButtonGroup"));Object.keys(j).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===j[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return j[t]}}))});var P=jt(require("./Card"));Object.keys(P).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===P[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return P[t]}}))});var m=jt(require("./CardActionArea"));Object.keys(m).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===m[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return m[t]}}))});var g=jt(require("./CardActions"));Object.keys(g).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===g[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return g[t]}}))});var h=jt(require("./CardContent"));Object.keys(h).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===h[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return h[t]}}))});var _=jt(require("./CardHeader"));Object.keys(_).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===_[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return _[t]}}))});var v=jt(require("./CardMedia"));Object.keys(v).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===v[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return v[t]}}))});var w=jt(require("./Checkbox"));Object.keys(w).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===w[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return w[t]}}))});var M=jt(require("./Chip"));Object.keys(M).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===M[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return M[t]}}))});var k=jt(require("./CircularProgress"));Object.keys(k).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===k[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return k[t]}}))});var E=jt(require("./ClickAwayListener"));Object.keys(E).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===E[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return E[t]}}))});var q=jt(require("./Collapse"));Object.keys(q).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===q[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return q[t]}}))});var S=jt(require("./Container"));Object.keys(S).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===S[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return S[t]}}))});var T=jt(require("./CssBaseline"));Object.keys(T).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===T[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return T[t]}}))});var C=jt(require("./Dialog"));Object.keys(C).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===C[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return C[t]}}))});var L=jt(require("./DialogActions"));Object.keys(L).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===L[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return L[t]}}))});var A=jt(require("./DialogContent"));Object.keys(A).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===A[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return A[t]}}))});var B=jt(require("./DialogContentText"));Object.keys(B).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===B[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return B[t]}}))});var I=jt(require("./DialogTitle"));Object.keys(I).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===I[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return I[t]}}))});var D=jt(require("./Divider"));Object.keys(D).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===D[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return D[t]}}))});var F=jt(require("./Drawer"));Object.keys(F).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===F[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return F[t]}}))});var G=jt(require("./ExpansionPanel"));Object.keys(G).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===G[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return G[t]}}))});var R=jt(require("./ExpansionPanelActions"));Object.keys(R).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===R[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return R[t]}}))});var H=jt(require("./ExpansionPanelDetails"));Object.keys(H).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===H[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return H[t]}}))});var N=jt(require("./ExpansionPanelSummary"));Object.keys(N).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===N[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return N[t]}}))});var W=jt(require("./Fab"));Object.keys(W).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===W[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return W[t]}}))});var z=jt(require("./Fade"));Object.keys(z).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===z[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return z[t]}}))});var Q=jt(require("./FilledInput"));Object.keys(Q).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Q[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Q[t]}}))});var U=jt(require("./FormControl"));Object.keys(U).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===U[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return U[t]}}))});var Z=jt(require("./FormControlLabel"));Object.keys(Z).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Z[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Z[t]}}))});var J=jt(require("./FormGroup"));Object.keys(J).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===J[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return J[t]}}))});var K=jt(require("./FormHelperText"));Object.keys(K).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===K[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return K[t]}}))});var V=jt(require("./FormLabel"));Object.keys(V).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===V[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return V[t]}}))});var X=jt(require("./Grid"));Object.keys(X).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===X[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return X[t]}}))});var Y=jt(require("./GridList"));Object.keys(Y).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Y[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Y[t]}}))});var $=jt(require("./GridListTile"));Object.keys($).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===$[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return $[t]}}))});var ee=jt(require("./GridListTileBar"));Object.keys(ee).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ee[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ee[t]}}))});var te=jt(require("./Grow"));Object.keys(te).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===te[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return te[t]}}))});var re=jt(require("./Hidden"));Object.keys(re).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===re[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return re[t]}}))});var oe=jt(require("./Icon"));Object.keys(oe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===oe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return oe[t]}}))});var ne=jt(require("./IconButton"));Object.keys(ne).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ne[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ne[t]}}))});var ue=jt(require("./Input"));Object.keys(ue).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ue[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ue[t]}}))});var ae=jt(require("./InputAdornment"));Object.keys(ae).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ae[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ae[t]}}))});var pe=jt(require("./InputBase"));Object.keys(pe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===pe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return pe[t]}}))});var ce=jt(require("./InputLabel"));Object.keys(ce).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ce[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ce[t]}}))});var ie=jt(require("./LinearProgress"));Object.keys(ie).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ie[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ie[t]}}))});var le=jt(require("./Link"));Object.keys(le).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===le[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return le[t]}}))});var fe=jt(require("./List"));Object.keys(fe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===fe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return fe[t]}}))});var se=jt(require("./ListItem"));Object.keys(se).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===se[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return se[t]}}))});var be=jt(require("./ListItemAvatar"));Object.keys(be).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===be[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return be[t]}}))});var de=jt(require("./ListItemIcon"));Object.keys(de).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===de[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return de[t]}}))});var ye=jt(require("./ListItemSecondaryAction"));Object.keys(ye).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ye[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ye[t]}}))});var Oe=jt(require("./ListItemText"));Object.keys(Oe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Oe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Oe[t]}}))});var xe=jt(require("./ListSubheader"));Object.keys(xe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===xe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return xe[t]}}))});var je=jt(require("./Menu"));Object.keys(je).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===je[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return je[t]}}))});var Pe=jt(require("./MenuItem"));Object.keys(Pe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Pe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Pe[t]}}))});var me=jt(require("./MenuList"));Object.keys(me).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===me[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return me[t]}}))});var ge=jt(require("./MobileStepper"));Object.keys(ge).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ge[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ge[t]}}))});var he=jt(require("./Modal"));Object.keys(he).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===he[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return he[t]}}))});var _e=jt(require("./NativeSelect"));Object.keys(_e).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===_e[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return _e[t]}}))});var ve=jt(require("./NoSsr"));Object.keys(ve).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ve[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ve[t]}}))});var we=jt(require("./OutlinedInput"));Object.keys(we).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===we[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return we[t]}}))});var Me=jt(require("./Paper"));Object.keys(Me).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Me[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Me[t]}}))});var ke=jt(require("./Popover"));Object.keys(ke).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ke[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ke[t]}}))});var Ee=jt(require("./Popper"));Object.keys(Ee).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ee[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ee[t]}}))});var qe=jt(require("./Portal"));Object.keys(qe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===qe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return qe[t]}}))});var Se=jt(require("./Radio"));Object.keys(Se).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Se[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Se[t]}}))});var Te=jt(require("./RadioGroup"));Object.keys(Te).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Te[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Te[t]}}))});var Ce=jt(require("./RootRef"));Object.keys(Ce).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ce[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ce[t]}}))});var Le=jt(require("./Select"));Object.keys(Le).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Le[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Le[t]}}))});var Ae=jt(require("./Slide"));Object.keys(Ae).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ae[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ae[t]}}))});var Be=jt(require("./Slider"));Object.keys(Be).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Be[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Be[t]}}))});var Ie=jt(require("./Snackbar"));Object.keys(Ie).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ie[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ie[t]}}))});var De=jt(require("./SnackbarContent"));Object.keys(De).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===De[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return De[t]}}))});var Fe=jt(require("./Step"));Object.keys(Fe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Fe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Fe[t]}}))});var Ge=jt(require("./StepButton"));Object.keys(Ge).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ge[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ge[t]}}))});var Re=jt(require("./StepConnector"));Object.keys(Re).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Re[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Re[t]}}))});var He=jt(require("./StepContent"));Object.keys(He).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===He[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return He[t]}}))});var Ne=jt(require("./StepIcon"));Object.keys(Ne).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ne[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ne[t]}}))});var We=jt(require("./StepLabel"));Object.keys(We).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===We[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return We[t]}}))});var ze=jt(require("./Stepper"));Object.keys(ze).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ze[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ze[t]}}))});var Qe=jt(require("./SvgIcon"));Object.keys(Qe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Qe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Qe[t]}}))});var Ue=jt(require("./SwipeableDrawer"));Object.keys(Ue).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ue[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ue[t]}}))});var Ze=jt(require("./Switch"));Object.keys(Ze).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ze[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ze[t]}}))});var Je=jt(require("./Tab"));Object.keys(Je).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Je[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Je[t]}}))});var Ke=jt(require("./Table"));Object.keys(Ke).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ke[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ke[t]}}))});var Ve=jt(require("./TableBody"));Object.keys(Ve).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ve[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ve[t]}}))});var Xe=jt(require("./TableCell"));Object.keys(Xe).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Xe[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Xe[t]}}))});var Ye=jt(require("./TableContainer"));Object.keys(Ye).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ye[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ye[t]}}))});var $e=jt(require("./TableFooter"));Object.keys($e).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===$e[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return $e[t]}}))});var et=jt(require("./TableHead"));Object.keys(et).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===et[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return et[t]}}))});var tt=jt(require("./TablePagination"));Object.keys(tt).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===tt[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return tt[t]}}))});var rt=jt(require("./TableRow"));Object.keys(rt).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===rt[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return rt[t]}}))});var ot=jt(require("./TableSortLabel"));Object.keys(ot).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ot[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ot[t]}}))});var nt=jt(require("./Tabs"));Object.keys(nt).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===nt[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return nt[t]}}))});var ut=jt(require("./TabScrollButton"));Object.keys(ut).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ut[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ut[t]}}))});var at=jt(require("./TextField"));Object.keys(at).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===at[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return at[t]}}))});var pt=jt(require("./TextareaAutosize"));Object.keys(pt).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===pt[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return pt[t]}}))});var ct=jt(require("./Toolbar"));Object.keys(ct).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ct[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ct[t]}}))});var it=jt(require("./Tooltip"));Object.keys(it).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===it[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return it[t]}}))});var lt=jt(require("./Typography"));Object.keys(lt).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===lt[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return lt[t]}}))});var ft=jt(require("./Unstable_TrapFocus"));Object.keys(ft).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===ft[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return ft[t]}}))});var st=jt(require("./useMediaQuery"));Object.keys(st).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===st[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return st[t]}}))});var bt=jt(require("./useScrollTrigger"));Object.keys(bt).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===bt[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return bt[t]}}))});var dt=jt(require("./withMobileDialog"));Object.keys(dt).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===dt[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return dt[t]}}))});var yt=jt(require("./withWidth"));Object.keys(yt).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===yt[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return yt[t]}}))});var Ot=jt(require("./Zoom"));function xt(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return xt=function(){return e},e}function jt(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=xt();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var u=o?Object.getOwnPropertyDescriptor(e,n):null;u&&(u.get||u.set)?Object.defineProperty(r,n,u):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}Object.keys(Ot).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||t in exports&&exports[t]===Ot[t]||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return Ot[t]}}))});
},{"./colors":"YrHg","./styles":"UUDD","./utils":"TtkM","./Accordion":"vMe9","./AccordionActions":"sbWD","./AccordionDetails":"QKcG","./AccordionSummary":"FLo1","./AppBar":"vztC","./Avatar":"NALm","./Backdrop":"iPmI","./Badge":"zSFR","./BottomNavigation":"Roco","./BottomNavigationAction":"F2hw","./Box":"VQeO","./Breadcrumbs":"vn4F","./Button":"uzLy","./ButtonBase":"VX66","./ButtonGroup":"TCPp","./Card":"Ws94","./CardActionArea":"Z0ud","./CardActions":"xvMz","./CardContent":"FWEV","./CardHeader":"PugE","./CardMedia":"Zbt6","./Checkbox":"HVXn","./Chip":"zfmF","./CircularProgress":"mb4G","./ClickAwayListener":"YjtO","./Collapse":"uPhD","./Container":"jygZ","./CssBaseline":"cmOJ","./Dialog":"zNDQ","./DialogActions":"dDut","./DialogContent":"lTXJ","./DialogContentText":"Gmh9","./DialogTitle":"Dg7a","./Divider":"pRXd","./Drawer":"vyf6","./ExpansionPanel":"VT0G","./ExpansionPanelActions":"qFdA","./ExpansionPanelDetails":"gInR","./ExpansionPanelSummary":"MGbU","./Fab":"ULTl","./Fade":"yr6S","./FilledInput":"wWb1","./FormControl":"eFUT","./FormControlLabel":"SR7c","./FormGroup":"QPPT","./FormHelperText":"iw6n","./FormLabel":"khD4","./Grid":"xZhg","./GridList":"IDL3","./GridListTile":"PY3v","./GridListTileBar":"B5WC","./Grow":"vuXQ","./Hidden":"Sxgj","./Icon":"YGXd","./IconButton":"e0Nd","./Input":"CaNl","./InputAdornment":"lydx","./InputBase":"UXeJ","./InputLabel":"pS8F","./LinearProgress":"knAy","./Link":"C9Eg","./List":"HMJ1","./ListItem":"vro7","./ListItemAvatar":"rot7","./ListItemIcon":"lJBu","./ListItemSecondaryAction":"CiZX","./ListItemText":"FcKO","./ListSubheader":"wSFK","./Menu":"AKYS","./MenuItem":"dYSc","./MenuList":"LIS1","./MobileStepper":"HvIv","./Modal":"IBPk","./NativeSelect":"S2QE","./NoSsr":"qvOT","./OutlinedInput":"Z2x8","./Paper":"mtQp","./Popover":"HEXW","./Popper":"PkJy","./Portal":"ZN8Z","./Radio":"BG1G","./RadioGroup":"k1RN","./RootRef":"IJ01","./Select":"NCwz","./Slide":"lCN9","./Slider":"v42q","./Snackbar":"gpsY","./SnackbarContent":"ECNl","./Step":"bhLS","./StepButton":"s0nP","./StepConnector":"wGYe","./StepContent":"JA1V","./StepIcon":"gJfS","./StepLabel":"tnFH","./Stepper":"i3xK","./SvgIcon":"R8TJ","./SwipeableDrawer":"zU4M","./Switch":"GFmN","./Tab":"DtdH","./Table":"Amxx","./TableBody":"cmi3","./TableCell":"lprt","./TableContainer":"qdnS","./TableFooter":"ZLWC","./TableHead":"BYgd","./TablePagination":"YhGx","./TableRow":"kIQr","./TableSortLabel":"Ptm9","./Tabs":"PzIu","./TabScrollButton":"LZng","./TextField":"JZs9","./TextareaAutosize":"bwIl","./Toolbar":"OGx2","./Tooltip":"FWNA","./Typography":"pi2F","./Unstable_TrapFocus":"LDYe","./useMediaQuery":"EWA0","./useScrollTrigger":"nQlU","./withMobileDialog":"xOow","./withWidth":"tyfK","./Zoom":"DTuf"}],"bJab":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("@material-ui/core/SvgIcon")),t=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}const a=r=>t.default.createElement(e.default,r,t.default.createElement("path",{d:"M12,2 C6.48,2 2,6.48 2,12 C2,17.52 6.48,22 12,22 C17.52,22 22,17.52 22,12 C22,6.48 17.52,2 12,2 Z M10,17 L5,12 L6.41,10.59 L10,14.17 L17.59,6.58 L19,8 L10,17 Z",id:"path-1"}));var u=a;exports.default=u;
},{"@material-ui/core/SvgIcon":"R8TJ","react":"n8MK"}],"b9OB":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.RunCodeButtonStatus=exports.MarginedBugIcon=exports.MarginedCheckCircle=exports.MarginedCircularProgress=exports.MarginedPlayIcon=void 0;var e=d(require("styled-components")),t=i(require("react")),r=d(require("prop-types")),n=d(require("@material-ui/core/Fab")),a=d(require("../icons/Play")),u=d(require("../icons/Bug")),o=require("@material-ui/core"),s=d(require("../icons/CheckCircle"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var u=n?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(r,a,u):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function d(e){return e&&e.__esModule?e:{default:e}}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const p=(0,e.default)(a.default)`
  margin-right: ${e=>e.theme.spacing()}px;
`;exports.MarginedPlayIcon=p;const f=(0,e.default)(o.CircularProgress)`
  margin-right: ${e=>e.theme.spacing()}px;
`;exports.MarginedCircularProgress=f;const g=(0,e.default)(s.default)`
  margin-right: ${e=>e.theme.spacing()}px;
`;exports.MarginedCheckCircle=g;const h=(0,e.default)(u.default)`
  margin-right: ${e=>e.theme.spacing()}px;
`;exports.MarginedBugIcon=h;const m=Object.freeze({normal:"normal",updating:"updating",error:"error",done:"done"});exports.RunCodeButtonStatus=m;class C extends t.Component{constructor(...e){super(...e),c(this,"shouldButtonBeDisabled",()=>{switch(this.props.runCodeButtonStatus.status){case m.error:case m.done:return!1;default:return!this.props.isCodeOnServerDifferent||this.props.runCodeButtonStatus.status===m.updating}})}shouldButtonBeClickable(){return!this.shouldButtonBeDisabled()||this.props.runCodeButtonStatus.status!==m.done||this.props.runCodeButtonStatus.status!==m.error}renderContent(e){switch(e){case m.normal:return t.default.createElement(t.default.Fragment,null,t.default.createElement(p,null),"Run Code");case m.updating:return t.default.createElement(t.default.Fragment,null,t.default.createElement(f,{color:"inherit",size:"24px"}),"Updating");case m.error:return t.default.createElement(t.default.Fragment,null,t.default.createElement(h,null),"Error!");case m.done:return t.default.createElement(t.default.Fragment,null,t.default.createElement(g,null),"Done")}}render(){return t.default.createElement(n.default,{color:"primary",className:this.props.className,disabled:this.shouldButtonBeDisabled(),"aria-label":"Run Code",variant:"extended",id:"post-code-button",onClick:this.shouldButtonBeClickable()?this.props.whenClicked:()=>{}},this.renderContent(this.props.runCodeButtonStatus.status))}}exports.default=C,c(C,"propTypes",{whenClicked:r.default.func,runCodeButtonStatus:r.default.shape({status:r.default.oneOf([m.normal,m.updating,m.error,m.done])}),isCodeOnServerDifferent:r.default.bool,className:r.default.string});
},{"styled-components":"tFSs","react":"n8MK","prop-types":"D9Od","@material-ui/core/Fab":"ULTl","../icons/Play":"oFSb","../icons/Bug":"j2yx","@material-ui/core":"dT3j","../icons/CheckCircle":"bJab"}],"NLqu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("redux"),t=o(require("./types")),r=require("../Game"),u=require("../AvatarWorker"),a=require("../../../components/RunCodeButton");function o(e){return e&&e.__esModule?e:{default:e}}const d=(e={},r)=>{switch(r.type){case t.default.GET_CODE_SUCCESS:return{...e,codeOnServer:r.payload.code,starterCode:r.payload.starterCode};case t.default.POST_CODE_REQUEST:return{...e,codeToBeSaved:r.payload.code};case t.default.POST_CODE_SUCCESS:return{...e,codeOnServer:e.codeToBeSaved,codeToBeSaved:null};case t.default.RESET_CODE:return{...e,resetCodeTo:e.starterCode};case t.default.CODE_RESET:return{...e,resetCodeTo:null};default:return e}},s=(e={},o)=>{switch(o.type){case t.default.POST_CODE_REQUEST:return{...e,status:a.RunCodeButtonStatus.updating};case u.avatarWorkerTypes.AVATAR_CODE_UPDATED:return{...e,status:a.RunCodeButtonStatus.done};case r.gameTypes.SOCKET_GAME_STATE_RECEIVED:return{...e,status:a.RunCodeButtonStatus.normal};default:return e}};var n=(0,e.combineReducers)({code:d,runCodeButton:s});exports.default=n;
},{"redux":"aVFJ","./types":"PjLo","../Game":"EAAz","../AvatarWorker":"XcZN","../../../components/RunCodeButton":"b9OB"}],"qMGm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./types"));function t(e){return e&&e.__esModule?e:{default:e}}const d=()=>({type:e.default.GET_CODE_REQUEST}),o=(t,d)=>({type:e.default.GET_CODE_SUCCESS,payload:{code:t,starterCode:d}}),a=t=>({type:e.default.POST_CODE_REQUEST,payload:{code:t}}),E=()=>({type:e.default.POST_CODE_SUCCESS}),u=()=>({type:e.default.AVATAR_CODE_UPDATED}),C=()=>({type:e.default.RESET_CODE}),p=()=>({type:e.default.CODE_RESET});var r={getCodeRequest:d,getCodeReceived:o,postCodeRequest:a,postCodeReceived:E,avatarCodeUpdated:u,resetCode:C,codeReset:p};exports.default=r;
},{"./types":"PjLo"}],"Vp9t":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=d(require("./actions")),o=require("../Analytics"),r=d(require("./types")),t=require("rxjs"),a=require("rxjs/operators"),p=require("redux-observable");function d(e){return e&&e.__esModule?e:{default:e}}const i=(o,d,{api:i})=>o.pipe((0,p.ofType)(r.default.GET_CODE_REQUEST),(0,a.mergeMap)(o=>i.get(`code/${d.value.game.connectionParameters.game_id}/`).pipe((0,a.map)(o=>e.default.getCodeReceived(o.code,o.starterCode)),(0,a.catchError)(e=>(0,t.of)({type:r.default.GET_CODE_FAILURE,payload:e.xhr.response,error:!0}))))),s=(o,d,{api:i})=>o.pipe((0,p.ofType)(r.default.POST_CODE_REQUEST),i.post(`/kurono/api/code/${d.value.game.connectionParameters.game_id}/`,e=>({code:e.payload.code})),(0,a.map)(()=>e.default.postCodeReceived()),(0,a.catchError)(e=>(0,t.of)({type:r.default.POST_CODE_FAILURE,payload:e.xhr.response,error:!0}))),c=e=>e.pipe((0,p.ofType)(r.default.POST_CODE_REQUEST),(0,a.mapTo)(o.actions.sendAnalyticsEvent("Kurono","Click","Run Code"))),u=e=>e.pipe((0,p.ofType)(r.default.RESET_CODE),(0,a.mapTo)(o.actions.sendAnalyticsEvent("Kurono","Click","Reset Code")));var n={getCodeEpic:i,postCodeEpic:s,postCodeAnalyticsEpic:c,resetCodeAnalyticsEpic:u};exports.default=n;
},{"./actions":"qMGm","../Analytics":"tGUC","./types":"PjLo","rxjs":"iRqj","rxjs/operators":"cVrl","redux-observable":"EOFz"}],"HJ0x":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"editorEpics",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"editorTypes",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"actions",{enumerable:!0,get:function(){return u.default}}),exports.default=void 0;var e=n(require("./reducers")),r=n(require("./epics")),t=n(require("./types")),u=n(require("./actions"));function n(e){return e&&e.__esModule?e:{default:e}}var o=e.default;exports.default=o;
},{"./reducers":"NLqu","./epics":"Vp9t","./types":"PjLo","./actions":"qMGm"}],"av7M":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const e="features/ConsoleLog/SOCKET_CONSOLE_LOG_RECEIVED",O="features/ConsoleLog/CLEAR_CONSOLE_LOGS";var E={SOCKET_CONSOLE_LOG_RECEIVED:e,CLEAR_CONSOLE_LOGS:O};exports.default=E;
},{}],"SSrD":[function(require,module,exports) {
"use strict";function e(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map(function(e){return"'"+e+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function t(e){return!!e&&!!e[Q]}function r(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof r&&Function.toString.call(r)===Z}(e)||Array.isArray(e)||!!e[L]||!!e.constructor[L]||s(e)||l(e))}function n(r){return t(r)||e(23,r),r[Q].t}function o(e,t,r){void 0===r&&(r=!1),0===i(e)?(r?Object.keys:ee)(e).forEach(function(n){r&&"symbol"==typeof n||t(n,e[n],e)}):e.forEach(function(r,n){return t(n,r,e)})}function i(e){var t=e[Q];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:s(e)?2:l(e)?3:0}function a(e,t){return 2===i(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return 2===i(e)?e.get(t):e[t]}function c(e,t,r){var n=i(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function s(e){return X&&e instanceof Map}function l(e){return q&&e instanceof Set}function p(e){return e.o||e.t}function h(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=te(e);delete t[Q];for(var r=ee(t),n=0;n<r.length;n++){var o=r[n],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function v(e,n){return void 0===n&&(n=!1),y(e)||t(e)||!r(e)?e:(i(e)>1&&(e.set=e.add=e.clear=e.delete=d),Object.freeze(e),n&&o(e,function(e,t){return v(t,!0)},!0),e)}function d(){e(2)}function y(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function b(t){var r=re[t];return r||e(18,t),r}function g(e,t){re[e]||(re[e]=t)}function m(){return J}function P(e,t){t&&(b("Patches"),e.u=[],e.s=[],e.v=t)}function O(e){x(e),e.p.forEach(j),e.p=null}function x(e){e===J&&(J=e.l)}function w(e){return J={p:[],l:J,h:e,m:!0,_:0}}function j(e){var t=e[Q];0===t.i||1===t.i?t.j():t.g=!0}function A(t,n){n._=n.p.length;var o=n.p[0],i=void 0!==t&&t!==o;return n.h.O||b("ES5").S(n,t,i),i?(o[Q].P&&(O(n),e(4)),r(t)&&(t=D(n,t),n.l||_(n,t)),n.u&&b("Patches").M(o[Q],t,n.u,n.s)):t=D(n,o,[]),O(n),n.u&&n.v(n.u,n.s),t!==H?t:void 0}function D(e,t,r){if(y(t))return t;var n=t[Q];if(!n)return o(t,function(o,i){return S(e,n,t,o,i,r)},!0),t;if(n.A!==e)return t;if(!n.P)return _(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=4===n.i||5===n.i?n.o=h(n.k):n.o;o(3===n.i?new Set(i):i,function(t,o){return S(e,n,i,t,o,r)}),_(e,i,!1),r&&e.u&&b("Patches").R(n,r,e.u,e.s)}return n.o}function S(e,n,o,i,u,f){if(t(u)){var s=D(e,u,f&&n&&3!==n.i&&!a(n.D,i)?f.concat(i):void 0);if(c(o,i,s),!t(s))return;e.m=!1}if(r(u)&&!y(u)){if(!e.h.F&&e._<1)return;D(e,u),n&&n.A.l||_(e,u)}}function _(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&v(t,r)}function k(e,t){var r=e[Q];return(r?p(r):e)[t]}function I(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function z(e){e.P||(e.P=!0,e.l&&z(e.l))}function E(e){e.o||(e.o=h(e.t))}function M(e,t,r){var n=s(t)?b("MapSet").N(t,r):l(t)?b("MapSet").T(t,r):e.O?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:m(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,i=ne;r&&(o=[n],i=oe);var a=Proxy.revocable(o,i),u=a.revoke,c=a.proxy;return n.k=c,n.j=u,c}(t,r):b("ES5").J(t,r);return(r?r.A:m()).p.push(n),n}function F(n){return t(n)||e(22,n),function e(t){if(!r(t))return t;var n,a=t[Q],f=i(t);if(a){if(!a.P&&(a.i<4||!b("ES5").K(a)))return a.t;a.I=!0,n=R(t,f),a.I=!1}else n=R(t,f);return o(n,function(t,r){a&&u(a.t,t)===r||c(n,t,e(r))}),3===f?new Set(n):n}(n)}function R(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return h(e)}function C(){function e(e,t){var r=u[e];return r?r.enumerable=t:u[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[Q];return ne.get(t,e)},set:function(t){var r=this[Q];ne.set(r,e,t)}},r}function r(e){for(var t=e.length-1;t>=0;t--){var r=e[t][Q];if(!r.P)switch(r.i){case 5:i(r)&&z(r);break;case 4:n(r)&&z(r)}}}function n(e){for(var t=e.t,r=e.k,n=ee(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==Q){var u=t[i];if(void 0===u&&!a(t,i))return!0;var c=r[i],s=c&&c[Q];if(s?s.t!==u:!f(c,u))return!0}}var l=!!t[Q];return n.length!==ee(t).length+(l?0:1)}function i(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!r||r.get)}var u={};g("ES5",{J:function(t,r){var n=Array.isArray(t),o=function(t,r){if(t){for(var n=Array(r.length),o=0;o<r.length;o++)Object.defineProperty(n,""+o,e(o,!0));return n}var i=te(r);delete i[Q];for(var a=ee(i),u=0;u<a.length;u++){var c=a[u];i[c]=e(c,t||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,t),i={i:n?5:4,A:r?r.A:m(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,Q,{value:i,writable:!0}),o},S:function(e,n,u){u?t(n)&&n[Q].A===e&&r(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[Q];if(r){var n=r.t,u=r.k,c=r.D,f=r.i;if(4===f)o(u,function(t){t!==Q&&(void 0!==n[t]||a(n,t)?c[t]||e(u[t]):(c[t]=!0,z(r)))}),o(n,function(e){void 0!==u[e]||a(u,e)||(c[e]=!1,z(r))});else if(5===f){if(i(r)&&(z(r),c.length=!0),u.length<n.length)for(var s=u.length;s<n.length;s++)c[s]=!1;else for(var l=n.length;l<u.length;l++)c[l]=!0;for(var p=Math.min(u.length,n.length),h=0;h<p;h++)void 0===c[h]&&e(u[h])}}}}(e.p[0]),r(e.p))},K:function(e){return 4===e.i?n(e):i(e)}})}function T(){function n(e){if(!r(e))return e;if(Array.isArray(e))return e.map(n);if(s(e))return new Map(Array.from(e.entries()).map(function(e){return[e[0],n(e[1])]}));if(l(e))return new Set(Array.from(e).map(n));var t=Object.create(Object.getPrototypeOf(e));for(var o in e)t[o]=n(e[o]);return t}function c(e){return t(e)?n(e):e}var f="add";g("Patches",{$:function(t,r){return r.forEach(function(r){for(var o=r.path,a=r.op,c=t,s=0;s<o.length-1;s++){var l=i(c),p=o[s];0!==l&&1!==l||"__proto__"!==p&&"constructor"!==p||e(24),"function"==typeof c&&"prototype"===p&&e(24),"object"!=typeof(c=u(c,p))&&e(15,o.join("/"))}var h=i(c),v=n(r.value),d=o[o.length-1];switch(a){case"replace":switch(h){case 2:return c.set(d,v);case 3:e(16);default:return c[d]=v}case f:switch(h){case 1:return c.splice(d,0,v);case 2:return c.set(d,v);case 3:return c.add(v);default:return c[d]=v}case"remove":switch(h){case 1:return c.splice(d,1);case 2:return c.delete(d);case 3:return c.delete(r.value);default:return delete c[d]}default:e(17,a)}}),t},R:function(e,t,r,n){switch(e.i){case 0:case 4:case 2:return function(e,t,r,n){var i=e.t,s=e.o;o(e.D,function(e,o){var l=u(i,e),p=u(s,e),h=o?a(i,e)?"replace":f:"remove";if(l!==p||"replace"!==h){var v=t.concat(e);r.push("remove"===h?{op:h,path:v}:{op:h,path:v,value:p}),n.push(h===f?{op:"remove",path:v}:"remove"===h?{op:f,path:v,value:c(l)}:{op:"replace",path:v,value:c(l)})}})}(e,t,r,n);case 5:case 1:return function(e,t,r,n){var o=e.t,i=e.D,a=e.o;if(a.length<o.length){var u=[a,o];o=u[0],a=u[1];var s=[n,r];r=s[0],n=s[1]}for(var l=0;l<o.length;l++)if(i[l]&&a[l]!==o[l]){var p=t.concat([l]);r.push({op:"replace",path:p,value:c(a[l])}),n.push({op:"replace",path:p,value:c(o[l])})}for(var h=o.length;h<a.length;h++){var v=t.concat([h]);r.push({op:f,path:v,value:c(a[h])})}o.length<a.length&&n.push({op:"replace",path:t.concat(["length"]),value:o.length})}(e,t,r,n);case 3:return function(e,t,r,n){var o=e.t,i=e.o,a=0;o.forEach(function(e){if(!i.has(e)){var o=t.concat([a]);r.push({op:"remove",path:o,value:e}),n.unshift({op:f,path:o,value:e})}a++}),a=0,i.forEach(function(e){if(!o.has(e)){var i=t.concat([a]);r.push({op:f,path:i,value:e}),n.unshift({op:"remove",path:i,value:e})}a++})}(e,t,r,n)}},M:function(e,t,r,n){r.push({op:"replace",path:[],value:t}),n.push({op:"replace",path:[],value:e.t})}})}function K(){function t(e,t){function r(){this.constructor=e}u(e,t),e.prototype=(r.prototype=t.prototype,new r)}function n(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function i(e){e.o||(e.o=new Set,e.t.forEach(function(t){if(r(t)){var n=M(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)}))}function a(t){t.g&&e(3,JSON.stringify(p(t)))}var u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},c=function(){function e(e,t){return this[Q]={i:2,l:t,A:t?t.A:m(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,g:!1},this}t(e,Map);var i=e.prototype;return Object.defineProperty(i,"size",{get:function(){return p(this[Q]).size}}),i.has=function(e){return p(this[Q]).has(e)},i.set=function(e,t){var r=this[Q];return a(r),p(r).has(e)&&p(r).get(e)===t||(n(r),z(r),r.D.set(e,!0),r.o.set(e,t),r.D.set(e,!0)),this},i.delete=function(e){if(!this.has(e))return!1;var t=this[Q];return a(t),n(t),z(t),t.D.set(e,!1),t.o.delete(e),!0},i.clear=function(){var e=this[Q];a(e),p(e).size&&(n(e),z(e),e.D=new Map,o(e.t,function(t){e.D.set(t,!1)}),e.o.clear())},i.forEach=function(e,t){var r=this;p(this[Q]).forEach(function(n,o){e.call(t,r.get(o),o,r)})},i.get=function(e){var t=this[Q];a(t);var o=p(t).get(e);if(t.I||!r(o))return o;if(o!==t.t.get(e))return o;var i=M(t.A.h,o,t);return n(t),t.o.set(e,i),i},i.keys=function(){return p(this[Q]).keys()},i.values=function(){var e,t=this,r=this.keys();return(e={})[V]=function(){return t.values()},e.next=function(){var e=r.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},i.entries=function(){var e,t=this,r=this.keys();return(e={})[V]=function(){return t.entries()},e.next=function(){var e=r.next();if(e.done)return e;var n=t.get(e.value);return{done:!1,value:[e.value,n]}},e},i[V]=function(){return this.entries()},e}(),f=function(){function e(e,t){return this[Q]={i:3,l:t,A:t?t.A:m(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,g:!1,C:!1},this}t(e,Set);var r=e.prototype;return Object.defineProperty(r,"size",{get:function(){return p(this[Q]).size}}),r.has=function(e){var t=this[Q];return a(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},r.add=function(e){var t=this[Q];return a(t),this.has(e)||(i(t),z(t),t.o.add(e)),this},r.delete=function(e){if(!this.has(e))return!1;var t=this[Q];return a(t),i(t),z(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},r.clear=function(){var e=this[Q];a(e),p(e).size&&(i(e),z(e),e.o.clear())},r.values=function(){var e=this[Q];return a(e),i(e),e.o.values()},r.entries=function(){var e=this[Q];return a(e),i(e),e.o.entries()},r.keys=function(){return this.values()},r[V]=function(){return this.values()},r.forEach=function(e,t){for(var r=this.values(),n=r.next();!n.done;)e.call(t,n.value,n.value,this),n=r.next()},e}();g("MapSet",{N:function(e,t){return new c(e,t)},T:function(e,t){return new f(e,t)}})}function U(){C(),K(),T()}function W(e){return e}function N(e){return e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.castDraft=W,exports.castImmutable=N,exports.current=F,exports.enableAllPlugins=U,exports.enableES5=C,exports.enableMapSet=K,exports.enablePatches=T,exports.freeze=v,exports.isDraft=t,exports.isDraftable=r,exports.original=n,exports.setUseProxies=exports.setAutoFreeze=exports.produceWithPatches=exports.produce=exports.nothing=exports.immerable=exports.finishDraft=exports.createDraft=exports.applyPatches=exports.Immer=exports.default=void 0;var $,J,G="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=G?Symbol.for("immer-nothing"):(($={})["immer-nothing"]=!0,$),L=G?Symbol.for("immer-draftable"):"__$immer_draftable",Q=G?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,ee="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,te=Object.getOwnPropertyDescriptors||function(e){var t={};return ee(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},re={},ne={get:function(e,t){if(t===Q)return e;var n=p(e);if(!a(n,t))return function(e,t,r){var n,o=I(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,n,t);var o=n[t];return e.I||!r(o)?o:o===k(e.t,t)?(E(e),e.o[t]=M(e.A.h,o,e)):o},has:function(e,t){return t in p(e)},ownKeys:function(e){return Reflect.ownKeys(p(e))},set:function(e,t,r){var n=I(p(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=k(p(e),t),i=null==o?void 0:o[Q];if(i&&i.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(f(r,o)&&(void 0!==r||a(e.t,t)))return!0;E(e),z(e)}return e.o[t]===r&&"number"!=typeof r||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==k(e.t,t)||t in e.t?(e.D[t]=!1,E(e),z(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=p(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){e(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){e(12)}},oe={};exports.immerable=L,exports.nothing=H,o(ne,function(e,t){oe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),oe.deleteProperty=function(e,t){return ne.deleteProperty.call(this,e[0],t)},oe.set=function(e,t,r){return ne.set.call(this,e[0],t,r,e[0])};var ie=function(){function n(t){var n=this;this.O=B,this.F=!0,this.produce=function(t,o,i){if("function"==typeof t&&"function"!=typeof o){var a=o;o=t;var u=n;return function(e){var t=this;void 0===e&&(e=a);for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return u.produce(e,function(e){var r;return(r=o).call.apply(r,[t,e].concat(n))})}}var c;if("function"!=typeof o&&e(6),void 0!==i&&"function"!=typeof i&&e(7),r(t)){var f=w(n),s=M(n,t,void 0),l=!0;try{c=o(s),l=!1}finally{l?O(f):x(f)}return"undefined"!=typeof Promise&&c instanceof Promise?c.then(function(e){return P(f,i),A(e,f)},function(e){throw O(f),e}):(P(f,i),A(c,f))}if(!t||"object"!=typeof t){if((c=o(t))===H)return;return void 0===c&&(c=t),n.F&&v(c,!0),c}e(21,t)},this.produceWithPatches=function(e,t){return"function"==typeof e?function(t){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n.produceWithPatches(t,function(t){return e.apply(void 0,[t].concat(o))})}:[n.produce(e,t,function(e,t){r=e,o=t}),r,o];var r,o},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var o=n.prototype;return o.createDraft=function(n){r(n)||e(8),t(n)&&(n=F(n));var o=w(this),i=M(this,n,void 0);return i[Q].C=!0,x(o),i},o.finishDraft=function(e,t){var r=e&&e[Q],n=r.A;return P(n,t),A(void 0,n)},o.setAutoFreeze=function(e){this.F=e},o.setUseProxies=function(t){t&&!B&&e(20),this.O=t},o.applyPatches=function(e,r){var n;for(n=r.length-1;n>=0;n--){var o=r[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}var i=b("Patches").$;return t(e)?i(e,r):this.produce(e,function(e){return i(e,r.slice(n+1))})},n}(),ae=new ie,ue=ae.produce,ce=ae.produceWithPatches.bind(ae),fe=ae.setAutoFreeze.bind(ae),se=ae.setUseProxies.bind(ae),le=ae.applyPatches.bind(ae),pe=ae.createDraft.bind(ae),he=ae.finishDraft.bind(ae);exports.finishDraft=he,exports.createDraft=pe,exports.applyPatches=le,exports.setUseProxies=se,exports.setAutoFreeze=fe,exports.produceWithPatches=ce,exports.produce=ue,exports.Immer=ie;var ve=ue;exports.default=ve;
},{}],"BYQ5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.MAX_NUMBER_OF_STORED_LOGS=void 0;var e=o(require("./types")),r=require("../AvatarWorker"),t=require("../Game"),a=o(require("immer"));function o(e){return e&&e.__esModule?e:{default:e}}const s=600;function u(e,r){return r&&e?[e,r].join("\n"):r||(e||void 0)}exports.MAX_NUMBER_OF_STORED_LOGS=600;const n=(o={logs:new Map,gameLog:""},s)=>{switch(s.type){case t.gameTypes.SOCKET_GAME_STATE_RECEIVED:return{...o,gameLog:s.payload.gameState.playerLog};case r.avatarWorkerTypes.AVATAR_CODE_UPDATED:case r.avatarWorkerTypes.AVATARS_NEXT_ACTION_COMPUTED:{const e=o.gameLog,r=s.payload.turnCount,t=u(s.payload.log,e);return t?(0,a.default)(o,e=>{const a=e.logs;a.set(r,t),a.size>600&&a.delete(a.keys().next().value)}):o}case e.default.CLEAR_CONSOLE_LOGS:return{...o,logs:new Map};default:return o}};var _=n;exports.default=_;
},{"./types":"av7M","../AvatarWorker":"XcZN","../Game":"EAAz","immer":"SSrD"}],"LiMa":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./types"));function t(e){return e&&e.__esModule?e:{default:e}}const o=t=>({type:e.default.SOCKET_CONSOLE_LOG_RECEIVED,payload:{log:t}}),l=()=>({type:e.default.CLEAR_CONSOLE_LOGS});var r={socketConsoleLogReceived:o,clearConsoleLogs:l};exports.default=r;
},{"./types":"av7M"}],"GD6G":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"consoleLogTypes",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"actions",{enumerable:!0,get:function(){return t.default}}),exports.default=void 0;var e=u(require("./reducers")),r=u(require("./types")),t=u(require("./actions"));function u(e){return e&&e.__esModule?e:{default:e}}var o=e.default;exports.default=o;
},{"./reducers":"BYQ5","./types":"av7M","./actions":"LiMa"}],"w05k":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rootReducer=exports.rootEpic=void 0;var e=require("redux"),r=require("redux-observable"),t=l(require("./AvatarWorker/reducers")),o=require("./Analytics"),u=s(require("./Editor")),a=l(require("./ConsoleLog")),i=s(require("./Game")),c=s(require("./AvatarWorker"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(t,u,a):t[u]=e[u]}return t.default=e,r&&r.set(e,t),t}function l(e){return e&&e.__esModule?e:{default:e}}const p=(0,r.combineEpics)(...Object.values(u.editorEpics),...Object.values(i.gameEpics),...Object.values(o.analyticEpics),...Object.values(c.avatarWorkerEpics));exports.rootEpic=p;const f=(0,e.combineReducers)({editor:u.default,game:i.default,consoleLog:a.default,action:t.default,avatarWorker:c.default});exports.rootReducer=f;
},{"redux":"aVFJ","redux-observable":"EOFz","./AvatarWorker/reducers":"eLOZ","./Analytics":"tGUC","./Editor":"HJ0x","./ConsoleLog":"GD6G","./Game":"EAAz","./AvatarWorker":"XcZN"}],"YNwZ":[function(require,module,exports) {
var global = arguments[3];
var o=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.root=void 0;var e="undefined"!=typeof window&&window,n="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,r=void 0!==o&&o,t=e||r||n;exports.root=t,function(){if(!t)throw new Error("RxJS could not find any global context (window, self, global)")}();
},{}],"Tx2C":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ajaxGet=p,exports.ajaxPost=c,exports.ajaxDelete=h,exports.ajaxPut=f,exports.ajaxPatch=b,exports.ajaxGetJSON=y,exports.AjaxTimeoutError=exports.AjaxError=exports.AjaxResponse=exports.AjaxSubscriber=exports.AjaxObservable=void 0;var e=i(require("tslib")),r=require("../../util/root"),t=require("../../Observable"),s=require("../../Subscriber"),o=require("../../operators/map");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n();if(r&&r.has(e))return r.get(e);var t={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=s?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(t,o,i):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function u(){if(r.root.XMLHttpRequest)return new r.root.XMLHttpRequest;if(r.root.XDomainRequest)return new r.root.XDomainRequest;throw new Error("CORS is not supported by your browser")}function a(){if(r.root.XMLHttpRequest)return new r.root.XMLHttpRequest;var e=void 0;try{for(var t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],s=0;s<3;s++)try{if(e=t[s],new r.root.ActiveXObject(e))break}catch(o){}return new r.root.ActiveXObject(e)}catch(o){throw new Error("XMLHttpRequest is not supported by your browser")}}function p(e,r){return void 0===r&&(r=null),new l({method:"GET",url:e,headers:r})}function c(e,r,t){return new l({method:"POST",url:e,body:r,headers:t})}function h(e,r){return new l({method:"DELETE",url:e,headers:r})}function f(e,r,t){return new l({method:"PUT",url:e,body:r,headers:t})}function b(e,r,t){return new l({method:"PATCH",url:e,body:r,headers:t})}var d=(0,o.map)(function(e,r){return e.response});function y(e,r){return d(new l({method:"GET",url:e,responseType:"json",headers:r}))}var l=function(r){function t(e){var t=r.call(this)||this,s={async:!0,createXHR:function(){return this.crossDomain?u():a()},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"==typeof e)s.url=e;else for(var o in e)e.hasOwnProperty(o)&&(s[o]=e[o]);return t.request=s,t}var s;return e.__extends(t,r),t.prototype._subscribe=function(e){return new x(e,this.request)},t.create=((s=function(e){return new t(e)}).get=p,s.post=c,s.delete=h,s.put=f,s.patch=b,s.getJSON=y,s),t}(t.Observable);exports.AjaxObservable=l;var x=function(t){function s(e,s){var o=t.call(this,e)||this;o.request=s,o.done=!1;var n=s.headers=s.headers||{};return s.crossDomain||o.getHeader(n,"X-Requested-With")||(n["X-Requested-With"]="XMLHttpRequest"),o.getHeader(n,"Content-Type")||r.root.FormData&&s.body instanceof r.root.FormData||void 0===s.body||(n["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),s.body=o.serializeBody(s.body,o.getHeader(s.headers,"Content-Type")),o.send(),o}return e.__extends(s,t),s.prototype.next=function(e){this.done=!0;var r,t=this.xhr,s=this.request,o=this.destination;try{r=new v(e,t,s)}catch(n){return o.error(n)}o.next(r)},s.prototype.send=function(){var e=this.request,r=this.request,t=r.user,s=r.method,o=r.url,n=r.async,i=r.password,u=r.headers,a=r.body;try{var p=this.xhr=e.createXHR();this.setupEvents(p,e),t?p.open(s,o,n,t,i):p.open(s,o,n),n&&(p.timeout=e.timeout,p.responseType=e.responseType),"withCredentials"in p&&(p.withCredentials=!!e.withCredentials),this.setHeaders(p,u),a?p.send(a):p.send()}catch(c){this.error(c)}},s.prototype.serializeBody=function(e,t){if(!e||"string"==typeof e)return e;if(r.root.FormData&&e instanceof r.root.FormData)return e;if(t){var s=t.indexOf(";");-1!==s&&(t=t.substring(0,s))}switch(t){case"application/x-www-form-urlencoded":return Object.keys(e).map(function(r){return encodeURIComponent(r)+"="+encodeURIComponent(e[r])}).join("&");case"application/json":return JSON.stringify(e);default:return e}},s.prototype.setHeaders=function(e,r){for(var t in r)r.hasOwnProperty(t)&&e.setRequestHeader(t,r[t])},s.prototype.getHeader=function(e,r){for(var t in e)if(t.toLowerCase()===r.toLowerCase())return e[t]},s.prototype.setupEvents=function(e,t){var s=t.progressSubscriber;function o(e){var r,t=o,s=t.subscriber,n=t.progressSubscriber,i=t.request;n&&n.error(e);try{r=new g(this,i)}catch(u){r=u}s.error(r)}if(e.ontimeout=o,o.request=t,o.subscriber=this,o.progressSubscriber=s,e.upload&&"withCredentials"in e){var n,i;if(s)n=function(e){n.progressSubscriber.next(e)},r.root.XDomainRequest?e.onprogress=n:e.upload.onprogress=n,n.progressSubscriber=s;i=function(e){var r,t=i,s=t.progressSubscriber,o=t.subscriber,n=t.request;s&&s.error(e);try{r=new m("ajax error",this,n)}catch(u){r=u}o.error(r)},e.onerror=i,i.request=t,i.subscriber=this,i.progressSubscriber=s}function u(e){}function a(e){var r=a,t=r.subscriber,s=r.progressSubscriber,o=r.request;if(4===this.readyState){var n=1223===this.status?204:this.status,i="text"===this.responseType?this.response||this.responseText:this.response;if(0===n&&(n=i?200:0),n<400)s&&s.complete(),t.next(e),t.complete();else{s&&s.error(e);var u=void 0;try{u=new m("ajax error "+n,this,o)}catch(p){u=p}t.error(u)}}}e.onreadystatechange=u,u.subscriber=this,u.progressSubscriber=s,u.request=t,e.onload=a,a.subscriber=this,a.progressSubscriber=s,a.request=t},s.prototype.unsubscribe=function(){var e=this.done,r=this.xhr;!e&&r&&4!==r.readyState&&"function"==typeof r.abort&&r.abort(),t.prototype.unsubscribe.call(this)},s}(s.Subscriber);exports.AjaxSubscriber=x;var v=function(){return function(e,r,t){this.originalEvent=e,this.xhr=r,this.request=t,this.status=r.status,this.responseType=r.responseType||t.responseType,this.response=j(this.responseType,r)}}();exports.AjaxResponse=v;var w=function(){function e(e,r,t){return Error.call(this),this.message=e,this.name="AjaxError",this.xhr=r,this.request=t,this.status=r.status,this.responseType=r.responseType||t.responseType,this.response=j(this.responseType,r),this}return e.prototype=Object.create(Error.prototype),e}(),m=w;function T(e){return"response"in e?e.responseType?e.response:JSON.parse(e.response||e.responseText||"null"):JSON.parse(e.responseText||"null")}function j(e,r){switch(e){case"json":return T(r);case"xml":return r.responseXML;case"text":default:return"response"in r?r.response:r.responseText}}function q(e,r){return m.call(this,"ajax timeout",e,r),this.name="AjaxTimeoutError",this}exports.AjaxError=m;var g=q;exports.AjaxTimeoutError=g;
},{"tslib":"vCxL","../../util/root":"YNwZ","../../Observable":"wbSE","../../Subscriber":"RaFB","../../operators/map":"dNh5"}],"odEc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ajax=void 0;var e=require("./AjaxObservable"),r=function(){return e.AjaxObservable.create}();exports.ajax=r;
},{"./AjaxObservable":"Tx2C"}],"qSqr":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ajax",{enumerable:!0,get:function(){return e.ajax}}),Object.defineProperty(exports,"AjaxResponse",{enumerable:!0,get:function(){return r.AjaxResponse}}),Object.defineProperty(exports,"AjaxError",{enumerable:!0,get:function(){return r.AjaxError}}),Object.defineProperty(exports,"AjaxTimeoutError",{enumerable:!0,get:function(){return r.AjaxTimeoutError}});var e=require("../internal/observable/dom/ajax"),r=require("../internal/observable/dom/AjaxObservable");
},{"../internal/observable/dom/ajax":"odEc","../internal/observable/dom/AjaxObservable":"Tx2C"}],"PhdE":[function(require,module,exports) {
var define;
var e;!function(n){var t;if("function"==typeof e&&e.amd&&(e(n),t=!0),"object"==typeof exports&&(module.exports=n(),t=!0),!t){var o=window.Cookies,r=window.Cookies=n();r.noConflict=function(){return window.Cookies=o,r}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var t=arguments[e];for(var o in t)n[o]=t[o]}return n}function n(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function t(o){function r(){}function i(n,t,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},r.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var c=JSON.stringify(t);/^[\{\[]/.test(c)&&(t=c)}catch(a){}t=o.write?o.write(t,n):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var f="";for(var u in i)i[u]&&(f+="; "+u,!0!==i[u]&&(f+="="+i[u].split(";")[0]));return document.cookie=n+"="+t+f}}function c(e,t){if("undefined"!=typeof document){for(var r={},i=document.cookie?document.cookie.split("; "):[],c=0;c<i.length;c++){var f=i[c].split("="),u=f.slice(1).join("=");t||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var a=n(f[0]);if(u=(o.read||o)(u,a)||n(u),t)try{u=JSON.parse(u)}catch(p){}if(r[a]=u,e===a)break}catch(p){}}return e?r[e]:r}}return r.set=i,r.get=function(e){return c(e,!1)},r.getJSON=function(e){return c(e,!0)},r.remove=function(n,t){i(n,"",e(t,{expires:-1}))},r.defaults={},r.withConverter=t,r}(function(){})});
},{}],"B2K4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("rxjs/ajax"),r=require("rxjs"),t=require("rxjs/operators"),o=s(require("js-cookie"));function s(e){return e&&e.__esModule?e:{default:e}}const a=e=>e.pipe((0,t.map)(e=>({csrfToken:o.default.get("csrftoken"),action:e}))),i=(r,o)=>s=>s.pipe((0,t.mergeMap)(({csrfToken:t,action:s})=>e.ajax.post(r,o(s),{withCredentials:!0,"X-CSRFToken":t}))),p=(e,t)=>(0,r.pipe)(a,i(e,t));var u=p;exports.default=u;
},{"rxjs/ajax":"qSqr","rxjs":"iRqj","rxjs/operators":"cVrl","js-cookie":"PhdE"}],"y3gS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.API_PATH=void 0;const e="/kurono/api/";exports.API_PATH=e;
},{}],"QeOr":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("rxjs/ajax"),t=require("./constants");const r=r=>e.ajax.getJSON(`${t.API_PATH}${r}`,{withCredentials:!0});var a=r;exports.default=a;
},{"rxjs/ajax":"qSqr","./constants":"y3gS"}],"imeZ":[function(require,module,exports) {
var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function t(r,e){var t=e.replace(/\/{2,9}/g,"/").split("/");return"/"!=e.substr(0,1)&&0!==e.length||t.splice(0,1),"/"==e.substr(e.length-1,1)&&t.splice(t.length-1,1),t}function s(r,e){var t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,e,s){e&&(t[e]=s)}),t}module.exports=function(u){var a=u,n=u.indexOf("["),o=u.indexOf("]");-1!=n&&-1!=o&&(u=u.substring(0,n)+u.substring(n,o).replace(/:/g,";")+u.substring(o,u.length));for(var i=r.exec(u||""),p={},c=14;c--;)p[e[c]]=i[c]||"";return-1!=n&&-1!=o&&(p.source=a,p.host=p.host.substring(1,p.host.length-1).replace(/;/g,":"),p.authority=p.authority.replace("[","").replace("]","").replace(/;/g,":"),p.ipv6uri=!0),p.pathNames=t(p,p.path),p.queryKey=s(p,p.query),p};
},{}],"NC0g":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.url=void 0;const t=require("parseuri"),o=require("debug")("socket.io-client:url");function r(r,e="",s){let p=r;s=s||"undefined"!=typeof location&&location,null==r&&(r=s.protocol+"//"+s.host),"string"==typeof r&&("/"===r.charAt(0)&&(r="/"===r.charAt(1)?s.protocol+r:s.host+r),/^(https?|wss?):\/\//.test(r)||(o("protocol-less url %s",r),r=void 0!==s?s.protocol+"//"+r:"https://"+r),o("parse %s",r),p=t(r)),p.port||(/^(http|ws)$/.test(p.protocol)?p.port="80":/^(http|ws)s$/.test(p.protocol)&&(p.port="443")),p.path=p.path||"/";const l=-1!==p.host.indexOf(":")?"["+p.host+"]":p.host;return p.id=p.protocol+"://"+l+":"+p.port+e,p.href=p.protocol+"://"+l+(s&&s.port===p.port?"":":"+p.port),p}exports.url=r;
},{"parseuri":"imeZ","debug":"jcLW"}],"mYnU":[function(require,module,exports) {
try{module.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){module.exports=!1}
},{}],"ViVL":[function(require,module,exports) {
module.exports=(()=>"undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")())();
},{}],"cVUh":[function(require,module,exports) {
const e=require("has-cors"),t=require("./globalThis");module.exports=function(n){const c=n.xdomain,o=n.xscheme,r=n.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!c||e))return new XMLHttpRequest}catch(i){}try{if("undefined"!=typeof XDomainRequest&&!o&&r)return new XDomainRequest}catch(i){}if(!c)try{return new(t[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(i){}};
},{"has-cors":"mYnU","./globalThis":"ViVL"}],"MMLY":[function(require,module,exports) {
const e=Object.create(null);e.open="0",e.close="1",e.ping="2",e.pong="3",e.message="4",e.upgrade="5",e.noop="6";const o=Object.create(null);Object.keys(e).forEach(r=>{o[e[r]]=r});const r={type:"error",data:"parser error"};module.exports={PACKET_TYPES:e,PACKET_TYPES_REVERSE:o,ERROR_PACKET:r};
},{}],"UafP":[function(require,module,exports) {
const{PACKET_TYPES:e}=require("./commons"),o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),r="function"==typeof ArrayBuffer,t=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,f=({type:f,data:a},u,i)=>o&&a instanceof Blob?u?i(a):n(a,i):r&&(a instanceof ArrayBuffer||t(a))?u?i(a instanceof ArrayBuffer?a:a.buffer):n(new Blob([a]),i):i(e[f]+(a||"")),n=(e,o)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];o("b"+e)},r.readAsDataURL(e)};module.exports=f;
},{"./commons":"MMLY"}],"vLJO":[function(require,module,exports) {
!function(n){"use strict";exports.encode=function(e){var r,t=new Uint8Array(e),i=t.length,f="";for(r=0;r<i;r+=3)f+=n[t[r]>>2],f+=n[(3&t[r])<<4|t[r+1]>>4],f+=n[(15&t[r+1])<<2|t[r+2]>>6],f+=n[63&t[r+2]];return i%3==2?f=f.substring(0,f.length-1)+"=":i%3==1&&(f=f.substring(0,f.length-2)+"=="),f},exports.decode=function(e){var r,t,i,f,g,o=.75*e.length,u=e.length,s=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var d=new ArrayBuffer(o),h=new Uint8Array(d);for(r=0;r<u;r+=4)t=n.indexOf(e[r]),i=n.indexOf(e[r+1]),f=n.indexOf(e[r+2]),g=n.indexOf(e[r+3]),h[s++]=t<<2|i>>4,h[s++]=(15&i)<<4|f>>2,h[s++]=(3&f)<<6|63&g;return d}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
},{}],"BVy5":[function(require,module,exports) {
const{PACKET_TYPES_REVERSE:e,ERROR_PACKET:r}=require("./commons"),t="function"==typeof ArrayBuffer;let a;t&&(a=require("base64-arraybuffer"));const s=(t,a)=>{if("string"!=typeof t)return{type:"message",data:u(t,a)};const s=t.charAt(0);return"b"===s?{type:"message",data:n(t.substring(1),a)}:e[s]?t.length>1?{type:e[s],data:t.substring(1)}:{type:e[s]}:r},n=(e,r)=>{if(a){const t=a.decode(e);return u(t,r)}return{base64:!0,data:e}},u=(e,r)=>{switch(r){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}};module.exports=s;
},{"./commons":"MMLY","base64-arraybuffer":"vLJO"}],"fAXJ":[function(require,module,exports) {
const e=require("./encodePacket"),o=require("./decodePacket"),r=String.fromCharCode(30),t=(o,t)=>{const c=o.length,d=new Array(c);let n=0;o.forEach((o,a)=>{e(o,!1,e=>{d[a]=e,++n===c&&t(d.join(r))})})},c=(e,t)=>{const c=e.split(r),d=[];for(let r=0;r<c.length;r++){const e=o(c[r],t);if(d.push(e),"error"===e.type)break}return d};module.exports={protocol:4,encodePacket:e,encodePayload:t,decodePacket:o,decodePayload:c};
},{"./encodePacket":"UafP","./decodePacket":"BVy5"}],"Wr69":[function(require,module,exports) {
function t(t){if(t)return e(t)}function e(e){for(var s in t.prototype)e[s]=t.prototype[s];return e}"undefined"!=typeof module&&(module.exports=t),t.prototype.on=t.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},t.prototype.once=function(t,e){function s(){this.off(t,s),e.apply(this,arguments)}return s.fn=e,this.on(t,s),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((s=r[i])===e||s.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},t.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),s=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(s){r=0;for(var i=(s=s.slice(0)).length;r<i;++r)s[r].apply(this,e)}return this},t.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},t.prototype.hasListeners=function(t){return!!this.listeners(t).length};
},{}],"HBl9":[function(require,module,exports) {
const e=require("engine.io-parser"),t=require("component-emitter"),s=require("debug")("engine.io-client:transport");class r extends t{constructor(e){super(),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t){const s=new Error(e);return s.type="TransportError",s.description=t,this.emit("error",s),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):s("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,this.emit("open")}onData(t){const s=e.decodePacket(t,this.socket.binaryType);this.onPacket(s)}onPacket(e){this.emit("packet",e)}onClose(){this.readyState="closed",this.emit("close")}}module.exports=r;
},{"engine.io-parser":"fAXJ","component-emitter":"Wr69","debug":"jcLW"}],"vs2a":[function(require,module,exports) {
exports.encode=function(e){var n="";for(var o in e)e.hasOwnProperty(o)&&(n.length&&(n+="&"),n+=encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return n},exports.decode=function(e){for(var n={},o=e.split("&"),t=0,r=o.length;t<r;t++){var d=o[t].split("=");n[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return n};
},{}],"t9Jt":[function(require,module,exports) {
"use strict";var r,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),t=64,n={},o=0,u=0;function a(r){var n="";do{n=e[r%t]+n,r=Math.floor(r/t)}while(r>0);return n}function c(r){var e=0;for(u=0;u<r.length;u++)e=e*t+n[r.charAt(u)];return e}function f(){var e=a(+new Date);return e!==r?(o=0,r=e):e+"."+a(o++)}for(;u<t;u++)n[e[u]]=u;f.encode=a,f.decode=c,module.exports=f;
},{}],"hsm0":[function(require,module,exports) {
const t=require("../transport"),e=require("parseqs"),i=require("engine.io-parser"),s=require("yeast"),o=require("debug")("engine.io-client:polling");class n extends t{get name(){return"polling"}doOpen(){this.poll()}pause(t){const e=this;function i(){o("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){let t=0;this.polling&&(o("we are currently polling - waiting to pause"),t++,this.once("pollComplete",function(){o("pre-pause polling complete"),--t||i()})),this.writable||(o("we are currently writing - waiting to pause"),t++,this.once("drain",function(){o("pre-pause writing complete"),--t||i()}))}else i()}poll(){o("polling"),this.polling=!0,this.doPoll(),this.emit("poll")}onData(t){const e=this;o("polling got data %s",t);i.decodePayload(t,this.socket.binaryType).forEach(function(t,i,s){if("opening"===e.readyState&&"open"===t.type&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():o('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=this;function e(){o("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(o("transport open - closing"),e()):(o("transport not open - deferring close"),this.once("open",e))}write(t){this.writable=!1,i.encodePayload(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emit("drain")})})}uri(){let t=this.query||{};const i=this.opts.secure?"https":"http";let o="";return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=s()),this.supportsBinary||t.sid||(t.b64=1),t=e.encode(t),this.opts.port&&("https"===i&&443!==Number(this.opts.port)||"http"===i&&80!==Number(this.opts.port))&&(o=":"+this.opts.port),t.length&&(t="?"+t),i+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+o+this.opts.path+t}}module.exports=n;
},{"../transport":"HBl9","parseqs":"vs2a","engine.io-parser":"fAXJ","yeast":"t9Jt","debug":"jcLW"}],"k9hq":[function(require,module,exports) {
module.exports.pick=((e,...r)=>r.reduce((r,o)=>(e.hasOwnProperty(o)&&(r[o]=e[o]),r),{}));
},{}],"tzUF":[function(require,module,exports) {
const t=require("../../contrib/xmlhttprequest-ssl/XMLHttpRequest"),e=require("./polling"),s=require("component-emitter"),{pick:o}=require("../util"),r=require("../globalThis"),n=require("debug")("engine.io-client:polling-xhr");function i(){}const a=null!=new t({xdomain:!1}).responseType;class h extends e{constructor(t){if(super(t),"undefined"!=typeof location){const e="https:"===location.protocol;let s=location.port;s||(s=e?443:80),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||s!==t.port,this.xs=t.secure!==e}const e=t&&t.forceBase64;this.supportsBinary=a&&!e}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new u(this.uri(),t)}doWrite(t,e){const s=this.request({method:"POST",data:t}),o=this;s.on("success",e),s.on("error",function(t){o.onError("xhr post error",t)})}doPoll(){n("xhr poll");const t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t}}class u extends s{constructor(t,e){super(),this.opts=e,this.method=e.method||"GET",this.uri=t,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.create()}create(){const e=o(this.opts,"agent","enablesXDR","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const s=this.xhr=new t(e),r=this;try{n("xhr open %s: %s",this.method,this.uri),s.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&s.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(i){}if("POST"===this.method)try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(i){}try{s.setRequestHeader("Accept","*/*")}catch(i){}"withCredentials"in s&&(s.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(s.timeout=this.opts.requestTimeout),this.hasXDR()?(s.onload=function(){r.onLoad()},s.onerror=function(){r.onError(s.responseText)}):s.onreadystatechange=function(){4===s.readyState&&(200===s.status||1223===s.status?r.onLoad():setTimeout(function(){r.onError("number"==typeof s.status?s.status:0)},0))},n("xhr data %s",this.data),s.send(this.data)}catch(i){return void setTimeout(function(){r.onError(i)},0)}"undefined"!=typeof document&&(this.index=u.requestsCount++,u.requests[this.index]=this)}onSuccess(){this.emit("success"),this.cleanup()}onData(t){this.emit("data",t),this.onSuccess()}onError(t){this.emit("error",t),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=i:this.xhr.onreadystatechange=i,t)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete u.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&this.onData(t)}hasXDR(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR}abort(){this.cleanup()}}if(u.requestsCount=0,u.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",c);else if("function"==typeof addEventListener){addEventListener("onpagehide"in r?"pagehide":"unload",c,!1)}function c(){for(let t in u.requests)u.requests.hasOwnProperty(t)&&u.requests[t].abort()}module.exports=h,module.exports.Request=u;
},{"../../contrib/xmlhttprequest-ssl/XMLHttpRequest":"cVUh","./polling":"hsm0","component-emitter":"Wr69","../util":"k9hq","../globalThis":"ViVL","debug":"jcLW"}],"ruO5":[function(require,module,exports) {
const e=require("./polling"),t=require("../globalThis"),r=/\n/g,i=/\\n/g;let o;class s extends e{constructor(e){super(e),this.query=this.query||{},o||(o=t.___eio=t.___eio||[]),this.index=o.length;const r=this;o.push(function(e){r.onData(e)}),this.query.j=this.index}get supportsBinary(){return!1}doClose(){this.script&&(this.script.onerror=(()=>{}),this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),super.doClose()}doPoll(){const e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};const r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){const e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)}doWrite(e,t){const o=this;let s;if(!this.form){const e=document.createElement("form"),t=document.createElement("textarea"),r=this.iframeId="eio_iframe_"+this.index;e.className="socketio",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.target=r,e.method="POST",e.setAttribute("accept-charset","utf-8"),t.name="d",e.appendChild(t),document.body.appendChild(e),this.form=e,this.area=t}function n(){a(),t()}function a(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(e){o.onError("jsonp polling iframe removal error",e)}try{const t='<iframe src="javascript:0" name="'+o.iframeId+'">';s=document.createElement(t)}catch(e){(s=document.createElement("iframe")).name=o.iframeId,s.src="javascript:0"}s.id=o.iframeId,o.form.appendChild(s),o.iframe=s}this.form.action=this.uri(),a(),e=e.replace(i,"\\\n"),this.area.value=e.replace(r,"\\n");try{this.form.submit()}catch(c){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&n()}:this.iframe.onload=n}}module.exports=s;
},{"./polling":"hsm0","../globalThis":"ViVL"}],"IKuD":[function(require,module,exports) {
const e=require("../globalThis");module.exports={WebSocket:e.WebSocket||e.MozWebSocket,usingBrowserWebSocket:!0,defaultBinaryType:"arraybuffer"};
},{"../globalThis":"ViVL"}],"yh9p":[function(require,module,exports) {
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
},{}],"JgNJ":[function(require,module,exports) {
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],"REa7":[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],"dskh":[function(require,module,exports) {

var global = arguments[3];
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
},{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"REa7","buffer":"dskh"}],"ExHC":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer;const t=require("../transport"),s=require("engine.io-parser"),o=require("parseqs"),r=require("yeast"),{pick:i}=require("../util"),{WebSocket:n,usingBrowserWebSocket:a,defaultBinaryType:p}=require("./websocket-constructor"),h=require("debug")("engine.io-client:websocket"),c="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class u extends t{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,s=c?{}:i(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=a&&!c?t?new n(e,t):new n(e):new n(e,t,s)}catch(o){return this.emit("error",o)}this.ws.binaryType=this.socket.binaryType||p,this.addEventListeners()}addEventListeners(){this.ws.onopen=(()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()}),this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=(e=>this.onData(e.data)),this.ws.onerror=(e=>this.onError("websocket error",e))}write(t){const o=this;this.writable=!1;let r=t.length,i=0;const n=r;for(;i<n;i++)!function(t){s.encodePacket(t,o.supportsBinary,function(s){const i={};if(!a&&(t.options&&(i.compress=t.options.compress),o.opts.perMessageDeflate)){("string"==typeof s?e.byteLength(s):s.length)<o.opts.perMessageDeflate.threshold&&(i.compress=!1)}try{a?o.ws.send(s):o.ws.send(s,i)}catch(n){h("websocket closed before onclose event")}--r||p()})}(t[i]);function p(){o.emit("flush"),setTimeout(function(){o.writable=!0,o.emit("drain")},0)}}onClose(){t.prototype.onClose.call(this)}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let s="";return this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(s=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=r()),this.supportsBinary||(e.b64=1),(e=o.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+e}check(){return!(!n||"__initialize"in n&&this.name===u.prototype.name)}}module.exports=u;
},{"../transport":"HBl9","engine.io-parser":"fAXJ","parseqs":"vs2a","yeast":"t9Jt","../util":"k9hq","./websocket-constructor":"IKuD","debug":"jcLW","buffer":"dskh"}],"xQDS":[function(require,module,exports) {
const e=require("../../contrib/xmlhttprequest-ssl/XMLHttpRequest"),o=require("./polling-xhr"),t=require("./polling-jsonp"),n=require("./websocket");function r(n){let r,i=!1,s=!1;const l=!1!==n.jsonp;if("undefined"!=typeof location){const e="https:"===location.protocol;let o=location.port;o||(o=e?443:80),i=n.hostname!==location.hostname||o!==n.port,s=n.secure!==e}if(n.xdomain=i,n.xscheme=s,"open"in(r=new e(n))&&!n.forceJSONP)return new o(n);if(!l)throw new Error("JSONP disabled");return new t(n)}exports.polling=r,exports.websocket=n;
},{"../../contrib/xmlhttprequest-ssl/XMLHttpRequest":"cVUh","./polling-xhr":"tzUF","./polling-jsonp":"ruO5","./websocket":"ExHC"}],"APvO":[function(require,module,exports) {
const t=require("./transports/index"),e=require("component-emitter"),s=require("debug")("engine.io-client:socket"),r=require("engine.io-parser"),o=require("parseuri"),i=require("parseqs");class n extends e{constructor(t,e={}){super(),t&&"object"==typeof t&&(e=t,t=null),t?(t=o(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=o(e.host).host),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,jsonp:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{}},e),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=i.decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),"localhost"!==this.hostname&&(this.offlineEventListener=(()=>{this.onClose("transport close")}),addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){s('creating transport "%s"',e);const o=a(this.opts.query);o.EIO=r.protocol,o.transport=e,this.id&&(o.sid=this.id);const i=Object.assign({},this.opts.transportOptions[e],this.opts,{query:o,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return s("options: %j",i),new t[e](i)}open(){let t;if(this.opts.rememberUpgrade&&n.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){const t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(e){return s("error while creating transport: %s",e),this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){s("setting transport %s",t.name);const e=this;this.transport&&(s("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})}probe(t){s('probing transport "%s"',t);let e=this.createTransport(t,{probe:1}),r=!1;const o=this;function i(){if(o.onlyBinaryUpgrades){const t=!this.supportsBinary&&o.transport.supportsBinary;r=r||t}r||(s('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",function(i){if(!r)if("pong"===i.type&&"probe"===i.data){if(s('probe transport "%s" pong',t),o.upgrading=!0,o.emit("upgrading",e),!e)return;n.priorWebsocketSuccess="websocket"===e.name,s('pausing current transport "%s"',o.transport.name),o.transport.pause(function(){r||"closed"!==o.readyState&&(s("changing transport and sending upgrade packet"),l(),o.setTransport(e),e.send([{type:"upgrade"}]),o.emit("upgrade",e),e=null,o.upgrading=!1,o.flush())})}else{s('probe transport "%s" failed',t);const r=new Error("probe error");r.transport=e.name,o.emit("upgradeError",r)}}))}function a(){r||(r=!0,l(),e.close(),e=null)}function p(r){const i=new Error("probe error: "+r);i.transport=e.name,a(),s('probe transport "%s" failed because of error: %s',t,r),o.emit("upgradeError",i)}function h(){p("transport closed")}function c(){p("socket closed")}function u(t){e&&t.name!==e.name&&(s('"%s" works - aborting "%s"',t.name,e.name),a())}function l(){e.removeListener("open",i),e.removeListener("error",p),e.removeListener("close",h),o.removeListener("close",c),o.removeListener("upgrading",u)}n.priorWebsocketSuccess=!1,e.once("open",i),e.once("error",p),e.once("close",h),this.once("close",c),this.once("upgrading",u),e.open()}onOpen(){if(s("socket open"),this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){s("starting upgrade probes");let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(s('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emit("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else s('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=setTimeout(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()}flush(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(s("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))}write(t,e,s){return this.sendPacket("message",t,e,s),this}send(t,e,s){return this.sendPacket("message",t,e,s),this}sendPacket(t,e,s,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof s&&(r=s,s=null),"closing"===this.readyState||"closed"===this.readyState)return;(s=s||{}).compress=!1!==s.compress;const o={type:t,data:e,options:s};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const t=this;function e(){t.onClose("forced close"),s("socket closing - telling transport to close"),t.transport.close()}function r(){t.removeListener("upgrade",r),t.removeListener("upgradeError",r),e()}function o(){t.once("upgrade",r),t.once("upgradeError",r)}return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",function(){this.upgrading?o():e()}):this.upgrading?o():e()),this}onError(t){s("socket error %j",t),n.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)}onClose(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){s('socket close with reason: "%s"',t);const r=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emit("close",t,e),r.writeBuffer=[],r.prevBufferLen=0}}filterUpgrades(t){const e=[];let s=0;const r=t.length;for(;s<r;s++)~this.transports.indexOf(t[s])&&e.push(t[s]);return e}}function a(t){const e={};for(let s in t)t.hasOwnProperty(s)&&(e[s]=t[s]);return e}n.priorWebsocketSuccess=!1,n.protocol=r.protocol,module.exports=n;
},{"./transports/index":"xQDS","component-emitter":"Wr69","debug":"jcLW","engine.io-parser":"fAXJ","parseuri":"imeZ","parseqs":"vs2a"}],"h0uD":[function(require,module,exports) {
const e=require("./socket");module.exports=((r,o)=>new e(r,o)),module.exports.Socket=e,module.exports.protocol=e.protocol,module.exports.Transport=require("./transport"),module.exports.transports=require("./transports/index"),module.exports.parser=require("engine.io-parser");
},{"./socket":"APvO","./transport":"HBl9","./transports/index":"xQDS","engine.io-parser":"fAXJ"}],"UYfZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.hasBinary=exports.isBinary=void 0;const e="function"==typeof ArrayBuffer,t=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,r=Object.prototype.toString,o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===r.call(Blob),n="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===r.call(File);function f(r){return e&&(r instanceof ArrayBuffer||t(r))||o&&r instanceof Blob||n&&r instanceof File}function i(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++)if(i(e[t]))return!0;return!1}if(f(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return i(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&i(e[r]))return!0;return!1}exports.isBinary=f,exports.hasBinary=i;
},{}],"zHTC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reconstructPacket=exports.deconstructPacket=void 0;const t=require("./is-binary");function e(t){const e=[],n=t.data,o=t;return o.data=r(n,e),o.attachments=e.length,{packet:o,buffers:e}}function r(e,n){if(!e)return e;if(t.isBinary(e)){const t={_placeholder:!0,num:n.length};return n.push(e),t}if(Array.isArray(e)){const t=new Array(e.length);for(let o=0;o<e.length;o++)t[o]=r(e[o],n);return t}if("object"==typeof e&&!(e instanceof Date)){const t={};for(const o in e)e.hasOwnProperty(o)&&(t[o]=r(e[o],n));return t}return e}function n(t,e){return t.data=o(t.data,e),t.attachments=void 0,t}function o(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=o(t[r],e);else if("object"==typeof t)for(const r in t)t.hasOwnProperty(r)&&(t[r]=o(t[r],e));return t}exports.deconstructPacket=e,exports.reconstructPacket=n;
},{"./is-binary":"UYfZ"}],"GVVZ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Decoder=exports.Encoder=exports.PacketType=exports.protocol=void 0;const t=require("component-emitter"),e=require("./binary"),r=require("./is-binary"),s=require("debug")("socket.io-parser");var n;exports.protocol=5,function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(n=exports.PacketType||(exports.PacketType={}));class c{encode(t){return s("encoding packet %j",t),t.type!==n.EVENT&&t.type!==n.ACK||!r.hasBinary(t)?[this.encodeAsString(t)]:(t.type=t.type===n.EVENT?n.BINARY_EVENT:n.BINARY_ACK,this.encodeAsBinary(t))}encodeAsString(t){let e=""+t.type;return t.type!==n.BINARY_EVENT&&t.type!==n.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data)),s("encoded %j as %s",t,e),e}encodeAsBinary(t){const r=e.deconstructPacket(t),s=this.encodeAsString(r.packet),n=r.buffers;return n.unshift(s),n}}exports.Encoder=c;class o extends t{constructor(){super()}add(t){let e;if("string"==typeof t)(e=this.decodeString(t)).type===n.BINARY_EVENT||e.type===n.BINARY_ACK?(this.reconstructor=new a(e),0===e.attachments&&super.emit("decoded",e)):super.emit("decoded",e);else{if(!r.isBinary(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(e=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,super.emit("decoded",e))}}decodeString(t){let e=0;const r={type:Number(t.charAt(0))};if(void 0===n[r.type])throw new Error("unknown packet type "+r.type);if(r.type===n.BINARY_EVENT||r.type===n.BINARY_ACK){const s=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const n=t.substring(s,e);if(n!=Number(n)||"-"!==t.charAt(e))throw new Error("Illegal attachments");r.attachments=Number(n)}if("/"===t.charAt(e+1)){const s=e+1;for(;++e;){if(","===t.charAt(e))break;if(e===t.length)break}r.nsp=t.substring(s,e)}else r.nsp="/";const c=t.charAt(e+1);if(""!==c&&Number(c)==c){const s=e+1;for(;++e;){const r=t.charAt(e);if(null==r||Number(r)!=r){--e;break}if(e===t.length)break}r.id=Number(t.substring(s,e+1))}if(t.charAt(++e)){const s=i(t.substr(e));if(!o.isPayloadValid(r.type,s))throw new Error("invalid payload");r.data=s}return s("decoded %s as %j",t,r),r}static isPayloadValid(t,e){switch(t){case n.CONNECT:return"object"==typeof e;case n.DISCONNECT:return void 0===e;case n.CONNECT_ERROR:return"string"==typeof e||"object"==typeof e;case n.EVENT:case n.BINARY_EVENT:return Array.isArray(e)&&e.length>0;case n.ACK:case n.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}function i(t){try{return JSON.parse(t)}catch(e){return!1}}exports.Decoder=o;class a{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=e.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}
},{"component-emitter":"Wr69","./binary":"zHTC","./is-binary":"UYfZ","debug":"jcLW"}],"N9LN":[function(require,module,exports) {
"use strict";function e(e,o,t){return e.on(o,t),function(){e.off(o,t)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.on=void 0,exports.on=e;
},{}],"hEaF":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StrictEventEmitter=void 0;const e=require("component-emitter");class t extends e{on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}emit(e,...t){return super.emit(e,...t),this}emitReserved(e,...t){return super.emit(e,...t),this}listeners(e){return super.listeners(e)}}exports.StrictEventEmitter=t;
},{"component-emitter":"Wr69"}],"t1Qm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Socket=void 0;const t=require("socket.io-parser"),e=require("./on"),s=require("./typed-events"),i=require("debug")("socket.io-client:socket"),n=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class c extends s.StrictEventEmitter{constructor(t,e,s){super(),this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},s&&s.auth&&(this.auth=s.auth),this.io._autoConnect&&this.open()}subEvents(){if(this.subs)return;const t=this.io;this.subs=[e.on(t,"open",this.onopen.bind(this)),e.on(t,"packet",this.onpacket.bind(this)),e.on(t,"error",this.onerror.bind(this)),e.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(e,...s){if(n.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');s.unshift(e);const c={type:t.PacketType.EVENT,data:s,options:{}};c.options.compress=!1!==this.flags.compress,"function"==typeof s[s.length-1]&&(i("emitting packet with ack id %d",this.ids),this.acks[this.ids]=s.pop(),c.id=this.ids++);const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!o||!this.connected)?i("discard packet as the transport is not currently writable"):this.connected?this.packet(c):this.sendBuffer.push(c),this.flags={},this}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){i("transport is open - connecting"),"function"==typeof this.auth?this.auth(e=>{this.packet({type:t.PacketType.CONNECT,data:e})}):this.packet({type:t.PacketType.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t){i("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case t.PacketType.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case t.PacketType.EVENT:case t.PacketType.BINARY_EVENT:this.onevent(e);break;case t.PacketType.ACK:case t.PacketType.BINARY_ACK:this.onack(e);break;case t.PacketType.DISCONNECT:this.ondisconnect();break;case t.PacketType.CONNECT_ERROR:const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s)}}onevent(t){const e=t.data||[];i("emitting event %j",e),null!=t.id&&(i("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const s of e)s.apply(this,t)}super.emit.apply(this,t)}ack(e){const s=this;let n=!1;return function(...c){n||(n=!0,i("sending ack %j",c),s.packet({type:t.PacketType.ACK,id:e,data:c}))}}onack(t){const e=this.acks[t.id];"function"==typeof e?(i("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):i("bad ack %s",t.id)}onconnect(t){i("socket connected with id %s",t),this.id=t,this.connected=!0,this.disconnected=!1,this.emitReserved("connect"),this.emitBuffered()}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>this.packet(t)),this.sendBuffer=[]}ondisconnect(){i("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(i("performing disconnect (%s)",this.nsp),this.packet({type:t.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}}exports.Socket=c;
},{"socket.io-parser":"GVVZ","./on":"N9LN","./typed-events":"hEaF","debug":"jcLW"}],"pAuI":[function(require,module,exports) {
function t(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}module.exports=t,t.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),o=Math.floor(i*this.jitter*t);t=0==(1&Math.floor(10*i))?t-o:t+o}return 0|Math.min(t,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(t){this.ms=t},t.prototype.setMax=function(t){this.max=t},t.prototype.setJitter=function(t){this.jitter=t};
},{}],"eK1u":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Manager=void 0;const e=require("engine.io-client"),t=require("./socket"),n=require("socket.io-parser"),i=require("./on"),o=require("backo2"),s=require("./typed-events"),c=require("debug")("socket.io-client:manager");class r extends s.StrictEventEmitter{constructor(e,t){super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new o({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||n;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(c("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=e(this.uri,this.opts);const n=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const s=i.on(n,"open",function(){o.onopen(),t&&t()}),r=i.on(n,"error",e=>{c("error"),o.cleanup(),o._readyState="closed",this.emitReserved("error",e),t?t(e):o.maybeReconnectOnOpen()});if(!1!==this._timeout){const e=this._timeout;c("connect attempt will timeout after %d",e),0===e&&s();const t=setTimeout(()=>{c("connect attempt timed out after %d",e),s(),n.close(),n.emit("error",new Error("timeout"))},e);this.opts.autoUnref&&t.unref(),this.subs.push(function(){clearTimeout(t)})}return this.subs.push(s),this.subs.push(r),this}connect(e){return this.open(e)}onopen(){c("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(i.on(e,"ping",this.onping.bind(this)),i.on(e,"data",this.ondata.bind(this)),i.on(e,"error",this.onerror.bind(this)),i.on(e,"close",this.onclose.bind(this)),i.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){c("error",e),this.emitReserved("error",e)}socket(e,n){let i=this.nsps[e];return i||(i=new t.Socket(this,e,n),this.nsps[e]=i),i}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return void c("socket %s is still active, skipping close",n)}this._close()}_packet(e){c("writing packet %j",e);const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){c("cleanup"),this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){c("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,"opening"===this._readyState&&this.cleanup(),this.backoff.reset(),this._readyState="closed",this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e){c("onclose"),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();c("will wait %dms before reconnect attempt",t),this._reconnecting=!0;const n=setTimeout(()=>{e.skipReconnect||(c("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(c("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(c("reconnect success"),e.onreconnect())}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(function(){clearTimeout(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}exports.Manager=r;
},{"engine.io-client":"h0uD","./socket":"t1Qm","socket.io-parser":"GVVZ","./on":"N9LN","backo2":"pAuI","./typed-events":"hEaF","debug":"jcLW"}],"pPpY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Socket=exports.io=exports.Manager=exports.protocol=void 0;const e=require("./url"),r=require("./manager"),o=require("./socket");Object.defineProperty(exports,"Socket",{enumerable:!0,get:function(){return o.Socket}});const t=require("debug")("socket.io-client");module.exports=exports=c;const n=exports.managers={};function c(o,c){"object"==typeof o&&(c=o,o=void 0),c=c||{};const s=e.url(o,c.path),u=s.source,i=s.id,a=s.path,p=n[i]&&a in n[i].nsps;let l;return c.forceNew||c["force new connection"]||!1===c.multiplex||p?(t("ignoring socket cache for %s",u),l=new r.Manager(u,c)):(n[i]||(t("new io instance for %s",u),n[i]=new r.Manager(u,c)),l=n[i]),s.query&&!c.query&&(c.query=s.queryKey),l.socket(s.path,c)}exports.io=c;var s=require("socket.io-parser");Object.defineProperty(exports,"protocol",{enumerable:!0,get:function(){return s.protocol}}),exports.connect=c;var u=require("./manager");Object.defineProperty(exports,"Manager",{enumerable:!0,get:function(){return u.Manager}}),exports.default=c;
},{"./url":"NC0g","./manager":"eK1u","./socket":"t1Qm","debug":"jcLW","socket.io-parser":"GVVZ"}],"uARm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e,r=require("socket.io-client"),t=require("../features/Game"),a=require("../features/ConsoleLog"),o=require("rxjs/operators"),i=require("rxjs");const s=()=>(0,o.map)(t=>{const{game_url_base:a,game_url_path:o,avatar_id:i}=t.payload.parameters;return e=(0,r.io)(a,{path:o,query:{avatar_id:i}})}),u=(e,r,t)=>(0,i.fromEvent)(r,e).pipe((0,o.map)(e=>t(e))),n=r=>{var t;return null===(t=e)||void 0===t?void 0:null==t?void 0:t.emit("action",r)},c=()=>(0,i.pipe)((0,o.mergeMap)(e=>(0,i.merge)(u("game-state",e,t.actions.socketGameStateReceived),u("log",e,a.actions.socketConsoleLogReceived))));var p={connectToGame:s,startListeners:c,emitAction:n};exports.default=p;
},{"socket.io-client":"pPpY","../features/Game":"EAAz","../features/ConsoleLog":"GD6G","rxjs/operators":"cVrl","rxjs":"iRqj"}],"z5jw":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./post")),t=u(require("./get")),r=u(require("./socket"));function u(e){return e&&e.__esModule?e:{default:e}}var o={get:t.default,post:e.default,socket:r.default};exports.default=o;
},{"./post":"B2K4","./get":"QeOr","./socket":"uARm"}],"z2GM":[function(require,module,exports) {
"use strict";function e(e,r){const i=e.deserialize.bind(e),a=e.serialize.bind(e);return{deserialize:e=>r.deserialize(e,i),serialize:e=>r.serialize(e,a)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendSerializer=e,exports.DefaultSerializer=void 0;const r={deserialize:e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),serialize:e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack})},i=e=>e&&"object"==typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker,a={deserialize:e=>i(e)?r.deserialize(e):e,serialize:e=>e instanceof Error?r.serialize(e):e};exports.DefaultSerializer=a;
},{}],"kdjL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.registerSerializer=i,exports.deserialize=t,exports.serialize=s;var e=require("./serializers");let r=e.DefaultSerializer;function i(i){r=(0,e.extendSerializer)(r,i)}function t(e){return r.deserialize(e)}function s(e){return r.serialize(e)}
},{"./serializers":"z2GM"}],"LQHy":[function(require,module,exports) {
"use strict";let e;function t(){return e||(e=n()),e}function n(){try{throw new Error}catch(e){const t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return r(t[0])}return"/"}function r(e){return(""+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getBaseURL=r,exports.getBundleURL=t;
},{}],"XK2w":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getWorkerImplementation=s,exports.isWorkerRuntime=a,exports.defaultPoolSize=void 0;var e=require("./get-bundle-url.browser");const t="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;exports.defaultPoolSize=t;const r=e=>/^(file|https?:)?\/\//i.test(e);function o(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function n(){if("undefined"==typeof Worker)return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class t extends Worker{constructor(t,n){"string"==typeof t&&n&&n._baseURL?t=new URL(t,n._baseURL):"string"==typeof t&&!r(t)&&(0,e.getBundleURL)().match(/^file:\/\//i)&&(t=new URL(t,(0,e.getBundleURL)().replace(/\/[^\/]+$/,"/")),t=o(`importScripts(${JSON.stringify(t)});`)),"string"==typeof t&&r(t)&&(t=o(`importScripts(${JSON.stringify(t)});`)),super(t,n)}}class n extends t{constructor(e,t){super(window.URL.createObjectURL(e),t)}static fromText(e,t){const r=new window.Blob([e],{type:"text/javascript"});return new n(r,t)}}return{blob:n,default:t}}let i;function s(){return i||(i=n()),i}function a(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)}
},{"./get-bundle-url.browser":"LQHy"}],"vpgy":[function(require,module,exports) {
"use strict";function e(e){return Promise.all(e.map(e=>{const t=e=>({status:"fulfilled",value:e}),r=e=>({status:"rejected",reason:e}),s=Promise.resolve(e);try{return s.then(t,r)}catch(l){return Promise.reject(l)}}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.allSettled=e;
},{}],"UYCO":[function(require,module,exports) {
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.PoolEventType=void 0,exports.PoolEventType=e,function(e){e.initialized="initialized",e.taskCanceled="taskCanceled",e.taskCompleted="taskCompleted",e.taskFailed="taskFailed",e.taskQueued="taskQueued",e.taskQueueDrained="taskQueueDrained",e.taskStart="taskStart",e.terminated="terminated"}(e||(exports.PoolEventType=e={}));
},{}],"fmdM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.$worker=exports.$transferable=exports.$terminate=exports.$events=exports.$errors=void 0;const e=Symbol("thread.errors");exports.$errors=e;const r=Symbol("thread.events");exports.$events=r;const t=Symbol("thread.terminate");exports.$terminate=t;const o=Symbol("thread.transferable");exports.$transferable=o;const s=Symbol("thread.worker");exports.$worker=s;
},{}],"LBuu":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Thread=void 0;var e=require("../symbols");function r(e){throw Error(e)}const s={errors:s=>s[e.$errors]||r("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:s=>s[e.$events]||r("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:r=>r[e.$terminate]()};exports.Thread=s;
},{"../symbols":"fmdM"}],"EB3M":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"PoolEventType",{enumerable:!0,get:function(){return s.PoolEventType}}),Object.defineProperty(exports,"Thread",{enumerable:!0,get:function(){return r.Thread}}),exports.Pool=void 0;var e=o(require("debug")),t=require("observable-fns"),n=require("../ponyfills"),i=require("./implementation"),s=require("./pool-types"),r=require("./thread");function o(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t,n,i){return new(n||(n=Promise))(function(s,r){function o(e){try{a(i.next(e))}catch(t){r(t)}}function u(e){try{a(i.throw(e))}catch(t){r(t)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,u)}a((i=i.apply(e,t||[])).next())})};let a=1;function l(e){const t=[];for(let n=0;n<e;n++)t.push(n);return t}function h(e){return new Promise(t=>setTimeout(t,e))}function d(e,t){return e.reduce((e,n)=>[...e,...t(n)],[])}function c(e){return e.replace(/\W/g," ").trim().replace(/\s+/g,"-")}function p(e,t){return l(t).map(()=>({init:e(),runningTasks:[]}))}class b{constructor(n,r){this.eventSubject=new t.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const o="number"==typeof r?{size:r}:r||{},{size:u=i.defaultPoolSize}=o;this.debug=(0,e.default)(`threads:pool:${c(o.name||String(a++))}`),this.options=o,this.workers=p(n,u),this.eventObservable=(0,t.multicast)(t.Observable.from(this.eventSubject)),Promise.all(this.workers.map(e=>e.init)).then(()=>this.eventSubject.next({type:s.PoolEventType.initialized,size:this.workers.length}),e=>{this.debug("Error while initializing pool worker:",e),this.eventSubject.error(e),this.initErrors.push(e)})}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find(t=>t.runningTasks.length<e)}runPoolTask(e,t){return u(this,void 0,void 0,function*(){const n=this.workers.indexOf(e)+1;this.debug(`Running task #${t.id} on worker #${n}...`),this.eventSubject.next({type:s.PoolEventType.taskStart,taskID:t.id,workerID:n});try{const r=yield t.run(yield e.init);this.debug(`Task #${t.id} completed successfully`),this.eventSubject.next({type:s.PoolEventType.taskCompleted,returnValue:r,taskID:t.id,workerID:n})}catch(i){this.debug(`Task #${t.id} failed`),this.eventSubject.next({type:s.PoolEventType.taskFailed,taskID:t.id,error:i,workerID:n})}})}run(e,t){return u(this,void 0,void 0,function*(){const n=(()=>u(this,void 0,void 0,function*(){yield h(0);try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter(e=>e!==n),this.isClosing||this.scheduleWork()}}))();e.runningTasks.push(n)})}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug("Task queue is empty"),void this.eventSubject.next({type:s.PoolEventType.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise((t,n)=>{const i=this.events().subscribe(r=>{r.type===s.PoolEventType.taskCompleted&&r.taskID===e?(i.unsubscribe(),t(r.returnValue)):r.type===s.PoolEventType.taskFailed&&r.taskID===e?(i.unsubscribe(),n(r.error)):r.type===s.PoolEventType.terminated&&(i.unsubscribe(),n(Error("Pool has been terminated before task was run.")))})})}settled(e=!1){return u(this,void 0,void 0,function*(){const t=()=>d(this.workers,e=>e.runningTasks),i=[],r=this.eventObservable.subscribe(e=>{e.type===s.PoolEventType.taskFailed&&i.push(e.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield(0,n.allSettled)(t()),i):(yield new Promise((e,t)=>{const n=this.eventObservable.subscribe({next(t){t.type===s.PoolEventType.taskQueueDrained&&(n.unsubscribe(),e())},error:t})}),yield(0,n.allSettled)(t()),r.unsubscribe(),i)})}completed(e=!1){return u(this,void 0,void 0,function*(){const t=this.settled(e),n=new Promise((e,n)=>{const i=this.eventObservable.subscribe({next(r){r.type===s.PoolEventType.taskQueueDrained?(i.unsubscribe(),e(t)):r.type===s.PoolEventType.taskFailed&&(i.unsubscribe(),n(r.error))},error:n})}),i=yield Promise.race([t,n]);if(i.length>0)throw i[0]})}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const n=this.nextTaskID++,i=this.taskCompletion(n);i.catch(e=>{this.debug(`Task #${n} errored:`,e)});const r={id:n,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(r)&&(this.taskQueue=this.taskQueue.filter(e=>e!==r),this.eventSubject.next({type:s.PoolEventType.taskCanceled,taskID:r.id}))},then:i.then.bind(i)};if(this.taskQueue.length>=t)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${r.id}...`),this.taskQueue.push(r),this.eventSubject.next({type:s.PoolEventType.taskQueued,taskID:r.id}),this.scheduleWork(),r}terminate(e){return u(this,void 0,void 0,function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:s.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(e=>u(this,void 0,void 0,function*(){return r.Thread.terminate(yield e.init)})))})}}function k(e,t){return new b(e,t)}b.EventType=s.PoolEventType,k.EventType=s.PoolEventType;const v=k;exports.Pool=v;
},{"debug":"jcLW","observable-fns":"cyO3","../ponyfills":"vpgy","./implementation":"XK2w","./pool-types":"UYCO","./thread":"LBuu"}],"PRGP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createPromiseWithResolver=t;const e=()=>void 0;function t(){let t,r=!1,o=e;return[new Promise(e=>{r?e(t):o=e}),e=>{r=!0,t=e,o()}]}
},{}],"ZLGT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerEventType=void 0;var e,r=require("../symbols");exports.WorkerEventType=e,function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(e||(exports.WorkerEventType=e={}));
},{"../symbols":"fmdM"}],"zXl4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ObservablePromise=void 0;var t=require("observable-fns");const e=()=>void 0,s=t=>t,r=t=>Promise.resolve().then(t);function i(t){throw t}function n(t){return t&&"function"==typeof t.then}class o extends t.Observable{constructor(t){super(e=>{const s=this,r=Object.assign(Object.assign({},e),{complete(){e.complete(),s.onCompletion()},error(t){e.error(t),s.onError(t)},next(t){e.next(t),s.onNext(t)}});try{return this.initHasRun=!0,t(r)}catch(i){r.error(i)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state="rejected",this.rejection=t;for(const e of this.rejectionCallbacks)r(()=>e(t))}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks)r(()=>t(this.firstValue))}then(t,e){const r=t||s,n=e||i;let o=!1;return new Promise((t,e)=>{const s=s=>{if(!o){o=!0;try{t(n(s))}catch(r){e(r)}}};return this.initHasRun||this.subscribe({error:s}),"fulfilled"===this.state?t(r(this.firstValue)):"rejected"===this.state?(o=!0,t(n(this.rejection))):(this.fulfillmentCallbacks.push(e=>{try{t(r(e))}catch(i){s(i)}}),void this.rejectionCallbacks.push(s))})}catch(t){return this.then(void 0,t)}finally(t){const s=t||e;return this.then(t=>(s(),t),()=>s())}static from(t){return n(t)?new o(e=>{t.then(t=>{e.next(t),e.complete()},t=>{e.error(t)})}):super.from(t)}}exports.ObservablePromise=o;
},{"observable-fns":"cyO3"}],"qW1u":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isTransferDescriptor=t,exports.Transfer=s;var r=require("./symbols");function e(r){return!(!r||"object"!=typeof r)}function t(e){return e&&"object"==typeof e&&e[r.$transferable]}function s(t,s){if(!s){if(!e(t))throw Error();s=[t]}return{[r.$transferable]:!0,send:t,transferables:s}}
},{"./symbols":"fmdM"}],"fUdt":[function(require,module,exports) {
"use strict";var e,r;Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerMessageType=exports.MasterMessageType=void 0,exports.MasterMessageType=e,function(e){e.cancel="cancel",e.run="run"}(e||(exports.MasterMessageType=e={})),exports.WorkerMessageType=r,function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(r||(exports.WorkerMessageType=r={}));
},{}],"iMbm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createProxyFunction=g,exports.createProxyModule=y;var e=n(require("debug")),r=require("observable-fns"),s=require("../common"),t=require("../observable-promise"),a=require("../transferable"),o=require("../types/messages");function n(e){return e&&e.__esModule?e:{default:e}}const i=(0,e.default)("threads:master:messages");let u=1;const l=e=>Array.from(new Set(e)),d=e=>e&&e.type===o.WorkerMessageType.error,c=e=>e&&e.type===o.WorkerMessageType.result,p=e=>e&&e.type===o.WorkerMessageType.running;function f(e,t){return new r.Observable(r=>{let a;const n=o=>{if(i("Message from worker:",o.data),o.data&&o.data.uid===t)if(p(o.data))a=o.data.resultType;else if(c(o.data))"promise"===a?(void 0!==o.data.payload&&r.next((0,s.deserialize)(o.data.payload)),r.complete(),e.removeEventListener("message",n)):(o.data.payload&&r.next((0,s.deserialize)(o.data.payload)),o.data.complete&&(r.complete(),e.removeEventListener("message",n)));else if(d(o.data)){const t=(0,s.deserialize)(o.data.error);r.error(t),e.removeEventListener("message",n)}};return e.addEventListener("message",n),()=>{if("observable"===a||!a){const r={type:o.MasterMessageType.cancel,uid:t};e.postMessage(r)}e.removeEventListener("message",n)}})}function m(e){if(0===e.length)return{args:[],transferables:[]};const r=[],t=[];for(const o of e)(0,a.isTransferDescriptor)(o)?(r.push((0,s.serialize)(o.send)),t.push(...o.transferables)):r.push((0,s.serialize)(o));return{args:r,transferables:0===t.length?t:l(t)}}function g(e,s){return(...a)=>{const n=u++,{args:l,transferables:d}=m(a),c={type:o.MasterMessageType.run,uid:n,method:s,args:l};i("Sending command to run function to worker:",c);try{e.postMessage(c,d)}catch(p){return t.ObservablePromise.from(Promise.reject(p))}return t.ObservablePromise.from((0,r.multicast)(f(e,n)))}}function y(e,r){const s={};for(const t of r)s[t]=g(e,t);return s}
},{"debug":"jcLW","observable-fns":"cyO3","../common":"kdjL","../observable-promise":"zXl4","../transferable":"qW1u","../types/messages":"fUdt"}],"a83E":[function(require,module,exports) {
var process = require("process");
var e=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.spawn=x;var t=u(require("debug")),r=require("observable-fns"),n=require("../common"),o=require("../promise"),i=require("../symbols"),s=require("../types/master"),a=require("./invocation-proxy");function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(t){i(t)}}function a(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};const d=(0,t.default)("threads:master:messages"),m=(0,t.default)("threads:master:spawn"),v=(0,t.default)("threads:master:thread-utils"),l=e=>e&&"init"===e.type,f=e=>e&&"uncaughtError"===e.type,p=1e4;function y(e,t,r){return c(this,void 0,void 0,function*(){let n;const o=new Promise((e,o)=>{n=setTimeout(()=>o(Error(r)),t)}),i=yield Promise.race([e,o]);return clearTimeout(n),i})}function h(e){return new Promise((t,r)=>{const o=i=>{d("Message from worker before finishing initialization:",i.data),l(i.data)?(e.removeEventListener("message",o),t(i.data)):f(i.data)&&(e.removeEventListener("message",o),r((0,n.deserialize)(i.data.error)))};e.addEventListener("message",o)})}function E(e,t){return new r.Observable(r=>{const n=e=>{const t={type:s.WorkerEventType.message,data:e.data};r.next(t)},o=e=>{v("Unhandled promise rejection event in thread:",e);const t={type:s.WorkerEventType.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener("message",n),e.addEventListener("unhandledrejection",o),t.then(()=>{const t={type:s.WorkerEventType.termination};e.removeEventListener("message",n),e.removeEventListener("unhandledrejection",o),r.next(t),r.complete()})})}function g(e){const[t,r]=(0,o.createPromiseWithResolver)();return{terminate:()=>c(this,void 0,void 0,function*(){v("Terminating worker"),yield e.terminate(),r()}),termination:t}}function w(e,t,r,n){const o=r.filter(e=>e.type===s.WorkerEventType.internalError).map(e=>e.error);return Object.assign(e,{[i.$errors]:o,[i.$events]:r,[i.$terminate]:n,[i.$worker]:t})}function x(e,t){return c(this,void 0,void 0,function*(){m("Initializing new thread");const r=(yield y(h(e),t&&t.timeout?t.timeout:p,`Timeout: Did not receive an init message from worker after ${p}ms. Make sure the worker calls expose().`)).exposed,{termination:n,terminate:o}=g(e),i=E(e,n);if("function"===r.type){return w((0,a.createProxyFunction)(e),e,i,o)}if("module"===r.type){return w((0,a.createProxyModule)(e,r.methods),e,i,o)}{const e=r.type;throw Error(`Worker init message states unexpected type of expose(): ${e}`)}})}
},{"debug":"jcLW","observable-fns":"cyO3","../common":"kdjL","../promise":"PRGP","../symbols":"fmdM","../types/master":"ZLGT","./invocation-proxy":"iMbm","process":"pBGv"}],"HfK0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"isWorkerRuntime",{enumerable:!0,get:function(){return e.isWorkerRuntime}}),Object.defineProperty(exports,"Pool",{enumerable:!0,get:function(){return r.Pool}}),Object.defineProperty(exports,"spawn",{enumerable:!0,get:function(){return t.spawn}}),Object.defineProperty(exports,"Thread",{enumerable:!0,get:function(){return o.Thread}}),exports.Worker=exports.BlobWorker=void 0;var e=require("./implementation"),r=require("./pool"),t=require("./spawn"),o=require("./thread");const n=(0,e.getWorkerImplementation)().blob;exports.BlobWorker=n;const i=(0,e.getWorkerImplementation)().default;exports.Worker=i;
},{"./implementation":"XK2w","./pool":"EB3M","./spawn":"a83E","./thread":"LBuu"}],"UALh":[function(require,module,exports) {
"use strict";const e=require("symbol-observable").default;module.exports=(o=>Boolean(o&&o[e]&&o===o[e]()));
},{"symbol-observable":"LkZ7"}],"AZa4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const e=function(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)},s=function(e,s){self.postMessage(e,s)},t=function(e){const s=s=>{e(s.data)};return self.addEventListener("message",s),()=>{self.removeEventListener("message",s)}};var n={isWorkerRuntime:e,postMessageToMaster:s,subscribeToMasterMessages:t};exports.default=n;
},{}],"l5pR":[function(require,module,exports) {
var process = require("process");
var e=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.expose=k,Object.defineProperty(exports,"registerSerializer",{enumerable:!0,get:function(){return r.registerSerializer}}),Object.defineProperty(exports,"Transfer",{enumerable:!0,get:function(){return s.Transfer}}),exports.isWorkerRuntime=void 0;var t=a(require("is-observable")),r=require("../common"),s=require("../transferable"),o=require("../types/messages"),n=a(require("./implementation"));function a(e){return e&&e.__esModule?e:{default:e}}var i=function(e,t,r,s){return new(r||(r=Promise))(function(o,n){function a(e){try{u(s.next(e))}catch(t){n(t)}}function i(e){try{u(s.throw(e))}catch(t){n(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,i)}u((s=s.apply(e,t||[])).next())})};const u=n.default.isWorkerRuntime;exports.isWorkerRuntime=u;let c=!1;const f=new Map,l=e=>e&&e.type===o.MasterMessageType.cancel,p=e=>e&&e.type===o.MasterMessageType.run,d=e=>(0,t.default)(e)||y(e);function y(e){return e&&"object"==typeof e&&"function"==typeof e.subscribe}function g(e){return(0,s.isTransferDescriptor)(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function b(){const e={type:o.WorkerMessageType.init,exposed:{type:"function"}};n.default.postMessageToMaster(e)}function m(e){const t={type:o.WorkerMessageType.init,exposed:{type:"module",methods:e}};n.default.postMessageToMaster(t)}function M(e,t){const{payload:s,transferables:a}=g(t),i={type:o.WorkerMessageType.error,uid:e,error:(0,r.serialize)(s)};n.default.postMessageToMaster(i,a)}function h(e,t,r){const{payload:s,transferables:a}=g(r),i={type:o.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:s};n.default.postMessageToMaster(i,a)}function T(e,t){const r={type:o.WorkerMessageType.running,uid:e,resultType:t};n.default.postMessageToMaster(r)}function v(e){try{const s={type:o.WorkerMessageType.uncaughtError,error:(0,r.serialize)(e)};n.default.postMessageToMaster(s)}catch(t){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\nLatest error:",t,"\nOriginal error:",e)}}function x(e,t,s){return i(this,void 0,void 0,function*(){let o;try{o=t(...s)}catch(a){return M(e,a)}const n=d(o)?"observable":"promise";if(T(e,n),d(o)){const t=o.subscribe(t=>h(e,!1,(0,r.serialize)(t)),t=>{M(e,(0,r.serialize)(t)),f.delete(e)},()=>{h(e,!0),f.delete(e)});f.set(e,t)}else try{const t=yield o;h(e,!0,(0,r.serialize)(t))}catch(a){M(e,(0,r.serialize)(a))}})}function k(e){if(!n.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(c)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(c=!0,"function"==typeof e)n.default.subscribeToMasterMessages(t=>{p(t)&&!t.method&&x(t.uid,e,t.args.map(r.deserialize))}),b();else{if("object"!=typeof e||!e)throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${e}`);n.default.subscribeToMasterMessages(t=>{p(t)&&t.method&&x(t.uid,e[t.method],t.args.map(r.deserialize))}),m(Object.keys(e).filter(t=>"function"==typeof e[t]))}n.default.subscribeToMasterMessages(e=>{if(l(e)){const t=e.uid,r=f.get(t);r&&(r.unsubscribe(),f.delete(t))}})}"undefined"!=typeof self&&"function"==typeof self.addEventListener&&n.default.isWorkerRuntime()&&(self.addEventListener("error",e=>{setTimeout(()=>v(e.error||e),250)}),self.addEventListener("unhandledrejection",e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout(()=>v(t),250)})),void 0!==e&&"function"==typeof e.on&&n.default.isWorkerRuntime()&&(e.on("uncaughtException",e=>{setTimeout(()=>v(e),250)}),e.on("unhandledRejection",e=>{e&&"string"==typeof e.message&&setTimeout(()=>v(e),250)}));
},{"is-observable":"UALh","../common":"kdjL","../transferable":"qW1u","../types/messages":"fUdt","./implementation":"AZa4","process":"pBGv"}],"CqwR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={registerSerializer:!0,expose:!0,DefaultSerializer:!0,Transfer:!0};Object.defineProperty(exports,"registerSerializer",{enumerable:!0,get:function(){return r.registerSerializer}}),Object.defineProperty(exports,"expose",{enumerable:!0,get:function(){return i.expose}}),Object.defineProperty(exports,"DefaultSerializer",{enumerable:!0,get:function(){return n.DefaultSerializer}}),Object.defineProperty(exports,"Transfer",{enumerable:!0,get:function(){return o.Transfer}});var r=require("./common"),t=require("./master/index");Object.keys(t).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||r in exports&&exports[r]===t[r]||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return t[r]}}))});var i=require("./worker/index"),n=require("./serializers"),o=require("./transferable");
},{"./common":"kdjL","./master/index":"HfK0","./worker/index":"l5pR","./serializers":"z2GM","./transferable":"qW1u"}],"Vzuc":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initializePyodide=o,exports.updateAvatarCode=r,exports.resetWorker=u,exports.computeNextAction$=void 0;var t=require("rxjs"),e=require("threads");let a,n=!1;async function o(){await i(),n=!0}async function i(){a=await(0,e.spawn)(new e.Worker("/static/react/webWorker.1848e605.js")),await a.initializePyodide()}async function r(t,e,n=0){return c(()=>a.updateAvatarCode(t,e,n),(null==e?void 0:null==e?void 0:e.turnCount)+1)}async function u(t,o){n=!1,await e.Thread.terminate(a),await i(),await a.updateAvatarCode(t,null,o),n=!0}async function c(t,e){return n?t():Promise.resolve({action:{action:{action_type:"wait"}},log:"",turnCount:e+1})}const s=(e,n)=>(0,t.defer)(()=>c(()=>a.computeNextAction(e,n),e.turnCount+1));exports.computeNextAction$=s;
},{"rxjs":"iRqj","threads":"CqwR","./webWorker.ts":[["webWorker.1848e605.js","rgp3"],"webWorker.1848e605.js.map","rgp3"]}],"Xmez":[function(require,module,exports) {
var r=Object.keys||function(r){var n=[];for(var e in r)({}).hasOwnProperty.call(r,e)&&n.push(e);return n};function n(n,e,t){for(var a=r(n),o={},u=0,v=a.length;u<v;u++){var c=a[u];o[c]=n[c]}return o[e]=t,o}module.exports=n;
},{}],"kqta":[function(require,module,exports) {
"use strict";var e=require("./utils/assign"),t=require("redux").compose;function n(){var t=arguments[0]||{};return t.features={pause:!0,export:!0,test:!0},t.type="redux",void 0===t.autoPause&&(t.autoPause=!0),void 0===t.latency&&(t.latency=500),function(n){return function(o,r,u){var i=n(o,r,u),s=i.dispatch,a=window.__REDUX_DEVTOOLS_EXTENSION__.connect(t);a.init(i.getState());var c=function(e){var t=s(e);return a.send(e,i.getState()),t};return Object.assign?Object.assign(i,{dispatch:c}):e(i,"dispatch",c)}}}function o(e){return function(){return t(t.apply(null,arguments),n(e))}}exports.__esModule=!0,exports.composeWithDevTools=function(){return"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?0===arguments.length?n():"object"==typeof arguments[0]?o(arguments[0]):o().apply(null,arguments):0!==arguments.length?"object"==typeof arguments[0]?t:t.apply(null,arguments):void 0},exports.devToolsEnhancer="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?n:function(){return function(e){return e}};
},{"./utils/assign":"Xmez","redux":"aVFJ"}],"HzN5":[function(require,module,exports) {
"use strict";var e=require("redux").compose,o=require("./logOnly");exports.__esModule=!0,exports.composeWithDevTools=o.composeWithDevTools,exports.devToolsEnhancer=o.devToolsEnhancer;
},{"redux":"aVFJ","./logOnly":"kqta"}],"dPLT":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=p;var e=require("redux"),r=require("./features"),t=require("redux-observable"),n=a(require("./api")),o=d(require("../pyodide/pyodideRunner")),u=require("redux-devtools-extension/logOnlyInProduction");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(t,o,u):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function a(e){return e&&e.__esModule?e:{default:e}}function p(i){const d=(0,t.createEpicMiddleware)({dependencies:{api:n.default,pyodideRunner:o}}),a=(0,e.createStore)(r.rootReducer,i,(0,u.composeWithDevTools)((0,e.applyMiddleware)(d)));return d.run(r.rootEpic),a}
},{"redux":"aVFJ","./features":"w05k","redux-observable":"EOFz","./api":"z5jw","../pyodide/pyodideRunner":"Vzuc","redux-devtools-extension/logOnlyInProduction":"HzN5"}],"xC8N":[function(require,module,exports) {
var global = arguments[3];
var define;
var e,t=arguments[3];!function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,i,n){"string"==typeof e?(2==arguments.length&&(n=i),t.modules[e]||(t.payloads[e]=n,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var i,n,s=function(e,t,i){if("string"==typeof t){var n=a(e,t);if(null!=n)return i&&i(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var s=[],r=0,l=t.length;r<l;++r){var h=a(e,t[r]);if(null==h&&o.original)return;s.push(h)}return i&&i.apply(null,s)||!0}},o=function(e,t){var i=s("",e,t);return null==i&&o.original?o.original.apply(this,arguments):i},r=function(e,t){if(-1!==t.indexOf("!")){var i=t.split("!");return r(e,i[0])+"!"+r(e,i[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},a=function(e,i){i=r(e,i);var n=t.modules[i];if(!n){if("function"==typeof(n=t.payloads[i])){var o={},a={id:i,uri:"",exports:o,packaged:!0};o=n(function(e,t){return s(i,e,t)},o,a)||a.exports,t.modules[i]=o,delete t.payloads[i]}n=t.modules[i]=o||n}return n};n=e,(i="ace")&&(e[i]||(e[i]={}),n=e[i]),n.define&&n.define.packaged||(t.original=n.define,n.define=t,n.define.packaged=!0),n.require&&n.require.packaged||(o.original=n.require,n.require=o,n.require.packaged=!0)}(),ace.define("ace/lib/fixoldbrowsers",["require","exports","module"],function(e,t,i){"use strict";"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,i){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var n="object"==typeof navigator?navigator:{},s=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),o=n.userAgent||"",r=n.appName||"";t.isWin="win"==s,t.isMac="mac"==s,t.isLinux="linux"==s,t.isIE="Microsoft Internet Explorer"==r||r.indexOf("MSAppHost")>=0?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=o.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(o.split(" Edge/")[1])||void 0,t.isAIR=o.indexOf("AdobeAIR")>=0,t.isAndroid=o.indexOf("Android")>=0,t.isChromeOS=o.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(o)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("./useragent");if(t.buildDom=function e(t,i,n){if("string"==typeof t&&t){var s=document.createTextNode(t);return i&&i.appendChild(s),s}if(!Array.isArray(t))return t&&t.appendChild&&i&&i.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var o=[],r=0;r<t.length;r++){var a=e(t[r],i,n);a&&o.push(a)}return o}var l=document.createElement(t[0]),h=t[1],c=1;h&&"object"==typeof h&&!Array.isArray(h)&&(c=2);for(r=c;r<t.length;r++)e(t[r],l,n);return 2==c&&Object.keys(h).forEach(function(e){var t=h[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?l[e]=t:"ref"===e?n&&(n[t]=l):null!=t&&l.setAttribute(e,t)}),i&&i.appendChild(l),l},t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,i){t.hasCssClass(e,i)||(e.className+=" "+i)},t.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t);if(-1==n)break;i.splice(n,1)}e.className=i.join(" ")},t.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var s=i.indexOf(t);if(-1==s)break;n=!1,i.splice(s,1)}return n&&i.push(t),e.className=i.join(" "),n},t.setCssClass=function(e,i,n){n?t.addCssClass(e,i):t.removeCssClass(e,i)},t.hasCssString=function(e,t){var i,n=0;if(i=(t=t||document).querySelectorAll("style"))for(;n<i.length;)if(i[n++].id===e)return!0},t.importCssString=function(e,i,n){var s=n;n&&n.getRootNode&&(s=n.getRootNode())&&s!=n||(s=document);var o=s.ownerDocument||s;if(i&&t.hasCssString(i,s))return null;i&&(e+="\n/*# sourceURL=ace/css/"+i+" */");var r=t.createElement("style");r.appendChild(o.createTextNode(e)),i&&(r.id=i),s==o&&(s=t.getDocumentHead(o)),s.insertBefore(r,s.firstChild)},t.importCssStylsheet=function(e,i){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(i))},t.scrollbarWidth=function(e){var i=t.createElement("ace_inner");i.style.width="100%",i.style.minWidth="0px",i.style.height="200px",i.style.display="block";var n=t.createElement("ace_outer"),s=n.style;s.position="absolute",s.left="-10000px",s.overflow="hidden",s.width="200px",s.minWidth="0px",s.height="150px",s.display="block",n.appendChild(i);var o=e.documentElement;o.appendChild(n);var r=i.offsetWidth;s.overflow="scroll";var a=i.offsetWidth;return r==a&&(a=n.clientWidth),o.removeChild(n),r-a},"undefined"==typeof document&&(t.importCssString=function(){}),t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,i){e[t]!==i&&(e[t]=i)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!n.isWin||"undefined"!=typeof window&&window.devicePixelRatio>=1.5,"undefined"!=typeof document){var s=document.createElement("div");t.HI_DPI&&void 0!==s.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),n.isEdge||void 0===s.style.animationName||(t.HAS_CSS_ANIMATION=!0),s=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}:t.translate=function(e,t,i){e.style.top=Math.round(i)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,i){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var i in t)e[i]=t[i];return e},t.implement=function(e,i){t.mixin(e,i)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,i){"use strict";var n=e("./oop"),s=function(){var e,t,i={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in i.FUNCTION_KEYS)e=i.FUNCTION_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);for(t in i.PRINTABLE_KEYS)e=i.PRINTABLE_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);return n.mixin(i,i.MODIFIER_KEYS),n.mixin(i,i.PRINTABLE_KEYS),n.mixin(i,i.FUNCTION_KEYS),i.enter=i.return,i.escape=i.esc,i.del=i.delete,i[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)i.KEY_MODS[t]=e.filter(function(e){return t&i.KEY_MODS[e]}).join("-")+"-"}(),i.KEY_MODS[0]="",i.KEY_MODS[-1]="input-",i}();n.mixin(t,s),t.keyCodeToString=function(e){var t=s[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";var n,s=e("./keys"),o=e("./useragent"),r=null,a=0;function l(){return null==n&&function(){n=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){n={passive:!1}}})}catch(e){}}(),n}function h(e,t,i){this.elem=e,this.type=t,this.callback=i}h.prototype.destroy=function(){u(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var c=t.addListener=function(e,t,i,n){e.addEventListener(t,i,l()),n&&n.$toDestroy.push(new h(e,t,i))},u=t.removeListener=function(e,t,i){e.removeEventListener(t,i,l())};t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||o.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,i){var n=e&&e.ownerDocument||document;function s(e){t&&t(e),i&&i(e),u(n,"mousemove",t),u(n,"mouseup",s),u(n,"dragstart",s)}return c(n,"mousemove",t),c(n,"mouseup",s),c(n,"dragstart",s),s},t.addMouseWheelListener=function(e,t,i){"onmousewheel"in e?c(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),t(e)},i):"onwheel"in e?c(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}t(e)},i):c(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),t(e)},i)},t.addMultiMouseDownListener=function(e,i,n,s,r){var a,l,h,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function g(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,o.isIE){var r=Math.abs(e.clientX-a)>5||Math.abs(e.clientY-l)>5;h&&!r||(u=1),h&&clearTimeout(h),h=setTimeout(function(){h=null},i[u-1]||600),1==u&&(a=e.clientX,l=e.clientY)}if(e._clicks=u,n[s]("mousedown",e),u>4)u=0;else if(u>1)return n[s](d[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){c(e,"mousedown",g,r)})};var d=function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function g(e,t,i){var n=d(t);if(!o.isMac&&r){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),r.altGr){if(3==(3&n))return;r.altGr=0}if(18===i||17===i){var l="location"in t?t.location:t.keyLocation;if(17===i&&1===l)1==r[i]&&(a=t.timeStamp);else if(18===i&&3===n&&2===l){t.timeStamp-a<50&&(r.altGr=!0)}}}if((i in s.MODIFIER_KEYS&&(i=-1),!n&&13===i)&&(3===(l="location"in t?t.location:t.keyLocation)&&(e(t,n,-i),t.defaultPrevented)))return;if(o.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in s.FUNCTION_KEYS||i in s.PRINTABLE_KEYS)&&e(t,n,i)}function f(){r=Object.create(null)}if(t.getModifierString=function(e){return s.KEY_MODS[d(e)]},t.addCommandKeyListener=function(e,i,n){if(o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)){var s=null;c(e,"keydown",function(e){s=e.keyCode},n),c(e,"keypress",function(e){return g(i,e,s)},n)}else{var a=null;c(e,"keydown",function(e){r[e.keyCode]=(r[e.keyCode]||0)+1;var t=g(i,e,e.keyCode);return a=e.defaultPrevented,t},n),c(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)},n),c(e,"keyup",function(e){r[e.keyCode]=null},n),r||(f(),c(window,"focus",f))}},"object"==typeof window&&window.postMessage&&!o.isOldIE){var m=1;t.nextTick=function(e,i){i=i||window;var n="zero-timeout-message-"+m++,s=function(o){o.data==n&&(t.stopPropagation(o),u(i,"message",s),e())};c(i,"message",s),i.postMessage(n,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,i){return setTimeout(function i(){t.$idleBlocked?setTimeout(i,100):e()},i)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,i){"use strict";var n=function(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,i=e.end,n=e.start;return 1==(t=this.compare(i.row,i.column))?1==(t=this.compare(n.row,n.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(n.row,n.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var i={row:t+1,column:0};else if(this.end.row<e)i={row:e,column:0};if(this.start.row>t)var s={row:t+1,column:0};else if(this.start.row<e)s={row:e,column:0};return n.fromPoints(s||this.start,i||this.end)},this.extend=function(e,t){var i=this.compare(e,t);if(0==i)return this;if(-1==i)var s={row:e,column:t};else var o={row:e,column:t};return n.fromPoints(s||this.start,o||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return n.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new n(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new n(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),i=e.documentToScreenPosition(this.end);return new n(t.row,t.column,i.row,i.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(n.prototype),n.fromPoints=function(e,t){return new n(e.row,e.column,t.row,t.column)},n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=n}),ace.define("ace/lib/lang",["require","exports","module"],function(e,t,i){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var i="";t>0;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var n=/^\s\s*/,s=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(s,"")},t.copyObject=function(e){var t={};for(var i in e)t[i]=e[i];return t},t.copyArray=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&"object"==typeof e[i]?t[i]=this.copyObject(e[i]):t[i]=e[i];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var i;if(Array.isArray(t)){i=[];for(var n=0;n<t.length;n++)i[n]=e(t[n]);return i}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var n in i={},t)i[n]=e(t[n]);return i},t.arrayToMap=function(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var i in e)t[i]=e[i];return t},t.arrayRemove=function(e,t){for(var i=0;i<=e.length;i++)t===e[i]&&e.splice(i,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var i=[];return e.replace(t,function(e){i.push({offset:arguments[arguments.length-2],length:e.length})}),i},t.deferredCall=function(e){var t=null,i=function(){t=null,e()},n=function(e){return n.cancel(),t=setTimeout(i,e||0),n};return n.schedule=n,n.call=function(){return this.cancel(),e(),n},n.cancel=function(){return clearTimeout(t),t=null,n},n.isPending=function(){return t},n},t.delayedCall=function(e,t){var i=null,n=function(){i=null,e()},s=function(e){null==i&&(i=setTimeout(n,e||t))};return s.delay=function(e){i&&clearTimeout(i),i=setTimeout(n,e||t)},s.schedule=s,s.call=function(){this.cancel(),e()},s.cancel=function(){i&&clearTimeout(i),i=null},s.isPending=function(){return i},s}}),ace.define("ace/clipboard",["require","exports","module"],function(e,t,i){"use strict";var n;i.exports={lineMode:!1,pasteCancelled:function(){return!!(n&&n>Date.now()-50)||(n=!1)},cancel:function(){n=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,i){"use strict";var n=e("../lib/event"),s=e("../lib/useragent"),o=e("../lib/dom"),r=e("../lib/lang"),a=e("../clipboard"),l=s.isChrome<18,h=s.isIE,c=s.isChrome>63,u=e("../lib/keys"),d=u.KEY_MODS,g=s.isIOS,f=g?/\s/:/\n/,m=s.isMobile;t.TextInput=function(e,t){var i=o.createElement("textarea");i.className="ace_text-input",i.setAttribute("wrap","off"),i.setAttribute("autocorrect","off"),i.setAttribute("autocapitalize","off"),i.setAttribute("spellcheck",!1),i.style.opacity="0",e.insertBefore(i,e.firstChild);var p=!1,v=!1,w=!1,$=!1,b="";m||(i.style.fontSize="1px");var y=!1,C=!1,S="",x=0,k=0,A=0;try{var L=document.activeElement===i}catch(K){}n.addListener(i,"blur",function(e){C||(t.onBlur(e),L=!1)},t),n.addListener(i,"focus",function(e){if(!C){if(L=!0,s.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),s.isEdge?setTimeout(R):R()}},t),this.$focusScroll=!1,this.focus=function(){if(b||c||"browser"==this.$focusScroll)return i.focus({preventScroll:!0});var e=i.style.top;i.style.position="fixed",i.style.top="0px";try{var t=0!=i.getBoundingClientRect().top}catch(K){return}var n=[];if(t)for(var s=i.parentElement;s&&1==s.nodeType;)n.push(s),s.setAttribute("ace_nocontext",!0),s=!s.parentElement&&s.getRootNode?s.getRootNode().host:s.parentElement;i.focus({preventScroll:!0}),t&&n.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){i.style.position="","0px"==i.style.top&&(i.style.top=e)},0)},this.blur=function(){i.blur()},this.isFocused=function(){return L},t.on("beforeEndOperation",function(){var e=t.curOp,n=e&&e.command&&e.command.name;if("insertstring"!=n){var s=n&&(e.docChanged||e.selectionChanged);w&&s&&(S=i.value="",H()),R()}});var R=g?function(e){if(L&&(!p||e)&&!$){e||(e="");var n="\n ab"+e+"cde fg\n";n!=i.value&&(i.value=S=n);var s=4+(e.length||(t.selection.isEmpty()?0:1));4==x&&k==s||i.setSelectionRange(4,s),x=4,k=s}}:function(){if(!w&&!$&&(L||E)){w=!0;var e=0,n=0,s="";if(t.session){var o=t.selection,r=o.getRange(),a=o.cursor.row;if(e=r.start.column,n=r.end.column,s=t.session.getLine(a),r.start.row!=a){var l=t.session.getLine(a-1);e=r.start.row<a-1?0:e,n+=l.length+1,s=l+"\n"+s}else if(r.end.row!=a){var h=t.session.getLine(a+1);n=r.end.row>a+1?h.length:n,n+=s.length+1,s=s+"\n"+h}else m&&a>0&&(s="\n"+s,n+=1,e+=1);s.length>400&&(e<400&&n<400?s=s.slice(0,400):(s="\n",e==n?e=n=0:(e=0,n=1)))}var c=s+"\n\n";if(c!=S&&(i.value=S=c,x=k=c.length),E&&(x=i.selectionStart,k=i.selectionEnd),k!=n||x!=e||i.selectionEnd!=k)try{i.setSelectionRange(e,n),x=e,k=n}catch(K){}w=!1}};this.resetSelection=R,L&&t.onFocus();var M=null;this.setInputHandler=function(e){M=e},this.getInputHandler=function(){return M};var E=!1,T=function(e,n){if(E&&(E=!1),v)return R(),e&&t.onPaste(e),v=!1,"";for(var o=i.selectionStart,r=i.selectionEnd,a=x,l=S.length-k,h=e,c=e.length-o,u=e.length-r,d=0;a>0&&S[d]==e[d];)d++,a--;for(h=h.slice(d),d=1;l>0&&S.length-d>x-1&&S[S.length-d]==e[e.length-d];)d++,l--;c-=d-1,u-=d-1;var g=h.length-d+1;if(g<0&&(a=-g,g=0),h=h.slice(0,g),!(n||h||c||a||l||u))return"";$=!0;var f=!1;return s.isAndroid&&". "==h&&(h="  ",f=!0),h&&!a&&!l&&!c&&!u||y?t.onTextInput(h):t.onTextInput(h,{extendLeft:a,extendRight:l,restoreStart:c,restoreEnd:u}),$=!1,S=e,x=o,k=r,A=u,f?"\n":h},_=function(e){if(w)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var n=i.value,s=T(n,!0);(n.length>500||f.test(s)||m&&x<1&&x==k)&&R()},F=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!l){var s=h||i?"Text":"text/plain";try{return t?!1!==n.setData(s,t):n.getData(s)}catch(e){if(!i)return F(e,t,!0)}}},O=function(e,s){var o=t.getCopyText();if(!o)return n.preventDefault(e);F(e,o)?(g&&(R(o),p=o,setTimeout(function(){p=!1},10)),s?t.onCut():t.onCopy(),n.preventDefault(e)):(p=!0,i.value=o,i.select(),setTimeout(function(){p=!1,R(),s?t.onCut():t.onCopy()}))},I=function(e){O(e,!0)},W=function(e){O(e,!1)},D=function(e){var o=F(e);a.pasteCancelled()||("string"==typeof o?(o&&t.onPaste(o,e),s.isIE&&setTimeout(R),n.preventDefault(e)):(i.value="",v=!0))};n.addCommandKeyListener(i,t.onCommandKey.bind(t),t),n.addListener(i,"select",function(e){w||(p?p=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=S.length&&e.value===S&&S&&e.selectionEnd!==k}(i)?(t.selectAll(),R()):m&&i.selectionStart!=x&&R())},t),n.addListener(i,"input",_,t),n.addListener(i,"cut",I,t),n.addListener(i,"copy",W,t),n.addListener(i,"paste",D,t),"oncut"in i&&"oncopy"in i&&"onpaste"in i||n.addListener(e,"keydown",function(e){if((!s.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:W(e);break;case 86:D(e);break;case 88:I(e)}},t);var B=function(){if(w&&t.onCompositionUpdate&&!t.$readOnly){if(y)return P();if(w.useTextareaForIME)t.onCompositionUpdate(i.value);else{var e=i.value;T(e),w.markerRange&&(w.context&&(w.markerRange.start.column=w.selectionStart=w.context.compositionStartOffset),w.markerRange.end.column=w.markerRange.start.column+k-w.selectionStart+A)}}},H=function(e){t.onCompositionEnd&&!t.$readOnly&&(w=!1,t.onCompositionEnd(),t.off("mousedown",P),e&&_())};function P(){C=!0,i.blur(),i.focus(),C=!1}var N,z=r.delayedCall(B,50).schedule.bind(null,null);function V(){clearTimeout(N),N=setTimeout(function(){b&&(i.style.cssText=b,b=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}n.addListener(i,"compositionstart",function(e){if(!w&&t.onCompositionStart&&!t.$readOnly&&(w={},!y)){e.data&&(w.useTextareaForIME=!1),setTimeout(B,0),t._signal("compositionStart"),t.on("mousedown",P);var n=t.getSelectionRange();n.end.row=n.start.row,n.end.column=n.start.column,w.markerRange=n,w.selectionStart=x,t.onCompositionStart(w),w.useTextareaForIME?(S=i.value="",x=0,k=0):(i.msGetInputContext&&(w.context=i.msGetInputContext()),i.getInputContext&&(w.context=i.getInputContext()))}},t),n.addListener(i,"compositionupdate",B,t),n.addListener(i,"keyup",function(e){27==e.keyCode&&i.value.length<i.selectionStart&&(w||(S=i.value),x=k=-1,R()),z()},t),n.addListener(i,"keydown",z,t),n.addListener(i,"compositionend",H,t),this.getElement=function(){return i},this.setCommandMode=function(e){y=e,i.readOnly=!1},this.setReadOnly=function(e){y||(i.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){E=!0,R(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,r){b||(b=i.style.cssText),i.style.cssText=(r?"z-index:100000;":"")+(s.isIE?"opacity:0.1;":"")+"text-indent: -"+(x+k)*t.renderer.characterWidth*.5+"px;";var a=t.container.getBoundingClientRect(),l=o.computedStyle(t.container),h=a.top+(parseInt(l.borderTopWidth)||0),c=a.left+(parseInt(a.borderLeftWidth)||0),u=a.bottom-h-i.clientHeight-2,d=function(e){o.translate(i,e.clientX-c-2,Math.min(e.clientY-h-2,u))};d(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(N),s.isWin&&n.capture(t.container,d,V))},this.onContextMenuClose=V;var U=function(e){t.textInput.onContextMenu(e),V()};n.addListener(i,"mouseup",U,t),n.addListener(i,"mousedown",function(e){e.preventDefault(),V()},t),n.addListener(t.renderer.scroller,"contextmenu",U,t),n.addListener(i,"contextmenu",U,t),g&&function(e,t,i){var n=null,s=!1;i.addEventListener("keydown",function(e){n&&clearTimeout(n),s=!0},!0),i.addEventListener("keyup",function(e){n=setTimeout(function(){s=!1},100)},!0);var o=function(e){if(document.activeElement===i&&!(s||w||t.$mouseHandler.isMousePressed||p)){var n=i.selectionStart,o=i.selectionEnd,r=null,a=0;if(0==n?r=u.up:1==n?r=u.home:o>k&&"\n"==S[o]?r=u.end:n<x&&" "==S[n-1]?(r=u.left,a=d.option):n<x||n==x&&k!=x&&n==o?r=u.left:o>k&&S.slice(0,o).split("\n").length>2?r=u.down:o>k&&" "==S[o-1]?(r=u.right,a=d.option):(o>k||o==k&&k!=x&&n==o)&&(r=u.right),n!==o&&(a|=d.shift),r){var l=t.onCommandKey({},a,r);if(!l&&t.commands){r=u.keyCodeToString(r);var h=t.commands.findKeyCommand(a,r);h&&t.execCommand(h)}x=n,k=o,R("")}}};document.addEventListener("selectionchange",o),t.on("destroy",function(){document.removeEventListener("selectionchange",o)})}(0,t,i)},t.$setUserAgentForTests=function(e,t){m=e,g=t}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/useragent");function s(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function o(e,t){if(e.start.row==e.end.row)var i=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)i=2*t.row-e.start.row-e.end.row;else var i=t.column-4;return i<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition();this.mousedownEvent=e;var s=this.editor,o=e.getButton();return 0!==o?((s.getSelectionRange().isEmpty()||1==o)&&s.selection.moveToPosition(i),void(2==o&&(s.textInput.onContextMenu(e.domEvent),n.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||s.isFocused()||(s.focus(),!this.$focusTimeout||this.$clickSelection||s.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(i,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.renderer.scroller.setCapture&&i.renderer.scroller.setCapture(),i.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(i);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var s=o(this.$clickSelection,i);i=s.cursor,e=s.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y),s=i.selection[e](n.row,n.column);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(s.start),a=this.$clickSelection.comparePoint(s.end);if(-1==r&&a<=0)t=this.$clickSelection.end,s.end.row==n.row&&s.end.column==n.column||(n=s.start);else if(1==a&&r>=0)t=this.$clickSelection.start,s.start.row==n.row&&s.start.column==n.column||(n=s.end);else if(-1==r&&1==a)n=s.end,t=s.start;else{var l=o(this.$clickSelection,n);n=l.cursor,t=l.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(n),i.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,i,n,s=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,i=this.x,n=this.y,Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))),o=Date.now();(s>0||o-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),i=this.editor,n=i.session.getBracketRange(t);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState("select")):(n=i.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=n,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var n=i.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=i.selection.getLineRange(n.start.row),this.$clickSelection.end=i.selection.getLineRange(n.end.row).end):this.$clickSelection=i.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,n=e.domEvent.timeStamp,s=n-i.t,o=s?e.wheelX/s:i.vx,r=s?e.wheelY/s:i.vy;s<550&&(o=(o+i.vx)/2,r=(r+i.vy)/2);var a=Math.abs(o/r),l=!1;if(a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l)i.allowed=n;else if(n-i.allowed<550){Math.abs(o)<=1.5*Math.abs(i.vx)&&Math.abs(r)<=1.5*Math.abs(i.vy)?(l=!0,i.allowed=n):i.allowed=0}return i.t=n,i.vx=o,i.vy=r,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(s.prototype),t.DefaultHandlers=s}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,i){"use strict";e("./lib/oop");var n=e("./lib/dom");function s(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=n.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){n.addCssClass(this.getElement(),e)},this.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(s.prototype),t.Tooltip=s}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,i){"use strict";var n=e("../lib/dom"),s=e("../lib/oop"),o=e("../lib/event"),r=e("../tooltip").Tooltip;function a(e){r.call(this,e)}s.inherits(a,r),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.getWidth(),o=this.getHeight();(e+=15)+s>i&&(e-=e+s-i),(t+=15)+o>n&&(t-=20+o),r.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,i,s,r=e.editor,l=r.renderer.$gutterLayer,h=new a(r.container);function c(){t&&(t=clearTimeout(t)),s&&(h.hide(),s=null,r._signal("hideGutterTooltip",h),r.off("mousewheel",c))}function u(e){h.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(r.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var i=t.getDocumentPosition().row,n=r.session.selection;if(t.getShiftKey())n.selectTo(i,0);else{if(2==t.domEvent.detail)return r.selectAll(),t.preventDefault();e.$clickSelection=r.selection.getLineRange(i)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(o){var a=o.domEvent.target||o.domEvent.srcElement;if(n.hasCssClass(a,"ace_fold-widget"))return c();s&&e.$tooltipFollowsMouse&&u(o),i=o,t||(t=setTimeout(function(){t=null,i&&!e.isMousePressed?function(){var t=i.getDocumentPosition().row,n=l.$annotations[t];if(!n)return c();if(t==r.session.getLength()){var o=r.renderer.pixelToScreenCoordinates(0,i.y).row,a=i.$pos;if(o>r.session.documentToScreenRow(a.row,a.column))return c()}if(s!=n)if(s=n.text.join("<br/>"),h.setHtml(s),h.show(),r._signal("showGutterTooltip",h),r.on("mousewheel",c),e.$tooltipFollowsMouse)u(i);else{var d=i.domEvent.target.getBoundingClientRect(),g=h.getElement().style;g.left=d.right+"px",g.top=d.bottom+"px"}}():c()},50))}),o.addListener(r.renderer.$gutter,"mouseout",function(e){i=null,s&&!t&&(t=setTimeout(function(){t=null,c()},50))},r),r.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/event"),s=e("../lib/useragent"),o=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return n.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=s.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(o.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/dom"),s=e("../lib/event"),o=e("../lib/useragent"),r=200,a=200,l=5;function h(e){var t=e.editor,i=n.createElement("img");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o.isOpera&&(i.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.on("mousedown",this.onMouseDown.bind(e));var h,u,d,g,f,m,p,v,w,$,b,y=t.container,C=0;function S(){var e=m;(function(e,i){var n=Date.now(),s=!i||e.row!=i.row,o=!i||e.column!=i.column;!$||s||o?(t.moveCursorToPosition(e),$=n,b={x:u,y:d}):c(b.x,b.y,u,d)>l?$=null:n-$>=a&&(t.renderer.scrollCursorIntoView(),$=null)})(m=t.renderer.screenToTextCoordinates(u,d),e),function(e,i){var n=Date.now(),s=t.renderer.layerConfig.lineHeight,o=t.renderer.layerConfig.characterWidth,a=t.renderer.scroller.getBoundingClientRect(),l={x:{left:u-a.left,right:a.right-u},y:{top:d-a.top,bottom:a.bottom-d}},h=Math.min(l.x.left,l.x.right),c=Math.min(l.y.top,l.y.bottom),g={row:e.row,column:e.column};h/o<=2&&(g.column+=l.x.left<l.x.right?-3:2),c/s<=1&&(g.row+=l.y.top<l.y.bottom?-1:1);var f=e.row!=g.row,m=e.column!=g.column,p=!i||e.row!=i.row;f||m&&!p?w?n-w>=r&&t.renderer.scrollCursorIntoView(g):w=n:w=null}(m,e)}function x(){f=t.selection.toOrientedRange(),h=t.session.addMarker(f,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(g),S(),g=setInterval(S,20),C=0,s.addListener(document,"mousemove",L)}function k(){clearInterval(g),t.session.removeMarker(h),h=null,t.selection.fromOrientedRange(f),t.isFocused()&&!v&&t.$resetCursorStyle(),f=null,m=null,C=0,w=null,$=null,s.removeListener(document,"mousemove",L)}this.onDragStart=function(e){if(this.cancelDrag||!y.draggable){var n=this;return setTimeout(function(){n.startSelect(),n.captureMouse(e)},0),e.preventDefault()}f=t.getSelectionRange();var s=e.dataTransfer;s.effectAllowed=t.getReadOnly()?"copy":"copyMove",o.isOpera&&(t.container.appendChild(i),i.scrollTop=0),s.setDragImage&&s.setDragImage(i,0,0),o.isOpera&&t.container.removeChild(i),s.clearData(),s.setData("Text",t.session.getTextRange()),v=!0,this.setState("drag")},this.onDragEnd=function(e){if(y.draggable=!1,v=!1,this.setState(null),!t.getReadOnly()){var i=e.dataTransfer.dropEffect;p||"move"!=i||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&R(e.dataTransfer))return u=e.clientX,d=e.clientY,h||x(),C++,e.dataTransfer.dropEffect=p=M(e),s.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&R(e.dataTransfer))return u=e.clientX,d=e.clientY,h||(x(),C++),null!==A&&(A=null),e.dataTransfer.dropEffect=p=M(e),s.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&h)return k(),p=null,s.preventDefault(e)},this.onDrop=function(e){if(m){var i=e.dataTransfer;if(v)switch(p){case"move":f=f.contains(m.row,m.column)?{start:m,end:m}:t.moveText(f,m);break;case"copy":f=t.moveText(f,m,!0)}else{var n=i.getData("Text");f={start:m,end:t.session.insert(m,n)},t.focus(),p=null}return k(),s.preventDefault(e)}},s.addListener(y,"dragstart",this.onDragStart.bind(e),t),s.addListener(y,"dragend",this.onDragEnd.bind(e),t),s.addListener(y,"dragenter",this.onDragEnter.bind(e),t),s.addListener(y,"dragover",this.onDragOver.bind(e),t),s.addListener(y,"dragleave",this.onDragLeave.bind(e),t),s.addListener(y,"drop",this.onDrop.bind(e),t);var A=null;function L(){null==A&&(A=setTimeout(function(){null!=A&&h&&k()},20))}function R(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function M(e){var t=["copy","copymove","all","uninitialized"],i=o.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var s="none";return i&&t.indexOf(n)>=0?s="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(n)>=0?s="move":t.indexOf(n)>=0&&(s="copy"),s}}function c(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=o.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;o.isIE&&"dragReady"==this.state&&(c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop());"dragWait"===this.state&&(c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition())))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,i=e.inSelection(),n=e.getButton();if(1===(e.domEvent.detail||1)&&0===n&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in s&&(s.unselectable="on"),t.getDragDelay()){if(o.isWebKit)this.cancelDrag=!0,t.container.draggable=!0;this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(h.prototype),t.DragdropHandler=h}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(e,t,i){"use strict";var n=e("./mouse_event").MouseEvent,s=e("../lib/event"),o=e("../lib/dom");t.addTouchListeners=function(e,t){var i,r,a,l,h,c,u,d,g,f="scroll",m=0,p=0,v=0,w=0;function $(){var e=window.navigator&&window.navigator.clipboard,i=!1,n=function(n){var s,r,a=n.target.getAttribute("action");if("more"==a||!i)return i=!i,s=t.getCopyText(),r=t.session.getUndoManager().hasUndo(),void g.replaceChild(o.buildDom(i?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],r&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),g.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),g.firstChild.style.display="none",i=!1,"openCommandPallete"!=a&&t.focus()};g=o.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),n(e)},onclick:n},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container)}function b(){g||$();var e=t.selection.cursor,i=t.renderer.textToScreenCoordinates(e.row,e.column),n=t.renderer.textToScreenCoordinates(0,0).pageX,s=t.renderer.scrollLeft,o=t.container.getBoundingClientRect();g.style.top=i.pageY-o.top-3+"px",i.pageX-o.left<o.width-70?(g.style.left="",g.style.right="10px"):(g.style.right="",g.style.left=n+s-o.left+"px"),g.style.display="",g.firstChild.style.display="none",t.on("input",y)}function y(e){g&&(g.style.display="none"),t.off("input",y)}function C(){h=null,clearTimeout(h);var e=t.selection.getRange(),i=e.contains(u.row,u.column);!e.isEmpty()&&i||(t.selection.moveToPosition(u),t.selection.selectWord()),f="wait",b()}s.addListener(e,"contextmenu",function(e){d&&t.textInput.getElement().focus()},t),s.addListener(e,"touchstart",function(e){var s=e.touches;if(h||s.length>1)return clearTimeout(h),h=null,a=-1,void(f="zoom");d=t.$mouseHandler.isMousePressed=!0;var o=t.renderer.layerConfig.lineHeight,c=t.renderer.layerConfig.lineHeight,g=e.timeStamp;l=g;var $=s[0],b=$.clientX,y=$.clientY;Math.abs(i-b)+Math.abs(r-y)>o&&(a=-1),i=e.clientX=b,r=e.clientY=y,v=w=0;var S=new n(e,t);if(u=S.getDocumentPosition(),g-a<500&&1==s.length&&!m)p++,e.preventDefault(),e.button=0,function(){h=null,clearTimeout(h),t.selection.moveToPosition(u);var e=p>=2?t.selection.getLineRange(u.row):t.session.getBracketRange(u);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{p=0;var x=t.selection.cursor,k=t.selection.isEmpty()?x:t.selection.anchor,A=t.renderer.$cursorLayer.getPixelPosition(x,!0),L=t.renderer.$cursorLayer.getPixelPosition(k,!0),R=t.renderer.scroller.getBoundingClientRect(),M=t.renderer.layerConfig.offset,E=t.renderer.scrollLeft,T=function(e,t){return(e/=c)*e+(t=t/o-.75)*t};if(e.clientX<R.left)return void(f="zoom");var _=T(e.clientX-R.left-A.left+E,e.clientY-R.top-A.top+M),F=T(e.clientX-R.left-L.left+E,e.clientY-R.top-L.top+M);_<3.5&&F<3.5&&(f=_>F?"cursor":"anchor"),f=F<3.5?"anchor":_<3.5?"cursor":"scroll",h=setTimeout(C,450)}a=g},t),s.addListener(e,"touchend",function(e){d=t.$mouseHandler.isMousePressed=!1,c&&clearInterval(c),"zoom"==f?(f="",m=0):h?(t.selection.moveToPosition(u),m=0,b()):"scroll"==f?(m+=60,c=setInterval(function(){m--<=0&&(clearInterval(c),c=null),Math.abs(v)<.01&&(v=0),Math.abs(w)<.01&&(w=0),m<20&&(v*=.9),m<20&&(w*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*v,10*w),e==t.session.getScrollTop()&&(m=0)},10),y()):b(),clearTimeout(h),h=null},t),s.addListener(e,"touchmove",function(e){h&&(clearTimeout(h),h=null);var s=e.touches;if(!(s.length>1||"zoom"==f)){var o=s[0],a=i-o.clientX,c=r-o.clientY;if("wait"==f){if(!(a*a+c*c>4))return e.preventDefault();f="cursor"}i=o.clientX,r=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var u=e.timeStamp,d=u-l;if(l=u,"scroll"==f){var g=new n(e,t);g.speed=1,g.wheelX=a,g.wheelY=c,10*Math.abs(a)<Math.abs(c)&&(a=0),10*Math.abs(c)<Math.abs(a)&&(c=0),0!=d&&(v=a/d,w=c/d),t._emit("mousewheel",g),g.propagationStopped||(v=w=0)}else{var m=new n(e,t).getDocumentPosition();"cursor"==f?t.selection.moveCursorToPosition(m):"anchor"==f&&t.selection.setSelectionAnchor(m.row,m.column),t.renderer.scrollCursorIntoView(m),e.preventDefault()}}},t)}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,t){var i=n.getDocumentHead(),s=document.createElement("script");s.src=e,i.appendChild(s),s.onload=s.onreadystatechange=function(e,i){!i&&s.readyState&&"loaded"!=s.readyState&&"complete"!=s.readyState||(s=s.onload=s.onreadystatechange=null,i||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,i){"use strict";var n={},s=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],n=this._defaultHandlers[e];if(i.length||n){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=s),t.preventDefault||(t.preventDefault=o),i=i.slice();for(var r=0;r<i.length&&(i[r](t,this),!t.propagationStopped);r++);return n&&!t.defaultPrevented?n(t,this):void 0}},n._signal=function(e,t){var i=(this._eventRegistry||{})[e];if(i){i=i.slice();for(var n=0;n<i.length;n++)i[n](t,this)}},n.once=function(e,t){var i=this;if(this.on(e,function n(){i.off(e,n),t.apply(null,arguments)}),!t)return new Promise(function(e){t=e})},n.setDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[e]){var n=i[e],s=i._disabled_[e];s||(i._disabled_[e]=s=[]),s.push(n);var o=s.indexOf(t);-1!=o&&s.splice(o,1)}i[e]=t},n.removeDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i){var n=i._disabled_[e];if(i[e]==t)n&&this.setDefaultHandler(e,n.pop());else if(n){var s=n.indexOf(t);-1!=s&&n.splice(s,1)}}},n.on=n.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return n||(n=this._eventRegistry[e]=[]),-1==n.indexOf(t)&&n[i?"unshift":"push"](t),t},n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];if(i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}},n.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=n}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){var n=e("./oop"),s=e("./event_emitter").EventEmitter,o={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var i=this.$options;e=Object.keys(i).filter(function(e){return!i[e].hidden})}return e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this["$"+e]!==t){var i=this.$options[e];if(!i)return r('misspelled option "'+e+'"');if(i.forwardTo)return this[i.forwardTo]&&this[i.forwardTo].setOption(e,t);i.handlesSet||(this["$"+e]=t),i&&i.set&&i.set.call(this,t)}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:r('misspelled option "'+e+'"')}};function r(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function a(e,t){var i=new Error(e);i.data=t,"object"==typeof console&&console.error&&console.error(i),setTimeout(function(){throw i})}var l=function(){this.$defaultOptions={}};(function(){n.implement(this,s),this.defineOptions=function(e,t,i){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(i).forEach(function(t){var n=i[t];"string"==typeof n&&(n={forwardTo:n}),n.name||(n.name=t),e.$options[n.name]=n,"initialValue"in n&&(e["$"+n.name]=n.initialValue)}),n.implement(e,o),this},this.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var i=e.$options[t];"value"in i&&e.setOption(t,i.value)})},this.setDefaultValue=function(e,t,i){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});n[t]&&(n.forwardTo?this.setDefaultValue(n.forwardTo,t,i):n[t].value=i)},this.setDefaultValues=function(e,t){Object.keys(t).forEach(function(i){this.setDefaultValue(e,i,t[i])},this)},this.warn=r,this.reportError=a}).call(l.prototype),t.AppConfig=l}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(t,i,n){var s=t("./lib/lang"),o=(t("./lib/oop"),t("./lib/net")),r=t("./lib/app_config").AppConfig;n.exports=i=new r;var a=function(){return this||"undefined"!=typeof window&&window}(),l={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1};i.get=function(e){if(!l.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return l[e]},i.set=function(e,t){if(l.hasOwnProperty(e))l[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e)},i.all=function(){return s.copyObject(l)},i.$modes={},i.moduleUrl=function(e,t){if(l.$moduleUrls[e])return l.$moduleUrls[e];var i=e.split("/"),n="snippets"==(t=t||i[i.length-2]||"")?"/":"-",s=i[i.length-1];if("worker"==t&&"-"==n){var o=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");s=s.replace(o,"")}(!s||s==t)&&i.length>1&&(s=i[i.length-2]);var r=l[t+"Path"];return null==r?r=l.basePath:"/"==n&&(t=n=""),r&&"/"!=r.slice(-1)&&(r+="/"),r+t+n+s+this.get("suffix")},i.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},i.$loading={},i.loadModule=function(e,n){var s,r;Array.isArray(e)&&(r=e[0],e=e[1]);try{s=t(e)}catch(l){}if(s&&!i.$loading[e])return n&&n(s);if(i.$loading[e]||(i.$loading[e]=[]),i.$loading[e].push(n),!(i.$loading[e].length>1)){var a=function(){t([e],function(t){i._emit("load.module",{name:e,module:t});var n=i.$loading[e];i.$loading[e]=null,n.forEach(function(e){e&&e(t)})})};if(!i.get("packaged"))return a();o.loadScript(i.moduleUrl(e,r),a),h()}};var h=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),h=function(){})};function c(s){if(a&&a.document){l.packaged=s||t.packaged||n.packaged||a.define&&e.packaged;for(var o,r={},h="",c=document.currentScript||document._currentScript,u=(c&&c.ownerDocument||document).getElementsByTagName("script"),d=0;d<u.length;d++){var g=u[d],f=g.src||g.getAttribute("src");if(f){for(var m=g.attributes,p=0,v=m.length;p<v;p++){var w=m[p];0===w.name.indexOf("data-ace-")&&(r[(o=w.name.replace(/^data-ace-/,""),o.replace(/-(.)/g,function(e,t){return t.toUpperCase()}))]=w.value)}var $=f.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);$&&(h=$[1])}}for(var b in h&&(r.base=r.base||h,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base,r)void 0!==r[b]&&i.set(b,r[b])}}c(!0),i.init=c,i.version="1.4.12"}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(e,t,i){"use strict";var n=e("../lib/event"),s=e("../lib/useragent"),o=e("./default_handlers").DefaultHandlers,r=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,h=e("./touch_handler").addTouchListeners,c=e("../config"),u=function(e){var t=this;this.editor=e,new o(this),new r(this),new l(this);var i=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus()},a=e.renderer.getMouseEventTarget();n.addListener(a,"click",this.onMouseEvent.bind(this,"click"),e),n.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove"),e),n.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",e),n.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e),h(e.container,e);var c=e.renderer.$gutter;n.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e),n.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick"),e),n.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e),n.addListener(c,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e),n.addListener(a,"mousedown",i,e),n.addListener(c,"mousedown",i,e),s.isIE&&e.renderer.scrollBarV&&(n.addListener(e.renderer.scrollBarV.element,"mousedown",i,e),n.addListener(e.renderer.scrollBarH.element,"mousedown",i,e)),e.on("mousemove",function(i){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var n=e.renderer.screenToTextCoordinates(i.x,i.y),s=e.session.selection.getRange(),o=e.renderer;!s.isEmpty()&&s.insideStart(n.row,n.column)?o.setCursorStyle("default"):o.setCursorStyle("")}},e)};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new a(t,this.editor))},this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new a(t,this.editor))},this.onMouseWheel=function(e,t){var i=new a(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var i=this.editor,o=this.editor.renderer;o.$isMousePressed=!0;var r=this,l=function(e){if(e){if(s.isWebKit&&!e.which&&r.releaseMouse)return r.releaseMouse();r.x=e.clientX,r.y=e.clientY,t&&t(e),r.mouseEvent=new a(e,r.editor),r.$mouseMoved=!0}},h=function(e){i.off("beforeEndOperation",u),clearInterval(d),c(),r[r.state+"End"]&&r[r.state+"End"](e),r.state="",r.isMousePressed=o.$isMousePressed=!1,o.$keepTextAreaAtCursor&&o.$moveTextAreaToCursor(),r.$onCaptureMouseMove=r.releaseMouse=null,e&&r.onMouseEvent("mouseup",e),i.endOperation()},c=function(){r[r.state]&&r[r.state](),r.$mouseMoved=!1};if(s.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){h(e)});var u=function(e){r.releaseMouse&&i.curOp.command.name&&i.curOp.selectionChanged&&(r[r.state+"End"]&&r[r.state+"End"](),r.state="",r.releaseMouse())};i.on("beforeEndOperation",u),i.startOperation({command:{name:"mouse"}}),r.$onCaptureMouseMove=l,r.releaseMouse=n.capture(this.editor.container,l,h);var d=setInterval(c,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&n.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)},this.destroy=function(){this.releaseMouse&&this.releaseMouse()}}).call(u.prototype),c.defineOptions(u.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:s.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=u}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom");t.FoldHandler=function(e){e.on("click",function(t){var i=t.getDocumentPosition(),s=e.session,o=s.getFoldAt(i.row,i.column,1);o&&(t.getAccelKey()?s.removeFold(o):s.expandFold(o),t.stop());var r=t.domEvent&&t.domEvent.target;r&&n.hasCssClass(r,"ace_inline_button")&&n.hasCssClass(r,"ace_toggle_wrap")&&(s.setOption("wrap",!s.getUseWrapMode()),e.renderer.scrollCursorIntoView())}),e.on("gutterclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,n=e.session;n.foldWidgets&&n.foldWidgets[i]&&e.session.onFoldWidgetClick(i,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,n=e.session,s=n.getParentFoldRangeData(i,!0),o=s.range||s.firstRange;if(o){i=o.start.row;var r=n.getFoldAt(i,n.getLine(i).length,1);r?n.removeFold(r):(n.addFold("...",o),e.renderer.scrollCursorIntoView({row:o.start.row,column:0}))}t.stop()}})}}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,i){"use strict";var n=e("../lib/keys"),s=e("../lib/event"),o=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e);var i=this.$handlers.indexOf(e);-1!=i&&this.$handlers.splice(i,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(i){return i.getStatusText&&i.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,i,n){for(var o,r=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((o=this.$handlers[l].handleKeyboard(this.$data,e,t,i,n))&&o.command&&((r="null"==o.command||a.exec(o.command,this.$editor,o.args,n))&&n&&-1!=e&&1!=o.passEvent&&1!=o.command.passEvent&&s.stopEvent(n),r)););return r||-1!=e||(o={command:"insertstring"},r=a.exec("insertstring",this.$editor,t)),r&&this.$editor._signal&&this.$editor._signal("keyboardActivity",o),r},this.onCommandKey=function(e,t,i){var s=n.keyCodeToString(i);return this.$callKeyboardHandlers(t,s,i,e)},this.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)}}).call(o.prototype),t.KeyBinding=o}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,t,i){"use strict";var n=0,s=0,o=!1,r=!1,a=!1,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],c=1,u=0,d=1,g=2,f=3,m=4,p=5,v=6,w=7,$=8,b=9,y=10,C=11,S=12,x=13,k=14,A=15,L=16,R=17,M=18,E=[M,M,M,M,M,M,M,M,M,v,p,v,$,p,M,M,M,M,M,M,M,M,M,M,M,M,M,M,p,p,p,v,$,m,m,C,C,C,m,m,m,m,m,y,b,y,b,b,g,g,g,g,g,g,g,g,g,g,b,m,m,m,m,m,m,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,m,m,m,m,m,m,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,m,m,m,m,M,M,M,M,M,M,p,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,b,m,C,C,C,C,m,m,m,m,u,m,m,M,m,m,C,C,g,g,m,u,m,m,m,g,u,m,m,m,m,m],T=[$,$,$,$,$,$,$,$,$,$,$,M,M,M,u,d,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,$,p,x,k,A,L,R,b,C,C,C,C,C,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,b,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,$];function _(e,t,i){if(!(s<e))if(1!=e||n!=c||r)for(var o,a,l,h,u=i.length,d=0;d<u;){if(t[d]>=e){for(o=d+1;o<u&&t[o]>=e;)o++;for(a=d,l=o-1;a<l;a++,l--)h=i[a],i[a]=i[l],i[l]=h;d=o}d++}else i.reverse()}function F(e,t,i,s){var l,h,c,E,T=t[s];switch(T){case u:case d:o=!1;case m:case f:return T;case g:return o?f:g;case w:return o=!0,!0,d;case $:return m;case b:return s<1||s+1>=t.length||(l=i[s-1])!=g&&l!=f||(h=t[s+1])!=g&&h!=f?m:(o&&(h=f),h==l?h:m);case y:return(l=s>0?i[s-1]:p)==g&&s+1<t.length&&t[s+1]==g?g:m;case C:if(s>0&&i[s-1]==g)return g;if(o)return m;for(E=s+1,c=t.length;E<c&&t[E]==C;)E++;return E<c&&t[E]==g?g:m;case S:for(c=t.length,E=s+1;E<c&&t[E]==S;)E++;if(E<c){var _=e[s],F=_>=1425&&_<=2303||64286==_;if(l=t[E],F&&(l==d||l==w))return d}return s<1||(l=t[s-1])==p?m:i[s-1];case p:return o=!1,r=!0,n;case v:return a=!0,m;case x:case k:case L:case R:case A:o=!1;case M:return m}}function O(e){var t=e.charCodeAt(0),i=t>>8;return 0==i?t>191?u:E[t]:5==i?/[\u0591-\u05f4]/.test(e)?d:u:6==i?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?S:/[\u0660-\u0669\u066b-\u066c]/.test(e)?f:1642==t?C:/[\u06f0-\u06f9]/.test(e)?g:w:32==i&&t<=8287?T[255&t]:254==i&&t>=65136?w:m}t.L=u,t.R=d,t.EN=g,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,i,u){if(e.length<2)return{};var g=e.split(""),b=new Array(g.length),y=new Array(g.length),C=[];n=u?c:0,function(e,t,i,c){var u=n?h:l,d=null,g=null,f=null,m=0,w=null,b=-1,y=null,C=null,S=[];if(!c)for(y=0,c=[];y<i;y++)c[y]=O(e[y]);for(s=n,o=!1,!1,r=!1,a=!1,C=0;C<i;C++){if(d=m,S[C]=g=F(e,c,S,C),w=240&(m=u[d][g]),m&=15,t[C]=f=u[m][5],w>0)if(16==w){for(y=b;y<C;y++)t[y]=1;b=-1}else b=-1;if(u[m][6])-1==b&&(b=C);else if(b>-1){for(y=b;y<C;y++)t[y]=f;b=-1}c[C]==p&&(t[C]=0),s|=f}if(a)for(y=0;y<i;y++)if(c[y]==v){t[y]=n;for(var x=y-1;x>=0&&c[x]==$;x--)t[x]=n}}(g,C,g.length,i);for(var S=0;S<b.length;b[S]=S,S++);_(2,C,b),_(1,C,b);for(S=0;S<b.length-1;S++)i[S]===f?C[S]=t.AN:C[S]===d&&(i[S]>w&&i[S]<x||i[S]===m||i[S]===M)?C[S]=t.ON_R:S>0&&"ل"===g[S-1]&&/\u0622|\u0623|\u0625|\u0627/.test(g[S])&&(C[S-1]=C[S]=t.R_H,S++);g[g.length-1]===t.DOT&&(C[g.length-1]=t.B),"‫"===g[0]&&(C[0]=t.RLE);for(S=0;S<b.length;S++)y[S]=C[b[S]];return{logicalFromVisual:b,bidiLevels:y}},t.hasBidiCharacters=function(e,t){for(var i=!1,n=0;n<e.length;n++)t[n]=O(e.charAt(n)),i||t[n]!=d&&t[n]!=w&&t[n]!=f||(i=!0);return i},t.getVisualFromLogicalIdx=function(e,t){for(var i=0;i<t.logicalFromVisual.length;i++)if(t.logicalFromVisual[i]==e)return i;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(e,t,i){"use strict";var n=e("./lib/bidiutil"),s=e("./lib/lang"),o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,r=function(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=n,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=o.test(e.getValue())};(function(){this.isBidiRow=function(e,t,i){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,i),this.updateBidiMap()),this.bidiMap.bidiLevels)},this.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&o.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var i=this.session.$getRowCacheIndex(t,this.currentRow);i>=0&&(e=this.session.$docRowCache[i])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(i=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=i,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var i=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var o=this.session.$wrapData[e];o&&(void 0===t&&(t=this.getSplitIndex()),t>0&&o.length?(this.wrapIndent=o.indent,this.wrapOffset=this.wrapIndent*this.charWidths[n.L],this.line=t<o.length?this.line.substring(o[t-1],o[t]):this.line.substring(o[o.length-1])):this.line=this.line.substring(0,o[t])),t==o.length&&(this.line+=this.showInvisibles?i:n.DOT)}else this.line+=this.showInvisibles?i:n.DOT;var r,a=this.session,l=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(e,t){return"\t"===e||a.isFullWidth(e.charCodeAt(0))?(r="\t"===e?a.getScreenTabSize(t+l):2,l+=r-1,s.stringRepeat(n.DOT,r)):e}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==n.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var e=[];n.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=n.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,i=e.$measureCharWidth("ה");this.charWidths[n.L]=this.charWidths[n.EN]=this.charWidths[n.ON_R]=t,this.charWidths[n.R]=this.charWidths[n.AN]=i,this.charWidths[n.R_H]=.45*i,this.charWidths[n.B]=this.charWidths[n.RLE]=0,this.currentRow=null}},this.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},this.setEolChar=function(e){this.EOL=e},this.setContentWidth=function(e){this.contentWidth=e},this.isRtlLine=function(e){return!!this.$isRtl||(null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},this.setRtlDirection=function(e,t){for(var i=e.getCursorPosition(),n=e.selection.getSelectionAnchor().row;n<=i.row;n++)t||e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:n},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(n,0,1)},this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=e>t?this.session.getOverwrite()?e:e-1:t,s=n.getVisualFromLogicalIdx(i,this.bidiMap),o=this.bidiMap.bidiLevels,r=0;!this.session.getOverwrite()&&e<=t&&o[s]%2!=0&&s++;for(var a=0;a<s;a++)r+=this.charWidths[o[a]];return!this.session.getOverwrite()&&e>t&&o[s]%2==0&&(r+=this.charWidths[o[s]]),this.wrapIndent&&(r+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(r+=this.rtlLineOffset),r},this.getSelections=function(e,t){var i,n=this.bidiMap,s=n.bidiLevels,o=[],r=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,h=!1,c=!1,u=0;this.wrapIndent&&(r+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,g=0;g<s.length;g++)d=n.logicalFromVisual[g],i=s[g],(h=d>=a&&d<l)&&!c?u=r:!h&&c&&o.push({left:u,width:r-u}),r+=this.charWidths[i],c=h;if(h&&g===s.length&&o.push({left:u,width:r-u}),this.isRtlDir)for(var f=0;f<o.length;f++)o[f].left+=this.rtlLineOffset;return o},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,i=(e=Math.max(e,0),0),n=0,s=this.bidiMap.bidiLevels,o=this.charWidths[s[n]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>i+o/2;){if(i+=o,n===s.length-1){o=0;break}o=this.charWidths[s[++n]]}return n>0&&s[n-1]%2!=0&&s[n]%2==0?(e<i&&n--,t=this.bidiMap.logicalFromVisual[n]):n>0&&s[n-1]%2==0&&s[n]%2!=0?t=1+(e>i?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===s.length-1&&0===o&&s[n-1]%2==0||!this.isRtlDir&&0===n&&s[n]%2!=0?t=1+this.bidiMap.logicalFromVisual[n]:(n>0&&s[n-1]%2!=0&&0!==o&&n--,t=this.bidiMap.logicalFromVisual[n]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(r.prototype),t.BidiHandler=r}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/lang"),o=e("./lib/event_emitter").EventEmitter,r=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){n.implement(this,o),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?r.fromPoints(t,t):this.isBackwards()?r.fromPoints(t,e):r.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var i=t?e.end:e.start,n=t?e.start:e.end;this.$setSelection(i.row,i.column,n.row,n.column)},this.$setSelection=function(e,t,i,n){if(!this.$silent){var s=this.$isEmpty,o=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(i,n),this.$isEmpty=!r.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||s!=this.$isEmpty||o)&&this._emit("changeSelection")}},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var i=e||this.lead;e=i.row,t=i.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var i,n="number"==typeof e?e:this.lead.row,s=this.session.getFoldLine(n);return s?(n=s.start.row,i=s.end.row):i=n,!0===t?new r(n,0,i,this.session.getLine(i).length):new r(n,0,i+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column,s=e.column+t;return i<0&&(n=e.column-t,s=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,s).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var i=this.session.getTabSize();t=this.lead;this.wouldMoveIntoSoftTab(t,i,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,i):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,i=this.session.documentToScreenRow(e,t),n=this.session.screenToDocumentPosition(i,0),s=this.session.getDisplayLine(e,null,n.row,n.column).match(/^\s*/);s[0].length==t||this.session.$useEmacsStyleLineStart||(n.column+=s[0].length),this.moveCursorToPosition(n)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var i=this.session.getLine(t.row);if(t.column==i.length){var n=i.search(/\s+$/);n>0&&(t.column=n)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);if(s)this.moveCursorTo(s.end.row,s.end.column);else{if(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(t)),t>=i.length)return this.moveCursorTo(e,i.length),this.moveCursorRight(),void(e<this.doc.getLength()-1&&this.moveCursorWordRight());this.session.tokenRe.exec(n)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)}},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))this.moveCursorTo(e.start.row,e.start.column);else{var n=this.session.getFoldStringAt(t,i,-1);null==n&&(n=this.doc.getLine(t).substring(0,i));var o=s.stringReverse(n);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(o)&&(i-=this.session.nonTokenRe.lastIndex,o=o.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),i<=0)return this.moveCursorTo(t,0),this.moveCursorLeft(),void(t>0&&this.moveCursorWordLeft());this.session.tokenRe.exec(o)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i)}},this.$shortWordEndIndex=function(e){var t,i=0,n=/\s/,s=this.session.tokenRe;if(s.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else{for(;(t=e[i])&&n.test(t);)i++;if(i<1)for(s.lastIndex=0;(t=e[i])&&!s.test(t);)if(s.lastIndex=0,i++,n.test(t)){if(i>2){i--;break}for(;(t=e[i])&&n.test(t);)i++;if(i>2)break}}return s.lastIndex=0,i},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),s=this.session.getFoldAt(e,t,1);if(s)return this.moveCursorTo(s.end.row,s.end.column);if(t==i.length){var o=this.doc.getLength();do{e++,n=this.doc.getLine(e)}while(e<o&&/^\s*$/.test(n));/^\s+/.test(n)||(n=""),t=0}var r=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+r)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))return this.moveCursorTo(e.start.row,e.start.column);var n=this.session.getLine(t).substring(0,i);if(0===i){do{t--,n=this.doc.getLine(t)}while(t>0&&/^\s*$/.test(n));i=n.length,/\s+$/.test(n)||(n="")}var o=s.stringReverse(n),r=this.$shortWordEndIndex(o);return this.moveCursorTo(t,i-r)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var i,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var s=this.session.lineWidgets[this.lead.row];e<0?e-=s.rowsAbove||0:e>0&&(e+=s.rowCount-(s.rowsAbove||0))}var o=this.session.screenToDocumentPosition(n.row+e,n.column,i);0!==e&&0===t&&o.row===this.lead.row&&(o.column,this.lead.column),this.moveCursorTo(o.row,o.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0;var s=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(s.charAt(t))&&s.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,i){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return r.fromPoints(t,i)}catch(n){return r.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=r.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,i){"use strict";var n=e("./config"),s=2e3,o=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var i=this.states[t],n=[],s=0,o=this.matchMappings[t]={defaultToken:"text"},r="g",a=[],l=0;l<i.length;l++){var h=i[l];if(h.defaultToken&&(o.defaultToken=h.defaultToken),h.caseInsensitive&&(r="gi"),null!=h.regex){h.regex instanceof RegExp&&(h.regex=h.regex.toString().slice(1,-1));var c=h.regex,u=new RegExp("(?:("+c+")|(.))").exec("a").length-2;Array.isArray(h.token)?1==h.token.length||1==u?h.token=h.token[0]:u-1!=h.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:h,groupCount:u-1}),h.token=h.token[0]):(h.tokenArray=h.token,h.token=null,h.onMatch=this.$arrayTokens):"function"!=typeof h.token||h.onMatch||(h.onMatch=u>1?this.$applyToken:h.token),u>1&&(/\\\d/.test(h.regex)?c=h.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+s+1)}):(u=1,c=this.removeCapturingGroups(h.regex)),h.splitRegex||"string"==typeof h.token||a.push(h)),o[s]=l,s+=u,n.push(c),h.onMatch||(h.onMatch=null)}}n.length||(o[0]=0,n.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,r)},this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",r)}};(function(){this.$setMaxTokenCount=function(e){s=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeof i)return[{type:i,value:e}];for(var n=[],s=0,o=i.length;s<o;s++)t[s]&&(n[n.length]={type:i[s],value:t[s]});return n},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var i=[],n=this.tokenArray,s=0,o=n.length;s<o;s++)t[s+1]&&(i[i.length]={type:n[s],value:t[s+1]});return i},this.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e})},this.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var i=0,n=!1,s={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,o,r,a,l){return n?n="]"!=a:a?n=!0:r?(i==s.stack&&(s.end=l+1,s.stack=-1),i--):o&&(i++,1!=o.length&&(s.stack=i,s.start=l)),e}),null!=s.end&&/^\)*$/.test(e.substr(s.end))&&(e=e.substring(0,s.start)+e.substr(s.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeof t){var i=t.slice(0);"#tmp"===(t=i[0])&&(i.shift(),t=i.shift())}else i=[];var n=t||"start",o=this.states[n];o||(n="start",o=this.states[n]);var r=this.matchMappings[n],a=this.regExps[n];a.lastIndex=0;for(var l,h=[],c=0,u=0,d={type:null,value:""};l=a.exec(e);){var g=r.defaultToken,f=null,m=l[0],p=a.lastIndex;if(p-m.length>c){var v=e.substring(c,p-m.length);d.type==g?d.value+=v:(d.type&&h.push(d),d={type:g,value:v})}for(var w=0;w<l.length-2;w++)if(void 0!==l[w+1]){g=(f=o[r[w]]).onMatch?f.onMatch(m,n,i,e):f.token,f.next&&(n="string"==typeof f.next?f.next:f.next(n,i),(o=this.states[n])||(this.reportError("state doesn't exist",n),n="start",o=this.states[n]),r=this.matchMappings[n],c=p,(a=this.regExps[n]).lastIndex=p),f.consumeLineEnd&&(c=p);break}if(m)if("string"==typeof g)f&&!1===f.merge||d.type!==g?(d.type&&h.push(d),d={type:g,value:m}):d.value+=m;else if(g){d.type&&h.push(d),d={type:null,value:""};for(w=0;w<g.length;w++)h.push(g[w])}if(c==e.length)break;if(c=p,u++>s){for(u>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c<e.length;)d.type&&h.push(d),d={value:e.substring(c,c+=500),type:"overflow"};n="start",i=[];break}}return d.type&&h.push(d),i.length>1&&i[0]!==n&&i.unshift("#tmp",n),{tokens:h,state:i.length?i:n}},this.reportError=n.reportError}).call(o.prototype),t.Tokenizer=o}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,i){"use strict";var n=e("../lib/lang"),s=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],s=0;s<n.length;s++){var o=n[s];(o.next||o.onMatch)&&("string"==typeof o.next&&0!==o.next.indexOf(t)&&(o.next=t+o.next),o.nextState&&0!==o.nextState.indexOf(t)&&(o.nextState=t+o.nextState))}this.$rules[t+i]=n}else for(var i in e)this.$rules[i]=e[i]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,i,s,o){var r="function"==typeof e?(new e).getRules():e;if(s)for(var a=0;a<s.length;a++)s[a]=t+s[a];else for(var l in s=[],r)s.push(t+l);if(this.addRules(r,t),i){var h=Array.prototype[o?"push":"unshift"];for(a=0;a<s.length;a++)h.apply(this.$rules[s[a]],n.deepCopy(i))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return("start"!=e||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){var i=0,n=this.$rules;Object.keys(n).forEach(function s(o){var r=n[o];r.processed=!0;for(var a=0;a<r.length;a++){var l=r[a],h=null;Array.isArray(l)&&(h=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0);var c=l.next||l.push;if(c&&Array.isArray(c)){var u=l.stateName;u||("string"!=typeof(u=l.token)&&(u=u[0]||""),n[u]&&(u+=i++)),n[u]=c,l.next=u,s(u)}else"pop"==c&&(l.next=t);if(l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var d in l.rules)n[d]?n[d].push&&n[d].push.apply(n[d],l.rules[d]):n[d]=l.rules[d];var g="string"==typeof l?l:l.include;if(g&&(h=Array.isArray(g)?g.map(function(e){return n[e]}):n[g]),h){var f=[a,1].concat(h);l.noEscape&&(f=f.filter(function(e){return!e.next})),r.splice.apply(r,f),a--}l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}},this)},this.createKeywordMapper=function(e,t,i,n){var s=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach(function(t){for(var o=e[t].split(n||"|"),r=o.length;r--;){var a=o[r];this.$keywordList.push(a),i&&(a=a.toLowerCase()),s[a]=t}},this),e=null,i?function(e){return s[e.toLowerCase()]||t}:function(e){return s[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(s.prototype),t.TextHighlightRules=s}),ace.define("ace/mode/behaviour",["require","exports","module"],function(e,t,i){"use strict";var n=function(){this.$behaviours={}};(function(){this.add=function(e,t,i){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=i},this.addBehaviours=function(e){for(var t in e)for(var i in e[t])this.add(t,i,e[t][i])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)var i=(new e).getBehaviours(t);else i=e.getBehaviours(t);this.addBehaviours(i)},this.getBehaviours=function(e){if(e){for(var t={},i=0;i<e.length;i++)this.$behaviours[e[i]]&&(t[e[i]]=this.$behaviours[e[i]]);return t}return this.$behaviours}}).call(n.prototype),t.Behaviour=n}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range,s=function(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,i);this.$tokenIndex=n?n.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){var e;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,i=e[t].start;if(void 0!==i)return i;for(i=0;t>0;)i+=e[t-=1].value.length;return i},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)}}).call(s.prototype),t.TokenIterator=s}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,i){"use strict";var n,s=e("../../lib/oop"),o=e("../behaviour").Behaviour,r=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],h=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},u={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return n=c[t];n=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},g=function(e,t,i,n){var s=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,s,e.end.column+(s?0:1)]}},f=function(e){this.add("braces","insertion",function(t,i,s,o,r){var l=s.getCursorPosition(),h=o.doc.getLine(l.row);if("{"==r){d(s);var c=s.getSelectionRange(),u=o.doc.getTextRange(c);if(""!==u&&"{"!==u&&s.getWrapBehavioursEnabled())return g(c,u,"{","}");if(f.isSaneInsertion(s,o))return/[\]\}\)]/.test(h[l.column])||s.inMultiSelectMode||e&&e.braces?(f.recordAutoInsert(s,o,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(s,o,"{"),{text:"{",selection:[1,1]})}else if("}"==r){if(d(s),"}"==h.substring(l.column,l.column+1))if(null!==o.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&f.isAutoInsertedClosing(l,h,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==r||"\r\n"==r){d(s);var m="";if(f.isMaybeInsertedClosing(l,h)&&(m=a.stringRepeat("}",n.maybeInsertedBrackets),f.clearMaybeInsertedClosing()),"}"===h.substring(l.column,l.column+1)){var p=o.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!p)return null;var v=this.$getIndent(o.getLine(p.row))}else{if(!m)return void f.clearMaybeInsertedClosing();v=this.$getIndent(h)}var w=v+o.getTabString();return{text:"\n"+w+"\n"+v+m,selection:[1,w.length,1,w.length]}}f.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,i,s,o){var r=s.doc.getTextRange(o);if(!o.isMultiLine()&&"{"==r){if(d(i),"}"==s.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o;n.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,i,n,s){if("("==s){d(i);var o=i.getSelectionRange(),r=n.doc.getTextRange(o);if(""!==r&&i.getWrapBehavioursEnabled())return g(o,r,"(",")");if(f.isSaneInsertion(i,n))return f.recordAutoInsert(i,n,")"),{text:"()",selection:[1,1]}}else if(")"==s){d(i);var a=i.getCursorPosition(),l=n.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1))if(null!==n.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,s))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,i,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&"("==o&&(d(i),")"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s}),this.add("brackets","insertion",function(e,t,i,n,s){if("["==s){d(i);var o=i.getSelectionRange(),r=n.doc.getTextRange(o);if(""!==r&&i.getWrapBehavioursEnabled())return g(o,r,"[","]");if(f.isSaneInsertion(i,n))return f.recordAutoInsert(i,n,"]"),{text:"[]",selection:[1,1]}}else if("]"==s){d(i);var a=i.getCursorPosition(),l=n.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1))if(null!==n.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,s))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,i,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&"["==o&&(d(i),"]"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s}),this.add("string_dquotes","insertion",function(e,t,i,n,s){var o=n.$mode.$quotes||u;if(1==s.length&&o[s]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(s))return;d(i);var r=s,a=i.getSelectionRange(),l=n.doc.getTextRange(a);if(!(""===l||1==l.length&&o[l])&&i.getWrapBehavioursEnabled())return g(a,l,r,r);if(!l){var h=i.getCursorPosition(),c=n.doc.getLine(h.row),f=c.substring(h.column-1,h.column),m=c.substring(h.column,h.column+1),p=n.getTokenAt(h.row,h.column),v=n.getTokenAt(h.row,h.column+1);if("\\"==f&&p&&/escape/.test(p.type))return null;var w,$=p&&/string|escape/.test(p.type),b=!v||/string|escape/.test(v.type);if(m==r)(w=$!==b)&&/string\.end/.test(v.type)&&(w=!1);else{if($&&!b)return null;if($&&b)return null;var y=n.$mode.tokenRe;y.lastIndex=0;var C=y.test(f);y.lastIndex=0;var S=y.test(f);if(C||S)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var x=c[h.column-2];if(f==r&&(x==r||y.test(x)))return null;w=!0}return{text:w?r+r:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,i,n,s){var o=n.$mode.$quotes||u,r=n.doc.getTextRange(s);if(!s.isMultiLine()&&o.hasOwnProperty(r)&&(d(i),n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)==r))return s.end.column++,s})};f.isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new r(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(i.row)[i.column]))return!0;var s=new r(t,i.row,i.column+1);if(!this.$matchTokenType(s.getCurrentToken()||"text",l))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",h)},f.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},f.recordAutoInsert=function(e,t,i){var s=e.getCursorPosition(),o=t.doc.getLine(s.row);this.isAutoInsertedClosing(s,o,n.autoInsertedLineEnd[0])||(n.autoInsertedBrackets=0),n.autoInsertedRow=s.row,n.autoInsertedLineEnd=i+o.substr(s.column),n.autoInsertedBrackets++},f.recordMaybeInsert=function(e,t,i){var s=e.getCursorPosition(),o=t.doc.getLine(s.row);this.isMaybeInsertedClosing(s,o)||(n.maybeInsertedBrackets=0),n.maybeInsertedRow=s.row,n.maybeInsertedLineStart=o.substr(0,s.column)+i,n.maybeInsertedLineEnd=o.substr(s.column),n.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(e,t,i){return n.autoInsertedBrackets>0&&e.row===n.autoInsertedRow&&i===n.autoInsertedLineEnd[0]&&t.substr(e.column)===n.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(e,t){return n.maybeInsertedBrackets>0&&e.row===n.maybeInsertedRow&&t.substr(e.column)===n.maybeInsertedLineEnd&&t.substr(0,e.column)==n.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){n.autoInsertedLineEnd=n.autoInsertedLineEnd.substr(1),n.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){n&&(n.maybeInsertedBrackets=0,n.maybeInsertedRow=-1)},s.inherits(f,o),t.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(e,t,i){"use strict";for(var n=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],s=0,o=[],r=0;r<n.length;r+=2)o.push(s+=n[r]),n[r+1]&&o.push(45,s+=n[r+1]);t.wordChars=String.fromCharCode.apply(null,o)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var n=e("../config"),s=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,r=e("./behaviour/cstyle").CstyleBehaviour,a=e("../unicode"),l=e("../lib/lang"),h=e("../token_iterator").TokenIterator,c=e("../range").Range,u=function(){this.HighlightRules=o};(function(){this.$defaultBehaviour=new r,this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new s(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,n){var s=t.doc,o=!0,r=!0,a=1/0,h=t.getTabSize(),c=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))m=this.lineCommentStart.map(l.escapeRegExp).join("|"),g=this.lineCommentStart[0];else m=l.escapeRegExp(this.lineCommentStart),g=this.lineCommentStart;m=new RegExp("^(\\s*)(?:"+m+") ?"),c=t.getUseSoftTabs();w=function(e,t){var i=e.match(m);if(i){var n=i[1].length,o=i[0].length;d(e,n,o)||" "!=i[0][o-1]||o--,s.removeInLine(t,n,o)}};var u=g+" ",d=(v=function(e,t){o&&!/\S/.test(e)||(d(e,a,a)?s.insertInLine({row:t,column:a},u):s.insertInLine({row:t,column:a},g))},$=function(e,t){return m.test(e)},function(e,t,i){for(var n=0;t--&&" "==e.charAt(t);)n++;if(n%h!=0)return!1;for(n=0;" "==e.charAt(i++);)n++;return h>2?n%h!=h-1:n%h==0})}else{if(!this.blockComment)return!1;var g=this.blockComment.start,f=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(g)+")"),p=new RegExp("(?:"+l.escapeRegExp(f)+")\\s*$"),v=function(e,t){$(e,t)||o&&!/\S/.test(e)||(s.insertInLine({row:t,column:e.length},f),s.insertInLine({row:t,column:a},g))},w=function(e,t){var i;(i=e.match(p))&&s.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(m))&&s.removeInLine(t,i[1].length,i[0].length)},$=function(e,i){if(m.test(e))return!0;for(var n=t.getTokens(i),s=0;s<n.length;s++)if("comment"===n[s].type)return!0}}function b(e){for(var t=i;t<=n;t++)e(s.getLine(t),t)}var y=1/0;b(function(e,t){var i=e.search(/\S/);-1!==i?(i<a&&(a=i),r&&!$(e,t)&&(r=!1)):y>e.length&&(y=e.length)}),a==1/0&&(a=y,o=!1,r=!1),c&&a%h!=0&&(a=Math.floor(a/h)*h),b(r?w:v)},this.toggleBlockComment=function(e,t,i,n){var s=this.blockComment;if(s){!s.start&&s[0]&&(s=s[0]);var o,r,a=(m=new h(t,n.row,n.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var u,d;a&&/comment/.test(a.type);){if(-1!=(p=a.value.indexOf(s.start))){var g=m.getCurrentTokenRow(),f=m.getCurrentTokenColumn()+p;u=new c(g,f,g,f+s.start.length);break}a=m.stepBackward()}var m;for(a=(m=new h(t,n.row,n.column)).getCurrentToken();a&&/comment/.test(a.type);){var p;if(-1!=(p=a.value.indexOf(s.end))){g=m.getCurrentTokenRow(),f=m.getCurrentTokenColumn()+p;d=new c(g,f,g,f+s.end.length);break}a=m.stepForward()}d&&t.remove(d),u&&(t.remove(u),o=u.start.row,r=-s.start.length)}else r=s.start.length,o=i.start.row,t.insert(i.end,s.end),t.insert(i.start,s.start);l.start.row==o&&(l.start.column+=r),l.end.row==o&&(l.end.column+=r),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},this.autoOutdent=function(e,t,i){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var i=e[t],s=i.prototype.$id,o=n.$modes[s];o||(n.$modes[s]=o=new i),n.$modes[t]||(n.$modes[t]=o),this.$embeds.push(t),this.$modes[t]=o}var r=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;t<r.length;t++)!function(e){var i=r[t],n=e[i];e[r[t]]=function(){return this.$delegator(i,arguments,n)}}(this)},this.$delegator=function(e,t,i){var n=t[0]||"start";if("string"!=typeof n){if(Array.isArray(n[2])){var s=n[2][n[2].length-1];if(r=this.$modes[s])return r[e].apply(r,[n[1]].concat([].slice.call(t,1)))}n=n[0]||"start"}for(var o=0;o<this.$embeds.length;o++)if(this.$modes[this.$embeds[o]]){var r,a=n.split(this.$embeds[o]);if(!a[0]&&a[1])return t[0]=a[1],(r=this.$modes[this.$embeds[o]])[e].apply(r,t)}var l=i.apply(this,t);return i?l:void 0},this.transformAction=function(e,t,i,n,s){if(this.$behaviour){var o=this.$behaviour.getBehaviours();for(var r in o)if(o[r][t]){var a=o[r][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,i=[];for(var n in t)for(var s=t[n],o=0,r=s.length;o<r;o++)if("string"==typeof s[o].token)/keyword|support|storage/.test(s[o].token)&&i.push(s[o].regex);else if("object"==typeof s[o].token)for(var a=0,l=s[o].token.length;a<l;a++)if(/keyword|support|storage/.test(s[o].token[a])){n=s[o].regex.match(/\(.+?\)/g)[a];i.push(n.substr(1,n.length-2))}this.completionKeywords=i}return e?i.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,i,n){return(this.$keywordList||this.$createKeywordList()).map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(u.prototype),t.Mode=u}),ace.define("ace/apply_delta",["require","exports","module"],function(e,t,i){"use strict";t.applyDelta=function(e,t,i){var n=t.start.row,s=t.start.column,o=e[n]||"";switch(t.action){case"insert":if(1===t.lines.length)e[n]=o.substring(0,s)+t.lines[0]+o.substring(s);else{var r=[n,1].concat(t.lines);e.splice.apply(e,r),e[n]=o.substring(0,s)+e[n],e[n+t.lines.length-1]+=o.substring(s)}break;case"remove":var a=t.end.column,l=t.end.row;n===l?e[n]=o.substring(0,s)+o.substring(a):e.splice(n,l-n+1,o.substring(0,s)+e[l].substring(a))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,o=t.Anchor=function(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===i?this.setPosition(t.row,t.column):this.setPosition(t,i)};(function(){function e(e,t,i){var n=i?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&n}n.implement(this,s),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(t){if(!(t.start.row==t.end.row&&t.start.row!=this.row||t.start.row>this.row)){var i=function(t,i,n){var s="insert"==t.action,o=(s?1:-1)*(t.end.row-t.start.row),r=(s?1:-1)*(t.end.column-t.start.column),a=t.start,l=s?a:t.end;if(e(i,a,n))return{row:i.row,column:i.column};if(e(l,i,!n))return{row:i.row+o,column:i.column+(i.row==l.row?r:0)};return{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(i.row,i.column,!0)}},this.setPosition=function(e,t,i){var n;if(n=i?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=n.row||this.column!=n.column){var s={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:s,value:n})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var i={};return e>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):e<0?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),t<0&&(i.column=0),i}}).call(o.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./apply_delta").applyDelta,o=e("./lib/event_emitter").EventEmitter,r=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){n.implement(this,o),this.setValue=function(e){var t=this.getLength()-1;this.remove(new r(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var i=t.length-1;e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column),n=this.pos(e.row,e.column+t.length);return this.applyDelta({start:i,end:n,action:"insert",lines:[t]},!0),this.clonePos(n)},this.clippedPos=function(e,t){var i=this.getLength();void 0===e?e=i:e<0?e=0:e>=i&&(e=i-1,t=void 0);var n=this.getLine(e);return null==t&&(t=n.length),{row:e,column:t=Math.min(Math.max(t,0),n.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var i=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),i=0):(t=[""].concat(t),e--,i=this.$lines[e].length),this.insertMergedLines({row:e,column:i},t)},this.insertMergedLines=function(e,t){var i=this.clippedPos(e.row,e.column),n={row:i.row+t.length-1,column:(1==t.length?i.column:0)+t[t.length-1].length};return this.applyDelta({start:i,end:n,action:"insert",lines:t}),this.clonePos(n)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),i=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:i,action:"remove",lines:this.getLinesForRange({start:t,end:i})}),this.clonePos(t)},this.removeInLine=function(e,t,i){var n=this.clippedPos(e,t),s=this.clippedPos(e,i);return this.applyDelta({start:n,end:s,action:"remove",lines:this.getLinesForRange({start:n,end:s})},!0),this.clonePos(n)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var i=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&e>0,n=t<this.getLength()-1,s=i?e-1:e,o=i?this.getLine(s).length:0,a=n?t+1:t,l=n?0:this.getLine(a).length,h=new r(s,o,a,l),c=this.$lines.slice(e,t+1);return this.applyDelta({start:h.start,end:h.end,action:"remove",lines:this.getLinesForRange(h)}),c},this.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof r||(e=r.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!r.comparePoints(e.start,e.end))||(i&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(s(this.$lines,e,t),this._signal("change",e)))},this.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row<t&&e.end.row<t||"insert"==e.action&&e.start.row<=t)&&this.applyDelta(e)},this.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,n=i.length-t+1,s=e.start.row,o=e.start.column,r=0,a=0;r<n;r=a){a+=t-1;var l=i.slice(r,a);l.push(""),this.applyDelta({start:this.pos(s+r,o),end:this.pos(s+a,o=0),action:e.action,lines:l},!0)}e.lines=i.slice(r),e.start.row=s+r,e.start.column=o,this.applyDelta(e,!0)},this.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=t||0,o=i.length;s<o;s++)if((e-=i[s].length+n)<0)return{row:s,column:e+i[s].length+n};return{row:o-1,column:e+i[o-1].length+n}},this.positionToIndex=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=0,o=Math.min(e.row,i.length),r=t||0;r<o;++r)s+=i[r].length+n;return s+e.column}}).call(l.prototype),t.Document=l}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,o=function(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var i=this;this.$worker=function(){if(i.running){for(var e=new Date,t=i.currentLine,n=-1,s=i.doc,o=t;i.lines[t];)t++;var r=s.getLength(),a=0;for(i.running=!1;t<r;){i.$tokenizeRow(t),n=t;do{t++}while(i.lines[t]);if(++a%5==0&&new Date-e>20){i.running=setTimeout(i.$worker,20);break}}i.currentLine=t,-1==n&&(n=t),o<=n&&i.fireUpdateEvent(o,n)}}};(function(){n.implement(this,s),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var i={first:e,last:t};this._signal("update",{data:i})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,i+1,null),this.states.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),i=this.states[e-1],n=this.tokenizer.getLineTokens(t,i,e);return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens}}).call(o.prototype),t.BackgroundTokenizer=o}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";var n=e("./lib/lang"),s=(e("./lib/oop"),e("./range").Range),o=function(e,t,i){this.setRegexp(e),this.clazz=t,this.type=i||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,i,o){if(this.regExp)for(var r=o.firstRow,a=o.lastRow,l=r;l<=a;l++){var h=this.cache[l];null==h&&((h=n.getMatchOffsets(i.getLine(l),this.regExp)).length>this.MAX_RANGES&&(h=h.slice(0,this.MAX_RANGES)),h=h.map(function(e){return new s(l,e.offset,l,e.offset+e.length)}),this.cache[l]=h.length?h:"");for(var c=h.length;c--;)t.drawSingleLineMarker(e,h[c].toScreenRange(i),this.clazz,o)}}}).call(o.prototype),t.SearchHighlight=o}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("../range").Range;function s(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var i=t[t.length-1];this.range=new n(t[0].start.row,t[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,i){var n,s,o=0,r=this.folds,a=!0;null==t&&(t=this.end.row,i=this.end.column);for(var l=0;l<r.length;l++){if(-1==(s=(n=r[l]).range.compareStart(t,i)))return void e(null,t,i,o,a);if(!e(null,n.start.row,n.start.column,o,a)&&e(n.placeholder,n.start.row,n.start.column,o)||0===s)return;a=!n.sameRow,o=n.end.column}e(null,t,i,o,a)},this.getNextFoldTo=function(e,t){for(var i,n,s=0;s<this.folds.length;s++){if(-1==(n=(i=this.folds[s]).range.compareEnd(e,t)))return{fold:i,kind:"after"};if(0===n)return{fold:i,kind:"inside"}}return null},this.addRemoveChars=function(e,t,i){var n,s,o=this.getNextFoldTo(e,t);if(o)if(n=o.fold,"inside"==o.kind&&n.start.column!=t&&n.start.row!=e)window.console&&window.console.log(e,t,n);else if(n.start.row==e){var r=(s=this.folds).indexOf(n);for(0===r&&(this.start.column+=i);r<s.length;r++){if((n=s[r]).start.column+=i,!n.sameRow)return;n.end.column+=i}this.end.column+=i}},this.split=function(e,t){var i=this.getNextFoldTo(e,t);if(!i||"inside"==i.kind)return null;var n=i.fold,o=this.folds,r=this.foldData,a=o.indexOf(n),l=o[a-1];this.end.row=l.end.row,this.end.column=l.end.column;var h=new s(r,o=o.splice(a,o.length-a));return r.splice(r.indexOf(this)+1,0,h),h},this.merge=function(e){for(var t=e.folds,i=0;i<t.length;i++)this.addFold(t[i]);var n=this.foldData;n.splice(n.indexOf(e),1)},this.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach(function(t){e.push("  "+t.toString())}),e.push("]"),e.join("\n")},this.idxToPosition=function(e){for(var t=0,i=0;i<this.folds.length;i++){var n=this.folds[i];if((e-=n.start.column-t)<0)return{row:n.start.row,column:n.start.column+e};if((e-=n.placeholder.length)<0)return n.start;t=n.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(s.prototype),t.FoldLine=s}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range.comparePoints,s=function(){this.ranges=[],this.$bias=1};(function(){this.comparePoints=n,this.pointIndex=function(e,t,i){for(var s=this.ranges,o=i||0;o<s.length;o++){var r=s[o],a=n(e,r.end);if(!(a>0)){var l=n(e,r.start);return 0===a?t&&0!==l?-o-2:o:l>0||0===l&&!t?o:-o-1}}return-o-1},this.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t);i<0&&(i=-i-1);var n=this.pointIndex(e.end,t,i);return n<0?n=-n-1:n++,this.ranges.splice(i,n-i,e)},this.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],i=this.ranges,s=(i=i.sort(function(e,t){return n(e.start,t.start)}))[0],o=1;o<i.length;o++){e=s,s=i[o];var r=n(e.end,s.start);r<0||(0!=r||e.isEmpty()||s.isEmpty())&&(n(e.end,s.end)<0&&(e.end.row=s.end.row,e.end.column=s.end.column),i.splice(o,1),t.push(s),s=e,o--)}return this.ranges=i,t},this.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];var n=this.pointIndex({row:e,column:0});n<0&&(n=-n-1);var s=this.pointIndex({row:t,column:0},n);s<0&&(s=-s-1);for(var o=[],r=n;r<s;r++)o.push(i[r]);return o},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){for(var t=e.start,i=e.end,n=t.row,s=i.row,o=this.ranges,r=0,a=o.length;r<a;r++){if((c=o[r]).end.row>=n)break}if("insert"==e.action)for(var l=s-n,h=-t.column+i.column;r<a;r++){if((c=o[r]).start.row>n)break;if(c.start.row==n&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=h,c.start.row+=l)),c.end.row==n&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&h>0&&r<a-1&&c.end.column>c.start.column&&c.end.column==o[r+1].start.column&&(c.end.column-=h),c.end.column+=h,c.end.row+=l}}else for(l=n-s,h=t.column-i.column;r<a;r++){if((c=o[r]).start.row>s)break;c.end.row<s&&(n<c.end.row||n==c.end.row&&t.column<c.end.column)?(c.end.row=n,c.end.column=t.column):c.end.row==s?c.end.column<=i.column?(l||c.end.column>t.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=h,c.end.row+=l):c.end.row>s&&(c.end.row+=l),c.start.row<s&&(n<c.start.row||n==c.start.row&&t.column<c.start.column)?(c.start.row=n,c.start.column=t.column):c.start.row==s?c.start.column<=i.column?(l||c.start.column>t.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=h,c.start.row+=l):c.start.row>s&&(c.start.row+=l)}if(0!=l&&r<a)for(;r<a;r++){var c;(c=o[r]).start.row+=l,c.end.row+=l}}}).call(s.prototype),t.RangeList=s}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list","ace/lib/oop"],function(e,t,i){"use strict";var n=e("../range_list").RangeList,s=e("../lib/oop"),o=t.Fold=function(e,t){this.foldLine=null,this.placeholder=t,this.range=e,this.start=e.start,this.end=e.end,this.sameRow=e.start.row==e.end.row,this.subFolds=this.ranges=[]};function r(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function a(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}s.inherits(o,n),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(t){t.setFoldLine(e)})},this.clone=function(){var e=this.range.clone(),t=new o(e,this.placeholder);return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){var t,i;t=e,i=this.start,r(t.start,i),r(t.end,i);for(var n=e.start.row,s=e.start.column,o=0,a=-1;o<this.subFolds.length&&1==(a=this.subFolds[o].range.compare(n,s));o++);var l=this.subFolds[o],h=0;if(0==a){if(l.range.containsRange(e))return l.addSubFold(e);h=1}n=e.range.end.row,s=e.range.end.column;var c=o;for(a=-1;c<this.subFolds.length&&1==(a=this.subFolds[c].range.compare(n,s));c++);0==a&&c++;for(var u=this.subFolds.splice(o,c-o,e),d=0==a?u.length-1:u.length,g=h;g<d;g++)e.addSubFold(u[g]);return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return function(e,t){a(e.start,t),a(e.end,t)}(e,this.start)}}.call(o.prototype)}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t,i){"use strict";var n=e("../range").Range,s=e("./fold_line").FoldLine,o=e("./fold").Fold,r=e("../token_iterator").TokenIterator;t.Folding=function(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;for(var s=n.folds,o=0;o<s.length;o++){var r=s[o].range;if(r.contains(e,t)){if(1==i&&r.isEnd(e,t)&&!r.isEmpty())continue;if(-1==i&&r.isStart(e,t)&&!r.isEmpty())continue;return s[o]}}},this.getFoldsInRange=function(e){var t=e.start,i=e.end,n=this.$foldData,s=[];t.column+=1,i.column-=1;for(var o=0;o<n.length;o++){var r=n[o].range.compareRange(e);if(2!=r){if(-2==r)break;for(var a=n[o].folds,l=0;l<a.length;l++){var h=a[l];if(-2==(r=h.range.compareRange(e)))break;if(2!=r){if(42==r)break;s.push(h)}}}}return t.column-=1,i.column+=1,s},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)}else t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,i=0;i<t.length;i++)for(var n=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);return e},this.getFoldStringAt=function(e,t,i,n){if(!(n=n||this.getFoldLine(e)))return null;for(var s,o,r={end:{column:0}},a=0;a<n.folds.length;a++){var l=(o=n.folds[a]).range.compareEnd(e,t);if(-1==l){s=this.getLine(o.start.row).substring(r.end.column,o.start.column);break}if(0===l)return null;r=o}return s||(s=this.getLine(o.start.row).substring(r.end.column)),-1==i?s.substring(0,t-r.end.column):1==i?s.substring(t-r.end.column):s},this.getFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0);n<i.length;n++){var s=i[n];if(s.start.row<=e&&s.end.row>=e)return s;if(s.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0);n<i.length;n++){var s=i[n];if(s.end.row>=e)return s}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,s=0;s<i.length;s++){var o=i[s],r=o.end.row,a=o.start.row;if(r>=t){a<t&&(a>=e?n-=t-a:n=0);break}r>=e&&(n-=a>=e?r-a:r-e+1)}return n},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var i,n=this.$foldData,r=!1;e instanceof o?i=e:(i=new o(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(i.range);var a=i.start.row,l=i.start.column,h=i.end.row,c=i.end.column,u=this.getFoldAt(a,l,1),d=this.getFoldAt(h,c,-1);if(u&&d==u)return u.addSubFold(i);u&&!u.range.isStart(a,l)&&this.removeFold(u),d&&!d.range.isEnd(h,c)&&this.removeFold(d);var g=this.getFoldsInRange(i.range);g.length>0&&(this.removeFolds(g),i.collapseChildren||g.forEach(function(e){i.addSubFold(e)}));for(var f=0;f<n.length;f++){var m=n[f];if(h==m.start.row){m.addFold(i),r=!0;break}if(a==m.end.row){if(m.addFold(i),r=!0,!i.sameRow){var p=n[f+1];if(p&&p.start.row==h){m.merge(p);break}}break}if(h<=m.start.row)break}return r||(m=this.$addFoldLine(new s(this.$foldData,i))),this.$useWrapMode?this.$updateWrapData(m.start.row,m.start.row):this.$updateRowLengthCache(m.start.row,m.start.row),this.$modified=!0,this._signal("changeFold",{data:i,action:"add"}),i},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,i=t.start.row,n=t.end.row,s=this.$foldData,o=t.folds;if(1==o.length)s.splice(s.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))o.pop(),t.end.row=o[o.length-1].end.row,t.end.column=o[o.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))o.shift(),t.start.row=o[0].start.row,t.start.column=o[0].start.column;else if(e.sameRow)o.splice(o.indexOf(e),1);else{var r=t.split(e.start.row,e.start.column);(o=r.folds).shift(),r.start.row=o[0].start.row,r.start.column=o[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(i,n):this.$updateRowLengthCache(i,n)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach(function(t){e.restoreRange(t),this.addFold(t)},this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var i,s;if(null==e?(i=new n(0,0,this.getLength(),0),null==t&&(t=!0)):i="number"==typeof e?new n(e,0,e,this.getLine(e).length):"row"in e?n.fromPoints(e,e):e,s=this.getFoldsInRangeList(i),0!=t?this.removeFolds(s):this.expandFolds(s),s.length)return s},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var i=this.getFoldLine(e,t);return i?i.end.row:e},this.getRowFoldStart=function(e,t){var i=this.getFoldLine(e,t);return i?i.start.row:e},this.getFoldDisplayLine=function(e,t,i,n,s){null==n&&(n=e.start.row),null==s&&(s=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var o=this.doc,r="";return e.walk(function(e,t,i,a){if(!(t<n)){if(t==n){if(i<s)return;a=Math.max(s,a)}r+=null!=e?e:o.getLine(t).substring(a,i)}},t,i),r},this.getDisplayLine=function(e,t,i,n){var s,o=this.getFoldLine(e);return o?this.getFoldDisplayLine(o,e,t,i,n):(s=this.doc.getLine(e)).substring(n||0,t||s.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map(function(t){var i=t.folds.map(function(e){return e.clone()});return new s(e,i)})},this.toggleFold=function(e){var t,i,n=this.selection.getRange();if(n.isEmpty()){var s=n.start;if(t=this.getFoldAt(s.row,s.column))return void this.expandFold(t);(i=this.findMatchingBracket(s))?1==n.comparePoint(i)?n.end=i:(n.start=i,n.start.column++,n.end.column--):(i=this.findMatchingBracket({row:s.row,column:s.column+1}))?(1==n.comparePoint(i)?n.end=i:n.start=i,n.start.column++):n=this.getCommentFoldRange(s.row,s.column)||n}else{var o=this.getFoldsInRange(n);if(e&&o.length)return void this.expandFolds(o);1==o.length&&(t=o[0])}if(t||(t=this.getFoldAt(n.start.row,n.start.column)),t&&t.range.toString()==n.toString())this.expandFold(t);else{var r="...";if(!n.isMultiLine()){if((r=this.getTextRange(n)).length<4)return;r=r.trim().substring(0,2)+".."}this.addFold(r,n)}},this.getCommentFoldRange=function(e,t,i){var s=new r(this,e,t),o=s.getCurrentToken(),a=o&&o.type;if(o&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start");var l=new RegExp(a),h=new n;if(1!=i){do{o=s.stepBackward()}while(o&&l.test(o.type));s.stepForward()}if(h.start.row=s.getCurrentTokenRow(),h.start.column=s.getCurrentTokenColumn()+2,s=new r(this,e,t),-1!=i){var c=-1;do{if(o=s.stepForward(),-1==c){var u=this.getState(s.$row);l.test(u)||(c=s.$row)}else if(s.$row>c)break}while(o&&l.test(o.type));o=s.stepBackward()}else o=s.getCurrentToken();return h.end.row=s.getCurrentTokenRow(),h.end.column=s.getCurrentTokenColumn()+o.value.length-2,h}},this.foldAll=function(e,t,i,n){null==i&&(i=1e5);var s=this.foldWidgets;if(s){t=t||this.getLength();for(var o=e=e||0;o<t;o++)if(null==s[o]&&(s[o]=this.getFoldWidget(o)),"start"==s[o]&&(!n||n(o))){var r=this.getFoldWidgetRange(o);r&&r.isMultiLine()&&r.end.row<=t&&r.start.row>=e&&(o=r.end.row,r.collapseChildren=i,this.addFold("...",r))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,function(t){for(var i=e.getTokens(t),n=0;n<i.length;n++){var s=i[n];if("text"!=s.type||!/^\s+$/.test(s.value))return!!/comment/.test(s.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var n,s=e-1;s>=0;){var o=i[s];if(null==o&&(o=i[s]=this.getFoldWidget(s)),"start"==o){var r=this.getFoldWidgetRange(s);if(n||(n=r),r&&r.end.row>=e)break}s--}return{range:-1!==s&&r,firstRange:n}},this.onFoldWidgetClick=function(e,t){var i={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,i)){var n=t.target||t.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),n=this.getLine(e),s="end"===i?-1:1,o=this.getFoldAt(e,-1===s?0:n.length,s);if(o)return t.children||t.all?this.removeFold(o):this.expandFold(o),o;var r=this.getFoldWidgetRange(e,!0);if(r&&!r.isMultiLine()&&(o=this.getFoldAt(r.start.row,r.start.column,1))&&r.isEqual(o.range))return this.removeFold(o),o;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,h=a.range.end.row;this.foldAll(l,h,t.all?1e4:0)}else t.children?(h=r?r.end.row:this.getLength(),this.foldAll(e+1,h,t.all?1e4:0)):r&&(t.all&&(r.collapseChildren=1e4),this.addFold("...",r));return r}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var i=this.$toggleFoldWidget(t,{});if(!i){var n=this.getParentFoldRangeData(t,!0);if(i=n.range||n.firstRange){t=i.start.row;var s=this.getFoldAt(t,this.getLine(t).length,1);s?this.removeFold(s):this.addFold("...",i)}}},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var n=e("../token_iterator").TokenIterator,s=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var i=t||this.getLine(e.row).charAt(e.column-1);if(""==i)return null;var n=i.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,i=this.getLine(e.row),n=!0,o=i.charAt(e.column-1),r=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(r||(o=i.charAt(e.column),e={row:e.row,column:e.column+1},r=o&&o.match(/([\(\[\{])|([\)\]\}])/),n=!1),!r)return null;if(r[1]){if(!(a=this.$findClosingBracket(r[1],e)))return null;t=s.fromPoints(e,a),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(r[2],e)))return null;t=s.fromPoints(a,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e){var t=this.getLine(e.row),i=t.charAt(e.column-1),n=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(n||(i=t.charAt(e.column),e={row:e.row,column:e.column+1},n=i&&i.match(/([\(\[\{])|([\)\]\}])/)),!n)return null;var o=new s(e.row,e.column-1,e.row,e.column),r=n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e);return r?[o,new s(r.row,r.column,r.row,r.column+1)]:[o]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,i){var s=this.$brackets[e],o=1,r=new n(this,t.row,t.column),a=r.getCurrentToken();if(a||(a=r.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-r.getCurrentTokenColumn()-2,h=a.value;;){for(;l>=0;){var c=h.charAt(l);if(c==s){if(0==(o-=1))return{row:r.getCurrentTokenRow(),column:l+r.getCurrentTokenColumn()}}else c==e&&(o+=1);l-=1}do{a=r.stepBackward()}while(a&&!i.test(a.type));if(null==a)break;l=(h=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,i){var s=this.$brackets[e],o=1,r=new n(this,t.row,t.column),a=r.getCurrentToken();if(a||(a=r.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-r.getCurrentTokenColumn();;){for(var h=a.value,c=h.length;l<c;){var u=h.charAt(l);if(u==s){if(0==(o-=1))return{row:r.getCurrentTokenRow(),column:l+r.getCurrentTokenColumn()}}else u==e&&(o+=1);l+=1}do{a=r.stepForward()}while(a&&!i.test(a.type));if(null==a)break;l=0}return null}}}}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/lang"),o=e("./bidihandler").BidiHandler,r=e("./config"),a=e("./lib/event_emitter").EventEmitter,l=e("./selection").Selection,h=e("./mode/text").Mode,c=e("./range").Range,u=e("./document").Document,d=e("./background_tokenizer").BackgroundTokenizer,g=e("./search_highlight").SearchHighlight,f=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++f.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new u(e)),this.setDocument(e),this.selection=new l(this),this.$bidiHandler=new o(this),r.resetOptions(this),this.setMode(t),r._signal("session",this)};f.$uid=0,function(){n.implement(this,a),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,i=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>i&&(this.$docRowCache.splice(i,t),this.$screenRowCache.splice(i,t))},this.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;i<=n;){var s=i+n>>1,o=e[s];if(t>o)i=s+1;else{if(!(t<o))return s;n=s-1}}return i-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},this.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(e){return this.bgTokenizer.getState(e)},this.getTokens=function(e){return this.bgTokenizer.getTokens(e)},this.getTokenAt=function(e,t){var i,n=this.bgTokenizer.getTokens(e),s=0;if(null==t){var o=n.length-1;s=this.getLine(e).length}else for(o=0;o<n.length&&!((s+=n[o].value.length)>=t);o++);return(i=n[o])?(i.index=o,i.start=s-i.value.length,i):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=s.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(e,t){void 0===t&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.addMarker=function(e,t,i,n){var s=this.$markerId++,o={range:e,type:i||"line",renderer:"function"==typeof i?i:null,clazz:t,inFront:!!n,id:s};return n?(this.$frontMarkers[s]=o,this._signal("changeFrontMarker")):(this.$backMarkers[s]=o,this._signal("changeBackMarker")),s},this.addDynamicMarker=function(e,t){if(e.update){var i=this.$markerId++;return e.id=i,e.inFront=!!t,t?(this.$frontMarkers[i]=e,this._signal("changeFrontMarker")):(this.$backMarkers[i]=e,this._signal("changeBackMarker")),e}},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){if(!this.$searchHighlight){var t=new g(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,i,n){"number"!=typeof t&&(i=t,t=e),i||(i="ace_step");var s=new c(e,0,t,1/0);return s.id=this.addMarker(s,i,"fullLine",n),s},this.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},this.getWordRange=function(e,t){var i=this.getLine(e),n=!1;if(t>0&&(n=!!i.charAt(t-1).match(this.tokenRe)),n||(n=!!i.charAt(t).match(this.tokenRe)),n)var s=this.tokenRe;else if(/^\s+$/.test(i.slice(t-1,t+1)))s=/\s/;else s=this.nonTokenRe;var o=t;if(o>0){do{o--}while(o>=0&&i.charAt(o).match(s));o++}for(var r=t;r<i.length&&i.charAt(r).match(s);)r++;return new c(e,o,e,r)},this.getAWordRange=function(e,t){for(var i=this.getWordRange(e,t),n=this.getLine(i.end.row);n.charAt(i.end.column).match(/[ \t]/);)i.end.column+=1;return i},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},this.$modes=r.$modes,this.$mode=null,this.$modeId=null,this.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var i=e,n=i.path}else n=e||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new h),this.$modes[n]&&!i)return this.$onChangeMode(this.$modes[n]),void(t&&t());this.$modeId=n,r.loadModule(["mode",n],function(e){if(this.$modeId!==n)return t&&t();this.$modes[n]&&!i?this.$onChangeMode(this.$modes[n]):e&&e.Mode&&(e=new e.Mode(i),i||(this.$modes[n]=e,e.$id=n),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){var i=this.$mode;this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var n=e.getTokenizer();if(void 0!==n.on){var s=this.onReloadTokenizer.bind(this);n.on("update",s)}if(this.bgTokenizer)this.bgTokenizer.setTokenizer(n);else{this.bgTokenizer=new d(n);var o=this;this.bgTokenizer.on("update",function(e){o._signal("tokenizerUpdate",e)})}this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:i,mode:e}))}},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){r.warn("Could not load worker",e),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.getLineWidgetMaxWidth=function(){if(null!=this.lineWidgetsWidth)return this.lineWidgetsWidth;var e=0;return this.lineWidgets.forEach(function(t){t&&t.screenWidth>e&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),i=this.$rowLengthCache,n=0,s=0,o=this.$foldData[s],r=o?o.start.row:1/0,a=t.length,l=0;l<a;l++){if(l>r){if((l=o.end.row+1)>=a)break;r=(o=this.$foldData[s++])?o.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>n&&(n=i[l])}this.screenWidth=n}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=e.length-1;-1!=i;i--){var n=e[i];"insert"==n.action||"remove"==n.action?this.doc.revertDelta(n):n.folds&&this.addFolds(n.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=0;i<e.length;i++){var n=e[i];"insert"!=n.action&&"remove"!=n.action||this.doc.$safeApplyDelta(n)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t){function i(e){return t?"insert"!==e.action:"insert"===e.action}for(var n,s,o=0;o<e.length;o++){var r=e[o];r.start&&(n?i(r)?(s=r.start,-1==n.compare(s.row,s.column)&&n.setStart(s),s=r.end,1==n.compare(s.row,s.column)&&n.setEnd(s)):(s=r.start,-1==n.compare(s.row,s.column)&&(n=c.fromPoints(r.start,r.start))):n=i(r)?c.fromPoints(r.start,r.end):c.fromPoints(r.start,r.start))}return n},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,i){var n=this.getTextRange(e),s=this.getFoldsInRange(e),o=c.fromPoints(t,t);if(!i){this.remove(e);var r=e.start.row-e.end.row;(h=r?-e.end.column:e.start.column-e.end.column)&&(o.start.row==e.end.row&&o.start.column>e.end.column&&(o.start.column+=h),o.end.row==e.end.row&&o.end.column>e.end.column&&(o.end.column+=h)),r&&o.start.row>=e.end.row&&(o.start.row+=r,o.end.row+=r)}if(o.end=this.insert(o.start,n),s.length){var a=e.start,l=o.start,h=(r=l.row-a.row,l.column-a.column);this.addFolds(s.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=h),e.end.row==a.row&&(e.end.column+=h),e.start.row+=r,e.end.row+=r,e}))}return o},this.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)},this.outdentRows=function(e){for(var t=e.collapseRows(),i=new c(0,0,0,0),n=this.getTabSize(),s=t.start.row;s<=t.end.row;++s){var o=this.getLine(s);i.start.row=s,i.end.row=s;for(var r=0;r<n&&" "==o.charAt(r);++r);r<n&&"\t"==o.charAt(r)?(i.start.column=r,i.end.column=r+1):(i.start.column=0,i.end.column=r),this.remove(i)}},this.$moveLines=function(e,t,i){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),i<0){if((s=this.getRowFoldStart(e+i))<0)return 0;var n=s-e}else if(i>0){var s;if((s=this.getRowFoldEnd(t+i))>this.doc.getLength()-1)return 0;n=s-t}else{e=this.$clipRowToDocument(e);n=(t=this.$clipRowToDocument(t))-e+1}var o=new c(e,0,t,Number.MAX_VALUE),r=this.getFoldsInRange(o).map(function(e){return(e=e.clone()).start.row+=n,e.end.row+=n,e}),a=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+n,a),r.length&&this.addFolds(r),n},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var i=this.doc.getLength();e>=i?(e=i-1,t=this.doc.getLine(i-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;i.max<0&&(i={min:t,max:t});var n=this.$constrainWrapLimit(e,i.min,i.max);return n!=this.$wrapLimit&&n>1&&(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i&&(e=Math.min(i,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,i=e.action,n=e.start,s=e.end,o=n.row,r=s.row,a=r-o,l=null;if(this.$updating=!0,0!=a)if("remove"===i){this[t?"$wrapData":"$rowLengthCache"].splice(o,a);var h=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(s.row)){m.addRemoveChars(s.row,s.column,n.column-s.column),m.shiftRow(-a);var u=this.getFoldLine(o);u&&u!==m&&(u.merge(m),m=u),c=h.indexOf(m)+1}for(;c<h.length;c++){(m=h[c]).start.row>=s.row&&m.shiftRow(-a)}r=o}else{var d=Array(a);d.unshift(o,0);var g=t?this.$wrapData:this.$rowLengthCache;g.splice.apply(g,d);h=this.$foldData,c=0;if(m=this.getFoldLine(o)){var f=m.range.compareInside(n.row,n.column);0==f?(m=m.split(n.row,n.column))&&(m.shiftRow(a),m.addRemoveChars(r,0,s.column-n.column)):-1==f&&(m.addRemoveChars(o,0,s.column-n.column),m.shiftRow(a)),c=h.indexOf(m)+1}for(;c<h.length;c++){var m;(m=h[c]).start.row>=o&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===i&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(o))&&m.addRemoveChars(o,n.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(o,r):this.$updateRowLengthCache(o,r),l},this.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(i,n){var s,o,r=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,h=this.$wrapLimit,c=i;for(n=Math.min(n,r.length-1);c<=n;)(o=this.getFoldLine(c,o))?(s=[],o.walk(function(i,n,o,a){var l;if(null!=i){(l=this.$getDisplayTokens(i,s.length))[0]=e;for(var h=1;h<l.length;h++)l[h]=t}else l=this.$getDisplayTokens(r[n].substring(a,o),s.length);s=s.concat(l)}.bind(this),o.end.row,r[o.end.row].length+1),l[o.start.row]=this.$computeWrapSplits(s,h,a),c=o.end.row+1):(s=this.$getDisplayTokens(r[c]),l[c]=this.$computeWrapSplits(s,h,a),c++)};var e=3,t=4,i=10,o=11,l=12;function u(e){return!(e<4352)&&(e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,s,r){if(0==n.length)return[];var a=[],h=n.length,c=0,u=0,d=this.$wrapAsCode,g=this.$indentedSoftWrap,f=s<=Math.max(2*r,8)||!1===g?0:Math.floor(s/2);function m(e){for(var t=e-c,s=c;s<e;s++){var h=n[s];12!==h&&2!==h||(t-=1)}a.length||(p=function(){var e=0;if(0===f)return e;if(g)for(var t=0;t<n.length;t++){var s=n[t];if(s==i)e+=1;else{if(s!=o){if(s==l)continue;break}e+=r}}return d&&!1!==g&&(e+=r),Math.min(e,f)}(),a.indent=p),u+=t,a.push(u),c=e}for(var p=0;h-c>s-p;){var v=c+s-p;if(n[v-1]>=i&&n[v]>=i)m(v);else if(n[v]!=e&&n[v]!=t){for(var w=Math.max(v-(s-(s>>2)),c-1);v>w&&n[v]<e;)v--;if(d){for(;v>w&&n[v]<e;)v--;for(;v>w&&9==n[v];)v--}else for(;v>w&&n[v]<i;)v--;v>w?m(++v):(2==n[v=c+s]&&v--,m(v-p))}else{for(;v!=c-1&&n[v]!=e;v--);if(v>c){m(v);continue}for(v=c+s;v<n.length&&n[v]==t;v++);if(v==n.length)break;m(v)}}return a},this.$getDisplayTokens=function(e,t){var n,s=[];t=t||0;for(var r=0;r<e.length;r++){var a=e.charCodeAt(r);if(9==a){n=this.getScreenTabSize(s.length+t),s.push(o);for(var h=1;h<n;h++)s.push(l)}else 32==a?s.push(i):a>39&&a<48||a>57&&a<64?s.push(9):a>=4352&&u(a)?s.push(1,2):s.push(1)}return s},this.$getStringScreenWidth=function(e,t,i){if(0==t)return[0,0];var n,s;for(null==t&&(t=1/0),i=i||0,s=0;s<e.length&&(9==(n=e.charCodeAt(s))?i+=this.getScreenTabSize(i):n>=4352&&u(n)?i+=2:i+=1,!(i>t));s++);return[i,s]},this.lineWidgets=null,this.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),i=this.$wrapData[t.row];return i.length&&i[0]<t.column?i.indent:0}return 0},this.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},this.getDocumentLastRowColumn=function(e,t){var i=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(i)},this.getDocumentLastRowColumnPosition=function(e,t){var i=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(i,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},this.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},this.screenToDocumentPosition=function(e,t,i){if(e<0)return{row:0,column:0};var n,s,o=0,r=0,a=0,l=0,h=this.$screenRowCache,c=this.$getRowCacheIndex(h,e),u=h.length;if(u&&c>=0){a=h[c],o=this.$docRowCache[c];var d=e>h[u-1]}else d=!u;for(var g=this.getLength()-1,f=this.getNextFoldLine(o),m=f?f.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(o))>e||o>=g);)a+=l,++o>m&&(o=f.end.row+1,m=(f=this.getNextFoldLine(o,f))?f.start.row:1/0),d&&(this.$docRowCache.push(o),this.$screenRowCache.push(a));if(f&&f.start.row<=o)n=this.getFoldDisplayLine(f),o=f.start.row;else{if(a+l<=e||o>g)return{row:g,column:this.getLine(g).length};n=this.getLine(o),f=null}var p=0,v=Math.floor(e-a);if(this.$useWrapMode){var w=this.$wrapData[o];w&&(s=w[v],v>0&&w.length&&(p=w.indent,r=w[v-1]||w[w.length-1],n=n.substring(r)))}return void 0!==i&&this.$bidiHandler.isBidiRow(a+v,o,v)&&(t=this.$bidiHandler.offsetToCol(i)),r+=this.$getStringScreenWidth(n,t-p)[1],this.$useWrapMode&&r>=s&&(r=s-1),f?f.idxToPosition(r):{row:o,column:r}},this.documentToScreenPosition=function(e,t){if(void 0===t)var i=this.$clipPositionToDocument(e.row,e.column);else i=this.$clipPositionToDocument(e,t);e=i.row,t=i.column;var n,s=0,o=null;(n=this.getFoldAt(e,t,1))&&(e=n.start.row,t=n.start.column);var r,a=0,l=this.$docRowCache,h=this.$getRowCacheIndex(l,e),c=l.length;if(c&&h>=0){a=l[h],s=this.$screenRowCache[h];var u=e>l[c-1]}else u=!c;for(var d=this.getNextFoldLine(a),g=d?d.start.row:1/0;a<e;){if(a>=g){if((r=d.end.row+1)>e)break;g=(d=this.getNextFoldLine(r,d))?d.start.row:1/0}else r=a+1;s+=this.getRowLength(a),a=r,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(s))}var f="";d&&a>=g?(f=this.getFoldDisplayLine(d,e,t),o=d.start.row):(f=this.getLine(e).substring(0,t),o=e);var m=0;if(this.$useWrapMode){var p=this.$wrapData[o];if(p){for(var v=0;f.length>=p[v];)s++,v++;f=f.substring(p[v-1]||0,f.length),m=v>0?p.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(s+=this.lineWidgets[a].rowsAbove),{row:s,column:m+this.$getStringScreenWidth(f)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var i=this.$wrapData.length,n=0,s=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);n<i;){var o=this.$wrapData[n];e+=o?o.length+1:1,++n>s&&(n=t.end.row+1,s=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var r=this.$foldData,a=0;a<r.length;a++)e-=(t=r[a]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,i,n){if(0===i)return[0,0];var s,o;for(i||(i=1/0),n=n||0,o=0;o<t.length&&!((n+="\t"===(s=t.charAt(o))?this.getScreenTabSize(n):e.getCharacterWidth(s))>i);o++);return[n,o]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=u}.call(f.prototype),e("./edit_session/folding").Folding.call(f.prototype),e("./edit_session/bracket_match").BracketMatch.call(f.prototype),r.defineOptions(f.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=f}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";var n=e("./lib/lang"),s=e("./lib/oop"),o=e("./range").Range,r=function(){this.$options={}};(function(){this.set=function(e){return s.mixin(this.$options,e),this},this.getOptions=function(){return n.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,i=this.$matchIterator(e,t);if(!i)return!1;var n=null;return i.forEach(function(e,i,s,r){return n=new o(e,i,s,r),!(i==r&&t.start&&t.start.start&&0!=t.skipCurrent&&n.isEqual(t.start))||(n=null,!1)}),n},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,s=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),r=[],a=t.re;if(t.$isMultiLine){var l,h=a.length,c=s.length-h;e:for(var u=a.offset||0;u<=c;u++){for(var d=0;d<h;d++)if(-1==s[u+d].search(a[d]))continue e;var g=s[u],f=s[u+h-1],m=g.length-g.match(a[0])[0].length,p=f.match(a[h-1])[0].length;l&&l.end.row===u&&l.end.column>m||(r.push(l=new o(u,m,u+h-1,p)),h>2&&(u=u+h-2))}}else for(var v=0;v<s.length;v++){var w=n.getMatchOffsets(s[v],a);for(d=0;d<w.length;d++){var $=w[d];r.push(new o(v,$.offset,v,$.offset+$.length))}}if(i){var b=i.start.column,y=i.start.column;for(v=0,d=r.length-1;v<d&&r[v].start.column<b&&r[v].start.row==i.start.row;)v++;for(;v<d&&r[d].end.column>y&&r[d].end.row==i.end.row;)d--;for(r=r.slice(v,d+1),v=0,d=r.length;v<d;v++)r[v].start.row+=i.start.row,r[v].end.row+=i.start.row}return r},this.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var s=n.exec(e);if(!s||s[0].length!=e.length)return null;if(t=e.replace(n,t),i.preserveCase){t=t.split("");for(var o=Math.min(e.length,e.length);o--;){var r=e[o];r&&r.toLowerCase()!=r?t[o]=t[o].toUpperCase():t[o]=t[o].toLowerCase()}t=t.join("")}return t}},this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i=e.needle;if(!e.needle)return e.re=!1;e.regExp||(i=n.escapeRegExp(i)),e.wholeWord&&(i=function(e,t){function i(e){return/\w/.test(e)||t.regExp?"\\b":""}return i(e[0])+e+i(e[e.length-1])}(i,e));var s=e.caseSensitive?"gm":"gmi";if(e.$isMultiLine=!t&&/[\n\r]/.test(i),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(i,s);try{var o=new RegExp(i,s)}catch(r){o=!1}return e.re=o},this.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],s=0;s<i.length;s++)try{n.push(new RegExp(i[s],t))}catch(o){return!1}return n},this.$matchIterator=function(e,t){var i=this.$assembleRegExp(t);if(!i)return!1;var n=1==t.backwards,s=0!=t.skipCurrent,o=t.range,r=t.start;r||(r=o?o[n?"end":"start"]:e.selection.getRange()),r.start&&(r=r[s!=n?"end":"start"]);var a=o?o.start.row:0,l=o?o.end.row:e.getLength()-1;if(n)var h=function(e){var i=r.row;if(!u(i,r.column,e)){for(i--;i>=a;i--)if(u(i,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(i=l,a=r.row;i>=a;i--)if(u(i,Number.MAX_VALUE,e))return}};else h=function(e){var i=r.row;if(!u(i,r.column,e)){for(i+=1;i<=l;i++)if(u(i,0,e))return;if(0!=t.wrap)for(i=a,l=r.row;i<=l;i++)if(u(i,0,e))return}};if(t.$isMultiLine)var c=i.length,u=function(t,s,o){var r=n?t-c+1:t;if(!(r<0)){var a=e.getLine(r),l=a.search(i[0]);if(!(!n&&l<s||-1===l)){for(var h=1;h<c;h++)if(-1==(a=e.getLine(r+h)).search(i[h]))return;var u=a.match(i[c-1])[0].length;if(!(n&&u>s))return!!o(r,l,r+c-1,u)||void 0}}};else if(n)u=function(t,n,s){var o,r=e.getLine(t),a=[],l=0;for(i.lastIndex=0;o=i.exec(r);){var h=o[0].length;if(l=o.index,!h){if(l>=r.length)break;i.lastIndex=l+=1}if(o.index+h>n)break;a.push(o.index,h)}for(var c=a.length-1;c>=0;c-=2){var u=a[c-1];if(s(t,u,t,u+(h=a[c])))return!0}};else u=function(t,n,s){var o,r,a=e.getLine(t);for(i.lastIndex=n;r=i.exec(a);){var l=r[0].length;if(s(t,o=r.index,t,o+l))return!0;if(!l&&(i.lastIndex=o+=1,o>=a.length))return!1}};return{forEach:h}}}).call(r.prototype),t.Search=r}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/keys"),s=e("../lib/useragent"),o=n.KEY_MODS;function r(e,t){this.platform=t||(s.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){r.call(this,e,t),this.$singleCommand=!1}a.prototype=r.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var i=e&&("string"==typeof e?e:e.name);e=this.commands[i],t||delete this.commands[i];var n=this.commandKeyBinding;for(var s in n){var o=n[s];if(o==e)delete n[s];else if(Array.isArray(o)){var r=o.indexOf(e);-1!=r&&(o.splice(r,1),1==o.length&&(n[s]=o[0]))}}},this.bindKey=function(e,t,i){if("object"==typeof e&&e&&(null==i&&(i=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var n="";if(-1!=e.indexOf(" ")){var s=e.split(/\s+/);e=s.pop(),s.forEach(function(e){var t=this.parseKeys(e),i=o[t.hashId]+t.key;n+=(n?" ":"")+i,this._addCommandToBinding(n,"chainKeys")},this),n+=" "}var r=this.parseKeys(e),a=o[r.hashId]+r.key;this._addCommandToBinding(n+a,t,i)},this)},this._addCommandToBinding=function(t,i,n){var s,o=this.commandKeyBinding;if(i)if(!o[t]||this.$singleCommand)o[t]=i;else{Array.isArray(o[t])?-1!=(s=o[t].indexOf(i))&&o[t].splice(s,1):o[t]=[o[t]],"number"!=typeof n&&(n=e(i));var r=o[t];for(s=0;s<r.length;s++){if(e(r[s])>n)break}r.splice(s,0,i)}else delete o[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var i=e[t];if(i){if("string"==typeof i)return this.bindKey(i,t);"function"==typeof i&&(i={exec:i}),"object"==typeof i&&(i.name||(i.name=t),this.addCommand(i))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),i=t.pop(),s=n[i];if(n.FUNCTION_KEYS[s])i=n.FUNCTION_KEYS[s].toLowerCase();else{if(!t.length)return{key:i,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:i.toUpperCase(),hashId:-1}}for(var o=0,r=t.length;r--;){var a=n.KEY_MODS[t[r]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[r]+" in "+e),!1;o|=a}return{key:i,hashId:o}},this.findKeyCommand=function(e,t){var i=o[e]+t;return this.commandKeyBinding[i]},this.handleKeyboard=function(e,t,i,n){if(!(n<0)){var s=o[t]+i,r=this.commandKeyBinding[s];return e.$keyChain&&(e.$keyChain+=" "+s,r=this.commandKeyBinding[e.$keyChain]||r),!r||"chainKeys"!=r&&"chainKeys"!=r[r.length-1]?(e.$keyChain&&(t&&4!=t||1!=i.length?(-1==t||n>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-s.length-1)),{command:r}):(e.$keyChain=e.$keyChain||s,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(r.prototype),t.HashHandler=r,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/oop"),s=e("../keyboard/hash_handler").MultiHashHandler,o=e("../lib/event_emitter").EventEmitter,r=function(e,t){s.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};n.inherits(r,s),function(){n.implement(this,o),this.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,i))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var s={editor:t,command:e,args:i};return s.returnValue=this._emit("exec",s),this._signal("afterExec",s),!1!==s.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(r.prototype),t.CommandManager=r}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,i){"use strict";var n=e("../lib/lang"),s=e("../config"),o=e("../range").Range;function r(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:r("Ctrl-,","Command-,"),exec:function(e){s.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:r("Alt-E","F4"),exec:function(e){s.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:r("Alt-Shift-E","Shift-F4"),exec:function(e){s.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:r("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:r(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:r("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:r("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:r("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:r("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:r("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:r(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:r(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:r("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:r("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:r("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:r("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:r("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:r("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:r("Ctrl-F","Command-F"),exec:function(e){s.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:r("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:r("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:r("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:r("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:r("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:r("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:r("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:r("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:r("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:r("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:r("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:r("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:r("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:r("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:r("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:r("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:r("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:r("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:r("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:r("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:r(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:r("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:r(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:r("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:r("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:r("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:r("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:r("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:r("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:r("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:r(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:r("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:r("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:r("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:r("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:r("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:r("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:r("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:r("Ctrl-H","Command-Option-F"),exec:function(e){s.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:r("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:r("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:r("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:r("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:r("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:r("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:r("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:r("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:r("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:r("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:r("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:r("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:r("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:r("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:r("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:r("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:r("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:r("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:r("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(n.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:r(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:r("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:r("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:r("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:r(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:r("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:r(null,null),exec:function(e){for(var t=e.selection.isBackwards(),i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),s=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(i.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(i.row),h=i.row+1;h<=s.row+1;h++){var c=n.stringTrimLeft(n.stringTrimRight(e.session.doc.getLine(h)));0!==c.length&&(c=" "+c),l+=c}s.row+1<e.session.doc.getLength()-1&&(l+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new o(i.row,0,s.row+2,0),l),a>0?(e.selection.moveCursorTo(i.row,i.column),e.selection.selectTo(i.row,i.column+a)):(r=e.session.doc.getLine(i.row).length>r?r+1:r,e.selection.moveCursorTo(i.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:r(null,null),exec:function(e){var t=e.session.doc.getLength()-1,i=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,s=[];n.length<1&&(n=[e.selection.getRange()]);for(var r=0;r<n.length;r++)r==n.length-1&&(n[r].end.row===t&&n[r].end.column===i||s.push(new o(n[r].end.row,n[r].end.column,t,i))),0===r?0===n[r].start.row&&0===n[r].start.column||s.push(new o(0,0,n[r].start.row,n[r].start.column)):s.push(new o(n[r-1].end.row,n[r-1].end.column,n[r].start.row,n[r].start.column));e.exitMultiSelectMode(),e.clearSelection();for(r=0;r<s.length;r++)e.selection.addRange(s[r],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert("\n"),0===t.row&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",description:"Open command pallete",bindKey:r("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:r(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var a=1;a<9;a++)t.commands.push({name:"foldToLevel"+a,description:"Fold To Level "+a,level:a,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/clipboard"],function(e,t,i){"use strict";e("./lib/fixoldbrowsers");var n=e("./lib/oop"),s=e("./lib/dom"),o=e("./lib/lang"),r=e("./lib/useragent"),a=e("./keyboard/textinput").TextInput,l=e("./mouse/mouse_handler").MouseHandler,h=e("./mouse/fold_handler").FoldHandler,c=e("./keyboard/keybinding").KeyBinding,u=e("./edit_session").EditSession,d=e("./search").Search,g=e("./range").Range,f=e("./lib/event_emitter").EventEmitter,m=e("./commands/command_manager").CommandManager,p=e("./commands/default_commands").commands,v=e("./config"),w=e("./token_iterator").TokenIterator,$=e("./clipboard"),b=function(e,t,i){this.$toDestroy=[];var n=e.getContainerElement();this.container=n,this.renderer=e,this.id="editor"+ ++b.$uid,this.commands=new m(r.isMac?"mac":"win",p),"object"==typeof document&&(this.textInput=new a(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new l(this),new h(this)),this.keyBinding=new c(this),this.$search=(new d).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=o.delayedCall(function(){this._signal("input",{}),this.session&&this.session.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(t||i&&i.session||new u("")),v.resetOptions(this),i&&this.setOptions(i),v._signal("editor",this)};b.$uid=0,function(){n.implement(this,f),this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=o.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},this.curOp=null,this.prevOp={},this.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},this.endOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue||!this.session)return this.curOp=null;if(1==e&&this.curOp.command&&"mouse"==this.curOp.command.name)return;if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,i=t&&t.scrollIntoView;if(i){switch(i){case"center-animate":i="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange(),s=this.renderer.layerConfig;(n.start.row>=s.lastRow||n.end.row<=s.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==i&&this.renderer.animateScrolling(this.curOp.scrollTop)}var o=this.selection.toJSON();this.curOp.selectionAfter=o,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(o),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var s=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(s)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==i.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var i=this;v.loadModule(["keybinding",e],function(n){i.$keybindingId==e&&i.keyBinding.setKeyboardHandler(n&&n.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var i=this.session.getSelection();i.off("changeCursor",this.$onCursorChange),i.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||s.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)}),t.$bracketHighlight=null);var i=t.getMatchingBracketRanges(e.getCursorPosition());if(!i&&t.$mode.getMatching&&(i=t.$mode.getMatching(e.session)),i){var n="ace_bracket";Array.isArray(i)?1==i.length&&(n="ace_error_bracket"):i=[i],2==i.length&&(0==g.comparePoints(i[0].end,i[1].start)?i=[g.fromPoints(i[0].start,i[1].end)]:0==g.comparePoints(i[0].start,i[1].end)&&(i=[g.fromPoints(i[1].start,i[0].end)])),t.$bracketHighlight={ranges:i,markerIds:i.map(function(e){return t.addMarker(e,n,"text")})}}}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var i=e.getCursorPosition(),n=new w(e.session,i.row,i.column),s=n.getCurrentToken();if(!s||!/\b(?:tag-open|tag-name)/.test(s.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1===s.type.indexOf("tag-open")||(s=n.stepForward())){var o=s.value,r=s.value,a=0,l=n.stepBackward();if("<"===l.value)do{l=s,(s=n.stepForward())&&(-1!==s.type.indexOf("tag-name")?o===(r=s.value)&&("<"===l.value?a++:"</"===l.value&&a--):o===r&&"/>"===s.value&&a--)}while(s&&a>=0);else{do{if(s=l,l=n.stepBackward(),s)if(-1!==s.type.indexOf("tag-name"))o===s.value&&("<"===l.value?a++:"</"===l.value&&a--);else if("/>"===s.value){for(var h=0,c=l;c;){if(-1!==c.type.indexOf("tag-name")&&c.value===o){a--;break}if("<"===c.value)break;c=n.stepBackward(),h++}for(var u=0;u<h;u++)n.stepForward()}}while(l&&a<=0);n.stepForward()}if(!s)return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);var d=n.getCurrentTokenRow(),f=n.getCurrentTokenColumn(),m=new g(d,f,d,f+s.value.length),p=t.$backMarkers[t.$tagHighlight];t.$tagHighlight&&null!=p&&0!==m.compareRange(p.range)&&(t.removeMarker(t.$tagHighlight),t.$tagHighlight=null),t.$tagHighlight||(t.$tagHighlight=t.addMarker(m,"ace_bracket","text"))}}},50)}},this.focus=function(){var e=this;setTimeout(function(){e.isFocused()||e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},this.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},this.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine()},this.onDocumentChange=function(e){var t=this.session.$useWrapMode,i=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,i,t),this._signal("change",e),this.$cursorChange()},this.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var i=new g(e.row,e.column,e.row,1/0);i.id=t.addMarker(i,"ace_active-line","screenLine"),t.$highlightLineMarker=i}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var i=this.selection.getRange(),n=this.getSelectionStyle();t.$selectionMarker=t.addMarker(i,"ace_selection",n)}var s=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(s),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var i=t.start.column,n=t.end.column,s=e.getLine(t.start.row),o=s.substring(i,n);if(!(o.length>5e3)&&/[\w\d]/.test(o)){var r=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:o}),a=s.substring(i-1,n+1);if(r.test(a))return r}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),i=!1;if(!e&&this.$copyWithEmptySelection){i=!0;for(var n=this.selection.getAllRanges(),s=0;s<n.length;s++){var o=n[s];s&&n[s-1].start.row==o.start.row||(e+=this.session.getLine(o.start.row)+t)}}var r={text:e};return this._signal("copy",r),$.lineMode=i?r.text:"",r.text},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e,t){var i={text:e,event:t};this.commands.exec("paste",this,i)},this.$handlePaste=function(e){"string"==typeof e&&(e={text:e}),this._signal("paste",e);var t=e.text,i=t==$.lineMode,n=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)i?n.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(i)this.selection.rangeList.ranges.forEach(function(e){n.insert({row:e.start.row,column:0},t)});else{var s=t.split(/\r\n|\r|\n/),o=this.selection.rangeList.ranges,r=!(2!=s.length||s[0]&&s[1]);if(s.length!=o.length||r)return this.commands.exec("insertstring",this,t);for(var a=o.length;a--;){var l=o[a];l.isEmpty()||n.remove(l),n.insert(l.start,s[a])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var i=this.session,n=i.getMode(),s=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var o=n.transformAction(i.getState(s.row),"insertion",this,i,e);o&&(e!==o.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=o.text)}if("\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&-1==e.indexOf("\n")){(r=new g.fromPoints(s,s)).end.column+=e.length,this.session.remove(r)}}else{var r=this.getSelectionRange();s=this.session.remove(r),this.clearSelection()}if("\n"==e||"\r\n"==e){var a=i.getLine(s.row);if(s.column>a.search(/\S|$/)){var l=a.substr(s.column).search(/\S|$/);i.doc.removeInLine(s.row,s.column,s.column+l)}}this.clearSelection();var h=s.column,c=i.getState(s.row),u=(a=i.getLine(s.row),n.checkOutdent(c,a,e));if(i.insert(s,e),o&&o.selection&&(2==o.selection.length?this.selection.setSelectionRange(new g(s.row,h+o.selection[0],s.row,h+o.selection[1])):this.selection.setSelectionRange(new g(s.row+o.selection[0],o.selection[1],s.row+o.selection[2],o.selection[3]))),this.$enableAutoIndent){if(i.getDocument().isNewLine(e)){var d=n.getNextLineIndent(c,a.slice(0,s.column),i.getTabString());i.insert({row:s.row+1,column:0},d)}u&&n.autoOutdent(c,i,s.row)}},this.autoIndent=function(){var e,t,i=this.session,n=i.getMode();if(this.selection.isEmpty())e=0,t=i.doc.getLength()-1;else{var s=this.getSelectionRange();e=s.start.row,t=s.end.row}for(var o,r,a,l="",h="",c="",u=i.getTabString(),d=e;d<=t;d++)d>0&&(l=i.getState(d-1),h=i.getLine(d-1),c=n.getNextLineIndent(l,h,u)),o=i.getLine(d),c!==(r=n.$getIndent(o))&&(r.length>0&&(a=new g(d,0,d,r.length),i.remove(a)),c.length>0&&i.insert({row:d,column:0},c)),n.autoOutdent(l,i,d)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var i=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(i):i(),this.endOperation()},this.applyComposition=function(e,t){var i;(t.extendLeft||t.extendRight)&&((i=this.selection.getRange()).start.column-=t.extendLeft,i.end.column+=t.extendRight,i.start.column<0&&(i.start.row--,i.start.column+=this.session.getLine(i.start.row).length+1),this.selection.setRange(i),e||i.isEmpty()||this.remove());(!e&&this.selection.isEmpty()||this.insert(e,!0),t.restoreStart||t.restoreEnd)&&((i=this.selection.getRange()).start.column-=t.restoreStart,i.end.column-=t.restoreEnd,this.selection.setRange(i))},this.onCommandKey=function(e,t,i){return this.keyBinding.onCommandKey(e,t,i)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var i=this.session,n=i.getState(t.start.row),s=i.getMode().transformAction(n,"deletion",this,i,t);if(0===t.end.column){var o=i.getTextRange(t);if("\n"==o[o.length-1]){var r=i.getLine(t.end.row);/^\s+$/.test(r)&&(t.end.column=r.length)}}s&&(t=s)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var i,n,s=this.session.getLine(e.row);t<s.length?(i=s.charAt(t)+s.charAt(t-1),n=new g(e.row,t-1,e.row,t+1)):(i=s.charAt(t-1)+s.charAt(t-2),n=new g(e.row,t-2,e.row,t)),this.session.replace(n,i),this.session.selection.moveToPosition(n.end)}}},this.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var i=e.getTextRange(t);if(!/^\s+$/.test(i)){c=this.$getSelectedRows();return void e.indentRows(c.first,c.last,"\t")}}var n=e.getLine(t.start.row),s=t.start,r=e.getTabSize(),a=e.documentToScreenColumn(s.row,s.column);if(this.session.getUseSoftTabs())var l=r-a%r,h=o.stringRepeat(" ",l);else{for(l=a%r;" "==n[t.start.column-1]&&l;)t.start.column--,l--;this.selection.setSelectionRange(t),h="\t"}return this.insert(h)}var c=this.$getSelectedRows();e.indentRows(c.first,c.last,"\t")},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,i=[],n=e.first;n<=e.last;n++)i.push(t.getLine(n));i.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0});var s=new g(0,0,0,0);for(n=e.first;n<=e.last;n++){var o=t.getLine(n);s.start.row=n,s.end.row=n,s.end.column=o.length,t.replace(s,i[n-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)},this.getNumberAt=function(e,t){var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g;i.lastIndex=0;for(var n=this.session.getLine(e);i.lastIndex<t;){var s=i.exec(n);if(s.index<=t&&s.index+s[0].length>=t)return{value:s[0],start:s.index,end:s.index+s[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,i=this.selection.getCursor().column,n=new g(t,i-1,t,i),s=this.session.getTextRange(n);if(!isNaN(parseFloat(s))&&isFinite(s)){var o=this.getNumberAt(t,i);if(o){var r=o.value.indexOf(".")>=0?o.start+o.value.indexOf(".")+1:o.end,a=o.start+o.value.length-r,l=parseFloat(o.value);l*=Math.pow(10,a),r!==o.end&&i<r?e*=Math.pow(10,o.end-i-1):e*=Math.pow(10,o.end-i),l+=e;var h=(l/=Math.pow(10,a)).toFixed(a),c=new g(t,o.start,t,o.end);this.session.replace(c,h),this.moveCursorTo(t,Math.max(o.start+1,i+h.length-o.value.length))}}else this.toggleWord()},this.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],this.toggleWord=function(){var e=this.selection.getCursor().row,t=this.selection.getCursor().column;this.selection.selectWord();var i=this.getSelectedText(),n=this.selection.getWordRange().start.column,s=i.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),r=t-n-1;r<0&&(r=0);var a=0,l=0,h=this;i.match(/[A-Za-z0-9_]+/)&&s.forEach(function(t,s){l=a+t.length,r>=a&&r<=l&&(i=t,h.selection.clearSelection(),h.moveCursorTo(e,a+n),h.selection.selectTo(e,l+n)),a=l});for(var c,u=this.$toggleWordPairs,d=0;d<u.length;d++)for(var g=u[d],f=0;f<=1;f++){var m=+!f,p=i.match(new RegExp("^\\s?_?("+o.escapeRegExp(g[f])+")\\s?$","i"));if(p)i.match(new RegExp("([_]|^|\\s)("+o.escapeRegExp(p[1])+")($|\\s)","g"))&&(c=i.replace(new RegExp(o.escapeRegExp(g[f]),"i"),function(e){var t=g[m];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+g[m].charAt(0).toUpperCase()+t.substr(1)),t}),this.insert(c),c="")}},this.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},this.duplicateSelection=function(){var e=this.selection,t=this.session,i=e.getRange(),n=e.isBackwards();if(i.isEmpty()){var s=i.start.row;t.duplicateLines(s,s)}else{var o=n?i.start:i.end,r=t.insert(o,t.getTextRange(i),!1);i.start=o,i.end=r,e.setSelectionRange(i,n)}},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(e,t,i){return this.session.moveText(e,t,i)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(e,t){var i,n,s=this.selection;if(!s.inMultiSelectMode||this.inVirtualSelectionMode){var o=s.toOrientedRange();i=this.$getSelectedRows(o),n=this.session.$moveLines(i.first,i.last,t?0:e),t&&-1==e&&(n=0),o.moveBy(n,0),s.fromOrientedRange(o)}else{var r=s.rangeList.ranges;s.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var a=0,l=0,h=r.length,c=0;c<h;c++){var u=c;r[c].moveBy(a,0);for(var d=(i=this.$getSelectedRows(r[c])).first,g=i.last;++c<h;){l&&r[c].moveBy(l,0);var f=this.$getSelectedRows(r[c]);if(t&&f.first!=g)break;if(!t&&f.first>g+1)break;g=f.last}for(c--,a=this.session.$moveLines(d,g,t?0:e),t&&-1==e&&(u=c+1);u<=c;)r[u].moveBy(a,0),u++;t||(a=0),l+=a}s.fromOrientedRange(s.ranges[0]),s.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var i=this.renderer,n=this.renderer.layerConfig,s=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(s,0)}):!1===t&&(this.selection.moveCursorBy(s,0),this.selection.clearSelection());var o=i.scrollTop;i.scrollBy(0,s*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(o)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,i,n){this.renderer.scrollToLine(e,t,i,n)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var i=this.getCursorPosition(),n=new w(this.session,i.row,i.column),s=n.getCurrentToken(),o=s||n.stepForward();if(o){var r,a,l=!1,h={},c=i.column-o.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(o.value.match(/[{}()\[\]]/g)){for(;c<o.value.length&&!l;c++)if(u[o.value[c]])switch(a=u[o.value[c]]+"."+o.type.replace("rparen","lparen"),isNaN(h[a])&&(h[a]=0),o.value[c]){case"(":case"[":case"{":h[a]++;break;case")":case"]":case"}":h[a]--,-1===h[a]&&(r="bracket",l=!0)}}else-1!==o.type.indexOf("tag-name")&&(isNaN(h[o.value])&&(h[o.value]=0),"<"===s.value?h[o.value]++:"</"===s.value&&h[o.value]--,-1===h[o.value]&&(r="tag",l=!0));l||(s=o,o=n.stepForward(),c=0)}while(o&&!l);if(r){var d,f;if("bracket"===r)(d=this.session.getBracketRange(i))||(f=(d=new g(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+c-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+c-1)).start,(t||f.row===i.row&&Math.abs(f.column-i.column)<2)&&(d=this.session.getBracketRange(f)));else if("tag"===r){if(!o||-1===o.type.indexOf("tag-name"))return;var m=o.value;if(0===(d=new g(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(i.row,i.column)){l=!1;do{o=s,(s=n.stepBackward())&&(-1!==s.type.indexOf("tag-close")&&d.setEnd(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+1),o.value===m&&-1!==o.type.indexOf("tag-name")&&("<"===s.value?h[m]++:"</"===s.value&&h[m]--,0===h[m]&&(l=!0)))}while(s&&!l)}o&&o.type.indexOf("tag-name")&&(f=d.start).row==i.row&&Math.abs(f.column-i.column)<2&&(f=d.end)}(f=d&&d.cursor||f)&&(e?d&&t?this.selection.setRange(d):d&&d.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(f.row,f.column):this.selection.moveTo(f.row,f.column))}}},this.gotoLine=function(e,t,i){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,i)},this.navigateTo=function(e,t){this.selection.moveTo(e,t)},this.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},this.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},this.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(e,t){t&&this.$search.set(t);var i=this.$search.find(this.session),n=0;return i?(this.$tryReplace(i,e)&&(n=1),this.selection.setSelectionRange(i),this.renderer.scrollSelectionIntoView(i.start,i.end),n):n},this.replaceAll=function(e,t){t&&this.$search.set(t);var i=this.$search.findAll(this.session),n=0;if(!i.length)return n;var s=this.getSelectionRange();this.selection.moveTo(0,0);for(var o=i.length-1;o>=0;--o)this.$tryReplace(i[o],e)&&n++;return this.selection.setSelectionRange(s),n},this.$tryReplace=function(e,t){var i=this.session.getTextRange(e);return null!==(t=this.$search.replace(i,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,i){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&n.mixin(t,e);var s=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(s)||this.$search.$options.needle)||(s=this.session.getWordRange(s.start.row,s.start.column),e=this.session.getTextRange(s)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:s});var o=this.$search.find(this.session);return t.preventScroll?o:o?(this.revealRange(o,i),o):(t.backwards?s.start=s.end:s.end=s.start,void this.selection.setRange(s))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(i)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(e){e.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,i=this,n=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var s=this.$scrollAnchor;s.style.cssText="position:absolute",this.container.insertBefore(s,this.container.firstChild);var o=this.on("changeSelection",function(){n=!0}),r=this.renderer.on("beforeRender",function(){n&&(t=i.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(n&&t&&(i.isFocused()||i.searchBox&&i.searchBox.isFocused())){var e=i.renderer,o=e.$cursorLayer.$pixelPos,r=e.layerConfig,a=o.top-r.offset;null!=(n=o.top>=0&&a+t.top<0||!(o.top<r.height&&o.top+t.top+r.lineHeight>window.innerHeight)&&null)&&(s.style.top=a+"px",s.style.left=o.left+"px",s.style.height=r.lineHeight+"px",s.scrollIntoView(n)),n=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",o),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",r))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,s.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,i){var n=this;v.loadModule("./ext/prompt",function(s){s.prompt(n,e,t,i)})}}.call(b.prototype),v.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?y.attach(this):y.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?y.attach(this):y.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.getValue());if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),s.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(e||this.renderer.placeholderNode)!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),s.addCssClass(this.container,"ace_hasPlaceholder");var t=s.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var y={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,i){return Math.max(t.toString().length,(i.lastRow+1).toString().length,2)*i.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=b}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,i){this.$fromUndo||e!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=i.length;n--;){var s=i[n][0];if(s.id<=e)break;s.id<t&&(s.ignore=!0)}this.lastDeltas=null},this.getSelection=function(e,t){for(var i=this.selections,n=i.length;n--;){var s=i[n];if(s.rev<e)return t&&(s=i[n+1]),s}},this.getRevision=function(){return this.$rev},this.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=null,s=0,o=i.length;o--;){var r=i[o][0];if(r.id<t&&!n&&(n=o+1),r.id<=e){s=o+1;break}}return i.slice(s,n)},this.getChangedRanges=function(e,t){null==t&&(t=this.$rev+1)},this.getChangedLines=function(e,t){null==t&&(t=this.$rev+1)},this.undo=function(e,t){this.lastDeltas=null;var i=this.$undoStack;if(function(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){for(;i<t-1;){var s=c(e[i],e[i+1]);e[i]=s[0],e[i+1]=s[1],i++}return!0}}}(i,i.length)){e||(e=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var n=i.pop(),s=null;return n&&(s=e.undoChanges(n,t),this.$redoStack.push(n),this.$syncRev()),this.$fromUndo=!1,s}},this.redo=function(e,t){if(this.lastDeltas=null,e||(e=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);!function(e,t){for(var i=0;i<t.length;i++)for(var n=t[i],s=0;s<n.length;s++)m(e,n[s])}(this.$redoStack,i),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(e){e[0].id=++this.$maxRev},this)}var n=this.$redoStack.pop(),s=null;return n&&(s=e.redoChanges(n,t),this.$undoStack.push(n),this.$syncRev()),this.$fromUndo=!1,s},this.$syncRev=function(){var e=this.$undoStack,t=e[e.length-1],i=t&&t[0].id||0;this.$redoStackBaseRev=i,this.$rev=i},this.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},this.canUndo=function(){return this.$undoStack.length>0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(n.prototype);var s=e("./range").Range,o=s.comparePoints;s.comparePoints;function r(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function h(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)if(o(t.start,e.end)>=0)d(t,e,-1);else{if(!(o(t.start,e.start)<=0))return null;d(e,t,1)}else if(i&&!n)if(o(t.start,e.end)>=0)d(t,e,-1);else{if(!(o(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!i&&n)if(o(t.start,e.start)>=0)d(t,e,1);else{if(!(o(t.start,e.start)<=0))return null;d(e,t,1)}else if(!i&&!n)if(o(t.start,e.start)>=0)d(t,e,1);else{if(!(o(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var i=e.length;i--;)for(var n=0;n<t.length;n++)if(!h(e[i],t[n])){for(;i<e.length;){for(;n--;)h(t[n],e[i]);n=t.length,i++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}function u(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)o(e.start,t.start)<0?d(t,e,1):d(e,t,1);else if(i&&!n)o(e.start,t.end)>=0?d(e,t,-1):o(e.start,t.start)<=0?d(t,e,1):(d(e,s.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!i&&n)o(t.start,e.end)>=0?d(t,e,-1):o(t.start,e.start)<=0?d(e,t,1):(d(t,s.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!i&&!n)if(o(t.start,e.end)>=0)d(t,e,-1);else{var r,a;if(!(o(t.end,e.start)<=0))return o(e.start,t.start)<0&&(r=e,e=f(e,t.start)),o(e.end,t.end)>0&&(a=f(e,t.end)),g(t.end,e.start,e.end,-1),a&&!r&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,r,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,i){g(e.start,t.start,t.end,i),g(e.end,t.start,t.end,i)}function g(e,t,i,n){e.row==(1==n?t:i).row&&(e.column+=n*(i.column-t.column)),e.row+=n*(i.row-t.row)}function f(e,t){var i=e.lines,n=e.end;e.end=r(t);var s=e.end.row-e.start.row,o=i.splice(s,i.length),a=s?t.column:t.column-e.start.column;return i.push(o[0].substring(0,a)),o[0]=o[0].substr(a),{start:r(t),end:n,lines:o,action:e.action}}function m(e,t){t=function(e){return{start:r(e.start),end:r(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var i=e.length;i--;){for(var n=e[i],s=0;s<n.length;s++){var o=u(n[s],t);t=o[0],2!=o.length&&(o[2]?(n.splice(s+1,1,o[1],o[2]),s++):o[1]||(n.splice(s,1),s--))}n.length||e.splice(i,1)}return e}t.UndoManager=n}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom"),s=function(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){n.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight,s=Math.floor(n/this.canvasHeight);return i.documentToScreenRow(e,0)*t.lineHeight-s*this.canvasHeight},this.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLineCount(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=n.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},this.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=n.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},this.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},this.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},this.createCell=function(e,t,i,s){var o=this.cellCache.pop();if(!o){var r=n.createElement("div");s&&s(r),this.element.appendChild(r),o={element:r,text:"",row:e}}return o.row=e,o}}).call(s.prototype),t.Lines=s}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],function(e,t,i){"use strict";var n=e("../lib/dom"),s=e("../lib/oop"),o=e("../lib/lang"),r=e("../lib/event_emitter").EventEmitter,a=e("./lines").Lines,l=function(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new a(this.element),this.$lines.$offsetCoefficient=1};function h(e){var t=document.createTextNode("");e.appendChild(t);var i=n.createElement("span");return e.appendChild(i),e}(function(){s.implement(this,r),this.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},this.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var i=e[t],n=i.row,s=this.$annotations[n];s||(s=this.$annotations[n]={text:[]});var r=i.text;r=r?o.escapeHTML(r):i.html||"",-1===s.text.indexOf(r)&&s.text.push(r);var a=i.type;"error"==a?s.className=" ace_error":"warning"==a&&" ace_error"!=s.className?s.className=" ace_warning":"info"!=a||s.className||(s.className=" ace_info")}},this.$updateAnnotations=function(e){if(this.$annotations.length){var t=e.start.row,i=e.end.row-t;if(0===i);else if("remove"==e.action)this.$annotations.splice(t,i+1,null);else{var n=new Array(i+1);n.unshift(t,1),this.$annotations.splice.apply(this.$annotations,n)}}},this.update=function(e){this.config=e;var t=this.session,i=e.firstRow,n=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=n,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var s=t.getNextFoldLine(i),o=s?s.start.row:1/0,r=null,a=-1,l=i;;){if(l>o&&(l=s.end.row+1,o=(s=t.getNextFoldLine(l,s))?s.start.row:1/0),l>n){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(r=this.$lines.get(++a))?r.row=l:(r=this.$lines.createCell(l,e,this.session,h),this.$lines.push(r)),this.$renderCell(r,e,s,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,i=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,s=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(s=t.getLength()+n-1);var o=i?i.getWidth(t,s,e):s.toString().length*e.characterWidth,r=this.$padding||this.$computePadding();(o+=r.left+r.right)===this.gutterWidth||isNaN(o)||(this.gutterWidth=o,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",o))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var i=0;i<t.length;i++){var n=t[i];if(n.row>=this.$cursorRow){if(n.row>this.$cursorRow){var s=this.session.getFoldLine(this.$cursorRow);if(!(i>0&&s&&s.start.row==t[i-1].row))break;n=t[i-1]}n.element.className="ace_gutter-active-line "+n.element.className,this.$cursorCell=n;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),n=this.oldLastRow;if(this.oldLastRow=i,!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var s=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);s>0;s--)this.$lines.shift();if(n>i)for(s=this.session.getFoldedRowCount(i+1,n);s>0;s--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),i>n&&this.$lines.push(this.$renderLines(e,n+1,i)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,i){for(var n=[],s=t,o=this.session.getNextFoldLine(s),r=o?o.start.row:1/0;s>r&&(s=o.end.row+1,r=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>i);){var a=this.$lines.createCell(s,e,this.session,h);this.$renderCell(a,e,o,s),n.push(a),s++}return n},this.$renderCell=function(e,t,i,s){var o=e.element,r=this.session,a=o.childNodes[0],l=o.childNodes[1],h=r.$firstLineNumber,c=r.$breakpoints,u=r.$decorations,d=r.gutterRenderer||this.$renderer,g=this.$showFoldWidgets&&r.foldWidgets,f=i?i.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(s==this.$cursorRow||i&&s<this.$cursorRow&&s>=f&&this.$cursorRow<=i.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[s]&&(m+=c[s]),u[s]&&(m+=u[s]),this.$annotations[s]&&(m+=this.$annotations[s].className),o.className!=m&&(o.className=m),g){var p=g[s];null==p&&(p=g[s]=r.getFoldWidget(s))}if(p){m="ace_fold-widget ace_"+p;"start"==p&&s==f&&s<i.end.row?m+=" ace_closed":m+=" ace_open",l.className!=m&&(l.className=m);var v=t.lineHeight+"px";n.setStyle(l.style,"height",v),n.setStyle(l.style,"display","inline-block")}else l&&n.setStyle(l.style,"display","none");var w=(d?d.getText(r,s):s+h).toString();return w!==a.data&&(a.data=w),n.setStyle(e.element.style,"height",this.$lines.computeLineHeight(s,t,r)+"px"),n.setStyle(e.element.style,"top",this.$lines.computeLineTop(s,t,r)+"px"),e.text=w,e},this.$fixedWidth=!1,this.$highlightGutterLine=!0,this.$renderer="",this.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?n.addCssClass(this.element,"ace_folding-enabled"):n.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},this.getShowFoldWidgets=function(){return this.$showFoldWidgets},this.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=n.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),i=this.element.getBoundingClientRect();return e.x<t.left+i.left?"markers":this.$showFoldWidgets&&e.x>i.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../range").Range,s=e("../lib/dom"),o=function(e){this.element=s.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var i=-1!=this.i&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=t,i.className=e},this.update=function(e){if(e){var t;for(var i in this.config=e,this.i=0,this.markers){var n=this.markers[i];if(n.range){var s=n.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),n.renderer){var o=this.$getTop(s.start.row,e),r=this.$padding+s.start.column*e.characterWidth;n.renderer(t,s,r,o,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,s,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,s,n.clazz,e):s.isMultiLine()?"text"==n.type?this.drawTextMarker(t,s,n.clazz,e):this.drawMultiLineMarker(t,s,n.clazz,e):this.drawSingleLineMarker(t,s,n.clazz+" ace_start ace_br15",e)}else n.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,i,s,o){for(var r=this.session,a=t.start.row,l=t.end.row,h=a,c=0,u=0,d=r.getScreenLastRowColumn(h),g=new n(h,t.start.column,h,u);h<=l;h++)g.start.row=g.end.row=h,g.start.column=h==a?t.start.column:r.getRowWrapIndent(h),g.end.column=d,c=u,u=d,d=h+1<l?r.getScreenLastRowColumn(h+1):h==l?0:t.end.column,this.drawSingleLineMarker(e,g,i+(h==a?" ace_start":"")+" ace_br"+((h==a||h==a+1&&t.start.column?1:0)|(c<u?2:0)|(u>d?4:0)|(h==l?8:0)),s,h==l?0:1,o)},this.drawMultiLineMarker=function(e,t,i,n,s){var o=this.$padding,r=n.lineHeight,a=this.$getTop(t.start.row,n),l=o+t.start.column*n.characterWidth;(s=s||"",this.session.$bidiHandler.isBidiRow(t.start.row))?((h=t.clone()).end.row=h.start.row,h.end.column=this.session.getLine(h.start.row).length,this.drawBidiSingleLineMarker(e,h,i+" ace_br1 ace_start",n,null,s)):this.elt(i+" ace_br1 ace_start","height:"+r+"px;right:0;top:"+a+"px;left:"+l+"px;"+(s||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var h;(h=t.clone()).start.row=h.end.row,h.start.column=0,this.drawBidiSingleLineMarker(e,h,i+" ace_br12",n,null,s)}else{a=this.$getTop(t.end.row,n);var c=t.end.column*n.characterWidth;this.elt(i+" ace_br12","height:"+r+"px;width:"+c+"px;top:"+a+"px;left:"+o+"px;"+(s||""))}if(!((r=(t.end.row-t.start.row-1)*n.lineHeight)<=0)){a=this.$getTop(t.start.row+1,n);var u=(t.start.column?1:0)|(t.end.column?0:8);this.elt(i+(u?" ace_br"+u:""),"height:"+r+"px;right:0;top:"+a+"px;left:"+o+"px;"+(s||""))}},this.drawSingleLineMarker=function(e,t,i,n,s,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,s,o);var r=n.lineHeight,a=(t.end.column+(s||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),h=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+r+"px;width:"+a+"px;top:"+l+"px;left:"+h+"px;"+(o||""))},this.drawBidiSingleLineMarker=function(e,t,i,n,s,o){var r=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(i,"height:"+r+"px;width:"+e.width+(s||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(o||""))},this)},this.drawFullLineMarker=function(e,t,i,n,s){var o=this.$getTop(t.start.row,n),r=n.lineHeight;t.start.row!=t.end.row&&(r+=this.$getTop(t.end.row,n)-o),this.elt(i,"height:"+r+"px;top:"+o+"px;left:0;right:0;"+(s||""))},this.drawScreenLineMarker=function(e,t,i,n,s){var o=this.$getTop(t.start.row,n),r=n.lineHeight;this.elt(i,"height:"+r+"px;top:"+o+"px;left:0;right:0;"+(s||""))}}).call(o.prototype),t.Marker=o}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/oop"),s=e("../lib/dom"),o=e("../lib/lang"),r=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=s,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new r(this.element)};(function(){n.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,"string"==typeof e?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],i=1;i<e+1;i++){if(this.showTabs)(n=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",n.textContent=o.stringRepeat(this.TAB_CHAR,i),t.push(n);else t.push(this.dom.createTextNode(o.stringRepeat(" ",i),this.element))}if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var n,s=this.showSpaces?" ace_invisible ace_invisible_space":"",r=this.showSpaces?o.stringRepeat(this.SPACE_CHAR,this.tabSize):o.stringRepeat(" ",this.tabSize),a=this.showTabs?" ace_invisible ace_invisible_tab":"",l=this.showTabs?o.stringRepeat(this.TAB_CHAR,this.tabSize):r;(n=this.dom.createElement("span")).className="ace_indent-guide"+s,n.textContent=r,this.$tabStrings[" "]=n,(n=this.dom.createElement("span")).className="ace_indent-guide"+a,n.textContent=l,this.$tabStrings["\t"]=n}},this.updateLines=function(e,t,i){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var n=Math.max(t,e.firstRow),s=Math.min(i,e.lastRow),o=this.element.childNodes,r=0,a=e.firstRow;a<n;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(n)){n=l.start.row;break}a=l.end.row}r++}for(var l,h=!1,c=(a=n,(l=this.session.getNextFoldLine(a))?l.start.row:1/0);a>c&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>s);){var u=o[r++];if(u){this.dom.removeChildren(u),this.$renderLine(u,a,a==c&&l),h&&(u.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";u.style.height!=d&&(h=!0,u.style.height=d)}a++}if(h)for(;r<this.$lines.cells.length;){var g=this.$lines.cells[r++];g.element.style.top=this.$lines.computeLineTop(g.row,e,this.session)+"px"}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=e.lastRow,n=t?t.lastRow:-1;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var s=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);s>0;s--)this.$lines.shift();if(t.lastRow>e.lastRow)for(s=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);s>0;s--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,i){for(var n=[],o=t,r=this.session.getNextFoldLine(o),a=r?r.start.row:1/0;o>a&&(o=r.end.row+1,a=(r=this.session.getNextFoldLine(o,r))?r.start.row:1/0),!(o>i);){var l=this.$lines.createCell(o,e,this.session),h=l.element;this.dom.removeChildren(h),s.setStyle(h.style,"height",this.$lines.computeLineHeight(o,e,this.session)+"px"),s.setStyle(h.style,"top",this.$lines.computeLineTop(o,e,this.session)+"px"),this.$renderLine(h,o,o==a&&r),this.$useLineGroups()?h.className="ace_line_group":h.className="ace_line",n.push(l),o++}return n},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,i=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,i))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,i,n){for(var s,r=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,a=this.dom.createFragment(this.element),l=0;s=r.exec(n);){var h=s[1],c=s[2],u=s[3],d=s[4],g=s[5];if(this.showSpaces||!c){var f=l!=s.index?n.slice(l,s.index):"";if(l=s.index+s[0].length,f&&a.appendChild(this.dom.createTextNode(f,this.element)),h){var m=this.session.getScreenTabSize(t+s.index);a.appendChild(this.$tabStrings[m].cloneNode(!0)),t+=m-1}else if(c){if(this.showSpaces)(v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=o.stringRepeat(this.SPACE_CHAR,c.length),a.appendChild(v);else a.appendChild(this.com.createTextNode(c,this.element))}else if(u){(v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=o.stringRepeat(this.SPACE_CHAR,u.length),a.appendChild(v)}else if(d){t+=1,(v=this.dom.createElement("span")).style.width=2*this.config.characterWidth+"px",v.className=this.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=this.showSpaces?this.SPACE_CHAR:d,a.appendChild(v)}else if(g){t+=1,(v=this.dom.createElement("span")).style.width=2*this.config.characterWidth+"px",v.className="ace_cjk",v.textContent=g,a.appendChild(v)}}}if(a.appendChild(this.dom.createTextNode(l?n.slice(l):n,this.element)),this.$textToken[i.type])e.appendChild(a);else{var p="ace_"+i.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==i.type&&(v.style.width=i.value.length*this.config.characterWidth+"px"),v.className=p,v.appendChild(a),e.appendChild(v)}return t+n.length},this.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(n<=0||n>=i)return t;if(" "==t[0]){for(var s=(n-=n%this.tabSize)/this.tabSize,o=0;o<s;o++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return t.substr(n)}if("\t"==t[0]){for(o=0;o<n;o++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return t.substr(n)}return t},this.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},this.$renderWrappedLine=function(e,t,i){var n=0,s=0,r=i[0],a=0,l=this.$createLineElement();e.appendChild(l);for(var h=0;h<t.length;h++){var c=t[h],u=c.value;if(0==h&&this.displayIndentGuides){if(n=u.length,!(u=this.renderIndentGuide(l,u,r)))continue;n-=u.length}if(n+u.length<r)a=this.$renderToken(l,a,c,u),n+=u.length;else{for(;n+u.length>=r;)a=this.$renderToken(l,a,c,u.substring(0,r-n)),u=u.substring(r-n),n=r,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(o.stringRepeat(" ",i.indent),this.element)),a=0,r=i[++s]||Number.MAX_VALUE;0!=u.length&&(n+=u.length,a=this.$renderToken(l,a,c,u))}}i[i.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var i=0,n=t[0],s=n.value;this.displayIndentGuides&&(s=this.renderIndentGuide(e,s)),s&&(i=this.$renderToken(e,i,n,s));for(var o=1;o<t.length;o++){if(i+(s=(n=t[o]).value).length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,n,s);i=this.$renderToken(e,i,n,s)}},this.$renderOverflowMessage=function(e,t,i,n,s){i&&this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t));var o=this.dom.createElement("span");o.className="ace_inline_button ace_keyword ace_toggle_wrap",o.textContent=s?"<hide>":"<click to see more...>",e.appendChild(o)},this.$renderLine=function(e,t,i){if(i||0==i||(i=this.session.getFoldLine(t)),i)var n=this.$getFoldLineTokens(t,i);else n=this.session.getTokens(t);var s=e;if(n.length){var o=this.session.getRowSplitData(t);if(o&&o.length){this.$renderWrappedLine(e,n,o);s=e.lastChild}else{s=e;this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s)),this.$renderSimpleLine(s,n)}}else this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s));if(this.showEOL&&s){i&&(t=i.end.row);var r=this.dom.createElement("span");r.className="ace_invisible ace_invisible_eol",r.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,s.appendChild(r)}},this.$getFoldLineTokens=function(e,t){var i=this.session,n=[];var s=i.getTokens(e);return t.walk(function(e,t,o,r,a){null!=e?n.push({type:"fold",value:e}):(a&&(s=i.getTokens(t)),s.length&&function(e,t,i){for(var s=0,o=0;o+e[s].value.length<t;)if(o+=e[s].value.length,++s==e.length)return;for(o!=t&&((r=e[s].value.substring(t-o)).length>i-t&&(r=r.substring(0,i-t)),n.push({type:e[s].type,value:r}),o=t+r.length,s+=1);o<i&&s<e.length;){var r;(r=e[s].value).length+o>i?n.push({type:e[s].type,value:r.substring(0,i-o)}):n.push(e[s]),o+=r.length,s+=1}}(s,r,o))},t.end.row,this.session.getLine(t.end.row).length),n},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom"),s=function(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),n.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)n.setStyle(t[i].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){n.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){n.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,n.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=n.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,n.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,n.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&n.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){n.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),n.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),top:(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.top<t.maxHeight},this.update=function(e){this.config=e;var t=this.session.$selectionMarkers,i=0,s=0;void 0!==t&&0!==t.length||(t=[{cursor:null}]);i=0;for(var o=t.length;i<o;i++){var r=this.getPixelPosition(t[i].cursor,!0);if(!((r.top>e.height+e.offset||r.top<0)&&i>1)){var a=this.cursors[s++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,r,e,t[i],this.session):this.isCursorInView(r,e)?(n.setStyle(l,"display","block"),n.translate(a,r.left,r.top),n.setStyle(l,"width",Math.round(e.characterWidth)+"px"),n.setStyle(l,"height",e.lineHeight+"px")):n.setStyle(l,"display","none")}}for(;this.cursors.length>s;)this.removeCursor();var h=this.session.getOverwrite();this.$setOverwrite(h),this.$pixelPos=r,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?n.addCssClass(this.element,"ace_overwrite-cursors"):n.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(s.prototype),t.Cursor=s}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/dom"),o=e("./lib/event"),r=e("./lib/event_emitter").EventEmitter,a=function(e){this.element=s.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=s.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,"scroll",this.onScroll.bind(this)),o.addListener(this.element,"mousedown",o.preventDefault)};(function(){n.implement(this,r),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(a.prototype);var l=function(e,t){a.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=s.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};n.inherits(l,a),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>32768?(this.coeff=32768/e,e=32768):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(l.prototype);var h=function(e,t){a.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};n.inherits(h,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(h.prototype),t.ScrollBar=l,t.ScrollBarV=l,t.ScrollBarH=h,t.VScrollBar=l,t.HScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,i){"use strict";var n=e("./lib/event"),s=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var i=this;this._flush=function(e){i.pending=!1;var t=i.changes;if(t&&(n.blockIdle(100),i.changes=0,i.onRender(t)),i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else i.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(n.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(s.prototype),t.RenderLoop=s}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,i){var n=e("../lib/oop"),s=e("../lib/dom"),o=e("../lib/lang"),r=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,h="function"==typeof ResizeObserver,c=200,u=t.FontMetrics=function(e){this.el=s.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=s.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=s.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=o.stringRepeat("X",256),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()};(function(){n.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){e.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=r.onIdle(function t(){e.checkForSizeChanges(),r.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/256};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.textContent=o.stringRepeat(e,256),this.$main.getBoundingClientRect().width/256},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t&&t.parentElement?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=s.buildDom([e(0,0),e(c,0),e(0,c),e(c,c)],this.el)},this.transformCoordinates=function(e,t){e&&(e=o(1/this.$getZoom(this.el),e));function i(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function r(e){var t=e.getBoundingClientRect();return[t.left,t.top]}this.els||this.$initTransformMeasureNodes();var a=r(this.els[0]),l=r(this.els[1]),h=r(this.els[2]),u=r(this.els[3]),d=i(n(u,l),n(u,h),n(s(l,h),s(u,a))),g=o(1+d[0],n(l,a)),f=o(1+d[1],n(h,a));if(t){var m=t,p=d[0]*m[0]/c+d[1]*m[1]/c+1,v=s(o(m[0],g),o(m[1],f));return s(o(1/p/c,v),a)}var w=n(e,a),$=i(n(g,o(d[0],w)),n(f,o(d[1],w)),w);return o(c,$)}}).call(u.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("./lib/oop"),s=e("./lib/dom"),o=e("./config"),r=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,h=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,u=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,g=e("./layer/font_metrics").FontMetrics,f=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius    : 3px;}.ace_br2 {border-top-right-radius   : 3px;}.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block;   }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',p=e("./lib/useragent"),v=p.isIE;s.importCssString(m,"ace_editor.css");var w=function(e,t){var i=this;this.container=e||s.createElement("div"),s.addCssClass(this.container,"ace_editor"),s.HI_DPI&&s.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=s.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=s.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=s.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new r(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var n=this.$textLayer=new l(this.content);this.canvas=n.element,this.$markerFront=new a(this.content),this.$cursorLayer=new h(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.on("scroll",function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)}),this.scrollBarH.on("scroll",function(e){i.$scrollAnimation||i.session.setScrollLeft(e.data-i.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new g(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!p.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),o.resetOptions(this),o._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,n.implement(this,f),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),s.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,i){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!i)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,i,n){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var s=this.container;n||(n=s.clientHeight||s.scrollHeight),i||(i=s.clientWidth||s.scrollWidth);var o=this.$updateCachedSize(e,t,i,n);if(!this.$size.scrollerHeight||!i&&!n)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(o|this.$changes,!0):this.$loop.schedule(o|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var o=0,r=this.$size,a={width:r.width,height:r.height,scrollerHeight:r.scrollerHeight,scrollerWidth:r.scrollerWidth};if(n&&(e||r.height!=n)&&(r.height=n,o|=this.CHANGE_SIZE,r.scrollerHeight=r.height,this.$horizScroll&&(r.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",o|=this.CHANGE_SCROLL),i&&(e||r.width!=i)){o|=this.CHANGE_SIZE,r.width=i,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,s.setStyle(this.scrollBarH.element.style,"left",t+"px"),s.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),r.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()-this.margin.h),s.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";s.setStyle(this.scrollBarH.element.style,"right",l),s.setStyle(this.scroller.style,"right",l),s.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(o|=this.CHANGE_FULL)}return r.$dirty=!i||!n,o&&this._signal("resize",a),o},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=s.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=s.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var i=this.$cursorLayer.$pixelPos;if(i){t&&t.markerRange&&(i=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var n=this.layerConfig,o=i.top,r=i.left;o-=n.offset;var a=t&&t.useTextareaForIME?this.lineHeight:v?0:1;if(o<0||o>n.height-a)s.translate(this.textarea,0,0);else{var l=1,h=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else o+=this.lineHeight+2;else o+=this.lineHeight;(r-=this.scrollLeft)>this.$size.scrollerWidth-l&&(r=this.$size.scrollerWidth-l),r+=this.gutterWidth+this.margin.left,s.setStyle(e,"height",a+"px"),s.setStyle(e,"width",l+"px"),s.translate(this.textarea,Math.min(r,this.$size.scrollerWidth-l),Math.min(o,h))}}}else s.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,i,n){var s=this.scrollMargin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|i,s.v=s.top+s.bottom,s.h=s.left+s.right,s.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-s.top),this.updateFull()},this.setMargin=function(e,t,i,n){var s=this.margin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|i,s.v=s.top+s.bottom,s.h=s.left+s.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var i=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),i.firstRow!=this.layerConfig.firstRow&&i.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(i.firstRow-this.layerConfig.firstRow)*this.lineHeight;n>0&&(this.scrollTop=n,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}i=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),s.translate(this.content,-this.scrollLeft,-i.offset);var o=i.width+2*this.$padding+"px",r=i.minHeight+"px";s.setStyle(this.content.style,"width",o),s.setStyle(this.content.style,"height",r)}if(e&this.CHANGE_H_SCROLL&&(s.translate(this.content,-this.scrollLeft,-i.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(i):this.$textLayer.scrollLines(i),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(i):this.$gutterLayer.scrollLines(i)),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(i):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(i):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(i),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(i),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(i),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(i),this._signal("afterRender",e)}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(i+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&i>this.$maxPixelHeight&&(i=this.$maxPixelHeight);var n=!(i<=2*this.lineHeight)&&e>t;if(i!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n));var s=this.container.clientWidth;this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,i),this.desiredHeight=i,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,i=t.height<=2*this.lineHeight,n=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),o=!i&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),r=this.$horizScroll!==o;r&&(this.$horizScroll=o,this.scrollBarH.setVisible(o));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,h=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;n+=h;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,n-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+c.right)));var u=!i&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-n+h<0||this.scrollTop>c.top),d=a!==u;d&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var g,f,m=this.scrollTop%this.lineHeight,p=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),w=v+p,$=this.lineHeight;v=e.screenToDocumentRow(v,0);var b=e.getFoldLine(v);b&&(v=b.start.row),g=e.documentToScreenRow(v,0),f=e.getRowLength(v)*$,w=Math.min(e.screenToDocumentRow(w,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(w)*$+f,m=this.scrollTop-g*$;var y=0;return(this.layerConfig.width!=s||r)&&(y=this.CHANGE_H_SCROLL),(r||d)&&(y|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(s=this.$getLongestLine())),this.layerConfig={width:s,padding:this.$padding,firstRow:v,firstRowScreen:g,lastRow:w,lineHeight:$,characterWidth:this.characterWidth,minHeight:l,maxHeight:n,offset:m,gutterOffset:$?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/$)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),y},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var i=this.layerConfig;if(!(e>i.lastRow+1||t<i.firstRow))return t===1/0?(this.$showGutter&&this.$gutterLayer.update(i),void this.$textLayer.update(i)):(this.$textLayer.updateLines(i,e,t),!0)}},this.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,i){this.scrollCursorIntoView(e,i),this.scrollCursorIntoView(t,i)},this.scrollCursorIntoView=function(e,t,i){if(0!==this.$size.scrollerHeight){var n=this.$cursorLayer.getPixelPosition(e),s=n.left,o=n.top,r=i&&i.top||0,a=i&&i.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+r>o?(t&&l+r>o+this.lineHeight&&(o-=t*this.$size.scrollerHeight),0===o&&(o=-this.scrollMargin.top),this.session.setScrollTop(o)):l+this.$size.scrollerHeight-a<o+this.lineHeight&&(t&&l+this.$size.scrollerHeight-a<o-this.lineHeight&&(o+=t*this.$size.scrollerHeight),this.session.setScrollTop(o+this.lineHeight+a-this.$size.scrollerHeight));var h=this.scrollLeft;h>s?(s<this.$padding+2*this.layerConfig.characterWidth&&(s=-this.scrollMargin.left),this.session.setScrollLeft(s)):h+this.$size.scrollerWidth<s+this.characterWidth?this.session.setScrollLeft(Math.round(s+this.characterWidth-this.$size.scrollerWidth)):h<=this.$padding&&s-h<this.characterWidth&&this.session.setScrollLeft(0)}},this.getScrollTop=function(){return this.session.getScrollTop()},this.getScrollLeft=function(){return this.session.getScrollLeft()},this.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},this.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},this.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},this.alignCursor=function(e,t){"number"==typeof e&&(e={row:e,column:0});var i=this.$cursorLayer.getPixelPosition(e),n=this.$size.scrollerHeight-this.lineHeight,s=i.top-n*(t||0);return this.session.setScrollTop(s),s},this.STEPS=8,this.$calcSteps=function(e,t){var i,n,s=0,o=this.STEPS,r=[];for(s=0;s<o;++s)r.push((i=s/this.STEPS,n=e,(t-e)*(Math.pow(i-1,3)+1)+n));return r},this.scrollToLine=function(e,t,i,n){var s=this.$cursorLayer.getPixelPosition({row:e,column:0}).top;t&&(s-=this.$size.scrollerHeight/2);var o=this.scrollTop;this.session.setScrollTop(s),!1!==i&&this.animateScrolling(o,n)},this.animateScrolling=function(e,t){var i=this.scrollTop;if(this.$animatedScroll){var n=this;if(e!=i){if(this.$scrollAnimation){var s=this.$scrollAnimation.steps;if(s.length&&(e=s[0])==i)return}var o=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:o},clearInterval(this.$timer),n.session.setScrollTop(o.shift()),n.session.$scrollTop=i,this.$timer=setInterval(function(){if(!n.session)return clearInterval(n.$timer);o.length?(n.session.setScrollTop(o.shift()),n.session.$scrollTop=i):null!=i?(n.session.$scrollTop=-1,n.session.setScrollTop(i),i=null):(n.$timer=clearInterval(n.$timer),n.$scrollAnimation=null,t&&t())},10)}}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(t)},this.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},this.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0)))},this.pixelToScreenCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else i=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-i.left-this.$padding,o=s/this.characterWidth,r=Math.floor((t+this.scrollTop-i.top)/this.lineHeight),a=this.$blockCursor?Math.floor(o):Math.round(o);return{row:r,column:a,side:o-a>0?1:-1,offsetX:s}},this.screenToTextCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else i=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-i.left-this.$padding,o=s/this.characterWidth,r=this.$blockCursor?Math.floor(o):Math.round(o),a=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(r,0),s)},this.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),n=this.session.documentToScreenPosition(e,t),s=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth)),o=n.row*this.lineHeight;return{pageX:i.left+s-this.scrollLeft,pageY:i.top+o-this.scrollTop}},this.visualizeFocus=function(){s.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){s.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(s.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),s.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(e,t,i,n){var s=this.session;s.bgTokenizer.lines[i]=null;var o={type:t,value:e},r=s.getTokens(i);if(null==n)r.push(o);else for(var a=0,l=0;l<r.length;l++){var h=r[l];if(n<=(a+=h.value.length)){var c=h.value.length-(a-n),u=h.value.slice(0,c),d=h.value.slice(c);r.splice(l,1,{type:h.type,value:u},o,{type:h.type,value:d});break}}this.updateLines(i,i)},this.removeExtraToken=function(e,t){this.updateLines(e,e)},this.setTheme=function(e,t){var i=this;if(this.$themeId=e,i._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e)r(e);else{var n=e||this.$options.theme.initialValue;o.loadModule(["theme",n],r)}function r(n){if(i.$themeId!=e)return t&&t();if(!n||!n.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");n.$id&&(i.$themeId=n.$id),s.importCssString(n.cssText,n.cssClass,i.container),i.theme&&s.removeCssClass(i.container,i.theme.cssClass);var o="padding"in n?n.padding:"padding"in(i.theme||{})?4:i.$padding;i.$padding&&o!=i.$padding&&i.setPadding(o),i.$theme=n.cssClass,i.theme=n,s.addCssClass(i.container,n.cssClass),s.setCssClass(i.container,"ace_dark",n.isDark),i.$size&&(i.$size.width=0,i.$updateSizeAsync()),i._dispatchEvent("themeLoaded",{theme:n}),t&&t()}},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){s.setCssClass(this.container,e,!1!==t)},this.unsetStyle=function(e){s.removeCssClass(this.container,e)},this.setCursorStyle=function(e){s.setStyle(this.scroller.style,"cursor",e)},this.setMouseCursor=function(e){s.setStyle(this.scroller.style,"cursor",e)},this.attachToShadowRoot=function(){s.importCssString(m,"ace_editor.css",this.container)},this.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent=""}}).call(w.prototype),o.defineOptions(w.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(e){s.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!p.isMobile&&!p.isIE}}),t.VirtualRenderer=w}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(e,t,i){"use strict";var n=e("../lib/oop"),s=e("../lib/net"),o=e("../lib/event_emitter").EventEmitter,r=e("../config");function a(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};if(r.get("loadWorkerFromBlob")){var t=function(e){var t="importScripts('"+s.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(n){var i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return i.append(t),i.getBlob("application/javascript")}}(e),i=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(i)}return new Worker(e)}var l=function(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){n.implement(this,o),this.$createWorkerFromOldConfig=function(t,i,n,s,o){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),r.get("packaged")||!e.toUrl)s=s||r.moduleUrl(i,"worker");else{var l=this.$normalizePath;s=s||l(e.toUrl("ace/worker/worker.js",null,"_"));var h={};t.forEach(function(t){h[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=a(s),o&&this.send("importScripts",o),this.$worker.postMessage({init:!0,tlns:h,module:i,classname:n}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var i=this.callbacks[t.id];i&&(i(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return s.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,i){if(i){var n=this.callbackId++;this.callbacks[n]=i,t.push(n)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker.postMessage({event:e,data:{data:t.data}})}catch(i){console.error(i.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype);t.UIWorkerClient=function(e,t,i){var n=null,s=!1,a=Object.create(o),h=[],c=new l({messageBuffer:h,terminate:function(){},postMessage:function(e){h.push(e),n&&(s?setTimeout(u):u())}});c.setEmitSync=function(e){s=e};var u=function(){var e=h.shift();e.command?n[e.command].apply(n,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},r.loadModule(["worker",t],function(e){for(n=new e[i](a);h.length;)u()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,i){"use strict";var n=e("./range").Range,s=e("./lib/event_emitter").EventEmitter,o=e("./lib/oop"),r=function(e,t,i,n,s,o){var r=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=s,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){r.onCursorChange()})},this.$pos=i;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){o.implement(this,s),this.setup=function(){var e=this,t=this.doc,i=this.session;this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var s=this.pos;s.$insertRight=!0,s.detach(),s.markerId=i.addMarker(new n(s.row,s.column,s.row,s.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(i){var n=t.createAnchor(i.row,i.column);n.$insertRight=!0,n.detach(),e.others.push(n)}),i.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(i){i.markerId=e.addMarker(new n(i.row,i.column,i.row,i.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},this.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var i="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,s=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,o=t.start.column-this.pos.column;if(this.updateAnchors(e),s&&(this.length+=i),s&&!this.session.$fromUndo)if("insert"===e.action)for(var r=this.others.length-1;r>=0;r--){var a={row:(l=this.others[r]).row,column:l.column+o};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(r=this.others.length-1;r>=0;r--){var l;a={row:(l=this.others[r]).row,column:l.column+o};this.doc.remove(new n(a.row,a.column,a.row,a.column-i))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,i=function(i,s){t.removeMarker(i.markerId),i.markerId=t.addMarker(new n(i.row,i.column,i.row,i.column+e.length),s,null,!1)};i(this.pos,this.mainClass);for(var s=this.others.length;s--;)i(this.others[s],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i<t;i++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}}).call(r.prototype),t.PlaceHolder=r}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){var n=e("../lib/event"),s=e("../lib/useragent");function o(e,t){return e.row==t.row&&e.column==t.column}t.onMouseDown=function(e){var t=e.domEvent,i=t.altKey,r=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),h=e.getButton();if(a&&s.isMac&&(h=t.button),e.editor.inMultiSelectMode&&2==h)e.editor.textInput.onContextMenu(e.domEvent);else if(a||i||l){if(0===h){var c,u=e.editor,d=u.selection,g=u.inMultiSelectMode,f=e.getDocumentPosition(),m=d.getCursor(),p=e.inSelection()||d.isEmpty()&&o(f,m),v=e.x,w=e.y,$=u.session,b=u.renderer.pixelToScreenCoordinates(v,w),y=b;if(u.$mouseHandler.$enableJumpToDef)a&&i||l&&i?c=r?"block":"add":i&&u.$blockSelectEnabled&&(c="block");else if(l&&!i){if(c="add",!g&&r)return}else i&&u.$blockSelectEnabled&&(c="block");if(c&&s.isMac&&t.ctrlKey&&u.$mouseHandler.cancelContextMenu(),"add"==c){if(!g&&p)return;if(!g){var C=d.toOrientedRange();u.addSelectionMarker(C)}var S=d.rangeList.rangeAtPoint(f);u.inVirtualSelectionMode=!0,r&&(S=null,C=d.ranges[0]||C,u.removeSelectionMarker(C)),u.once("mouseup",function(){var e=d.toOrientedRange();S&&e.isEmpty()&&o(S.cursor,e.cursor)?d.substractPoint(e.cursor):(r?d.substractPoint(C.cursor):C&&(u.removeSelectionMarker(C),d.addRange(C)),d.addRange(e)),u.inVirtualSelectionMode=!1})}else if("block"==c){var x;e.stop(),u.inVirtualSelectionMode=!0;var k=[],A=function(){var e=u.renderer.pixelToScreenCoordinates(v,w),t=$.screenToDocumentPosition(e.row,e.column,e.offsetX);o(y,e)&&o(t,d.lead)||(y=e,u.selection.moveToPosition(t),u.renderer.scrollCursorIntoView(),u.removeSelectionMarkers(k),k=d.rectangularRangeBlock(y,b),u.$mouseHandler.$clickSelection&&1==k.length&&k[0].isEmpty()&&(k[0]=u.$mouseHandler.$clickSelection.clone()),k.forEach(u.addSelectionMarker,u),u.updateSelectionMarkers())};g&&!l?d.toSingleRange():!g&&l&&(x=d.toOrientedRange(),u.addSelectionMarker(x)),r?b=$.documentToScreenPosition(d.lead):d.moveToPosition(f),y={row:-1,column:-1};var L=A;n.capture(u.container,function(e){v=e.clientX,w=e.clientY},function(e){A(),clearInterval(R),u.removeSelectionMarkers(k),k.length||(k=[d.toOrientedRange()]),x&&(u.removeSelectionMarker(x),d.toSingleRange(x));for(var t=0;t<k.length;t++)d.addRange(k[t]);u.inVirtualSelectionMode=!1,u.$mouseHandler.$clickSelection=null});var R=setInterval(function(){L()},20);return e.preventDefault()}}}else 0===h&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.rangeCount>1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var n=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new n(t.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t,i){var n=e("./range_list").RangeList,s=e("./range").Range,o=e("./selection").Selection,r=e("./mouse/multi_select_handler").onMouseDown,a=e("./lib/event"),l=e("./lib/lang"),h=e("./commands/multi_select_commands");t.commands=h.defaultCommands.concat(h.multiSelectCommands);var c=new(0,e("./search").Search);var u=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var i=this.toOrientedRange();if(this.rangeList.add(i),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(i),this.$onAddRange(i)}e.cursor||(e.cursor=e.end);var n=this.rangeList.add(e);return this.$onAddRange(e),n.length&&this.$onRemoveRange(n),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new n,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],i=0;i<e.length;i++){var n=e[i],o=n.start.row,r=n.end.row;if(o===r)t.push(n.clone());else{for(t.push(new s(o,n.start.column,o,this.session.getLine(o).length));++o<r;)t.push(this.getLineRange(o,!0));t.push(new s(r,0,r,n.end.column))}0!=i||this.isBackwards()||(t=t.reverse())}this.toSingleRange();for(i=t.length;i--;)this.addRange(t[i])},this.joinSelections=function(){var e=this.rangeList.ranges,t=e[e.length-1],i=s.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],i=s.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.cursor),o=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(n,o).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,i){var n=[],o=e.column<t.column;if(o)var r=e.column,a=t.column,l=e.offsetX,h=t.offsetX;else r=t.column,a=e.column,l=t.offsetX,h=e.offsetX;var c,u,d,g=e.row<t.row;if(g)var f=e.row,m=t.row;else f=t.row,m=e.row;r<0&&(r=0),f<0&&(f=0),f==m&&(i=!0);for(var p=f;p<=m;p++){var v=s.fromPoints(this.session.screenToDocumentPosition(p,r,l),this.session.screenToDocumentPosition(p,a,h));if(v.isEmpty()){if(c&&(u=v.end,d=c,u.row==d.row&&u.column==d.column))break;c=v.end}v.cursor=o?v.start:v.end,n.push(v)}if(g&&n.reverse(),!i){for(var w=n.length-1;n[w].isEmpty()&&w>0;)w--;if(w>0)for(var $=0;n[$].isEmpty();)$++;for(var b=w;b>=$;b--)n[b].isEmpty()&&n.splice(b,1)}return n}}.call(o.prototype);var d=e("./editor").Editor;function g(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",r),e.commands.addCommands(h.defaultCommands),function(e){if(!e.textInput)return;var t=e.textInput.getElement(),i=!1;function n(t){i&&(e.renderer.setMouseCursor(""),i=!1)}a.addListener(t,"keydown",function(t){var s=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&s?i||(e.renderer.setMouseCursor("crosshair"),i=!0):i&&n()},e),a.addListener(t,"keyup",n,e),a.addListener(t,"blur",n,e)}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,i=e.length;i--;){var n=e[i];if(n.marker){this.session.removeMarker(n.marker);var s=t.indexOf(n);-1!=s&&t.splice(s,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(h.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(h.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,i=e.editor;if(i.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?n=i.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?n=i.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(i.exitMultiSelectMode(),n=t.exec(i,e.args||{})):n=t.multiSelectAction(i,e.args||{});else{var n=t.exec(i,e.args||{});i.multiSelect.addRange(i.multiSelect.toOrientedRange()),i.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,s=i&&i.keepOrder,r=1==i||i&&i.$byLines,a=this.session,l=this.selection,h=l.rangeList,c=(s?l:h).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var u=l._eventRegistry;l._eventRegistry={};var d=new o(a);this.inVirtualSelectionMode=!0;for(var g=c.length;g--;){if(r)for(;g>0&&c[g].start.row==c[g-1].end.row;)g--;d.fromOrientedRange(c[g]),d.index=g,this.selection=a.selection=d;var f=e.exec?e.exec(this,t||{}):e(this,t||{});n||void 0===f||(n=f),d.toOrientedRange(c[g])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=u,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,i=[],n=0;n<t.length;n++)i.push(this.session.getTextRange(t[n]));var s=this.session.getDocument().getNewLineCharacter();(e=i.join(s)).length==(i.length-1)*s.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var i=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var n=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor;n.row!=t.row||this.session.$clipPositionToDocument(n.row,n.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(e,t,i){if((t=t||{}).needle=e||t.needle,null==t.needle){var n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(n)}this.$search.set(t);var s=this.$search.findAll(this.session);if(!s.length)return 0;var o=this.multiSelect;i||o.toSingleRange(s[0]);for(var r=s.length;r--;)o.addRange(s[r],!0);return n&&o.rangeList.rangeAtPoint(n.start)&&o.addRange(n,!0),s.length},this.selectMoreLines=function(e,t){var i=this.selection.toOrientedRange(),n=i.cursor==i.end,o=this.session.documentToScreenPosition(i.cursor);this.selection.$desiredColumn&&(o.column=this.selection.$desiredColumn);var r,a=this.session.screenToDocumentPosition(o.row+e,o.column);if(i.isEmpty())h=a;else var l=this.session.documentToScreenPosition(n?i.end:i.start),h=this.session.screenToDocumentPosition(l.row+e,l.column);n?(r=s.fromPoints(a,h)).cursor=r.start:(r=s.fromPoints(h,a)).cursor=r.end;if(r.desiredColumn=o.column,this.selection.inMultiSelectMode){if(t)var c=i.cursor}else this.selection.addRange(i);this.selection.addRange(r),c&&this.selection.substractPoint(c)},this.transposeSelections=function(e){for(var t=this.session,i=t.multiSelect,n=i.ranges,s=n.length;s--;){if((a=n[s]).isEmpty()){var o=t.getWordRange(a.start.row,a.start.column);a.start.row=o.start.row,a.start.column=o.start.column,a.end.row=o.end.row,a.end.column=o.end.column}}i.mergeOverlappingRanges();var r=[];for(s=n.length;s--;){var a=n[s];r.unshift(t.getTextRange(a))}e<0?r.unshift(r.pop()):r.push(r.shift());for(s=n.length;s--;){o=(a=n[s]).clone();t.replace(a,r[s]),a.start.row=o.start.row,a.start.column=o.start.column}i.fromOrientedRange(i.ranges[0])},this.selectMore=function(e,t,i){var n=this.session,s=n.multiSelect.toOrientedRange();if(!s.isEmpty()||((s=n.getWordRange(s.start.row,s.start.column)).cursor=-1==e?s.start:s.end,this.multiSelect.addRange(s),!i)){var o=n.getTextRange(s),r=function(e,t,i){return c.$options.wrap=!0,c.$options.needle=t,c.$options.backwards=-1==i,c.find(e)}(n,o,e);r&&(r.cursor=-1==e?r.start:r.end,this.session.unfold(r),this.multiSelect.addRange(r),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(s.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,i=t.ranges,n=-1,o=i.filter(function(e){if(e.cursor.row==n)return!0;n=e.cursor.row});if(i.length&&o.length!=i.length-1){o.forEach(function(e){t.substractPoint(e.cursor)});var r=0,a=1/0,h=i.map(function(t){var i=t.cursor,n=e.getLine(i.row).substr(i.column).search(/\S/g);return-1==n&&(n=0),i.column>r&&(r=i.column),n<a&&(a=n),n});i.forEach(function(t,i){var n=t.cursor,o=r-n.column,c=h[i]-a;o>c?e.insert(n,l.stringRepeat(" ",o-c)):e.remove(new s(n.row,n.column,n.row,n.column-o+c)),t.start.column=t.end.column=r,t.start.row=t.end.row=n.row,t.cursor=t.end}),t.fromOrientedRange(i[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),u=c.start.row,d=c.end.row,g=u==d;if(g){var f,m=this.session.getLength();do{f=this.session.getLine(d)}while(/[=:]/.test(f)&&++d<m);do{f=this.session.getLine(u)}while(/[=:]/.test(f)&&--u>0);u<0&&(u=0),d>=m&&(d=m-1)}var p=this.session.removeFullLines(u,d);p=this.$reAlignText(p,g),this.session.insert({row:u,column:0},p.join("\n")+"\n"),g||(c.start.column=0,c.end.column=p[p.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var i,n,s,o=!0,r=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==i?(i=t[1].length,n=t[2].length,s=t[3].length,t):(i+n+s!=t[1].length+t[2].length+t[3].length&&(r=!1),i!=t[1].length&&(o=!1),i>t[1].length&&(i=t[1].length),n<t[2].length&&(n=t[2].length),s>t[3].length&&(s=t[3].length),t):[e]}).map(t?h:o?r?function(e){return e[2]?a(i+n-e[2].length)+e[2]+a(s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:h:function(e){return e[2]?a(i)+e[2]+a(s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function h(e){return e[2]?a(i)+e[2]+a(n-e[2].length+s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var i=e.oldSession;i&&(i.multiSelect.off("addRange",this.$onAddRange),i.multiSelect.off("removeRange",this.$onRemoveRange),i.multiSelect.off("multiSelect",this.$onMultiSelect),i.multiSelect.off("singleSelect",this.$onSingleSelect),i.multiSelect.lead.off("change",this.$checkMultiselectChange),i.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=g,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){g(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",r)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",r))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("../../range").Range,s=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){var n=e.getLine(i);return this.foldingStartMarker.test(n)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?"end":""},this.getFoldWidgetRange=function(e,t,i){return null},this.indentationBlock=function(e,t,i){var s=/\S/,o=e.getLine(t),r=o.search(s);if(-1!=r){for(var a=i||o.length,l=e.getLength(),h=t,c=t;++t<l;){var u=e.getLine(t).search(s);if(-1!=u){if(u<=r){var d=e.getTokenAt(t,0);if(!d||"string"!==d.type)break}c=t}}if(c>h){var g=e.getLine(c).length;return new n(h,a,c,g)}}},this.openingBracketBlock=function(e,t,i,s,o){var r={row:i,column:s+1},a=e.$findClosingBracket(t,r,o);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>r.row&&(a.row--,a.column=e.getLine(a.row).length),n.fromPoints(r,a)}},this.closingBracketBlock=function(e,t,i,s,o){var r={row:i,column:s},a=e.$findOpeningBracket(t,r);if(a)return a.column++,r.column--,n.fromPoints(a,r)}}).call(s.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("./lib/dom");function s(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var i=t.lineWidgets;if(i&&e.action){for(var n=e.data,s=n.start.row,o=n.end.row,r="add"==e.action,a=s+1;a<o;a++)i[a]&&(i[a].hidden=r);i[o]&&(r?i[s]?i[o].hidden=r:i[s]=i[o]:(i[s]==i[o]&&(i[s]=void 0),i[o].hidden=r))}},this.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var i=e.start.row,n=e.end.row-i;if(0===n);else if("remove"==e.action){var s=t.splice(i+1,n);!t[i]&&s[s.length-1]&&(t[i]=s.pop()),s.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var o=new Array(n);t[i]&&null!=t[i].column&&e.start.column>t[i].column&&i++,o.unshift(i,0),t.splice.apply(t,o),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach(function(e,i){if(e)for(t=!1,e.row=i;e.$oldWidget;)e.$oldWidget.row=i,e=e.$oldWidget}),t&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},this.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=n.createElement("div"),e.el.innerHTML=e.html),e.el&&(n.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight)),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var i=this.session.getFoldAt(e.row,0);if(e.$fold=i,i){var s=this.session.lineWidgets;e.row!=i.end.row||s[i.start.row]?e.hidden=!0:s[i.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(i){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,i=t&&t[e],n=[];i;)n.push(i),i=i.$oldWidget;return n},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var i=this.session._changedWidgets,n=t.layerConfig;if(i&&i.length){for(var s=1/0,o=0;o<i.length;o++){var r=i[o];if(r&&r.el&&r.session==this.session){if(!r._inDocument){if(this.session.lineWidgets[r.row]!=r)continue;r._inDocument=!0,t.container.appendChild(r.el)}r.h=r.el.offsetHeight,r.fixedWidth||(r.w=r.el.offsetWidth,r.screenWidth=Math.ceil(r.w/n.characterWidth));var a=r.h/n.lineHeight;r.coverLine&&(a-=this.session.getRowLineCount(r.row))<0&&(a=0),r.rowCount!=a&&(r.rowCount=a,r.row<s&&(s=r.row))}}s!=1/0&&(this.session._emit("changeFold",{data:{start:{row:s}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var i=t.layerConfig,n=this.session.lineWidgets;if(n){for(var s=Math.min(this.firstRow,i.firstRow),o=Math.max(this.lastRow,i.lastRow,n.length);s>0&&!n[s];)s--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i;for(var r=s;r<=o;r++){var a=n[r];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:r,column:0},!0).top;a.coverLine||(l+=i.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-i.offset+"px";var h=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(h-=t.scrollLeft),a.el.style.left=h+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=i.width+2*i.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(s.prototype),t.LineWidgets=s}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,i){"use strict";var n=e("../line_widgets").LineWidgets,s=e("../lib/dom"),o=e("../range").Range;t.showErrorMarker=function(e,t){var i=e.session;i.widgetManager||(i.widgetManager=new n(i),i.widgetManager.attach(e));var r=e.getCursorPosition(),a=r.row,l=i.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var h,c=function(e,t,i){var n=e.getAnnotations().sort(o.comparePoints);if(n.length){var s=function(e,t,i){for(var n=0,s=e.length-1;n<=s;){var o=n+s>>1,r=i(t,e[o]);if(r>0)n=o+1;else{if(!(r<0))return o;s=o-1}}return-(n+1)}(n,{row:t,column:-1},o.comparePoints);s<0&&(s=-s-1),s>=n.length?s=i>0?0:n.length-1:0===s&&i<0&&(s=n.length-1);var r=n[s];if(r&&i){if(r.row===t){do{r=n[s+=i]}while(r&&r.row===t);if(!r)return n.slice()}var a=[];t=r.row;do{a[i<0?"unshift":"push"](r),r=n[s+=i]}while(r&&r.row==t);return a.length&&a}}}(i,a,t);if(c){var u=c[0];r.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,r.row=u.row,h=e.renderer.$gutterLayer.$annotations[r.row]}else{if(l)return;h={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(r.row),e.selection.moveToPosition(r);var d={row:r.row,fixedWidth:!0,coverGutter:!0,el:s.createElement("div"),type:"errorMarker"},g=d.el.appendChild(s.createElement("div")),f=d.el.appendChild(s.createElement("div"));f.className="error_widget_arrow "+h.className;var m=e.renderer.$cursorLayer.getPixelPosition(r).left;f.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",g.className="error_widget "+h.className,g.innerHTML=h.text.join("<br>"),g.appendChild(s.createElement("div"));var p=function(e,t,i){if(0===t&&("esc"===i||"return"===i))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(p),i.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(p),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},s.importCssString("    .error_widget_wrapper {        background: inherit;        color: inherit;        border:none    }    .error_widget {        border-top: solid 2px;        border-bottom: solid 2px;        margin: 5px 0;        padding: 10px 40px;        white-space: pre-wrap;    }    .error_widget.ace_error, .error_widget_arrow.ace_error{        border-color: #ff5a5a    }    .error_widget.ace_warning, .error_widget_arrow.ace_warning{        border-color: #F1D817    }    .error_widget.ace_info, .error_widget_arrow.ace_info{        border-color: #5a5a5a    }    .error_widget.ace_ok, .error_widget_arrow.ace_ok{        border-color: #5aaa5a    }    .error_widget_arrow {        position: absolute;        border: solid 5px;        border-top-color: transparent!important;        border-right-color: transparent!important;        border-left-color: transparent!important;        top: -5px;    }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(t,i,n){"use strict";t("./lib/fixoldbrowsers");var s=t("./lib/dom"),o=t("./lib/event"),r=t("./range").Range,a=t("./editor").Editor,l=t("./edit_session").EditSession,h=t("./undomanager").UndoManager,c=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),i.config=t("./config"),i.require=t,"function"==typeof e&&(i.define=e),i.edit=function(e,t){if("string"==typeof e){var n=e;if(!(e=document.getElementById(n)))throw new Error("ace.edit can't find div #"+n)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var r="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;r=l.value,e=s.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(r=e.textContent,e.innerHTML="");var h=i.createEditSession(r),u=new a(new c(e),h,t),d={document:h,editor:u,onResize:u.resize.bind(u,null)};return l&&(d.textarea=l),o.addListener(window,"resize",d.onResize),u.on("destroy",function(){o.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),u.container.env=u.env=d,u},i.createEditSession=function(e,t){var i=new l(e,t);return i.setUndoManager(new h),i},i.Range=r,i.Editor=a,i.EditSession=l,i.UndoManager=h,i.VirtualRenderer=c,i.version=i.config.version}),ace.require(["ace/ace"],function(e){for(var t in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(t)&&(window.ace[t]=e[t]);window.ace.default=window.ace,"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=window.ace)});
},{}],"a1XM":[function(require,module,exports) {
var global = arguments[3];

var t=arguments[3],e=200,r="__lodash_hash_undefined__",n=1,o=2,i=9007199254740991,u="[object Arguments]",a="[object Array]",c="[object AsyncFunction]",s="[object Boolean]",f="[object Date]",l="[object Error]",_="[object Function]",h="[object GeneratorFunction]",p="[object Map]",v="[object Number]",y="[object Null]",b="[object Object]",d="[object Promise]",g="[object Proxy]",j="[object RegExp]",w="[object Set]",m="[object String]",z="[object Symbol]",A="[object Undefined]",O="[object WeakMap]",S="[object ArrayBuffer]",x="[object DataView]",k="[object Float32Array]",E="[object Float64Array]",F="[object Int8Array]",P="[object Int16Array]",$="[object Int32Array]",U="[object Uint8Array]",B="[object Uint8ClampedArray]",I="[object Uint16Array]",L="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,D=/^(?:0|[1-9]\d*)$/,R={};R[k]=R[E]=R[F]=R[P]=R[$]=R[U]=R[B]=R[I]=R[L]=!0,R[u]=R[a]=R[S]=R[s]=R[x]=R[f]=R[l]=R[_]=R[p]=R[v]=R[b]=R[j]=R[w]=R[m]=R[O]=!1;var C="object"==typeof t&&t&&t.Object===Object&&t,N="object"==typeof self&&self&&self.Object===Object&&self,V=C||N||Function("return this")(),W="object"==typeof exports&&exports&&!exports.nodeType&&exports,G=W&&"object"==typeof module&&module&&!module.nodeType&&module,q=G&&G.exports===W,H=q&&C.process,J=function(){try{return H&&H.binding&&H.binding("util")}catch(t){}}(),K=J&&J.isTypedArray;function Q(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var u=t[r];e(u,r,t)&&(i[o++]=u)}return i}function X(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function Y(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Z(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function tt(t){return function(e){return t(e)}}function et(t,e){return t.has(e)}function rt(t,e){return null==t?void 0:t[e]}function nt(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function ot(t,e){return function(r){return t(e(r))}}function it(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}var ut=Array.prototype,at=Function.prototype,ct=Object.prototype,st=V["__core-js_shared__"],ft=at.toString,lt=ct.hasOwnProperty,_t=function(){var t=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ht=ct.toString,pt=RegExp("^"+ft.call(lt).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vt=q?V.Buffer:void 0,yt=V.Symbol,bt=V.Uint8Array,dt=ct.propertyIsEnumerable,gt=ut.splice,jt=yt?yt.toStringTag:void 0,wt=Object.getOwnPropertySymbols,mt=vt?vt.isBuffer:void 0,zt=ot(Object.keys,Object),At=Oe(V,"DataView"),Ot=Oe(V,"Map"),St=Oe(V,"Promise"),xt=Oe(V,"Set"),kt=Oe(V,"WeakMap"),Et=Oe(Object,"create"),Ft=Be(At),Pt=Be(Ot),$t=Be(St),Ut=Be(xt),Bt=Be(kt),It=yt?yt.prototype:void 0,Lt=It?It.valueOf:void 0;function Tt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Mt(){this.__data__=Et?Et(null):{},this.size=0}function Dt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Rt(t){var e=this.__data__;if(Et){var n=e[t];return n===r?void 0:n}return lt.call(e,t)?e[t]:void 0}function Ct(t){var e=this.__data__;return Et?void 0!==e[t]:lt.call(e,t)}function Nt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Et&&void 0===e?r:e,this}function Vt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wt(){this.__data__=[],this.size=0}function Gt(t){var e=this.__data__,r=le(e,t);return!(r<0)&&(r==e.length-1?e.pop():gt.call(e,r,1),--this.size,!0)}function qt(t){var e=this.__data__,r=le(e,t);return r<0?void 0:e[r][1]}function Ht(t){return le(this.__data__,t)>-1}function Jt(t,e){var r=this.__data__,n=le(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Kt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Qt(){this.size=0,this.__data__={hash:new Tt,map:new(Ot||Vt),string:new Tt}}function Xt(t){var e=Ae(this,t).delete(t);return this.size-=e?1:0,e}function Yt(t){return Ae(this,t).get(t)}function Zt(t){return Ae(this,t).has(t)}function te(t,e){var r=Ae(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function ee(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Kt;++e<r;)this.add(t[e])}function re(t){return this.__data__.set(t,r),this}function ne(t){return this.__data__.has(t)}function oe(t){var e=this.__data__=new Vt(t);this.size=e.size}function ie(){this.__data__=new Vt,this.size=0}function ue(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function ae(t){return this.__data__.get(t)}function ce(t){return this.__data__.has(t)}function se(t,r){var n=this.__data__;if(n instanceof Vt){var o=n.__data__;if(!Ot||o.length<e-1)return o.push([t,r]),this.size=++n.size,this;n=this.__data__=new Kt(o)}return n.set(t,r),this.size=n.size,this}function fe(t,e){var r=Te(t),n=!r&&Le(t),o=!r&&!n&&De(t),i=!r&&!n&&!o&&Ge(t),u=r||n||o||i,a=u?Z(t.length,String):[],c=a.length;for(var s in t)!e&&!lt.call(t,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ee(s,c))||a.push(s);return a}function le(t,e){for(var r=t.length;r--;)if(Ie(t[r][0],e))return r;return-1}function _e(t,e,r){var n=e(t);return Te(t)?n:X(n,r(t))}function he(t){return null==t?void 0===t?A:y:jt&&jt in Object(t)?Se(t):Ue(t)}function pe(t){return We(t)&&he(t)==u}function ve(t,e,r,n,o){return t===e||(null==t||null==e||!We(t)&&!We(e)?t!=t&&e!=e:ye(t,e,r,n,ve,o))}function ye(t,e,r,o,i,c){var s=Te(t),f=Te(e),l=s?a:ke(t),_=f?a:ke(e),h=(l=l==u?b:l)==b,p=(_=_==u?b:_)==b,v=l==_;if(v&&De(t)){if(!De(e))return!1;s=!0,h=!1}if(v&&!h)return c||(c=new oe),s||Ge(t)?je(t,e,r,o,i,c):we(t,e,l,r,o,i,c);if(!(r&n)){var y=h&&lt.call(t,"__wrapped__"),d=p&&lt.call(e,"__wrapped__");if(y||d){var g=y?t.value():t,j=d?e.value():e;return c||(c=new oe),i(g,j,r,o,c)}}return!!v&&(c||(c=new oe),me(t,e,r,o,i,c))}function be(t){return!(!Ve(t)||Pe(t))&&(Ce(t)?pt:M).test(Be(t))}function de(t){return We(t)&&Ne(t.length)&&!!R[he(t)]}function ge(t){if(!$e(t))return zt(t);var e=[];for(var r in Object(t))lt.call(t,r)&&"constructor"!=r&&e.push(r);return e}function je(t,e,r,i,u,a){var c=r&n,s=t.length,f=e.length;if(s!=f&&!(c&&f>s))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var _=-1,h=!0,p=r&o?new ee:void 0;for(a.set(t,e),a.set(e,t);++_<s;){var v=t[_],y=e[_];if(i)var b=c?i(y,v,_,e,t,a):i(v,y,_,t,e,a);if(void 0!==b){if(b)continue;h=!1;break}if(p){if(!Y(e,function(t,e){if(!et(p,e)&&(v===t||u(v,t,r,i,a)))return p.push(e)})){h=!1;break}}else if(v!==y&&!u(v,y,r,i,a)){h=!1;break}}return a.delete(t),a.delete(e),h}function we(t,e,r,i,u,a,c){switch(r){case x:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case S:return!(t.byteLength!=e.byteLength||!a(new bt(t),new bt(e)));case s:case f:case v:return Ie(+t,+e);case l:return t.name==e.name&&t.message==e.message;case j:case m:return t==e+"";case p:var _=nt;case w:var h=i&n;if(_||(_=it),t.size!=e.size&&!h)return!1;var y=c.get(t);if(y)return y==e;i|=o,c.set(t,e);var b=je(_(t),_(e),i,u,a,c);return c.delete(t),b;case z:if(Lt)return Lt.call(t)==Lt.call(e)}return!1}function me(t,e,r,o,i,u){var a=r&n,c=ze(t),s=c.length;if(s!=ze(e).length&&!a)return!1;for(var f=s;f--;){var l=c[f];if(!(a?l in e:lt.call(e,l)))return!1}var _=u.get(t);if(_&&u.get(e))return _==e;var h=!0;u.set(t,e),u.set(e,t);for(var p=a;++f<s;){var v=t[l=c[f]],y=e[l];if(o)var b=a?o(y,v,l,e,t,u):o(v,y,l,t,e,u);if(!(void 0===b?v===y||i(v,y,r,o,u):b)){h=!1;break}p||(p="constructor"==l)}if(h&&!p){var d=t.constructor,g=e.constructor;d!=g&&"constructor"in t&&"constructor"in e&&!("function"==typeof d&&d instanceof d&&"function"==typeof g&&g instanceof g)&&(h=!1)}return u.delete(t),u.delete(e),h}function ze(t){return _e(t,qe,xe)}function Ae(t,e){var r=t.__data__;return Fe(e)?r["string"==typeof e?"string":"hash"]:r.map}function Oe(t,e){var r=rt(t,e);return be(r)?r:void 0}function Se(t){var e=lt.call(t,jt),r=t[jt];try{t[jt]=void 0;var n=!0}catch(i){}var o=ht.call(t);return n&&(e?t[jt]=r:delete t[jt]),o}Tt.prototype.clear=Mt,Tt.prototype.delete=Dt,Tt.prototype.get=Rt,Tt.prototype.has=Ct,Tt.prototype.set=Nt,Vt.prototype.clear=Wt,Vt.prototype.delete=Gt,Vt.prototype.get=qt,Vt.prototype.has=Ht,Vt.prototype.set=Jt,Kt.prototype.clear=Qt,Kt.prototype.delete=Xt,Kt.prototype.get=Yt,Kt.prototype.has=Zt,Kt.prototype.set=te,ee.prototype.add=ee.prototype.push=re,ee.prototype.has=ne,oe.prototype.clear=ie,oe.prototype.delete=ue,oe.prototype.get=ae,oe.prototype.has=ce,oe.prototype.set=se;var xe=wt?function(t){return null==t?[]:(t=Object(t),Q(wt(t),function(e){return dt.call(t,e)}))}:He,ke=he;function Ee(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||D.test(t))&&t>-1&&t%1==0&&t<e}function Fe(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Pe(t){return!!_t&&_t in t}function $e(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ct)}function Ue(t){return ht.call(t)}function Be(t){if(null!=t){try{return ft.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ie(t,e){return t===e||t!=t&&e!=e}(At&&ke(new At(new ArrayBuffer(1)))!=x||Ot&&ke(new Ot)!=p||St&&ke(St.resolve())!=d||xt&&ke(new xt)!=w||kt&&ke(new kt)!=O)&&(ke=function(t){var e=he(t),r=e==b?t.constructor:void 0,n=r?Be(r):"";if(n)switch(n){case Ft:return x;case Pt:return p;case $t:return d;case Ut:return w;case Bt:return O}return e});var Le=pe(function(){return arguments}())?pe:function(t){return We(t)&&lt.call(t,"callee")&&!dt.call(t,"callee")},Te=Array.isArray;function Me(t){return null!=t&&Ne(t.length)&&!Ce(t)}var De=mt||Je;function Re(t,e){return ve(t,e)}function Ce(t){if(!Ve(t))return!1;var e=he(t);return e==_||e==h||e==c||e==g}function Ne(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function Ve(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function We(t){return null!=t&&"object"==typeof t}var Ge=K?tt(K):de;function qe(t){return Me(t)?fe(t):ge(t)}function He(){return[]}function Je(){return!1}module.exports=Re;
},{}],"nVSs":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0});var n=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];exports.editorOptions=n;var o=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];exports.editorEvents=o;var i=function(){var n;return"undefined"==typeof window?(e.window={},n=require("ace-builds"),delete e.window):window.ace?(n=window.ace).acequire=window.ace.require||window.ace.acequire:n=require("ace-builds"),n};exports.getAceInstance=i;var t=function(e,n){var o=null;return function(){var i=this,t=arguments;clearTimeout(o),o=setTimeout(function(){e.apply(i,t)},n)}};exports.debounce=t;
},{"ace-builds":"xC8N"}],"McQl":[function(require,module,exports) {
"use strict";var e=this&&this.__extends||function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),t=this&&this.__assign||function(){return(t=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var o=require("ace-builds"),r=require("prop-types"),n=require("react"),i=require("lodash.isequal"),s=require("./editorOptions"),a=s.getAceInstance(),h=function(h){function d(e){var t=h.call(this,e)||this;return s.editorEvents.forEach(function(e){t[e]=t[e].bind(t)}),t.debounce=s.debounce,t}return e(d,h),d.prototype.isInShadow=function(e){for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1},d.prototype.componentDidMount=function(){var e=this,t=this.props,o=t.className,r=t.onBeforeLoad,n=t.onValidate,i=t.mode,h=t.focus,d=t.theme,l=t.fontSize,p=t.value,c=t.defaultValue,u=t.showGutter,f=t.wrapEnabled,g=t.showPrintMargin,y=t.scrollMargin,m=void 0===y?[0,0,0,0]:y,b=t.keyboardHandler,S=t.onLoad,v=t.commands,w=t.annotations,C=t.markers,O=t.placeholder;this.editor=a.edit(this.refEditor),r&&r(a);for(var P=Object.keys(this.props.editorProps),M=0;M<P.length;M++)this.editor[P[M]]=this.props.editorProps[P[M]];this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),this.editor.renderer.setScrollMargin(m[0],m[1],m[2],m[3]),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.getSession().setMode("string"==typeof i?"ace/mode/"+i:i),this.editor.setTheme("ace/theme/"+d),this.editor.setFontSize("number"==typeof l?l+"px":l),this.editor.getSession().setValue(c||(p||"")),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(u),this.editor.getSession().setUseWrapMode(f),this.editor.setShowPrintMargin(g),this.editor.on("focus",this.onFocus),this.editor.on("blur",this.onBlur),this.editor.on("copy",this.onCopy),this.editor.on("paste",this.onPaste),this.editor.on("change",this.onChange),this.editor.on("input",this.onInput),O&&this.updatePlaceholder(),this.editor.getSession().selection.on("changeSelection",this.onSelectionChange),this.editor.getSession().selection.on("changeCursor",this.onCursorChange),n&&this.editor.getSession().on("changeAnnotation",function(){var t=e.editor.getSession().getAnnotations();e.props.onValidate(t)}),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(w||[]),C&&C.length>0&&this.handleMarkers(C);var k=this.editor.$options;s.editorOptions.forEach(function(t){k.hasOwnProperty(t)?e.editor.setOption(t,e.props[t]):e.props[t]&&console.warn("ReactAce: editor option "+t+" was activated but not found. Did you need to import a related tool or did you possibly mispell the option?")}),this.handleOptions(this.props),Array.isArray(v)&&v.forEach(function(t){"string"==typeof t.exec?e.editor.commands.bindKey(t.bindKey,t.exec):e.editor.commands.addCommand(t)}),b&&this.editor.setKeyboardHandler("ace/keyboard/"+b),o&&(this.refEditor.className+=" "+o),S&&S(this.editor),this.editor.resize(),h&&this.editor.focus()},d.prototype.componentDidUpdate=function(e){for(var t=e,o=this.props,r=0;r<s.editorOptions.length;r++){var n=s.editorOptions[r];o[n]!==t[n]&&this.editor.setOption(n,o[n])}if(o.className!==t.className){var a=this.refEditor.className.trim().split(" ");t.className.trim().split(" ").forEach(function(e){var t=a.indexOf(e);a.splice(t,1)}),this.refEditor.className=" "+o.className+" "+a.join(" ")}if(this.editor&&null!=o.value&&this.editor.getValue()!==o.value){this.silent=!0;var h=this.editor.session.selection.toJSON();this.editor.setValue(o.value,o.cursorStart),this.editor.session.selection.fromJSON(h),this.silent=!1}o.placeholder!==t.placeholder&&this.updatePlaceholder(),o.mode!==t.mode&&this.editor.getSession().setMode("string"==typeof o.mode?"ace/mode/"+o.mode:o.mode),o.theme!==t.theme&&this.editor.setTheme("ace/theme/"+o.theme),o.keyboardHandler!==t.keyboardHandler&&(o.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+o.keyboardHandler):this.editor.setKeyboardHandler(null)),o.fontSize!==t.fontSize&&this.editor.setFontSize("number"==typeof o.fontSize?o.fontSize+"px":o.fontSize),o.wrapEnabled!==t.wrapEnabled&&this.editor.getSession().setUseWrapMode(o.wrapEnabled),o.showPrintMargin!==t.showPrintMargin&&this.editor.setShowPrintMargin(o.showPrintMargin),o.showGutter!==t.showGutter&&this.editor.renderer.setShowGutter(o.showGutter),i(o.setOptions,t.setOptions)||this.handleOptions(o),i(o.annotations,t.annotations)||this.editor.getSession().setAnnotations(o.annotations||[]),!i(o.markers,t.markers)&&Array.isArray(o.markers)&&this.handleMarkers(o.markers),i(o.scrollMargin,t.scrollMargin)||this.handleScrollMargins(o.scrollMargin),e.height===this.props.height&&e.width===this.props.width||this.editor.resize(),this.props.focus&&!e.focus&&this.editor.focus()},d.prototype.handleScrollMargins=function(e){void 0===e&&(e=[0,0,0,0]),this.editor.renderer.setScrollMargin(e[0],e[1],e[2],e[3])},d.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},d.prototype.onChange=function(e){if(this.props.onChange&&!this.silent){var t=this.editor.getValue();this.props.onChange(t,e)}},d.prototype.onSelectionChange=function(e){if(this.props.onSelectionChange){var t=this.editor.getSelection();this.props.onSelectionChange(t,e)}},d.prototype.onCursorChange=function(e){if(this.props.onCursorChange){var t=this.editor.getSelection();this.props.onCursorChange(t,e)}},d.prototype.onInput=function(e){this.props.onInput&&this.props.onInput(e),this.props.placeholder&&this.updatePlaceholder()},d.prototype.onFocus=function(e){this.props.onFocus&&this.props.onFocus(e,this.editor)},d.prototype.onBlur=function(e){this.props.onBlur&&this.props.onBlur(e,this.editor)},d.prototype.onCopy=function(e){var t=e.text;this.props.onCopy&&this.props.onCopy(t)},d.prototype.onPaste=function(e){var t=e.text;this.props.onPaste&&this.props.onPaste(t)},d.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},d.prototype.handleOptions=function(e){for(var t=Object.keys(e.setOptions),o=0;o<t.length;o++)this.editor.setOption(t[o],e.setOptions[t[o]])},d.prototype.handleMarkers=function(e){var t=this,r=this.editor.getSession().getMarkers(!0);for(var n in r)r.hasOwnProperty(n)&&this.editor.getSession().removeMarker(r[n].id);for(var n in r=this.editor.getSession().getMarkers(!1))r.hasOwnProperty(n)&&"ace_active-line"!==r[n].clazz&&"ace_selected-word"!==r[n].clazz&&this.editor.getSession().removeMarker(r[n].id);e.forEach(function(e){var r=e.startRow,n=e.startCol,i=e.endRow,s=e.endCol,a=e.className,h=e.type,d=e.inFront,l=void 0!==d&&d,p=new o.Range(r,n,i,s);t.editor.getSession().addMarker(p,a,h,l)})},d.prototype.updatePlaceholder=function(){var e=this.editor,t=this.props.placeholder,o=!e.session.getValue().length,r=e.renderer.placeholderNode;!o&&r?(e.renderer.scroller.removeChild(e.renderer.placeholderNode),e.renderer.placeholderNode=null):o&&!r?((r=e.renderer.placeholderNode=document.createElement("div")).textContent=t||"",r.className="ace_comment ace_placeholder",r.style.padding="0 9px",r.style.position="absolute",r.style.zIndex="3",e.renderer.scroller.appendChild(r)):o&&r&&(r.textContent=t)},d.prototype.updateRef=function(e){this.refEditor=e},d.prototype.render=function(){var e=this.props,o=e.name,r=e.width,i=e.height,s=e.style,a=t({width:r,height:i},s);return n.createElement("div",{ref:this.updateRef,id:o,style:a})},d.propTypes={mode:r.oneOfType([r.string,r.object]),focus:r.bool,theme:r.string,name:r.string,className:r.string,height:r.string,width:r.string,fontSize:r.oneOfType([r.number,r.string]),showGutter:r.bool,onChange:r.func,onCopy:r.func,onPaste:r.func,onFocus:r.func,onInput:r.func,onBlur:r.func,onScroll:r.func,value:r.string,defaultValue:r.string,onLoad:r.func,onSelectionChange:r.func,onCursorChange:r.func,onBeforeLoad:r.func,onValidate:r.func,minLines:r.number,maxLines:r.number,readOnly:r.bool,highlightActiveLine:r.bool,tabSize:r.number,showPrintMargin:r.bool,cursorStart:r.number,debounceChangePeriod:r.number,editorProps:r.object,setOptions:r.object,style:r.object,scrollMargin:r.array,annotations:r.array,markers:r.array,keyboardHandler:r.string,wrapEnabled:r.bool,enableSnippets:r.bool,enableBasicAutocompletion:r.oneOfType([r.bool,r.array]),enableLiveAutocompletion:r.oneOfType([r.bool,r.array]),navigateToFileEnd:r.bool,commands:r.array,placeholder:r.string},d.defaultProps={name:"ace-editor",focus:!1,mode:"",theme:"",height:"500px",width:"500px",fontSize:12,enableSnippets:!1,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,placeholder:null,navigateToFileEnd:!0},d}(n.Component);exports.default=h;
},{"ace-builds":"xC8N","prop-types":"D9Od","react":"n8MK","lodash.isequal":"a1XM","./editorOptions":"nVSs"}],"hqur":[function(require,module,exports) {
ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(t,i,e){"use strict";var s=t("./lib/oop"),o=(t("./lib/lang"),t("./lib/event_emitter").EventEmitter),n=t("./editor").Editor,r=t("./virtual_renderer").VirtualRenderer,h=t("./edit_session").EditSession,a=function(t,i,e){this.BELOW=1,this.BESIDE=0,this.$container=t,this.$theme=i,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(e||1),this.$cEditor=this.$editors[0],this.on("focus",function(t){this.$cEditor=t}.bind(this))};(function(){s.implement(this,o),this.$createEditor=function(){var t=document.createElement("div");t.className=this.$editorCSS,t.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(t);var i=new n(new r(t,this.$theme));return i.on("focus",function(){this._emit("focus",i)}.bind(this)),this.$editors.push(i),i.setFontSize(this.$fontSize),i},this.setSplits=function(t){var i;if(t<1)throw"The number of splits have to be > 0!";if(t!=this.$splits){if(t>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<t;)i=this.$editors[this.$splits],this.$container.appendChild(i.container),i.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<t;)this.$createEditor(),this.$splits++}else for(;this.$splits>t;)i=this.$editors[this.$splits-1],this.$container.removeChild(i.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(t){return this.$editors[t]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(t){this.$editors.forEach(function(i){i.setTheme(t)})},this.setKeyboardHandler=function(t){this.$editors.forEach(function(i){i.setKeyboardHandler(t)})},this.forEach=function(t,i){this.$editors.forEach(t,i)},this.$fontSize="",this.setFontSize=function(t){this.$fontSize=t,this.forEach(function(i){i.setFontSize(t)})},this.$cloneSession=function(t){var i=new h(t.getDocument(),t.getMode()),e=t.getUndoManager();return i.setUndoManager(e),i.setTabSize(t.getTabSize()),i.setUseSoftTabs(t.getUseSoftTabs()),i.setOverwrite(t.getOverwrite()),i.setBreakpoints(t.getBreakpoints()),i.setUseWrapMode(t.getUseWrapMode()),i.setUseWorker(t.getUseWorker()),i.setWrapLimitRange(t.$wrapLimitRange.min,t.$wrapLimitRange.max),i.$foldData=t.$cloneFoldData(),i},this.setSession=function(t,i){var e;return e=null==i?this.$cEditor:this.$editors[i],this.$editors.some(function(i){return i.session===t})&&(t=this.$cloneSession(t)),e.setSession(t),t},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(t){this.$orientation!=t&&(this.$orientation=t,this.resize())},this.resize=function(){var t,i=this.$container.clientWidth,e=this.$container.clientHeight;if(this.$orientation==this.BESIDE)for(var s=i/this.$splits,o=0;o<this.$splits;o++)(t=this.$editors[o]).container.style.width=s+"px",t.container.style.top="0px",t.container.style.left=o*s+"px",t.container.style.height=e+"px",t.resize();else{var n=e/this.$splits;for(o=0;o<this.$splits;o++)(t=this.$editors[o]).container.style.width=i+"px",t.container.style.top=o*n+"px",t.container.style.left="0px",t.container.style.height=n+"px",t.resize()}}}).call(a.prototype),i.Split=a}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(t,i,e){"use strict";e.exports=t("../split")}),ace.require(["ace/ext/split"],function(t){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=t)});
},{}],"ZEnN":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],r="Expected a function",n="__lodash_hash_undefined__",e=1/0,o="[object Function]",u="[object GeneratorFunction]",i="[object Symbol]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,f=/^\./,s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/[\\^$.*+?()[\]{}|]/g,l=/\\(\\)?/g,_=/^\[object .+?Constructor\]$/,h="object"==typeof t&&t&&t.Object===Object&&t,y="object"==typeof self&&self&&self.Object===Object&&self,v=h||y||Function("return this")();function d(t,r){return null==t?void 0:t[r]}function g(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(n){}return r}var b=Array.prototype,j=Function.prototype,m=Object.prototype,O=v["__core-js_shared__"],w=function(){var t=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),$=j.toString,S=m.hasOwnProperty,x=m.toString,E=RegExp("^"+$.call(S).replace(p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=v.Symbol,A=b.splice,C=ot(v,"Map"),P=ot(Object,"create"),k=F?F.prototype:void 0,R=k?k.toString:void 0;function T(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var e=t[r];this.set(e[0],e[1])}}function G(){this.__data__=P?P(null):{}}function I(t){return this.has(t)&&delete this.__data__[t]}function M(t){var r=this.__data__;if(P){var e=r[t];return e===n?void 0:e}return S.call(r,t)?r[t]:void 0}function q(t){var r=this.__data__;return P?void 0!==r[t]:S.call(r,t)}function z(t,r){return this.__data__[t]=P&&void 0===r?n:r,this}function B(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var e=t[r];this.set(e[0],e[1])}}function D(){this.__data__=[]}function H(t){var r=this.__data__,n=Y(r,t);return!(n<0)&&(n==r.length-1?r.pop():A.call(r,n,1),!0)}function J(t){var r=this.__data__,n=Y(r,t);return n<0?void 0:r[n][1]}function K(t){return Y(this.__data__,t)>-1}function L(t,r){var n=this.__data__,e=Y(n,t);return e<0?n.push([t,r]):n[e][1]=r,this}function N(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var e=t[r];this.set(e[0],e[1])}}function Q(){this.__data__={hash:new T,map:new(C||B),string:new T}}function U(t){return et(this,t).delete(t)}function V(t){return et(this,t).get(t)}function W(t){return et(this,t).has(t)}function X(t,r){return et(this,t).set(t,r),this}function Y(t,r){for(var n=t.length;n--;)if(lt(t[n][0],r))return n;return-1}function Z(t,r){for(var n=0,e=(r=ut(r,t)?[r]:nt(r)).length;null!=t&&n<e;)t=t[ft(r[n++])];return n&&n==e?t:void 0}function tt(t){return!(!yt(t)||at(t))&&(ht(t)||g(t)?E:_).test(st(t))}function rt(t){if("string"==typeof t)return t;if(dt(t))return R?R.call(t):"";var r=t+"";return"0"==r&&1/t==-e?"-0":r}function nt(t){return _t(t)?t:ct(t)}function et(t,r){var n=t.__data__;return it(r)?n["string"==typeof r?"string":"hash"]:n.map}function ot(t,r){var n=d(t,r);return tt(n)?n:void 0}function ut(t,r){if(_t(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!dt(t))||(c.test(t)||!a.test(t)||null!=r&&t in Object(r))}function it(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t}function at(t){return!!w&&w in t}T.prototype.clear=G,T.prototype.delete=I,T.prototype.get=M,T.prototype.has=q,T.prototype.set=z,B.prototype.clear=D,B.prototype.delete=H,B.prototype.get=J,B.prototype.has=K,B.prototype.set=L,N.prototype.clear=Q,N.prototype.delete=U,N.prototype.get=V,N.prototype.has=W,N.prototype.set=X;var ct=pt(function(t){t=gt(t);var r=[];return f.test(t)&&r.push(""),t.replace(s,function(t,n,e,o){r.push(e?o.replace(l,"$1"):n||t)}),r});function ft(t){if("string"==typeof t||dt(t))return t;var r=t+"";return"0"==r&&1/t==-e?"-0":r}function st(t){if(null!=t){try{return $.call(t)}catch(r){}try{return t+""}catch(r){}}return""}function pt(t,n){if("function"!=typeof t||n&&"function"!=typeof n)throw new TypeError(r);var e=function(){var r=arguments,o=n?n.apply(this,r):r[0],u=e.cache;if(u.has(o))return u.get(o);var i=t.apply(this,r);return e.cache=u.set(o,i),i};return e.cache=new(pt.Cache||N),e}function lt(t,r){return t===r||t!=t&&r!=r}pt.Cache=N;var _t=Array.isArray;function ht(t){var r=yt(t)?x.call(t):"";return r==o||r==u}function yt(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function vt(t){return!!t&&"object"==typeof t}function dt(t){return"symbol"==typeof t||vt(t)&&x.call(t)==i}function gt(t){return null==t?"":rt(t)}function bt(t,r,n){var e=null==t?void 0:Z(t,r);return void 0===e?n:e}module.exports=bt;
},{}],"ipoQ":[function(require,module,exports) {
"use strict";var e=this&&this.__extends||function(){var e=function(o,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var t in o)o.hasOwnProperty(t)&&(e[t]=o[t])})(o,t)};return function(o,t){function n(){this.constructor=o}e(o,t),o.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var o,t=1,n=arguments.length;t<n;t++)for(var r in o=arguments[t])Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);return e}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./editorOptions"),n=t.getAceInstance(),r=require("ace-builds"),s=require("ace-builds/src-noconflict/ext-split"),i=require("prop-types"),a=require("react"),p=require("lodash.isequal"),h=require("lodash.get"),l=function(l){function c(e){var o=l.call(this,e)||this;return t.editorEvents.forEach(function(e){o[e]=o[e].bind(o)}),o.debounce=t.debounce,o}return e(c,l),c.prototype.isInShadow=function(e){for(var o=e&&e.parentNode;o;){if("[object ShadowRoot]"===o.toString())return!0;o=o.parentNode}return!1},c.prototype.componentDidMount=function(){var e=this,o=this.props,r=o.className,i=o.onBeforeLoad,a=o.mode,p=o.focus,l=o.theme,c=o.fontSize,d=o.value,u=o.defaultValue,f=o.cursorStart,g=o.showGutter,y=o.wrapEnabled,m=o.showPrintMargin,b=o.scrollMargin,S=void 0===b?[0,0,0,0]:b,v=o.keyboardHandler,w=o.onLoad,O=o.commands,C=o.annotations,E=o.markers,P=o.splits;this.editor=n.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/"+l),i&&i(n);var M=Object.keys(this.props.editorProps),k=new s.Split(this.editor.container,"ace/theme/"+l,P);this.editor.env.split=k,this.splitEditor=k.getEditor(0),this.split=k,this.editor.setShowPrintMargin(!1),this.editor.renderer.setShowGutter(!1);var A=this.splitEditor.$options;this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),k.forEach(function(o,r){for(var s=0;s<M.length;s++)o[M[s]]=e.props.editorProps[M[s]];var i=h(u,r),p=h(d,r,"");o.session.setUndoManager(new n.UndoManager),o.setTheme("ace/theme/"+l),o.renderer.setScrollMargin(S[0],S[1],S[2],S[3]),o.getSession().setMode("ace/mode/"+a),o.setFontSize(c),o.renderer.setShowGutter(g),o.getSession().setUseWrapMode(y),o.setShowPrintMargin(m),o.on("focus",e.onFocus),o.on("blur",e.onBlur),o.on("input",e.onInput),o.on("copy",e.onCopy),o.on("paste",e.onPaste),o.on("change",e.onChange),o.getSession().selection.on("changeSelection",e.onSelectionChange),o.getSession().selection.on("changeCursor",e.onCursorChange),o.session.on("changeScrollTop",e.onScroll),o.setValue(void 0===i?p:i,f);var b=h(C,r,[]),w=h(E,r,[]);o.getSession().setAnnotations(b),w&&w.length>0&&e.handleMarkers(w,o);for(s=0;s<t.editorOptions.length;s++){var P=t.editorOptions[s];A.hasOwnProperty(P)?o.setOption(P,e.props[P]):e.props[P]&&console.warn("ReaceAce: editor option "+P+" was activated but not found. Did you need to import a related tool or did you possibly mispell the option?")}e.handleOptions(e.props,o),Array.isArray(O)&&O.forEach(function(e){"string"==typeof e.exec?o.commands.bindKey(e.bindKey,e.exec):o.commands.addCommand(e)}),v&&o.setKeyboardHandler("ace/keyboard/"+v)}),r&&(this.refEditor.className+=" "+r),p&&this.splitEditor.focus();var L=this.editor.env.split;L.setOrientation("below"===this.props.orientation?L.BELOW:L.BESIDE),L.resize(!0),w&&w(L)},c.prototype.componentDidUpdate=function(e){var o=this,n=e,r=this.props,s=this.editor.env.split;if(r.splits!==n.splits&&s.setSplits(r.splits),r.orientation!==n.orientation&&s.setOrientation("below"===r.orientation?s.BELOW:s.BESIDE),s.forEach(function(e,s){r.mode!==n.mode&&e.getSession().setMode("ace/mode/"+r.mode),r.keyboardHandler!==n.keyboardHandler&&(r.keyboardHandler?e.setKeyboardHandler("ace/keyboard/"+r.keyboardHandler):e.setKeyboardHandler(null)),r.fontSize!==n.fontSize&&e.setFontSize(r.fontSize),r.wrapEnabled!==n.wrapEnabled&&e.getSession().setUseWrapMode(r.wrapEnabled),r.showPrintMargin!==n.showPrintMargin&&e.setShowPrintMargin(r.showPrintMargin),r.showGutter!==n.showGutter&&e.renderer.setShowGutter(r.showGutter);for(var i=0;i<t.editorOptions.length;i++){var a=t.editorOptions[i];r[a]!==n[a]&&e.setOption(a,r[a])}p(r.setOptions,n.setOptions)||o.handleOptions(r,e);var l=h(r.value,s,"");if(e.getValue()!==l){o.silent=!0;var c=e.session.selection.toJSON();e.setValue(l,r.cursorStart),e.session.selection.fromJSON(c),o.silent=!1}var d=h(r.annotations,s,[]),u=h(n.annotations,s,[]);p(d,u)||e.getSession().setAnnotations(d);var f=h(r.markers,s,[]),g=h(n.markers,s,[]);!p(f,g)&&Array.isArray(f)&&o.handleMarkers(f,e)}),r.className!==n.className){var i=this.refEditor.className.trim().split(" ");n.className.trim().split(" ").forEach(function(e){var o=i.indexOf(e);i.splice(o,1)}),this.refEditor.className=" "+r.className+" "+i.join(" ")}r.theme!==n.theme&&s.setTheme("ace/theme/"+r.theme),r.focus&&!n.focus&&this.splitEditor.focus(),r.height===this.props.height&&r.width===this.props.width||this.editor.resize()},c.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},c.prototype.onChange=function(e){if(this.props.onChange&&!this.silent){var o=[];this.editor.env.split.forEach(function(e){o.push(e.getValue())}),this.props.onChange(o,e)}},c.prototype.onSelectionChange=function(e){if(this.props.onSelectionChange){var o=[];this.editor.env.split.forEach(function(e){o.push(e.getSelection())}),this.props.onSelectionChange(o,e)}},c.prototype.onCursorChange=function(e){if(this.props.onCursorChange){var o=[];this.editor.env.split.forEach(function(e){o.push(e.getSelection())}),this.props.onCursorChange(o,e)}},c.prototype.onFocus=function(e){this.props.onFocus&&this.props.onFocus(e)},c.prototype.onInput=function(e){this.props.onInput&&this.props.onInput(e)},c.prototype.onBlur=function(e){this.props.onBlur&&this.props.onBlur(e)},c.prototype.onCopy=function(e){this.props.onCopy&&this.props.onCopy(e)},c.prototype.onPaste=function(e){this.props.onPaste&&this.props.onPaste(e)},c.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},c.prototype.handleOptions=function(e,o){for(var t=Object.keys(e.setOptions),n=0;n<t.length;n++)o.setOption(t[n],e.setOptions[t[n]])},c.prototype.handleMarkers=function(e,o){var t=o.getSession().getMarkers(!0);for(var n in t)t.hasOwnProperty(n)&&o.getSession().removeMarker(t[n].id);for(var n in t=o.getSession().getMarkers(!1))t.hasOwnProperty(n)&&o.getSession().removeMarker(t[n].id);e.forEach(function(e){var t=e.startRow,n=e.startCol,s=e.endRow,i=e.endCol,a=e.className,p=e.type,h=e.inFront,l=void 0!==h&&h,c=new r.Range(t,n,s,i);o.getSession().addMarker(c,a,p,l)})},c.prototype.updateRef=function(e){this.refEditor=e},c.prototype.render=function(){var e=this.props,t=e.name,n=e.width,r=e.height,s=e.style,i=o({width:n,height:r},s);return a.createElement("div",{ref:this.updateRef,id:t,style:i})},c.propTypes={className:i.string,debounceChangePeriod:i.number,defaultValue:i.arrayOf(i.string),focus:i.bool,fontSize:i.oneOfType([i.number,i.string]),height:i.string,mode:i.string,name:i.string,onBlur:i.func,onChange:i.func,onCopy:i.func,onFocus:i.func,onInput:i.func,onLoad:i.func,onPaste:i.func,onScroll:i.func,orientation:i.string,showGutter:i.bool,splits:i.number,theme:i.string,value:i.arrayOf(i.string),width:i.string,onSelectionChange:i.func,onCursorChange:i.func,onBeforeLoad:i.func,minLines:i.number,maxLines:i.number,readOnly:i.bool,highlightActiveLine:i.bool,tabSize:i.number,showPrintMargin:i.bool,cursorStart:i.number,editorProps:i.object,setOptions:i.object,style:i.object,scrollMargin:i.array,annotations:i.array,markers:i.array,keyboardHandler:i.string,wrapEnabled:i.bool,enableBasicAutocompletion:i.oneOfType([i.bool,i.array]),enableLiveAutocompletion:i.oneOfType([i.bool,i.array]),commands:i.array},c.defaultProps={name:"ace-editor",focus:!1,orientation:"beside",splits:2,mode:"",theme:"",height:"500px",width:"500px",value:[],fontSize:12,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1},c}(a.Component);exports.default=l;
},{"./editorOptions":"nVSs","ace-builds":"xC8N","ace-builds/src-noconflict/ext-split":"hqur","prop-types":"D9Od","react":"n8MK","lodash.isequal":"a1XM","lodash.get":"ZEnN"}],"k8CM":[function(require,module,exports) {
var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},e=-1,n=1,i=0;t.Diff=function(t,e){return[t,e]},t.prototype.diff_main=function(e,n,r,h){void 0===h&&(h=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var s=h;if(null==e||null==n)throw new Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(i,e)]:[];void 0===r&&(r=!0);var f=r,a=this.diff_commonPrefix(e,n),l=e.substring(0,a);e=e.substring(a),n=n.substring(a),a=this.diff_commonSuffix(e,n);var g=e.substring(e.length-a);e=e.substring(0,e.length-a),n=n.substring(0,n.length-a);var o=this.diff_compute_(e,n,f,s);return l&&o.unshift(new t.Diff(i,l)),g&&o.push(new t.Diff(i,g)),this.diff_cleanupMerge(o),o},t.prototype.diff_compute_=function(r,h,s,f){var a;if(!r)return[new t.Diff(n,h)];if(!h)return[new t.Diff(e,r)];var l=r.length>h.length?r:h,g=r.length>h.length?h:r,o=l.indexOf(g);if(-1!=o)return a=[new t.Diff(n,l.substring(0,o)),new t.Diff(i,g),new t.Diff(n,l.substring(o+g.length))],r.length>h.length&&(a[0][0]=a[2][0]=e),a;if(1==g.length)return[new t.Diff(e,r),new t.Diff(n,h)];var c=this.diff_halfMatch_(r,h);if(c){var u=c[0],p=c[1],d=c[2],_=c[3],b=c[4],v=this.diff_main(u,d,s,f),m=this.diff_main(p,_,s,f);return v.concat([new t.Diff(i,b)],m)}return s&&r.length>100&&h.length>100?this.diff_lineMode_(r,h,f):this.diff_bisect_(r,h,f)},t.prototype.diff_lineMode_=function(r,h,s){var f=this.diff_linesToChars_(r,h);r=f.chars1,h=f.chars2;var a=f.lineArray,l=this.diff_main(r,h,!1,s);this.diff_charsToLines_(l,a),this.diff_cleanupSemantic(l),l.push(new t.Diff(i,""));for(var g=0,o=0,c=0,u="",p="";g<l.length;){switch(l[g][0]){case n:c++,p+=l[g][1];break;case e:o++,u+=l[g][1];break;case i:if(o>=1&&c>=1){l.splice(g-o-c,o+c),g=g-o-c;for(var d=this.diff_main(u,p,!1,s),_=d.length-1;_>=0;_--)l.splice(g,0,d[_]);g+=d.length}c=0,o=0,u="",p=""}g++}return l.pop(),l},t.prototype.diff_bisect_=function(i,r,h){for(var s=i.length,f=r.length,a=Math.ceil((s+f)/2),l=a,g=2*a,o=new Array(g),c=new Array(g),u=0;u<g;u++)o[u]=-1,c[u]=-1;o[l+1]=0,c[l+1]=0;for(var p=s-f,d=p%2!=0,_=0,b=0,v=0,m=0,w=0;w<a&&!((new Date).getTime()>h);w++){for(var x=-w+_;x<=w-b;x+=2){for(var M=l+x,D=(I=x==-w||x!=w&&o[M-1]<o[M+1]?o[M+1]:o[M-1]+1)-x;I<s&&D<f&&i.charAt(I)==r.charAt(D);)I++,D++;if(o[M]=I,I>s)b+=2;else if(D>f)_+=2;else if(d){if((k=l+p-x)>=0&&k<g&&-1!=c[k])if(I>=(A=s-c[k]))return this.diff_bisectSplit_(i,r,I,D,h)}}for(var y=-w+v;y<=w-m;y+=2){for(var A,k=l+y,E=(A=y==-w||y!=w&&c[k-1]<c[k+1]?c[k+1]:c[k-1]+1)-y;A<s&&E<f&&i.charAt(s-A-1)==r.charAt(f-E-1);)A++,E++;if(c[k]=A,A>s)m+=2;else if(E>f)v+=2;else if(!d){if((M=l+p-y)>=0&&M<g&&-1!=o[M]){var I;D=l+(I=o[M])-M;if(I>=(A=s-A))return this.diff_bisectSplit_(i,r,I,D,h)}}}}return[new t.Diff(e,i),new t.Diff(n,r)]},t.prototype.diff_bisectSplit_=function(t,e,n,i,r){var h=t.substring(0,n),s=e.substring(0,i),f=t.substring(n),a=e.substring(i),l=this.diff_main(h,s,!1,r),g=this.diff_main(f,a,!1,r);return l.concat(g)},t.prototype.diff_linesToChars_=function(t,e){var n=[],i={};function r(t){for(var e="",r=0,s=-1,f=n.length;s<t.length-1;){-1==(s=t.indexOf("\n",r))&&(s=t.length-1);var a=t.substring(r,s+1);(i.hasOwnProperty?i.hasOwnProperty(a):void 0!==i[a])?e+=String.fromCharCode(i[a]):(f==h&&(a=t.substring(r),s=t.length),e+=String.fromCharCode(f),i[a]=f,n[f++]=a),r=s+1}return e}n[0]="";var h=4e4,s=r(t);return h=65535,{chars1:s,chars2:r(e),lineArray:n}},t.prototype.diff_charsToLines_=function(t,e){for(var n=0;n<t.length;n++){for(var i=t[n][1],r=[],h=0;h<i.length;h++)r[h]=e[i.charCodeAt(h)];t[n][1]=r.join("")}},t.prototype.diff_commonPrefix=function(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,i=Math.min(t.length,e.length),r=i,h=0;n<r;)t.substring(h,r)==e.substring(h,r)?h=n=r:i=r,r=Math.floor((i-n)/2+n);return r},t.prototype.diff_commonSuffix=function(t,e){if(!t||!e||t.charAt(t.length-1)!=e.charAt(e.length-1))return 0;for(var n=0,i=Math.min(t.length,e.length),r=i,h=0;n<r;)t.substring(t.length-r,t.length-h)==e.substring(e.length-r,e.length-h)?h=n=r:i=r,r=Math.floor((i-n)/2+n);return r},t.prototype.diff_commonOverlap_=function(t,e){var n=t.length,i=e.length;if(0==n||0==i)return 0;n>i?t=t.substring(n-i):n<i&&(e=e.substring(0,n));var r=Math.min(n,i);if(t==e)return r;for(var h=0,s=1;;){var f=t.substring(r-s),a=e.indexOf(f);if(-1==a)return h;s+=a,0!=a&&t.substring(r-s)!=e.substring(0,s)||(h=s,s++)}},t.prototype.diff_halfMatch_=function(t,e){if(this.Diff_Timeout<=0)return null;var n=t.length>e.length?t:e,i=t.length>e.length?e:t;if(n.length<4||2*i.length<n.length)return null;var r=this;function h(t,e,n){for(var i,h,s,f,a=t.substring(n,n+Math.floor(t.length/4)),l=-1,g="";-1!=(l=e.indexOf(a,l+1));){var o=r.diff_commonPrefix(t.substring(n),e.substring(l)),c=r.diff_commonSuffix(t.substring(0,n),e.substring(0,l));g.length<c+o&&(g=e.substring(l-c,l)+e.substring(l,l+o),i=t.substring(0,n-c),h=t.substring(n+o),s=e.substring(0,l-c),f=e.substring(l+o))}return 2*g.length>=t.length?[i,h,s,f,g]:null}var s,f,a,l,g,o=h(n,i,Math.ceil(n.length/4)),c=h(n,i,Math.ceil(n.length/2));return o||c?(s=c?o&&o[4].length>c[4].length?o:c:o,t.length>e.length?(f=s[0],a=s[1],l=s[2],g=s[3]):(l=s[0],g=s[1],f=s[2],a=s[3]),[f,a,l,g,s[4]]):null},t.prototype.diff_cleanupSemantic=function(r){for(var h=!1,s=[],f=0,a=null,l=0,g=0,o=0,c=0,u=0;l<r.length;)r[l][0]==i?(s[f++]=l,g=c,o=u,c=0,u=0,a=r[l][1]):(r[l][0]==n?c+=r[l][1].length:u+=r[l][1].length,a&&a.length<=Math.max(g,o)&&a.length<=Math.max(c,u)&&(r.splice(s[f-1],0,new t.Diff(e,a)),r[s[f-1]+1][0]=n,f--,l=--f>0?s[f-1]:-1,g=0,o=0,c=0,u=0,a=null,h=!0)),l++;for(h&&this.diff_cleanupMerge(r),this.diff_cleanupSemanticLossless(r),l=1;l<r.length;){if(r[l-1][0]==e&&r[l][0]==n){var p=r[l-1][1],d=r[l][1],_=this.diff_commonOverlap_(p,d),b=this.diff_commonOverlap_(d,p);_>=b?(_>=p.length/2||_>=d.length/2)&&(r.splice(l,0,new t.Diff(i,d.substring(0,_))),r[l-1][1]=p.substring(0,p.length-_),r[l+1][1]=d.substring(_),l++):(b>=p.length/2||b>=d.length/2)&&(r.splice(l,0,new t.Diff(i,p.substring(0,b))),r[l-1][0]=n,r[l-1][1]=d.substring(0,d.length-b),r[l+1][0]=e,r[l+1][1]=p.substring(b),l++),l++}l++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var i=e.charAt(e.length-1),r=n.charAt(0),h=i.match(t.nonAlphaNumericRegex_),s=r.match(t.nonAlphaNumericRegex_),f=h&&i.match(t.whitespaceRegex_),a=s&&r.match(t.whitespaceRegex_),l=f&&i.match(t.linebreakRegex_),g=a&&r.match(t.linebreakRegex_),o=l&&e.match(t.blanklineEndRegex_),c=g&&n.match(t.blanklineStartRegex_);return o||c?5:l||g?4:h&&!f&&a?3:f||a?2:h||s?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==i&&e[r+1][0]==i){var h=e[r-1][1],s=e[r][1],f=e[r+1][1],a=this.diff_commonSuffix(h,s);if(a){var l=s.substring(s.length-a);h=h.substring(0,h.length-a),s=l+s.substring(0,s.length-a),f=l+f}for(var g=h,o=s,c=f,u=n(h,s)+n(s,f);s.charAt(0)===f.charAt(0);){h+=s.charAt(0),s=s.substring(1)+f.charAt(0),f=f.substring(1);var p=n(h,s)+n(s,f);p>=u&&(u=p,g=h,o=s,c=f)}e[r-1][1]!=g&&(g?e[r-1][1]=g:(e.splice(r-1,1),r--),e[r][1]=o,c?e[r+1][1]=c:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(r){for(var h=!1,s=[],f=0,a=null,l=0,g=!1,o=!1,c=!1,u=!1;l<r.length;)r[l][0]==i?(r[l][1].length<this.Diff_EditCost&&(c||u)?(s[f++]=l,g=c,o=u,a=r[l][1]):(f=0,a=null),c=u=!1):(r[l][0]==e?u=!0:c=!0,a&&(g&&o&&c&&u||a.length<this.Diff_EditCost/2&&g+o+c+u==3)&&(r.splice(s[f-1],0,new t.Diff(e,a)),r[s[f-1]+1][0]=n,f--,a=null,g&&o?(c=u=!0,f=0):(l=--f>0?s[f-1]:-1,c=u=!1),h=!0)),l++;h&&this.diff_cleanupMerge(r)},t.prototype.diff_cleanupMerge=function(r){r.push(new t.Diff(i,""));for(var h,s=0,f=0,a=0,l="",g="";s<r.length;)switch(r[s][0]){case n:a++,g+=r[s][1],s++;break;case e:f++,l+=r[s][1],s++;break;case i:f+a>1?(0!==f&&0!==a&&(0!==(h=this.diff_commonPrefix(g,l))&&(s-f-a>0&&r[s-f-a-1][0]==i?r[s-f-a-1][1]+=g.substring(0,h):(r.splice(0,0,new t.Diff(i,g.substring(0,h))),s++),g=g.substring(h),l=l.substring(h)),0!==(h=this.diff_commonSuffix(g,l))&&(r[s][1]=g.substring(g.length-h)+r[s][1],g=g.substring(0,g.length-h),l=l.substring(0,l.length-h))),s-=f+a,r.splice(s,f+a),l.length&&(r.splice(s,0,new t.Diff(e,l)),s++),g.length&&(r.splice(s,0,new t.Diff(n,g)),s++),s++):0!==s&&r[s-1][0]==i?(r[s-1][1]+=r[s][1],r.splice(s,1)):s++,a=0,f=0,l="",g=""}""===r[r.length-1][1]&&r.pop();var o=!1;for(s=1;s<r.length-1;)r[s-1][0]==i&&r[s+1][0]==i&&(r[s][1].substring(r[s][1].length-r[s-1][1].length)==r[s-1][1]?(r[s][1]=r[s-1][1]+r[s][1].substring(0,r[s][1].length-r[s-1][1].length),r[s+1][1]=r[s-1][1]+r[s+1][1],r.splice(s-1,1),o=!0):r[s][1].substring(0,r[s+1][1].length)==r[s+1][1]&&(r[s-1][1]+=r[s+1][1],r[s][1]=r[s][1].substring(r[s+1][1].length)+r[s+1][1],r.splice(s+1,1),o=!0)),s++;o&&this.diff_cleanupMerge(r)},t.prototype.diff_xIndex=function(t,i){var r,h=0,s=0,f=0,a=0;for(r=0;r<t.length&&(t[r][0]!==n&&(h+=t[r][1].length),t[r][0]!==e&&(s+=t[r][1].length),!(h>i));r++)f=h,a=s;return t.length!=r&&t[r][0]===e?a:a+(i-f)},t.prototype.diff_prettyHtml=function(t){for(var r=[],h=/&/g,s=/</g,f=/>/g,a=/\n/g,l=0;l<t.length;l++){var g=t[l][0],o=t[l][1].replace(h,"&amp;").replace(s,"&lt;").replace(f,"&gt;").replace(a,"&para;<br>");switch(g){case n:r[l]='<ins style="background:#e6ffe6;">'+o+"</ins>";break;case e:r[l]='<del style="background:#ffe6e6;">'+o+"</del>";break;case i:r[l]="<span>"+o+"</span>"}}return r.join("")},t.prototype.diff_text1=function(t){for(var e=[],i=0;i<t.length;i++)t[i][0]!==n&&(e[i]=t[i][1]);return e.join("")},t.prototype.diff_text2=function(t){for(var n=[],i=0;i<t.length;i++)t[i][0]!==e&&(n[i]=t[i][1]);return n.join("")},t.prototype.diff_levenshtein=function(t){for(var r=0,h=0,s=0,f=0;f<t.length;f++){var a=t[f][0],l=t[f][1];switch(a){case n:h+=l.length;break;case e:s+=l.length;break;case i:r+=Math.max(h,s),h=0,s=0}}return r+=Math.max(h,s)},t.prototype.diff_toDelta=function(t){for(var r=[],h=0;h<t.length;h++)switch(t[h][0]){case n:r[h]="+"+encodeURI(t[h][1]);break;case e:r[h]="-"+t[h][1].length;break;case i:r[h]="="+t[h][1].length}return r.join("\t").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(r,h){for(var s=[],f=0,a=0,l=h.split(/\t/g),g=0;g<l.length;g++){var o=l[g].substring(1);switch(l[g].charAt(0)){case"+":try{s[f++]=new t.Diff(n,decodeURI(o))}catch(p){throw new Error("Illegal escape in diff_fromDelta: "+o)}break;case"-":case"=":var c=parseInt(o,10);if(isNaN(c)||c<0)throw new Error("Invalid number in diff_fromDelta: "+o);var u=r.substring(a,a+=c);"="==l[g].charAt(0)?s[f++]=new t.Diff(i,u):s[f++]=new t.Diff(e,u);break;default:if(l[g])throw new Error("Invalid diff operation in diff_fromDelta: "+l[g])}}if(a!=r.length)throw new Error("Delta length ("+a+") does not equal source text length ("+r.length+").");return s},t.prototype.match_main=function(t,e,n){if(null==t||null==e||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,t.length)),t==e?0:t.length?t.substring(n,n+e.length)==e?n:this.match_bitap_(t,e,n):-1},t.prototype.match_bitap_=function(t,e,n){if(e.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(e),r=this;function h(t,i){var h=t/e.length,s=Math.abs(n-i);return r.Match_Distance?h+s/r.Match_Distance:s?1:h}var s=this.Match_Threshold,f=t.indexOf(e,n);-1!=f&&(s=Math.min(h(0,f),s),-1!=(f=t.lastIndexOf(e,n+e.length))&&(s=Math.min(h(0,f),s)));var a,l,g=1<<e.length-1;f=-1;for(var o,c=e.length+t.length,u=0;u<e.length;u++){for(a=0,l=c;a<l;)h(u,n+l)<=s?a=l:c=l,l=Math.floor((c-a)/2+a);c=l;var p=Math.max(1,n-l+1),d=Math.min(n+l,t.length)+e.length,_=Array(d+2);_[d+1]=(1<<u)-1;for(var b=d;b>=p;b--){var v=i[t.charAt(b-1)];if(_[b]=0===u?(_[b+1]<<1|1)&v:(_[b+1]<<1|1)&v|(o[b+1]|o[b])<<1|1|o[b+1],_[b]&g){var m=h(u,b-1);if(m<=s){if(s=m,!((f=b-1)>n))break;p=Math.max(1,2*n-f)}}}if(h(u+1,n)>s)break;o=_}return f},t.prototype.match_alphabet_=function(t){for(var e={},n=0;n<t.length;n++)e[t.charAt(n)]=0;for(n=0;n<t.length;n++)e[t.charAt(n)]|=1<<t.length-n-1;return e},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var r=n.substring(e.start2,e.start2+e.length1),h=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)h+=this.Patch_Margin,r=n.substring(e.start2-h,e.start2+e.length1+h);h+=this.Patch_Margin;var s=n.substring(e.start2-h,e.start2);s&&e.diffs.unshift(new t.Diff(i,s));var f=n.substring(e.start2+e.length1,e.start2+e.length1+h);f&&e.diffs.push(new t.Diff(i,f)),e.start1-=s.length,e.start2-=s.length,e.length1+=s.length+f.length,e.length2+=s.length+f.length}},t.prototype.patch_make=function(r,h,s){var f,a;if("string"==typeof r&&"string"==typeof h&&void 0===s)f=r,(a=this.diff_main(f,h,!0)).length>2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(r&&"object"==typeof r&&void 0===h&&void 0===s)a=r,f=this.diff_text1(a);else if("string"==typeof r&&h&&"object"==typeof h&&void 0===s)f=r,a=h;else{if("string"!=typeof r||"string"!=typeof h||!s||"object"!=typeof s)throw new Error("Unknown call format to patch_make.");f=r,a=s}if(0===a.length)return[];for(var l=[],g=new t.patch_obj,o=0,c=0,u=0,p=f,d=f,_=0;_<a.length;_++){var b=a[_][0],v=a[_][1];switch(o||b===i||(g.start1=c,g.start2=u),b){case n:g.diffs[o++]=a[_],g.length2+=v.length,d=d.substring(0,u)+v+d.substring(u);break;case e:g.length1+=v.length,g.diffs[o++]=a[_],d=d.substring(0,u)+d.substring(u+v.length);break;case i:v.length<=2*this.Patch_Margin&&o&&a.length!=_+1?(g.diffs[o++]=a[_],g.length1+=v.length,g.length2+=v.length):v.length>=2*this.Patch_Margin&&o&&(this.patch_addContext_(g,p),l.push(g),g=new t.patch_obj,o=0,p=d,c=u)}b!==n&&(c+=v.length),b!==e&&(u+=v.length)}return o&&(this.patch_addContext_(g,p),l.push(g)),l},t.prototype.patch_deepCopy=function(e){for(var n=[],i=0;i<e.length;i++){var r=e[i],h=new t.patch_obj;h.diffs=[];for(var s=0;s<r.diffs.length;s++)h.diffs[s]=new t.Diff(r.diffs[s][0],r.diffs[s][1]);h.start1=r.start1,h.start2=r.start2,h.length1=r.length1,h.length2=r.length2,n[i]=h}return n},t.prototype.patch_apply=function(t,r){if(0==t.length)return[r,[]];t=this.patch_deepCopy(t);var h=this.patch_addPadding(t);r=h+r+h,this.patch_splitMax(t);for(var s=0,f=[],a=0;a<t.length;a++){var l,g,o=t[a].start2+s,c=this.diff_text1(t[a].diffs),u=-1;if(c.length>this.Match_MaxBits?-1!=(l=this.match_main(r,c.substring(0,this.Match_MaxBits),o))&&(-1==(u=this.match_main(r,c.substring(c.length-this.Match_MaxBits),o+c.length-this.Match_MaxBits))||l>=u)&&(l=-1):l=this.match_main(r,c,o),-1==l)f[a]=!1,s-=t[a].length2-t[a].length1;else if(f[a]=!0,s=l-o,c==(g=-1==u?r.substring(l,l+c.length):r.substring(l,u+this.Match_MaxBits)))r=r.substring(0,l)+this.diff_text2(t[a].diffs)+r.substring(l+c.length);else{var p=this.diff_main(c,g,!1);if(c.length>this.Match_MaxBits&&this.diff_levenshtein(p)/c.length>this.Patch_DeleteThreshold)f[a]=!1;else{this.diff_cleanupSemanticLossless(p);for(var d,_=0,b=0;b<t[a].diffs.length;b++){var v=t[a].diffs[b];v[0]!==i&&(d=this.diff_xIndex(p,_)),v[0]===n?r=r.substring(0,l+d)+v[1]+r.substring(l+d):v[0]===e&&(r=r.substring(0,l+d)+r.substring(l+this.diff_xIndex(p,_+v[1].length))),v[0]!==e&&(_+=v[1].length)}}}}return[r=r.substring(h.length,r.length-h.length),f]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r="",h=1;h<=n;h++)r+=String.fromCharCode(h);for(h=0;h<e.length;h++)e[h].start1+=n,e[h].start2+=n;var s=e[0],f=s.diffs;if(0==f.length||f[0][0]!=i)f.unshift(new t.Diff(i,r)),s.start1-=n,s.start2-=n,s.length1+=n,s.length2+=n;else if(n>f[0][1].length){var a=n-f[0][1].length;f[0][1]=r.substring(f[0][1].length)+f[0][1],s.start1-=a,s.start2-=a,s.length1+=a,s.length2+=a}if(0==(f=(s=e[e.length-1]).diffs).length||f[f.length-1][0]!=i)f.push(new t.Diff(i,r)),s.length1+=n,s.length2+=n;else if(n>f[f.length-1][1].length){a=n-f[f.length-1][1].length;f[f.length-1][1]+=r.substring(0,a),s.length1+=a,s.length2+=a}return r},t.prototype.patch_splitMax=function(r){for(var h=this.Match_MaxBits,s=0;s<r.length;s++)if(!(r[s].length1<=h)){var f=r[s];r.splice(s--,1);for(var a=f.start1,l=f.start2,g="";0!==f.diffs.length;){var o=new t.patch_obj,c=!0;for(o.start1=a-g.length,o.start2=l-g.length,""!==g&&(o.length1=o.length2=g.length,o.diffs.push(new t.Diff(i,g)));0!==f.diffs.length&&o.length1<h-this.Patch_Margin;){var u=f.diffs[0][0],p=f.diffs[0][1];u===n?(o.length2+=p.length,l+=p.length,o.diffs.push(f.diffs.shift()),c=!1):u===e&&1==o.diffs.length&&o.diffs[0][0]==i&&p.length>2*h?(o.length1+=p.length,a+=p.length,c=!1,o.diffs.push(new t.Diff(u,p)),f.diffs.shift()):(p=p.substring(0,h-o.length1-this.Patch_Margin),o.length1+=p.length,a+=p.length,u===i?(o.length2+=p.length,l+=p.length):c=!1,o.diffs.push(new t.Diff(u,p)),p==f.diffs[0][1]?f.diffs.shift():f.diffs[0][1]=f.diffs[0][1].substring(p.length))}g=(g=this.diff_text2(o.diffs)).substring(g.length-this.Patch_Margin);var d=this.diff_text1(f.diffs).substring(0,this.Patch_Margin);""!==d&&(o.length1+=d.length,o.length2+=d.length,0!==o.diffs.length&&o.diffs[o.diffs.length-1][0]===i?o.diffs[o.diffs.length-1][1]+=d:o.diffs.push(new t.Diff(i,d))),c||r.splice(++s,0,o)}}},t.prototype.patch_toText=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=t[n];return e.join("")},t.prototype.patch_fromText=function(r){var h=[];if(!r)return h;for(var s=r.split("\n"),f=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;f<s.length;){var l=s[f].match(a);if(!l)throw new Error("Invalid patch string: "+s[f]);var g=new t.patch_obj;for(h.push(g),g.start1=parseInt(l[1],10),""===l[2]?(g.start1--,g.length1=1):"0"==l[2]?g.length1=0:(g.start1--,g.length1=parseInt(l[2],10)),g.start2=parseInt(l[3],10),""===l[4]?(g.start2--,g.length2=1):"0"==l[4]?g.length2=0:(g.start2--,g.length2=parseInt(l[4],10)),f++;f<s.length;){var o=s[f].charAt(0);try{var c=decodeURI(s[f].substring(1))}catch(u){throw new Error("Illegal escape in patch_fromText: "+c)}if("-"==o)g.diffs.push(new t.Diff(e,c));else if("+"==o)g.diffs.push(new t.Diff(n,c));else if(" "==o)g.diffs.push(new t.Diff(i,c));else{if("@"==o)break;if(""!==o)throw new Error('Invalid patch mode "'+o+'" in: '+c)}f++}}return h},t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},t.patch_obj.prototype.toString=function(){for(var t,r=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],h=0;h<this.diffs.length;h++){switch(this.diffs[h][0]){case n:t="+";break;case e:t="-";break;case i:t=" "}r[h+1]=t+encodeURI(this.diffs[h][1])+"\n"}return r.join("").replace(/%20/g," ")},module.exports=t,module.exports.diff_match_patch=t,module.exports.DIFF_DELETE=e,module.exports.DIFF_INSERT=n,module.exports.DIFF_EQUAL=i;
},{}],"aPYv":[function(require,module,exports) {
"use strict";var t=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(exports,"__esModule",{value:!0});var e=require("prop-types"),r=require("react"),i=require("./split"),n=require("diff-match-patch"),o=function(o){function s(t){var e=o.call(this,t)||this;return e.state={value:e.props.value},e.onChange=e.onChange.bind(e),e.diff=e.diff.bind(e),e}return t(s,o),s.prototype.componentDidUpdate=function(){var t=this.props.value;t!==this.state.value&&this.setState({value:t})},s.prototype.onChange=function(t){this.setState({value:t}),this.props.onChange&&this.props.onChange(t)},s.prototype.diff=function(){var t=new n,e=this.state.value[0],r=this.state.value[1];if(0===e.length&&0===r.length)return[];var i=t.diff_main(e,r);t.diff_cleanupSemantic(i);var o=this.generateDiffedLines(i);return this.setCodeMarkers(o)},s.prototype.generateDiffedLines=function(t){var e=0,r=-1,i=1,n={left:[],right:[]},o={left:1,right:1};return t.forEach(function(t){var s=t[0],a=t[1],p=a.split("\n").length-1;if(0!==a.length){var h=a[0],l=a[a.length-1],u=0;switch(s){case e:o.left+=p,o.right+=p;break;case r:"\n"===h&&(o.left++,p--),0===(u=p)&&n.right.push({startLine:o.right,endLine:o.right}),"\n"===l&&(u-=1),n.left.push({startLine:o.left,endLine:o.left+u}),o.left+=p;break;case i:"\n"===h&&(o.right++,p--),0===(u=p)&&n.left.push({startLine:o.left,endLine:o.left}),"\n"===l&&(u-=1),n.right.push({startLine:o.right,endLine:o.right+u}),o.right+=p;break;default:throw new Error("Diff type was not defined.")}}}),n},s.prototype.setCodeMarkers=function(t){void 0===t&&(t={left:[],right:[]});for(var e=[],r={left:[],right:[]},i=0;i<t.left.length;i++){var n={startRow:t.left[i].startLine-1,endRow:t.left[i].endLine,type:"text",className:"codeMarker"};r.left.push(n)}for(i=0;i<t.right.length;i++){n={startRow:t.right[i].startLine-1,endRow:t.right[i].endLine,type:"text",className:"codeMarker"};r.right.push(n)}return e[0]=r.left,e[1]=r.right,e},s.prototype.render=function(){var t=this.diff();return r.createElement(i.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:t})},s.propTypes={cursorStart:e.number,editorProps:e.object,enableBasicAutocompletion:e.bool,enableLiveAutocompletion:e.bool,focus:e.bool,fontSize:e.number,height:e.string,highlightActiveLine:e.bool,maxLines:e.number,minLines:e.number,mode:e.string,name:e.string,className:e.string,onLoad:e.func,onPaste:e.func,onScroll:e.func,onChange:e.func,orientation:e.string,readOnly:e.bool,scrollMargin:e.array,setOptions:e.object,showGutter:e.bool,showPrintMargin:e.bool,splits:e.number,style:e.object,tabSize:e.number,theme:e.string,value:e.array,width:e.string,wrapEnabled:e.bool},s.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},s}(r.Component);exports.default=o;
},{"prop-types":"D9Od","react":"n8MK","./split":"ipoQ","diff-match-patch":"k8CM"}],"aNUg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./ace"),r=require("./diff");exports.diff=r.default;var t=require("./split");exports.split=t.default,exports.default=e.default;
},{"./ace":"McQl","./diff":"aPYv","./split":"ipoQ"}],"FjgI":[function(require,module,exports) {
ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e=this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":"abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|bin|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|apply|delattr|help|next|setattr|set|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern|ascii|breakpoint|bytes","variable.language":"self|cls","constant.language":"True|False|None|NotImplemented|Ellipsis|__debug__",keyword:"and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield|async|await|nonlocal"},"identifier"),t="(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))",n="(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))",r="(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|"+n+")",i="\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:'[uU]?"{3}',next:"qqstring3"},{token:"string",regex:'[uU]?"(?=.)',next:"qqstring"},{token:"string",regex:"[uU]?'{3}",next:"qstring3"},{token:"string",regex:"[uU]?'(?=.)",next:"qstring"},{token:"string",regex:'[rR]"{3}',next:"rawqqstring3"},{token:"string",regex:'[rR]"(?=.)',next:"rawqqstring"},{token:"string",regex:"[rR]'{3}",next:"rawqstring3"},{token:"string",regex:"[rR]'(?=.)",next:"rawqstring"},{token:"string",regex:'[fF]"{3}',next:"fqqstring3"},{token:"string",regex:'[fF]"(?=.)',next:"fqqstring"},{token:"string",regex:"[fF]'{3}",next:"fqstring3"},{token:"string",regex:"[fF]'(?=.)",next:"fqstring"},{token:"string",regex:'(?:[rR][fF]|[fF][rR])"{3}',next:"rfqqstring3"},{token:"string",regex:'(?:[rR][fF]|[fF][rR])"(?=.)',next:"rfqqstring"},{token:"string",regex:"(?:[rR][fF]|[fF][rR])'{3}",next:"rfqstring3"},{token:"string",regex:"(?:[rR][fF]|[fF][rR])'(?=.)",next:"rfqstring"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|@|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"punctuation",regex:",|:|;|\\->|\\+=|\\-=|\\*=|\\/=|\\/\\/=|%=|@=|&=|\\|=|^=|>>=|<<=|\\*\\*="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"},{include:"constants"}],qqstring3:[{token:"constant.language.escape",regex:i},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:i},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:i},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:i},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}],rawqqstring3:[{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],rawqstring3:[{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],rawqqstring:[{token:"string",regex:"\\\\$",next:"rawqqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],rawqstring:[{token:"string",regex:"\\\\$",next:"rawqstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}],fqqstring3:[{token:"constant.language.escape",regex:i},{token:"string",regex:'"{3}',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstring3:[{token:"constant.language.escape",regex:i},{token:"string",regex:"'{3}",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqqstring:[{token:"constant.language.escape",regex:i},{token:"string",regex:"\\\\$",next:"fqqstring"},{token:"string",regex:'"|$',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstring:[{token:"constant.language.escape",regex:i},{token:"string",regex:"'|$",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqqstring3:[{token:"string",regex:'"{3}',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqstring3:[{token:"string",regex:"'{3}",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqqstring:[{token:"string",regex:"\\\\$",next:"rfqqstring"},{token:"string",regex:'"|$',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqstring:[{token:"string",regex:"'|$",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstringParRules:[{token:"paren.lparen",regex:"[\\[\\(]"},{token:"paren.rparen",regex:"[\\]\\)]"},{token:"string",regex:"\\s+"},{token:"string",regex:"'[^']*'"},{token:"string",regex:'"[^"]*"'},{token:"function.support",regex:"(!s|!r|!a)"},{include:"constants"},{token:"paren.rparen",regex:"}",next:"pop"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"}],constants:[{token:"constant.numeric",regex:"(?:"+r+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:r},{token:"constant.numeric",regex:t+"[lL]\\b"},{token:"constant.numeric",regex:t+"\\b"},{token:["punctuation","function.support"],regex:"(\\.)([a-zA-Z_]+)\\b"},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}]},this.normalizeRules()};r.inherits(s,i),t.PythonHighlightRules=s}),ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){this.foldingStartMarker=new RegExp("([\\[{])(?:\\s*)$|("+e+")(?:\\s*)(?:#.*)?$")};r.inherits(s,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n).match(this.foldingStartMarker);if(r)return r[1]?this.openingBracketBlock(e,r[1],n,r.index):r[2]?this.indentationBlock(e,n,r.index+r[2].length):this.indentationBlock(e,n)}}.call(s.prototype)}),ace.define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./python_highlight_rules").PythonHighlightRules,o=e("./folding/pythonic").FoldMode,g=e("../range").Range,a=function(){this.HighlightRules=s,this.foldingRules=new o("\\:"),this.$behaviour=this.$defaultBehaviour};r.inherits(a,i),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&"comment"==i[i.length-1].type)return r;"start"==e&&(t.match(/^.*[\{\(\[:]\s*$/)&&(r+=n));return r};var e={pass:1,return:1,raise:1,break:1,continue:1};this.checkOutdent=function(t,n,r){if("\r\n"!==r&&"\r"!==r&&"\n"!==r)return!1;var i=this.getTokenizer().getLineTokens(n.trim(),t).tokens;if(!i)return!1;do{var s=i.pop()}while(s&&("comment"==s.type||"text"==s.type&&s.value.match(/^\s+$/)));return!!s&&("keyword"==s.type&&e[s.value])},this.autoOutdent=function(e,t,n){n+=1;var r=this.$getIndent(t.getLine(n)),i=t.getTabString();r.slice(-i.length)==i&&t.remove(new g(n,r.length-i.length,n,r.length))},this.$id="ace/mode/python",this.snippetFileId="ace/snippets/python"}.call(a.prototype),t.Mode=a}),ace.require(["ace/mode/python"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)});
},{}],"lBFH":[function(require,module,exports) {
ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(a,e,o){e.isDark=!0,e.cssClass="ace-monokai",e.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",a("../lib/dom").importCssString(e.cssText,e.cssClass)}),ace.require(["ace/theme/monokai"],function(a){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=a)});
},{}],"wOaG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.IDEEditor=exports.PositionedRunCodeButton=exports.IDEEditorLayout=void 0;var e=c(require("styled-components")),t=a(require("react")),o=c(require("react-ace")),r=c(require("prop-types")),n=require("@material-ui/core/styles"),i=c(require("../../components/RunCodeButton")),d=require("react-redux"),s=require("../../redux/features/Editor");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=r?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(o,n,i):o[n]=e[n]}return o.default=e,t&&t.set(e,o),o}function c(e){return e&&e.__esModule?e:{default:e}}function p(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}require("ace-builds/src-noconflict/mode-python"),require("ace-builds/src-noconflict/theme-monokai");const l=e.default.div`
  position: relative;
  grid-area: ide-editor;
`;exports.IDEEditorLayout=l;const f=(0,e.default)(i.default)`
  && {
    position: absolute;
    right: ${e=>e.theme.spacing(3)}px;
    bottom: ${e=>e.theme.spacing(3)}px;
    z-index: 5;
  }
`;exports.PositionedRunCodeButton=f;class h extends t.PureComponent{constructor(...e){super(...e),p(this,"state",{code:"",codeLoaded:!1}),p(this,"isCodeOnServerDifferent",()=>this.state.code!==this.props.codeOnServer),p(this,"postCode",()=>{this.props.postCode(this.state.code)}),p(this,"codeChanged",e=>{this.setState({code:e})})}componentDidMount(){this.props.getCode()}static getDerivedStateFromProps(e,t){if(!t.codeLoaded&&e.codeOnServer)return{code:e.codeOnServer,codeLoaded:!0};if(e.resetCodeTo){const o={...t,code:e.resetCodeTo};return e.codeReset(),o}return t}options(){return{showLineNumbers:!0,tabSize:4,fontFamily:this.props.theme.additionalVariables.typography.code.fontFamily}}renderEditor(){if(this.state.codeLoaded)return t.default.createElement(o.default,{mode:"python",theme:"monokai",name:"ace_editor",onChange:this.codeChanged,fontSize:"18px",showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,value:this.state.code,width:"100%",height:"100%",setOptions:this.options()})}render(){return t.default.createElement(l,null,this.renderEditor(),t.default.createElement(f,{runCodeButtonStatus:this.props.runCodeButtonStatus,isCodeOnServerDifferent:this.isCodeOnServerDifferent(),"aria-label":"Run Code",id:"post-code-button",whenClicked:this.postCode}))}}exports.IDEEditor=h,p(h,"propTypes",{codeOnServer:r.default.string,getCode:r.default.func,resetCodeTo:r.default.string,codeReset:r.default.func,theme:r.default.object,postCode:r.default.func,runCodeButtonStatus:r.default.object});const C=e=>({codeOnServer:e.editor.code.codeOnServer,resetCodeTo:e.editor.code.resetCodeTo,runCodeButtonStatus:e.editor.runCodeButton}),m={getCode:s.actions.getCodeRequest,codeReset:s.actions.codeReset,postCode:s.actions.postCodeRequest};var g=(0,d.connect)(C,m)((0,n.withTheme)(h));exports.default=g;
},{"styled-components":"tFSs","react":"n8MK","react-ace":"aNUg","prop-types":"D9Od","@material-ui/core/styles":"UUDD","../../components/RunCodeButton":"b9OB","react-redux":"jYIL","../../redux/features/Editor":"HJ0x","ace-builds/src-noconflict/mode-python":"FjgI","ace-builds/src-noconflict/theme-monokai":"lBFH"}],"ziQg":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.StyledTable=exports.BottomSnapper=exports.LogTurn=exports.LogData=exports.LogEntry=void 0;var e=p(require("styled-components")),t=u(require("react")),r=p(require("prop-types")),o=p(require("@material-ui/core/Table")),a=p(require("@material-ui/core/TableBody")),n=p(require("@material-ui/core/TableCell")),l=p(require("@material-ui/core/TableRow"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=o?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(r,a,n):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const f=(0,e.default)(l.default)`
  overflow-anchor: none;
  font-family: ${e=>e.theme.additionalVariables.typography.code.fontFamily};
  font-size: ${e=>e.theme.additionalVariables.typography.code.fontSize};
`;exports.LogEntry=f;const c=(0,e.default)(n.default)`
  padding-inline-start: ${e=>e.theme.spacing(3)}px;
`;exports.LogData=c;const d=(0,e.default)(n.default)`
  color: ${e=>e.theme.palette.grey[500]};
  white-space: nowrap;
  vertical-align: text-top;
`;exports.LogTurn=d;const h=e.default.tr`
  overflow-anchor: auto;
  height: 1px;
`;exports.BottomSnapper=h;const m=(0,e.default)(o.default)`
  white-space: pre-line;
`;exports.StyledTable=m;class y extends t.Component{isOverflown({clientWidth:e,clientHeight:t,scrollWidth:r,scrollHeight:o}){return o>t||r>e}componentDidUpdate(){this.bottomSnapperRef&&this.props.shouldActivateSnapToBottom&&this.bottomSnapperRef.scrollIntoView({behavior:"smooth"})}generateLogEntries(){const e=Array.from(this.props.logs,([e,r])=>t.default.createElement(f,{key:e},t.default.createElement(c,null,r),t.default.createElement(d,{align:"right"},"Turn: ",e)));return e.push(t.default.createElement(h,{key:-1,ref:e=>{this.bottomSnapperRef=e}})),e}render(){return t.default.createElement(m,{size:"small",ref:e=>{this.tableRef=e}},t.default.createElement(a.default,null,this.generateLogEntries()))}}exports.default=y,s(y,"propTypes",{shouldActivateSnapToBottom:r.default.bool,logs:r.default.instanceOf(Map)});
},{"styled-components":"tFSs","react":"n8MK","prop-types":"D9Od","@material-ui/core/Table":"Amxx","@material-ui/core/TableBody":"cmi3","@material-ui/core/TableCell":"lprt","@material-ui/core/TableRow":"kIQr"}],"t7py":[function(require,module,exports) {
var e=require("@babel/runtime/helpers/typeof").default;function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(r){if(r&&r.__esModule)return r;if(null===r||"object"!==e(r)&&"function"!=typeof r)return{default:r};var o=t();if(o&&o.has(r))return o.get(r);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in r)if(Object.prototype.hasOwnProperty.call(r,f)){var l=u?Object.getOwnPropertyDescriptor(r,f):null;l&&(l.get||l.set)?Object.defineProperty(n,f,l):n[f]=r[f]}return n.default=r,o&&o.set(r,n),n}module.exports=r,module.exports.default=module.exports,module.exports.__esModule=!0;
},{"@babel/runtime/helpers/typeof":"b9XL"}],"SpGf":[function(require,module,exports) {
function e(e){return e&&e.__esModule?e:{default:e}}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"dLyZ":[function(require,module,exports) {
function e(){return module.exports=e=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},module.exports.default=module.exports,module.exports.__esModule=!0,e.apply(this,arguments)}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"t2zx":[function(require,module,exports) {
function e(e,o){if(null==e)return{};var r,t,u={},l=Object.keys(e);for(t=0;t<l.length;t++)r=l[t],o.indexOf(r)>=0||(u[r]=e[r]);return u}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"U8F3":[function(require,module,exports) {
var e=require("./objectWithoutPropertiesLoose.js");function r(r,o){if(null==r)return{};var t,l,u=e(r,o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(r);for(l=0;l<p.length;l++)t=p[l],o.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(r,t)&&(u[t]=r[t])}return u}module.exports=r,module.exports.default=module.exports,module.exports.__esModule=!0;
},{"./objectWithoutPropertiesLoose.js":"t2zx"}],"IxO8":[function(require,module,exports) {
function e(e,o,r){return o in e?Object.defineProperty(e,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[o]=r,e}module.exports=e,module.exports.default=module.exports,module.exports.__esModule=!0;
},{}],"txUJ":[function(require,module,exports) {
"use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u,exports.keys=void 0;var t=e(require("@babel/runtime/helpers/extends")),n=e(require("@babel/runtime/helpers/objectWithoutProperties")),r=["xs","sm","md","lg","xl"];function u(e){var u=e.values,i=void 0===u?{xs:0,sm:600,md:960,lg:1280,xl:1920}:u,o=e.unit,a=void 0===o?"px":o,c=e.step,s=void 0===c?5:c,d=(0,n.default)(e,["values","unit","step"]);function l(e){var t="number"==typeof i[e]?i[e]:e;return"@media (min-width:".concat(t).concat(a,")")}function m(e,t){var n=r.indexOf(t);return n===r.length-1?l(e):"@media (min-width:".concat("number"==typeof i[e]?i[e]:e).concat(a,") and ")+"(max-width:".concat((-1!==n&&"number"==typeof i[r[n+1]]?i[r[n+1]]:t)-s/100).concat(a,")")}return(0,t.default)({keys:r,values:i,up:l,down:function(e){var t=r.indexOf(e)+1,n=i[r[t]];return t===r.length?l("xs"):"@media (max-width:".concat(("number"==typeof n&&t>0?n:e)-s/100).concat(a,")")},between:m,only:function(e){return m(e,e)},width:function(e){return i[e]}},d)}exports.keys=r;
},{"@babel/runtime/helpers/interopRequireDefault":"SpGf","@babel/runtime/helpers/extends":"dLyZ","@babel/runtime/helpers/objectWithoutProperties":"U8F3"}],"Q0vi":[function(require,module,exports) {
"use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var t=e(require("@babel/runtime/helpers/defineProperty")),r=e(require("@babel/runtime/helpers/extends"));function i(e,i,u){var a;return(0,r.default)({gutters:function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.default)({paddingLeft:i(2),paddingRight:i(2)},u,(0,t.default)({},e.up("sm"),(0,r.default)({paddingLeft:i(3),paddingRight:i(3)},u[e.up("sm")])))},toolbar:(a={minHeight:56},(0,t.default)(a,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),(0,t.default)(a,e.up("sm"),{minHeight:64}),a)},u)}
},{"@babel/runtime/helpers/interopRequireDefault":"SpGf","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/helpers/extends":"dLyZ"}],"PLaZ":[function(require,module,exports) {
"use strict";var r=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=h,exports.dark=exports.light=void 0;var e=r(require("@babel/runtime/helpers/extends")),a=r(require("@babel/runtime/helpers/objectWithoutProperties")),t=require("@material-ui/utils"),i=r(require("../colors/common")),o=r(require("../colors/grey")),d=r(require("../colors/indigo")),l=r(require("../colors/pink")),n=r(require("../colors/red")),u=r(require("../colors/orange")),s=r(require("../colors/blue")),c=r(require("../colors/green")),g=require("./colorManipulator"),f={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:i.default.white,default:o.default[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}};exports.light=f;var p={text:{primary:i.default.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:o.default[800],default:"#303030"},action:{active:i.default.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function b(r,e,a,t){var i=t.light||t,o=t.dark||1.5*t;r[e]||(r.hasOwnProperty(a)?r[e]=r[a]:"light"===e?r.light=(0,g.lighten)(r.main,i):"dark"===e&&(r.dark=(0,g.darken)(r.main,o)))}function h(r){var h=r.primary,m=void 0===h?{light:d.default[300],main:d.default[500],dark:d.default[700]}:h,v=r.secondary,y=void 0===v?{light:l.default.A200,main:l.default.A400,dark:l.default.A700}:v,k=r.error,O=void 0===k?{light:n.default[300],main:n.default[500],dark:n.default[700]}:k,x=r.warning,q=void 0===x?{light:u.default[300],main:u.default[500],dark:u.default[700]}:x,w=r.info,A=void 0===w?{light:s.default[300],main:s.default[500],dark:s.default[700]}:w,M=r.success,T=void 0===M?{light:c.default[300],main:c.default[500],dark:c.default[700]}:M,E=r.type,C=void 0===E?"light":E,P=r.contrastThreshold,_=void 0===P?3:P,j=r.tonalOffset,B=void 0===j?.2:j,R=(0,a.default)(r,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function D(r){var e=(0,g.getContrastRatio)(r,p.text.primary)>=_?p.text.primary:f.text.primary;return e}var J=function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(r=(0,e.default)({},r)).main&&r[a]&&(r.main=r[a]),!r.main)throw new Error((0,t.formatMuiErrorMessage)(4,a));if("string"!=typeof r.main)throw new Error(_formatMuiErrorMessage(5,JSON.stringify(r.main)));return b(r,"light",i,B),b(r,"dark",o,B),r.contrastText||(r.contrastText=D(r.main)),r},N={dark:p,light:f};return(0,t.deepmerge)((0,e.default)({common:i.default,type:C,primary:J(m),secondary:J(y,"A400","A200","A700"),error:J(O),warning:J(q),info:J(A),success:J(T),grey:o.default,contrastThreshold:_,getContrastText:D,augmentColor:J,tonalOffset:B},N[C]),R)}exports.dark=p;
},{"@babel/runtime/helpers/interopRequireDefault":"SpGf","@babel/runtime/helpers/extends":"dLyZ","@babel/runtime/helpers/objectWithoutProperties":"U8F3","@material-ui/utils":"gEhD","../colors/common":"DyYm","../colors/grey":"jh9N","../colors/indigo":"S7CI","../colors/pink":"orzA","../colors/red":"kzD0","../colors/orange":"VeQ7","../colors/blue":"qweW","../colors/green":"fqHu","./colorManipulator":"aguB"}],"CjVL":[function(require,module,exports) {
"use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var t=e(require("@babel/runtime/helpers/extends")),i=e(require("@babel/runtime/helpers/objectWithoutProperties")),o=require("@material-ui/utils");function n(e){return Math.round(1e5*e)/1e5}var r={textTransform:"uppercase"},l='"Roboto", "Helvetica", "Arial", sans-serif';function u(e,u){var a="function"==typeof u?u(e):u,f=a.fontFamily,h=void 0===f?l:f,d=a.fontSize,g=void 0===d?14:d,m=a.fontWeightLight,s=void 0===m?300:m,c=a.fontWeightRegular,p=void 0===c?400:c,v=a.fontWeightMedium,b=void 0===v?500:v,W=a.fontWeightBold,y=void 0===W?700:W,R=a.htmlFontSize,S=void 0===R?16:R,x=a.allVariants,z=a.pxToRem,F=(0,i.default)(a,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var q=g/14,M=z||function(e){return"".concat(e/S*q,"rem")},T=function(e,i,o,r,u){return(0,t.default)({fontFamily:h,fontWeight:e,fontSize:M(i),lineHeight:o},h===l?{letterSpacing:"".concat(n(r/i),"em")}:{},u,x)},B={h1:T(s,96,1.167,-1.5),h2:T(s,60,1.2,-.5),h3:T(p,48,1.167,0),h4:T(p,34,1.235,.25),h5:T(p,24,1.334,0),h6:T(b,20,1.6,.15),subtitle1:T(p,16,1.75,.15),subtitle2:T(b,14,1.57,.1),body1:T(p,16,1.5,.15),body2:T(p,14,1.43,.15),button:T(b,14,1.75,.4,r),caption:T(p,12,1.66,.4),overline:T(p,12,2.66,1,r)};return(0,o.deepmerge)((0,t.default)({htmlFontSize:S,pxToRem:M,round:n,fontFamily:h,fontSize:g,fontWeightLight:s,fontWeightRegular:p,fontWeightMedium:b,fontWeightBold:y},B),F,{clone:!1})}
},{"@babel/runtime/helpers/interopRequireDefault":"SpGf","@babel/runtime/helpers/extends":"dLyZ","@babel/runtime/helpers/objectWithoutProperties":"U8F3","@material-ui/utils":"gEhD"}],"bCwc":[function(require,module,exports) {
"use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.duration=exports.easing=void 0;var r=e(require("@babel/runtime/helpers/objectWithoutProperties")),t={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"};exports.easing=t;var n={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(e){return"".concat(Math.round(e),"ms")}exports.duration=n;var i={easing:t,duration:n,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.duration,u=void 0===o?n.standard:o,s=i.easing,c=void 0===s?t.easeInOut:s,d=i.delay,l=void 0===d?0:d;(0,r.default)(i,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map(function(e){return"".concat(e," ").concat("string"==typeof u?u:a(u)," ").concat(c," ").concat("string"==typeof l?l:a(l))}).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var r=e/36;return Math.round(10*(4+15*Math.pow(r,.25)+r/5))}};exports.default=i;
},{"@babel/runtime/helpers/interopRequireDefault":"SpGf","@babel/runtime/helpers/objectWithoutProperties":"U8F3"}],"VAPn":[function(require,module,exports) {
"use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var r=e(require("@babel/runtime/helpers/defineProperty")),t=e(require("@babel/runtime/helpers/objectWithoutProperties")),i=require("@material-ui/utils"),a=e(require("./createBreakpoints")),u=e(require("./createMixins")),p=e(require("./createPalette")),n=e(require("./createTypography")),o=e(require("./shadows")),s=e(require("./shape")),d=e(require("./createSpacing")),l=e(require("./transitions")),f=e(require("./zIndex"));function c(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.breakpoints,c=void 0===r?{}:r,h=e.mixins,q=void 0===h?{}:h,g=e.palette,v=void 0===g?{}:g,b=e.spacing,y=e.typography,m=void 0===y?{}:y,x=(0,t.default)(e,["breakpoints","mixins","palette","spacing","typography"]),k=(0,p.default)(v),P=(0,a.default)(c),w=(0,d.default)(b),j=(0,i.deepmerge)({breakpoints:P,direction:"ltr",mixins:(0,u.default)(P,w,q),overrides:{},palette:k,props:{},shadows:o.default,typography:(0,n.default)(k,m),spacing:w,shape:s.default,transitions:l.default,zIndex:f.default},x),z=arguments.length,I=new Array(z>1?z-1:0),M=1;M<z;M++)I[M-1]=arguments[M];return j=I.reduce(function(e,r){return(0,i.deepmerge)(e,r)},j)}var h=c;exports.default=h;
},{"@babel/runtime/helpers/interopRequireDefault":"SpGf","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/helpers/objectWithoutProperties":"U8F3","@material-ui/utils":"gEhD","./createBreakpoints":"txUJ","./createMixins":"Q0vi","./createPalette":"PLaZ","./createTypography":"CjVL","./shadows":"GVmz","./shape":"PrAq","./createSpacing":"njM4","./transitions":"bCwc","./zIndex":"ROtz"}],"DSA6":[function(require,module,exports) {
"use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var r=e(require("./createMuiTheme")),t=(0,r.default)(),u=t;exports.default=u;
},{"@babel/runtime/helpers/interopRequireDefault":"SpGf","./createMuiTheme":"VAPn"}],"FV5o":[function(require,module,exports) {
"use strict";var e=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var r=e(require("@babel/runtime/helpers/extends")),t=require("@material-ui/styles"),u=e(require("./defaultTheme"));function l(e,l){return(0,t.withStyles)(e,(0,r.default)({defaultTheme:u.default},l))}var a=l;exports.default=a;
},{"@babel/runtime/helpers/interopRequireDefault":"SpGf","@babel/runtime/helpers/extends":"dLyZ","@material-ui/styles":"thJn","./defaultTheme":"DSA6"}],"xQcF":[function(require,module,exports) {
"use strict";var e=require("@babel/runtime/helpers/interopRequireWildcard"),r=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var t=r(require("@babel/runtime/helpers/extends")),i=r(require("@babel/runtime/helpers/objectWithoutProperties")),a=r(require("@babel/runtime/helpers/defineProperty")),s=e(require("react")),l=r(require("prop-types")),u=r(require("clsx")),n=r(require("../styles/withStyles")),o=function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:(0,a.default)({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}};exports.styles=o;var p=s.forwardRef(function(e,r){var a=e.classes,l=e.className,n=e.component,o=void 0===n?"div":n,p=e.disableGutters,d=void 0!==p&&p,c=e.variant,f=void 0===c?"regular":c,b=(0,i.default)(e,["classes","className","component","disableGutters","variant"]);return s.createElement(o,(0,t.default)({className:(0,u.default)(a.root,a[f],l,!d&&a.gutters),ref:r},b))}),d=(0,n.default)(o,{name:"MuiToolbar"})(p);exports.default=d;
},{"@babel/runtime/helpers/interopRequireWildcard":"t7py","@babel/runtime/helpers/interopRequireDefault":"SpGf","@babel/runtime/helpers/extends":"dLyZ","@babel/runtime/helpers/objectWithoutProperties":"U8F3","@babel/runtime/helpers/defineProperty":"IxO8","react":"n8MK","prop-types":"D9Od","clsx":"WLGK","../styles/withStyles":"FV5o"}],"SJec":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("@material-ui/core/SvgIcon")),t=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}const L=r=>t.default.createElement(e.default,r,t.default.createElement("path",{d:"M20,19 L20,7 L4,7 L4,19 L20,19 Z M20,3 C21.1045695,3 22,3.8954305 22,5 L22,19 C22,20.1045695 21.1045695,21 20,21 L4,21 C2.8954305,21 2,20.1045695 2,19 L2,5 C2,3.89 2.9,3 4,3 L20,3 Z M13,17 L13,15 L18,15 L18,17 L13,17 Z M9.58,13 L5.57,9 L8.4,9 L11.7,12.3 C12.09,12.69 12.09,13.33 11.7,13.72 L8.42,17 L5.59,17 L9.58,13 Z",id:"path-1"}));var a=L;exports.default=a;
},{"@material-ui/core/SvgIcon":"R8TJ","react":"n8MK"}],"INNe":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("@material-ui/core/SvgIcon")),t=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}const a=r=>t.default.createElement(e.default,r,t.default.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},t.default.createElement("g",{id:"clear_icon",transform:"translate(5, 3.000000)"},t.default.createElement("path",{d:"M14,1 L10.5,1 L9.5,0 L4.5,0 L3.5,1 L0,1 L0,3 L14,3 L14,1 Z M1,16 C1,17.1045695 1.8954305,18 3,18 L11,18 C12.1045695,18 13,17.1045695 13,16 L13,4 L1,4 L1,16 Z",id:"path-1"}))));var l=a;exports.default=l;
},{"@material-ui/core/SvgIcon":"R8TJ","react":"n8MK"}],"LMiS":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.StyledConsoleIcon=exports.StyledConsoleTitle=exports.StyledConsoleBar=void 0;var e=c(require("styled-components")),t=c(require("@material-ui/core/Toolbar/Toolbar")),r=require("@material-ui/core"),o=c(require("../icons/Console")),l=c(require("../icons/Clear")),n=i(require("react")),a=c(require("prop-types"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=o?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=e[l]}return r.default=e,t&&t.set(e,r),r}function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s=(0,e.default)(t.default)`
  background-color: ${e=>e.theme.palette.grey.A700};
  display: flex;
  justify-content: space-between;
`;exports.StyledConsoleBar=s;const f=e.default.div`
  display: inline-flex;
`;exports.StyledConsoleTitle=f;const p=(0,e.default)(o.default)`
  padding-right: ${e=>e.theme.spacing()}px;
`;exports.StyledConsoleIcon=p;class y extends n.Component{render(){return n.default.createElement(s,{variant:"dense"},n.default.createElement(f,null,n.default.createElement(p,{color:"disabled"}),n.default.createElement(r.Typography,{variant:"body1",color:"textSecondary"},"Console Log")),n.default.createElement(r.Button,{variant:"outlined",onClick:this.props.handleResetCodeClicked},"Reset code"),n.default.createElement(r.IconButton,{size:"small",onClick:this.props.clearConsoleClicked},n.default.createElement(l.default,null)))}}exports.default=y,d(y,"propTypes",{clearConsoleClicked:a.default.func,handleResetCodeClicked:a.default.func});
},{"styled-components":"tFSs","@material-ui/core/Toolbar/Toolbar":"xQcF","@material-ui/core":"dT3j","../icons/Console":"SJec","../icons/Clear":"INNe","react":"n8MK","prop-types":"D9Od"}],"iONP":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.IDEConsole=exports.StyledConsole=exports.IDEConsoleSection=void 0;var e=d(require("styled-components")),t=c(require("react")),o=d(require("prop-types")),r=d(require("../../components/LogEntries")),s=d(require("../../components/ConsoleBar")),a=require("react-redux"),l=require("../../redux/features/ConsoleLog"),n=require("../../redux/features/Editor");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=r?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(o,s,a):o[s]=e[s]}return o.default=e,t&&t.set(e,o),o}function d(e){return e&&e.__esModule?e:{default:e}}function u(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p=e.default.section`
  grid-area: ide-console;
  display: flex;
  flex-direction: column;
`;exports.IDEConsoleSection=p;const f=e.default.div`
  color: ${e=>e.theme.palette.text.primary};
  background-color: ${e=>e.theme.palette.background.default};
  font-family: ${e=>e.theme.additionalVariables.typography.code.fontFamily};
  overflow-y: auto;
  height: 100%;

  ::-webkit-scrollbar {
    background-color: ${e=>e.theme.palette.divider};
  }

  ::-webkit-scrollbar-track {
    background: ${e=>e.theme.palette.divider};
  }

  ::-webkit-scrollbar-thumb {
    background: ${e=>e.theme.palette.grey.A200};
    border-radius: 100px;
    border: ${e=>e.theme.spacing(.25)}px solid transparent;
    background-clip: content-box;
  }
`;exports.StyledConsole=f;class h extends t.Component{constructor(...e){super(...e),u(this,"state",{activatedScrollToBottom:!1,shouldActivateSnapToBottom:!1}),u(this,"clearConsole",()=>{this.props.clearConsoleLogs(),this.setState({...this.state,activatedScrollToBottom:!1})}),u(this,"resetCode",()=>{confirm("Are you sure you want to reset to the starter code?")&&this.props.resetCode()})}componentDidUpdate(){this.snapToBottomIfNeeded()}isOverflown({clientHeight:e,scrollHeight:t}){return t>e}isOverflownForTheFirstTime(){return!this.state.activatedScrollToBottom&&this.consoleRef&&this.isOverflown(this.consoleRef)}snapToBottomIfNeeded(){this.isOverflownForTheFirstTime()?this.setState({...this.state,shouldActivateSnapToBottom:!0,activatedScrollToBottom:!0}):this.state.activatedScrollToBottom&&this.state.shouldActivateSnapToBottom&&this.setState({...this.state,shouldActivateSnapToBottom:!1})}render(){return t.default.createElement(p,null,t.default.createElement(s.default,{clearConsoleClicked:this.clearConsole,handleResetCodeClicked:this.resetCode}),t.default.createElement(f,{ref:e=>{this.consoleRef=e}},t.default.createElement(r.default,{shouldActivateSnapToBottom:this.state.shouldActivateSnapToBottom,logs:this.props.logs})))}}exports.IDEConsole=h,u(h,"propTypes",{logs:o.default.instanceOf(Map),resetCode:o.default.func,clearConsoleLogs:o.default.func});const m=e=>({logs:e.consoleLog.logs}),g={clearConsoleLogs:l.actions.clearConsoleLogs,resetCode:n.actions.resetCode};var v=(0,a.connect)(m,g)(h);exports.default=v;
},{"styled-components":"tFSs","react":"n8MK","prop-types":"D9Od","../../components/LogEntries":"ziQg","../../components/ConsoleBar":"LMiS","react-redux":"jYIL","../../redux/features/ConsoleLog":"GD6G","../../redux/features/Editor":"HJ0x"}],"O9TG":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("react")),t=a(require("../../containers/IDEEditor")),r=a(require("../../containers/IDEConsole")),n=require("../../theme"),u=require("@material-ui/core/styles"),o=require("styled-components");function a(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var o=n?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(r,u,o):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}class f extends e.Component{render(){return e.default.createElement(o.ThemeProvider,{theme:n.darkTheme},e.default.createElement(u.MuiThemeProvider,{theme:n.darkTheme},e.default.createElement(t.default,null),e.default.createElement(r.default,null)))}}exports.default=f;
},{"react":"n8MK","../../containers/IDEEditor":"wOaG","../../containers/IDEConsole":"iONP","../../theme":"QFJf","@material-ui/core/styles":"UUDD","styled-components":"tFSs"}],"oE3B":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("@material-ui/core/SvgIcon")),t=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}const l=r=>t.default.createElement(e.default,r,t.default.createElement("path",{d:"M21.535 19.451c1.09 2.27.198 3.2-1.98 2.064l-3.593-1.872c-2.179-1.135-5.745-1.135-7.923 0l-3.593 1.872c-2.179 1.136-3.07.207-1.981-2.064l7.554-15.748c1.09-2.27 2.872-2.27 3.962 0l7.554 15.748z"}));var a=l;exports.default=a;
},{"@material-ui/core/SvgIcon":"R8TJ","react":"n8MK"}],"ZroK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.MarginedLocationIcon=void 0;var e=u(require("styled-components")),r=u(require("prop-types")),t=o(require("react")),n=require("@material-ui/core"),a=u(require("../icons/FindMe"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(t,a,o):t[a]=e[a]}return t.default=e,r&&r.set(e,t),t}function u(e){return e&&e.__esModule?e:{default:e}}function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const s=(0,e.default)(a.default)`
    margin-right: ${e=>e.theme.spacing()}px;
`;exports.MarginedLocationIcon=s;class c extends t.Component{render(){return t.default.createElement(n.Fab,{color:"primary",className:this.props.className,disabled:this.props.isCameraCenteredOnUserAvatar,"aria-label":"Find Me",id:"find-me-button",variant:"extended",onClick:this.props.whenClicked},t.default.createElement(s,{color:"inherit"}),"Find Me")}}exports.default=c,l(c,"propTypes",{whenClicked:r.default.func,isCameraCenteredOnUserAvatar:r.default.bool,className:r.default.string});
},{"styled-components":"tFSs","prop-types":"D9Od","react":"n8MK","@material-ui/core":"dT3j","../icons/FindMe":"oE3B"}],"aUc4":[function(require,module,exports) {
"use strict";function e(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DiffProcessor=void 0;class r{constructor(r){e(this,"handler",void 0),this.handler=r}handleDifferences(e){for(const r of e.deleteList)this.handler.remove(r);for(const r of e.editList)this.handler.edit(r);for(const r of e.addList)this.handler.add(r)}}exports.DiffProcessor=r;
},{}],"SZeO":[function(require,module,exports) {
var define;
var global = arguments[3];
var e,t=arguments[3];!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof e&&e.amd?e("babylonjs",[],i):"object"==typeof exports?exports.babylonjs=i():t.BABYLON=i()}("undefined"!=typeof self?self:void 0!==t?t:this,function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=169)}([function(e,t,i){"use strict";i.d(t,"d",function(){return c}),i.d(t,"e",function(){return l}),i.d(t,"f",function(){return u}),i.d(t,"b",function(){return h}),i.d(t,"a",function(){return d}),i.d(t,"c",function(){return p});var n=i(14),r=i(28),o=i(44),a=i(11),s=i(74),c=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.x=e,this.y=t}return e.prototype.toString=function(){return"{X: "+this.x+" Y: "+this.y+"}"},e.prototype.getClassName=function(){return"Vector2"},e.prototype.getHashCode=function(){var e=0|this.x;return 397*e^(0|this.y)},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.copyFromFloats=function(e,t){return this.x=e,this.y=t,this},e.prototype.set=function(e,t){return this.copyFromFloats(e,t)},e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,this},e.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.addVector3=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y)},e.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,this},e.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this},e.prototype.multiply=function(t){return new e(this.x*t.x,this.y*t.y)},e.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,this},e.prototype.multiplyByFloats=function(t,i){return new e(this.x*t,this.y*i)},e.prototype.divide=function(t){return new e(this.x/t.x,this.y/t.y)},e.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,this},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.negate=function(){return new e(-this.x,-this.y)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this.x,-1*this.y)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this},e.prototype.scale=function(t){var i=new e(0,0);return this.scaleToRef(t,i),i},e.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,this},e.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=r.a),e&&n.a.WithinEpsilon(this.x,e.x,t)&&n.a.WithinEpsilon(this.y,e.y,t)},e.prototype.floor=function(){return new e(Math.floor(this.x),Math.floor(this.y))},e.prototype.fract=function(){return new e(this.x-Math.floor(this.x),this.y-Math.floor(this.y))},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.length();return 0===e||(this.x/=e,this.y/=e),this},e.prototype.clone=function(){return new e(this.x,this.y)},e.Zero=function(){return new e(0,0)},e.One=function(){return new e(1,1)},e.FromArray=function(t,i){return void 0===i&&(i=0),new e(t[i],t[i+1])},e.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1]},e.CatmullRom=function(t,i,n,r,o){var a=o*o,s=o*a;return new e(.5*(2*i.x+(-t.x+n.x)*o+(2*t.x-5*i.x+4*n.x-r.x)*a+(-t.x+3*i.x-3*n.x+r.x)*s),.5*(2*i.y+(-t.y+n.y)*o+(2*t.y-5*i.y+4*n.y-r.y)*a+(-t.y+3*i.y-3*n.y+r.y)*s))},e.Clamp=function(t,i,n){var r=t.x;r=(r=r>n.x?n.x:r)<i.x?i.x:r;var o=t.y;return new e(r,o=(o=o>n.y?n.y:o)<i.y?i.y:o)},e.Hermite=function(t,i,n,r,o){var a=o*o,s=o*a,c=2*s-3*a+1,l=-2*s+3*a,u=s-2*a+o,h=s-a;return new e(t.x*c+n.x*l+i.x*u+r.x*h,t.y*c+n.y*l+i.y*u+r.y*h)},e.Lerp=function(t,i,n){return new e(t.x+(i.x-t.x)*n,t.y+(i.y-t.y)*n)},e.Dot=function(e,t){return e.x*t.x+e.y*t.y},e.Normalize=function(e){var t=e.clone();return t.normalize(),t},e.Minimize=function(t,i){return new e(t.x<i.x?t.x:i.x,t.y<i.y?t.y:i.y)},e.Maximize=function(t,i){return new e(t.x>i.x?t.x:i.x,t.y>i.y?t.y:i.y)},e.Transform=function(t,i){var n=e.Zero();return e.TransformToRef(t,i,n),n},e.TransformToRef=function(e,t,i){var n=t.m,r=e.x*n[0]+e.y*n[4]+n[12],o=e.x*n[1]+e.y*n[5]+n[13];i.x=r,i.y=o},e.PointInTriangle=function(e,t,i,n){var r=.5*(-i.y*n.x+t.y*(-i.x+n.x)+t.x*(i.y-n.y)+i.x*n.y),o=r<0?-1:1,a=(t.y*n.x-t.x*n.y+(n.y-t.y)*e.x+(t.x-n.x)*e.y)*o,s=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*o;return a>0&&s>0&&a+s<2*r*o},e.Distance=function(t,i){return Math.sqrt(e.DistanceSquared(t,i))},e.DistanceSquared=function(e,t){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},e.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},e.DistanceOfPointFromSegment=function(t,i,n){var r=e.DistanceSquared(i,n);if(0===r)return e.Distance(t,i);var o=n.subtract(i),a=Math.max(0,Math.min(1,e.Dot(t.subtract(i),o)/r)),s=i.add(o.multiplyByFloats(a,a));return e.Distance(t,s)},e}(),l=function(){function e(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),this._isDirty=!0,this._x=e,this._y=t,this._z=i}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+"}"},e.prototype.getClassName=function(){return"Vector3"},e.prototype.getHashCode=function(){var e=0|this._x;return 397*(e=397*e^(0|this._y))^(0|this._z)},e.prototype.asArray=function(){var e=[];return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.toQuaternion=function(){return h.RotationYawPitchRoll(this._y,this._x,this._z)},e.prototype.addInPlace=function(e){return this.addInPlaceFromFloats(e._x,e._y,e._z)},e.prototype.addInPlaceFromFloats=function(e,t,i){return this.x+=e,this.y+=t,this.z+=i,this},e.prototype.add=function(t){return new e(this._x+t._x,this._y+t._y,this._z+t._z)},e.prototype.addToRef=function(e,t){return t.copyFromFloats(this._x+e._x,this._y+e._y,this._z+e._z)},e.prototype.subtractInPlace=function(e){return this.x-=e._x,this.y-=e._y,this.z-=e._z,this},e.prototype.subtract=function(t){return new e(this._x-t._x,this._y-t._y,this._z-t._z)},e.prototype.subtractToRef=function(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)},e.prototype.subtractFromFloats=function(t,i,n){return new e(this._x-t,this._y-i,this._z-n)},e.prototype.subtractFromFloatsToRef=function(e,t,i,n){return n.copyFromFloats(this._x-e,this._y-t,this._z-i)},e.prototype.negate=function(){return new e(-this._x,-this._y,-this._z)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this._x,-1*this._y,-1*this._z)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this},e.prototype.scale=function(t){return new e(this._x*t,this._y*t,this._z*t)},e.prototype.scaleToRef=function(e,t){return t.copyFromFloats(this._x*e,this._y*e,this._z*e)},e.prototype.scaleAndAddToRef=function(e,t){return t.addInPlaceFromFloats(this._x*e,this._y*e,this._z*e)},e.prototype.projectOnPlane=function(t,i){var n=e.Zero();return this.projectOnPlaneToRef(t,i,n),n},e.prototype.projectOnPlaneToRef=function(t,i,n){var r=t.normal,o=t.d,a=f.Vector3[0];this.subtractToRef(i,a),a.normalize();var s=e.Dot(a,r),c=-(e.Dot(i,r)+o)/s,l=a.scaleInPlace(c);i.addToRef(l,n)},e.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=r.a),e&&n.a.WithinEpsilon(this._x,e._x,t)&&n.a.WithinEpsilon(this._y,e._y,t)&&n.a.WithinEpsilon(this._z,e._z,t)},e.prototype.equalsToFloats=function(e,t,i){return this._x===e&&this._y===t&&this._z===i},e.prototype.multiplyInPlace=function(e){return this.x*=e._x,this.y*=e._y,this.z*=e._z,this},e.prototype.multiply=function(e){return this.multiplyByFloats(e._x,e._y,e._z)},e.prototype.multiplyToRef=function(e,t){return t.copyFromFloats(this._x*e._x,this._y*e._y,this._z*e._z)},e.prototype.multiplyByFloats=function(t,i,n){return new e(this._x*t,this._y*i,this._z*n)},e.prototype.divide=function(t){return new e(this._x/t._x,this._y/t._y,this._z/t._z)},e.prototype.divideToRef=function(e,t){return t.copyFromFloats(this._x/e._x,this._y/e._y,this._z/e._z)},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.minimizeInPlace=function(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)},e.prototype.maximizeInPlace=function(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)},e.prototype.minimizeInPlaceFromFloats=function(e,t,i){return e<this._x&&(this.x=e),t<this._y&&(this.y=t),i<this._z&&(this.z=i),this},e.prototype.maximizeInPlaceFromFloats=function(e,t,i){return e>this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this},e.prototype.isNonUniformWithinEpsilon=function(e){var t=Math.abs(this._x),i=Math.abs(this._y);if(!n.a.WithinEpsilon(t,i,e))return!0;var r=Math.abs(this._z);return!n.a.WithinEpsilon(t,r,e)||!n.a.WithinEpsilon(i,r,e)},Object.defineProperty(e.prototype,"isNonUniform",{get:function(){var e=Math.abs(this._x);return e!==Math.abs(this._y)||e!==Math.abs(this._z)},enumerable:!1,configurable:!0}),e.prototype.floor=function(){return new e(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))},e.prototype.fract=function(){return new e(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))},e.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)},e.prototype.lengthSquared=function(){return this._x*this._x+this._y*this._y+this._z*this._z},e.prototype.normalize=function(){return this.normalizeFromLength(this.length())},e.prototype.reorderInPlace=function(e){var t=this;return"xyz"===(e=e.toLowerCase())||(f.Vector3[0].copyFrom(this),["x","y","z"].forEach(function(i,n){t[i]=f.Vector3[0][e[n]]})),this},e.prototype.rotateByQuaternionToRef=function(t,i){return t.toRotationMatrix(f.Matrix[0]),e.TransformCoordinatesToRef(this,f.Matrix[0],i),i},e.prototype.rotateByQuaternionAroundPointToRef=function(e,t,i){return this.subtractToRef(t,f.Vector3[0]),f.Vector3[0].rotateByQuaternionToRef(e,f.Vector3[0]),t.addToRef(f.Vector3[0],i),i},e.prototype.cross=function(t){return e.Cross(this,t)},e.prototype.normalizeFromLength=function(e){return 0===e||1===e?this:this.scaleInPlace(1/e)},e.prototype.normalizeToNew=function(){var t=new e(0,0,0);return this.normalizeToRef(t),t},e.prototype.normalizeToRef=function(e){var t=this.length();return 0===t||1===t?e.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/t,e)},e.prototype.clone=function(){return new e(this._x,this._y,this._z)},e.prototype.copyFrom=function(e){return this.copyFromFloats(e._x,e._y,e._z)},e.prototype.copyFromFloats=function(e,t,i){return this.x=e,this.y=t,this.z=i,this},e.prototype.set=function(e,t,i){return this.copyFromFloats(e,t,i)},e.prototype.setAll=function(e){return this.x=this.y=this.z=e,this},e.GetClipFactor=function(t,i,n,r){var o=e.Dot(t,n)-r;return o/(o-(e.Dot(i,n)-r))},e.GetAngleBetweenVectors=function(t,i,n){var r=t.normalizeToRef(f.Vector3[1]),o=i.normalizeToRef(f.Vector3[2]),a=e.Dot(r,o),s=f.Vector3[3];return e.CrossToRef(r,o,s),e.Dot(s,n)>0?Math.acos(a):-Math.acos(a)},e.FromArray=function(t,i){return void 0===i&&(i=0),new e(t[i],t[i+1],t[i+2])},e.FromFloatArray=function(t,i){return e.FromArray(t,i)},e.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2]},e.FromFloatArrayToRef=function(t,i,n){return e.FromArrayToRef(t,i,n)},e.FromFloatsToRef=function(e,t,i,n){n.copyFromFloats(e,t,i)},e.Zero=function(){return new e(0,0,0)},e.One=function(){return new e(1,1,1)},e.Up=function(){return new e(0,1,0)},Object.defineProperty(e,"UpReadOnly",{get:function(){return e._UpReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ZeroReadOnly",{get:function(){return e._ZeroReadOnly},enumerable:!1,configurable:!0}),e.Down=function(){return new e(0,-1,0)},e.Forward=function(t){return void 0===t&&(t=!1),new e(0,0,t?-1:1)},e.Backward=function(t){return void 0===t&&(t=!1),new e(0,0,t?1:-1)},e.Right=function(){return new e(1,0,0)},e.Left=function(){return new e(-1,0,0)},e.TransformCoordinates=function(t,i){var n=e.Zero();return e.TransformCoordinatesToRef(t,i,n),n},e.TransformCoordinatesToRef=function(t,i,n){e.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,i,n)},e.TransformCoordinatesFromFloatsToRef=function(e,t,i,n,r){var o=n.m,a=e*o[0]+t*o[4]+i*o[8]+o[12],s=e*o[1]+t*o[5]+i*o[9]+o[13],c=e*o[2]+t*o[6]+i*o[10]+o[14],l=1/(e*o[3]+t*o[7]+i*o[11]+o[15]);r.x=a*l,r.y=s*l,r.z=c*l},e.TransformNormal=function(t,i){var n=e.Zero();return e.TransformNormalToRef(t,i,n),n},e.TransformNormalToRef=function(e,t,i){this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i)},e.TransformNormalFromFloatsToRef=function(e,t,i,n,r){var o=n.m;r.x=e*o[0]+t*o[4]+i*o[8],r.y=e*o[1]+t*o[5]+i*o[9],r.z=e*o[2]+t*o[6]+i*o[10]},e.CatmullRom=function(t,i,n,r,o){var a=o*o,s=o*a;return new e(.5*(2*i._x+(-t._x+n._x)*o+(2*t._x-5*i._x+4*n._x-r._x)*a+(-t._x+3*i._x-3*n._x+r._x)*s),.5*(2*i._y+(-t._y+n._y)*o+(2*t._y-5*i._y+4*n._y-r._y)*a+(-t._y+3*i._y-3*n._y+r._y)*s),.5*(2*i._z+(-t._z+n._z)*o+(2*t._z-5*i._z+4*n._z-r._z)*a+(-t._z+3*i._z-3*n._z+r._z)*s))},e.Clamp=function(t,i,n){var r=new e;return e.ClampToRef(t,i,n,r),r},e.ClampToRef=function(e,t,i,n){var r=e._x;r=(r=r>i._x?i._x:r)<t._x?t._x:r;var o=e._y;o=(o=o>i._y?i._y:o)<t._y?t._y:o;var a=e._z;a=(a=a>i._z?i._z:a)<t._z?t._z:a,n.copyFromFloats(r,o,a)},e.CheckExtends=function(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)},e.Hermite=function(t,i,n,r,o){var a=o*o,s=o*a,c=2*s-3*a+1,l=-2*s+3*a,u=s-2*a+o,h=s-a;return new e(t._x*c+n._x*l+i._x*u+r._x*h,t._y*c+n._y*l+i._y*u+r._y*h,t._z*c+n._z*l+i._z*u+r._z*h)},e.Lerp=function(t,i,n){var r=new e(0,0,0);return e.LerpToRef(t,i,n,r),r},e.LerpToRef=function(e,t,i,n){n.x=e._x+(t._x-e._x)*i,n.y=e._y+(t._y-e._y)*i,n.z=e._z+(t._z-e._z)*i},e.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z},e.Cross=function(t,i){var n=e.Zero();return e.CrossToRef(t,i,n),n},e.CrossToRef=function(e,t,i){var n=e._y*t._z-e._z*t._y,r=e._z*t._x-e._x*t._z,o=e._x*t._y-e._y*t._x;i.copyFromFloats(n,r,o)},e.Normalize=function(t){var i=e.Zero();return e.NormalizeToRef(t,i),i},e.NormalizeToRef=function(e,t){e.normalizeToRef(t)},e.Project=function(t,i,n,r){var o=new e;return e.ProjectToRef(t,i,n,r,o),o},e.ProjectToRef=function(t,i,n,r,o){var a=r.width,s=r.height,c=r.x,l=r.y,u=f.Matrix[1];d.FromValuesToRef(a/2,0,0,0,0,-s/2,0,0,0,0,.5,0,c+a/2,s/2+l,.5,1,u);var h=f.Matrix[0];return i.multiplyToRef(n,h),h.multiplyToRef(u,h),e.TransformCoordinatesToRef(t,h,o),o},e._UnprojectFromInvertedMatrixToRef=function(t,i,r){e.TransformCoordinatesToRef(t,i,r);var o=i.m,a=t._x*o[3]+t._y*o[7]+t._z*o[11]+o[15];n.a.WithinEpsilon(a,1)&&r.scaleInPlace(1/a)},e.UnprojectFromTransform=function(t,i,n,r,o){var a=f.Matrix[0];r.multiplyToRef(o,a),a.invert(),t.x=t._x/i*2-1,t.y=-(t._y/n*2-1);var s=new e;return e._UnprojectFromInvertedMatrixToRef(t,a,s),s},e.Unproject=function(t,i,n,r,o,a){var s=e.Zero();return e.UnprojectToRef(t,i,n,r,o,a,s),s},e.UnprojectToRef=function(t,i,n,r,o,a,s){e.UnprojectFloatsToRef(t._x,t._y,t._z,i,n,r,o,a,s)},e.UnprojectFloatsToRef=function(t,i,n,r,o,a,s,c,l){var u=f.Matrix[0];a.multiplyToRef(s,u),u.multiplyToRef(c,u),u.invert();var h=f.Vector3[0];h.x=t/r*2-1,h.y=-(i/o*2-1),h.z=2*n-1,e._UnprojectFromInvertedMatrixToRef(h,u,l)},e.Minimize=function(e,t){var i=e.clone();return i.minimizeInPlace(t),i},e.Maximize=function(e,t){var i=e.clone();return i.maximizeInPlace(t),i},e.Distance=function(t,i){return Math.sqrt(e.DistanceSquared(t,i))},e.DistanceSquared=function(e,t){var i=e._x-t._x,n=e._y-t._y,r=e._z-t._z;return i*i+n*n+r*r},e.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},e.RotationFromAxis=function(t,i,n){var r=e.Zero();return e.RotationFromAxisToRef(t,i,n,r),r},e.RotationFromAxisToRef=function(e,t,i,n){var r=f.Quaternion[0];h.RotationQuaternionFromAxisToRef(e,t,i,r),r.toEulerAnglesToRef(n)},e._UpReadOnly=e.Up(),e._ZeroReadOnly=e.Zero(),e}(),u=function(){function e(e,t,i,n){this.x=e,this.y=t,this.z=i,this.w=n}return e.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+" Z:"+this.z+" W:"+this.w+"}"},e.prototype.getClassName=function(){return"Vector4"},e.prototype.getHashCode=function(){var e=0|this.x;return 397*(e=397*(e=397*e^(0|this.y))^(0|this.z))^(0|this.w)},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)},e.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t.z=this.z+e.z,t.w=this.w+e.w,this},e.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)},e.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t.z=this.z-e.z,t.w=this.w-e.w,this},e.prototype.subtractFromFloats=function(t,i,n,r){return new e(this.x-t,this.y-i,this.z-n,this.w-r)},e.prototype.subtractFromFloatsToRef=function(e,t,i,n,r){return r.x=this.x-e,r.y=this.y-t,r.z=this.z-i,r.w=this.w-n,this},e.prototype.negate=function(){return new e(-this.x,-this.y,-this.z,-this.w)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this.x,-1*this.y,-1*this.z,-1*this.w)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},e.prototype.scale=function(t){return new e(this.x*t,this.y*t,this.z*t,this.w*t)},e.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t.w=this.w*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,t.z+=this.z*e,t.w+=this.w*e,this},e.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=r.a),e&&n.a.WithinEpsilon(this.x,e.x,t)&&n.a.WithinEpsilon(this.y,e.y,t)&&n.a.WithinEpsilon(this.z,e.z,t)&&n.a.WithinEpsilon(this.w,e.w,t)},e.prototype.equalsToFloats=function(e,t,i,n){return this.x===e&&this.y===t&&this.z===i&&this.w===n},e.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},e.prototype.multiply=function(t){return new e(this.x*t.x,this.y*t.y,this.z*t.z,this.w*t.w)},e.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t.z=this.z*e.z,t.w=this.w*e.w,this},e.prototype.multiplyByFloats=function(t,i,n,r){return new e(this.x*t,this.y*i,this.z*n,this.w*r)},e.prototype.divide=function(t){return new e(this.x/t.x,this.y/t.y,this.z/t.z,this.w/t.w)},e.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t.z=this.z/e.z,t.w=this.w/e.w,this},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.minimizeInPlace=function(e){return e.x<this.x&&(this.x=e.x),e.y<this.y&&(this.y=e.y),e.z<this.z&&(this.z=e.z),e.w<this.w&&(this.w=e.w),this},e.prototype.maximizeInPlace=function(e){return e.x>this.x&&(this.x=e.x),e.y>this.y&&(this.y=e.y),e.z>this.z&&(this.z=e.z),e.w>this.w&&(this.w=e.w),this},e.prototype.floor=function(){return new e(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},e.prototype.fract=function(){return new e(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.prototype.normalize=function(){var e=this.length();return 0===e?this:this.scaleInPlace(1/e)},e.prototype.toVector3=function(){return new l(this.x,this.y,this.z)},e.prototype.clone=function(){return new e(this.x,this.y,this.z,this.w)},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},e.prototype.copyFromFloats=function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},e.prototype.set=function(e,t,i,n){return this.copyFromFloats(e,t,i,n)},e.prototype.setAll=function(e){return this.x=this.y=this.z=this.w=e,this},e.FromArray=function(t,i){return i||(i=0),new e(t[i],t[i+1],t[i+2],t[i+3])},e.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3]},e.FromFloatArrayToRef=function(t,i,n){e.FromArrayToRef(t,i,n)},e.FromFloatsToRef=function(e,t,i,n,r){r.x=e,r.y=t,r.z=i,r.w=n},e.Zero=function(){return new e(0,0,0,0)},e.One=function(){return new e(1,1,1,1)},e.Normalize=function(t){var i=e.Zero();return e.NormalizeToRef(t,i),i},e.NormalizeToRef=function(e,t){t.copyFrom(e),t.normalize()},e.Minimize=function(e,t){var i=e.clone();return i.minimizeInPlace(t),i},e.Maximize=function(e,t){var i=e.clone();return i.maximizeInPlace(t),i},e.Distance=function(t,i){return Math.sqrt(e.DistanceSquared(t,i))},e.DistanceSquared=function(e,t){var i=e.x-t.x,n=e.y-t.y,r=e.z-t.z,o=e.w-t.w;return i*i+n*n+r*r+o*o},e.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},e.TransformNormal=function(t,i){var n=e.Zero();return e.TransformNormalToRef(t,i,n),n},e.TransformNormalToRef=function(e,t,i){var n=t.m,r=e.x*n[0]+e.y*n[4]+e.z*n[8],o=e.x*n[1]+e.y*n[5]+e.z*n[9],a=e.x*n[2]+e.y*n[6]+e.z*n[10];i.x=r,i.y=o,i.z=a,i.w=e.w},e.TransformNormalFromFloatsToRef=function(e,t,i,n,r,o){var a=r.m;o.x=e*a[0]+t*a[4]+i*a[8],o.y=e*a[1]+t*a[5]+i*a[9],o.z=e*a[2]+t*a[6]+i*a[10],o.w=n},e.FromVector3=function(t,i){return void 0===i&&(i=0),new e(t._x,t._y,t._z,i)},e}(),h=function(){function e(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=1),this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=n}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"w",{get:function(){return this._w},set:function(e){this._w=e,this._isDirty=!0},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+" W:"+this._w+"}"},e.prototype.getClassName=function(){return"Quaternion"},e.prototype.getHashCode=function(){var e=0|this._x;return 397*(e=397*(e=397*e^(0|this._y))^(0|this._z))^(0|this._w)},e.prototype.asArray=function(){return[this._x,this._y,this._z,this._w]},e.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=r.a),e&&n.a.WithinEpsilon(this._x,e._x,t)&&n.a.WithinEpsilon(this._y,e._y,t)&&n.a.WithinEpsilon(this._z,e._z,t)&&n.a.WithinEpsilon(this._w,e._w,t)},e.prototype.clone=function(){return new e(this._x,this._y,this._z,this._w)},e.prototype.copyFrom=function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this.w=e._w,this},e.prototype.copyFromFloats=function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},e.prototype.set=function(e,t,i,n){return this.copyFromFloats(e,t,i,n)},e.prototype.add=function(t){return new e(this._x+t._x,this._y+t._y,this._z+t._z,this._w+t._w)},e.prototype.addInPlace=function(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this},e.prototype.subtract=function(t){return new e(this._x-t._x,this._y-t._y,this._z-t._z,this._w-t._w)},e.prototype.scale=function(t){return new e(this._x*t,this._y*t,this._z*t,this._w*t)},e.prototype.scaleToRef=function(e,t){return t.x=this._x*e,t.y=this._y*e,t.z=this._z*e,t.w=this._w*e,this},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this._x*e,t.y+=this._y*e,t.z+=this._z*e,t.w+=this._w*e,this},e.prototype.multiply=function(t){var i=new e(0,0,0,1);return this.multiplyToRef(t,i),i},e.prototype.multiplyToRef=function(e,t){var i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,n=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,r=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,o=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,n,r,o),this},e.prototype.multiplyInPlace=function(e){return this.multiplyToRef(e,this),this},e.prototype.conjugateToRef=function(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),this},e.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.prototype.conjugate=function(){return new e(-this._x,-this._y,-this._z,this._w)},e.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},e.prototype.normalize=function(){var e=this.length();if(0===e)return this;var t=1/e;return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.prototype.toEulerAngles=function(e){void 0===e&&(e="YZX");var t=l.Zero();return this.toEulerAnglesToRef(t),t},e.prototype.toEulerAnglesToRef=function(e){var t=this._z,i=this._x,n=this._y,r=this._w,o=r*r,a=t*t,s=i*i,c=n*n,l=n*t-i*r;return l<-.4999999?(e.y=2*Math.atan2(n,r),e.x=Math.PI/2,e.z=0):l>.4999999?(e.y=2*Math.atan2(n,r),e.x=-Math.PI/2,e.z=0):(e.z=Math.atan2(2*(i*n+t*r),-a-s+c+o),e.x=Math.asin(-2*(t*n-i*r)),e.y=Math.atan2(2*(t*i+n*r),a-s-c+o)),this},e.prototype.toRotationMatrix=function(e){return d.FromQuaternionToRef(this,e),this},e.prototype.fromRotationMatrix=function(t){return e.FromRotationMatrixToRef(t,this),this},e.FromRotationMatrix=function(t){var i=new e;return e.FromRotationMatrixToRef(t,i),i},e.FromRotationMatrixToRef=function(e,t){var i,n=e.m,r=n[0],o=n[4],a=n[8],s=n[1],c=n[5],l=n[9],u=n[2],h=n[6],d=n[10],f=r+c+d;f>0?(i=.5/Math.sqrt(f+1),t.w=.25/i,t.x=(h-l)*i,t.y=(a-u)*i,t.z=(s-o)*i):r>c&&r>d?(i=2*Math.sqrt(1+r-c-d),t.w=(h-l)/i,t.x=.25*i,t.y=(o+s)/i,t.z=(a+u)/i):c>d?(i=2*Math.sqrt(1+c-r-d),t.w=(a-u)/i,t.x=(o+s)/i,t.y=.25*i,t.z=(l+h)/i):(i=2*Math.sqrt(1+d-r-c),t.w=(s-o)/i,t.x=(a+u)/i,t.y=(l+h)/i,t.z=.25*i)},e.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w},e.AreClose=function(t,i){return e.Dot(t,i)>=0},e.Zero=function(){return new e(0,0,0,0)},e.Inverse=function(t){return new e(-t._x,-t._y,-t._z,t._w)},e.InverseToRef=function(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t},e.Identity=function(){return new e(0,0,0,1)},e.IsIdentity=function(e){return e&&0===e._x&&0===e._y&&0===e._z&&1===e._w},e.RotationAxis=function(t,i){return e.RotationAxisToRef(t,i,new e)},e.RotationAxisToRef=function(e,t,i){var n=Math.sin(t/2);return e.normalize(),i.w=Math.cos(t/2),i.x=e._x*n,i.y=e._y*n,i.z=e._z*n,i},e.FromArray=function(t,i){return i||(i=0),new e(t[i],t[i+1],t[i+2],t[i+3])},e.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3]},e.FromEulerAngles=function(t,i,n){var r=new e;return e.RotationYawPitchRollToRef(i,t,n,r),r},e.FromEulerAnglesToRef=function(t,i,n,r){return e.RotationYawPitchRollToRef(i,t,n,r),r},e.FromEulerVector=function(t){var i=new e;return e.RotationYawPitchRollToRef(t._y,t._x,t._z,i),i},e.FromEulerVectorToRef=function(t,i){return e.RotationYawPitchRollToRef(t._y,t._x,t._z,i),i},e.RotationYawPitchRoll=function(t,i,n){var r=new e;return e.RotationYawPitchRollToRef(t,i,n,r),r},e.RotationYawPitchRollToRef=function(e,t,i,n){var r=.5*i,o=.5*t,a=.5*e,s=Math.sin(r),c=Math.cos(r),l=Math.sin(o),u=Math.cos(o),h=Math.sin(a),d=Math.cos(a);n.x=d*l*c+h*u*s,n.y=h*u*c-d*l*s,n.z=d*u*s-h*l*c,n.w=d*u*c+h*l*s},e.RotationAlphaBetaGamma=function(t,i,n){var r=new e;return e.RotationAlphaBetaGammaToRef(t,i,n,r),r},e.RotationAlphaBetaGammaToRef=function(e,t,i,n){var r=.5*(i+e),o=.5*(i-e),a=.5*t;n.x=Math.cos(o)*Math.sin(a),n.y=Math.sin(o)*Math.sin(a),n.z=Math.sin(r)*Math.cos(a),n.w=Math.cos(r)*Math.cos(a)},e.RotationQuaternionFromAxis=function(t,i,n){var r=new e(0,0,0,0);return e.RotationQuaternionFromAxisToRef(t,i,n,r),r},e.RotationQuaternionFromAxisToRef=function(t,i,n,r){var o=f.Matrix[0];d.FromXYZAxesToRef(t.normalize(),i.normalize(),n.normalize(),o),e.FromRotationMatrixToRef(o,r)},e.Slerp=function(t,i,n){var r=e.Identity();return e.SlerpToRef(t,i,n,r),r},e.SlerpToRef=function(e,t,i,n){var r,o,a=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,s=!1;if(a<0&&(s=!0,a=-a),a>.999999)o=1-i,r=s?-i:i;else{var c=Math.acos(a),l=1/Math.sin(c);o=Math.sin((1-i)*c)*l,r=s?-Math.sin(i*c)*l:Math.sin(i*c)*l}n.x=o*e._x+r*t._x,n.y=o*e._y+r*t._y,n.z=o*e._z+r*t._z,n.w=o*e._w+r*t._w},e.Hermite=function(t,i,n,r,o){var a=o*o,s=o*a,c=2*s-3*a+1,l=-2*s+3*a,u=s-2*a+o,h=s-a;return new e(t._x*c+n._x*l+i._x*u+r._x*h,t._y*c+n._y*l+i._y*u+r._y*h,t._z*c+n._z*l+i._z*u+r._z*h,t._w*c+n._w*l+i._w*u+r._w*h)},e}(),d=function(){function e(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,s.a.MatrixTrackPrecisionChange&&s.a.MatrixTrackedMatrices.push(this),this._m=new s.a.MatrixCurrentType(16),this._updateIdentityStatus(!1)}return Object.defineProperty(e,"Use64Bits",{get:function(){return s.a.MatrixUse64Bits},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this._m},enumerable:!1,configurable:!0}),e.prototype._markAsUpdated=function(){this.updateFlag=e._updateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0},e.prototype._updateIdentityStatus=function(t,i,n,r){void 0===i&&(i=!1),void 0===n&&(n=!1),void 0===r&&(r=!0),this.updateFlag=e._updateFlagSeed++,this._isIdentity=t,this._isIdentity3x2=t||n,this._isIdentityDirty=!this._isIdentity&&i,this._isIdentity3x2Dirty=!this._isIdentity3x2&&r},e.prototype.isIdentity=function(){if(this._isIdentityDirty){this._isIdentityDirty=!1;var e=this._m;this._isIdentity=1===e[0]&&0===e[1]&&0===e[2]&&0===e[3]&&0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]&&0===e[8]&&0===e[9]&&1===e[10]&&0===e[11]&&0===e[12]&&0===e[13]&&0===e[14]&&1===e[15]}return this._isIdentity},e.prototype.isIdentityAs3x2=function(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,1!==this._m[0]||1!==this._m[5]||1!==this._m[15]||0!==this._m[1]||0!==this._m[2]||0!==this._m[3]||0!==this._m[4]||0!==this._m[6]||0!==this._m[7]||0!==this._m[8]||0!==this._m[9]||0!==this._m[10]||0!==this._m[11]||0!==this._m[12]||0!==this._m[13]||0!==this._m[14]?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2},e.prototype.determinant=function(){if(!0===this._isIdentity)return 1;var e=this._m,t=e[0],i=e[1],n=e[2],r=e[3],o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],h=e[10],d=e[11],f=e[12],p=e[13],_=e[14],m=e[15],g=h*m-_*d,v=u*m-p*d,b=u*_-p*h,y=l*m-f*d,T=l*_-h*f,E=l*p-f*u;return t*+(a*g-s*v+c*b)+i*-(o*g-s*y+c*T)+n*+(o*v-a*y+c*E)+r*-(o*b-a*T+s*E)},e.prototype.toArray=function(){return this._m},e.prototype.asArray=function(){return this._m},e.prototype.invert=function(){return this.invertToRef(this),this},e.prototype.reset=function(){return e.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this},e.prototype.add=function(t){var i=new e;return this.addToRef(t,i),i},e.prototype.addToRef=function(e,t){for(var i=this._m,n=t._m,r=e.m,o=0;o<16;o++)n[o]=i[o]+r[o];return t._markAsUpdated(),this},e.prototype.addToSelf=function(e){for(var t=this._m,i=e.m,n=0;n<16;n++)t[n]+=i[n];return this._markAsUpdated(),this},e.prototype.invertToRef=function(t){if(!0===this._isIdentity)return e.IdentityToRef(t),this;var i=this._m,n=i[0],r=i[1],o=i[2],a=i[3],s=i[4],c=i[5],l=i[6],u=i[7],h=i[8],d=i[9],f=i[10],p=i[11],_=i[12],m=i[13],g=i[14],v=i[15],b=f*v-g*p,y=d*v-m*p,T=d*g-m*f,E=h*v-_*p,S=h*g-f*_,A=h*m-_*d,P=+(c*b-l*y+u*T),C=-(s*b-l*E+u*S),R=+(s*y-c*E+u*A),x=-(s*T-c*S+l*A),O=n*P+r*C+o*R+a*x;if(0===O)return t.copyFrom(this),this;var M=1/O,I=l*v-g*u,D=c*v-m*u,N=c*g-m*l,L=s*v-_*u,w=s*g-_*l,F=s*m-_*c,B=l*p-f*u,U=c*p-d*u,V=c*f-d*l,k=s*p-h*u,G=s*f-h*l,z=s*d-h*c,j=-(r*b-o*y+a*T),W=+(n*b-o*E+a*S),H=-(n*y-r*E+a*A),X=+(n*T-r*S+o*A),Y=+(r*I-o*D+a*N),K=-(n*I-o*L+a*w),Q=+(n*D-r*L+a*F),q=-(n*N-r*w+o*F),Z=-(r*B-o*U+a*V),J=+(n*B-o*k+a*G),$=-(n*U-r*k+a*z),ee=+(n*V-r*G+o*z);return e.FromValuesToRef(P*M,j*M,Y*M,Z*M,C*M,W*M,K*M,J*M,R*M,H*M,Q*M,$*M,x*M,X*M,q*M,ee*M,t),this},e.prototype.addAtIndex=function(e,t){return this._m[e]+=t,this._markAsUpdated(),this},e.prototype.multiplyAtIndex=function(e,t){return this._m[e]*=t,this._markAsUpdated(),this},e.prototype.setTranslationFromFloats=function(e,t,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this._markAsUpdated(),this},e.prototype.addTranslationFromFloats=function(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this._markAsUpdated(),this},e.prototype.setTranslation=function(e){return this.setTranslationFromFloats(e._x,e._y,e._z)},e.prototype.getTranslation=function(){return new l(this._m[12],this._m[13],this._m[14])},e.prototype.getTranslationToRef=function(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],this},e.prototype.removeRotationAndScaling=function(){var t=this.m;return e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]),this},e.prototype.multiply=function(t){var i=new e;return this.multiplyToRef(t,i),i},e.prototype.copyFrom=function(e){e.copyToArray(this._m);var t=e;return this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this},e.prototype.copyToArray=function(e,t){void 0===t&&(t=0);var i=this._m;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],this},e.prototype.multiplyToRef=function(e,t){return this._isIdentity?(t.copyFrom(e),this):e._isIdentity?(t.copyFrom(this),this):(this.multiplyToArray(e,t._m,0),t._markAsUpdated(),this)},e.prototype.multiplyToArray=function(e,t,i){var n=this._m,r=e.m,o=n[0],a=n[1],s=n[2],c=n[3],l=n[4],u=n[5],h=n[6],d=n[7],f=n[8],p=n[9],_=n[10],m=n[11],g=n[12],v=n[13],b=n[14],y=n[15],T=r[0],E=r[1],S=r[2],A=r[3],P=r[4],C=r[5],R=r[6],x=r[7],O=r[8],M=r[9],I=r[10],D=r[11],N=r[12],L=r[13],w=r[14],F=r[15];return t[i]=o*T+a*P+s*O+c*N,t[i+1]=o*E+a*C+s*M+c*L,t[i+2]=o*S+a*R+s*I+c*w,t[i+3]=o*A+a*x+s*D+c*F,t[i+4]=l*T+u*P+h*O+d*N,t[i+5]=l*E+u*C+h*M+d*L,t[i+6]=l*S+u*R+h*I+d*w,t[i+7]=l*A+u*x+h*D+d*F,t[i+8]=f*T+p*P+_*O+m*N,t[i+9]=f*E+p*C+_*M+m*L,t[i+10]=f*S+p*R+_*I+m*w,t[i+11]=f*A+p*x+_*D+m*F,t[i+12]=g*T+v*P+b*O+y*N,t[i+13]=g*E+v*C+b*M+y*L,t[i+14]=g*S+v*R+b*I+y*w,t[i+15]=g*A+v*x+b*D+y*F,this},e.prototype.equals=function(e){var t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;var i=this.m,n=t.m;return i[0]===n[0]&&i[1]===n[1]&&i[2]===n[2]&&i[3]===n[3]&&i[4]===n[4]&&i[5]===n[5]&&i[6]===n[6]&&i[7]===n[7]&&i[8]===n[8]&&i[9]===n[9]&&i[10]===n[10]&&i[11]===n[11]&&i[12]===n[12]&&i[13]===n[13]&&i[14]===n[14]&&i[15]===n[15]},e.prototype.clone=function(){var t=new e;return t.copyFrom(this),t},e.prototype.getClassName=function(){return"Matrix"},e.prototype.getHashCode=function(){for(var e=0|this._m[0],t=1;t<16;t++)e=397*e^(0|this._m[t]);return e},e.prototype.decompose=function(t,i,n){if(this._isIdentity)return n&&n.setAll(0),t&&t.setAll(1),i&&i.copyFromFloats(0,0,0,1),!0;var r=this._m;if(n&&n.copyFromFloats(r[12],r[13],r[14]),(t=t||f.Vector3[0]).x=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),t.y=Math.sqrt(r[4]*r[4]+r[5]*r[5]+r[6]*r[6]),t.z=Math.sqrt(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),this.determinant()<=0&&(t.y*=-1),0===t._x||0===t._y||0===t._z)return i&&i.copyFromFloats(0,0,0,1),!1;if(i){var o=1/t._x,a=1/t._y,s=1/t._z;e.FromValuesToRef(r[0]*o,r[1]*o,r[2]*o,0,r[4]*a,r[5]*a,r[6]*a,0,r[8]*s,r[9]*s,r[10]*s,0,0,0,0,1,f.Matrix[0]),h.FromRotationMatrixToRef(f.Matrix[0],i)}return!0},e.prototype.getRow=function(e){if(e<0||e>3)return null;var t=4*e;return new u(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])},e.prototype.setRow=function(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)},e.prototype.transpose=function(){return e.Transpose(this)},e.prototype.transposeToRef=function(t){return e.TransposeToRef(this,t),this},e.prototype.setRowFromFloats=function(e,t,i,n,r){if(e<0||e>3)return this;var o=4*e;return this._m[o+0]=t,this._m[o+1]=i,this._m[o+2]=n,this._m[o+3]=r,this._markAsUpdated(),this},e.prototype.scale=function(t){var i=new e;return this.scaleToRef(t,i),i},e.prototype.scaleToRef=function(e,t){for(var i=0;i<16;i++)t._m[i]=this._m[i]*e;return t._markAsUpdated(),this},e.prototype.scaleAndAddToRef=function(e,t){for(var i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t._markAsUpdated(),this},e.prototype.toNormalMatrix=function(t){var i=f.Matrix[0];this.invertToRef(i),i.transposeToRef(t);var n=t._m;e.FromValuesToRef(n[0],n[1],n[2],0,n[4],n[5],n[6],0,n[8],n[9],n[10],0,0,0,0,1,t)},e.prototype.getRotationMatrix=function(){var t=new e;return this.getRotationMatrixToRef(t),t},e.prototype.getRotationMatrixToRef=function(t){var i=f.Vector3[0];if(!this.decompose(i))return e.IdentityToRef(t),this;var n=this._m,r=1/i._x,o=1/i._y,a=1/i._z;return e.FromValuesToRef(n[0]*r,n[1]*r,n[2]*r,0,n[4]*o,n[5]*o,n[6]*o,0,n[8]*a,n[9]*a,n[10]*a,0,0,0,0,1,t),this},e.prototype.toggleModelMatrixHandInPlace=function(){var e=this._m;e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this._markAsUpdated()},e.prototype.toggleProjectionMatrixHandInPlace=function(){var e=this._m;e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this._markAsUpdated()},e.FromArray=function(t,i){void 0===i&&(i=0);var n=new e;return e.FromArrayToRef(t,i,n),n},e.FromArrayToRef=function(e,t,i){for(var n=0;n<16;n++)i._m[n]=e[n+t];i._markAsUpdated()},e.FromFloat32ArrayToRefScaled=function(e,t,i,n){for(var r=0;r<16;r++)n._m[r]=e[r+t]*i;n._markAsUpdated()},Object.defineProperty(e,"IdentityReadOnly",{get:function(){return e._identityReadOnly},enumerable:!1,configurable:!0}),e.FromValuesToRef=function(e,t,i,n,r,o,a,s,c,l,u,h,d,f,p,_,m){var g=m._m;g[0]=e,g[1]=t,g[2]=i,g[3]=n,g[4]=r,g[5]=o,g[6]=a,g[7]=s,g[8]=c,g[9]=l,g[10]=u,g[11]=h,g[12]=d,g[13]=f,g[14]=p,g[15]=_,m._markAsUpdated()},e.FromValues=function(t,i,n,r,o,a,s,c,l,u,h,d,f,p,_,m){var g=new e,v=g._m;return v[0]=t,v[1]=i,v[2]=n,v[3]=r,v[4]=o,v[5]=a,v[6]=s,v[7]=c,v[8]=l,v[9]=u,v[10]=h,v[11]=d,v[12]=f,v[13]=p,v[14]=_,v[15]=m,g._markAsUpdated(),g},e.Compose=function(t,i,n){var r=new e;return e.ComposeToRef(t,i,n,r),r},e.ComposeToRef=function(e,t,i,n){var r=n._m,o=t._x,a=t._y,s=t._z,c=t._w,l=o+o,u=a+a,h=s+s,d=o*l,f=o*u,p=o*h,_=a*u,m=a*h,g=s*h,v=c*l,b=c*u,y=c*h,T=e._x,E=e._y,S=e._z;r[0]=(1-(_+g))*T,r[1]=(f+y)*T,r[2]=(p-b)*T,r[3]=0,r[4]=(f-y)*E,r[5]=(1-(d+g))*E,r[6]=(m+v)*E,r[7]=0,r[8]=(p+b)*S,r[9]=(m-v)*S,r[10]=(1-(d+_))*S,r[11]=0,r[12]=i._x,r[13]=i._y,r[14]=i._z,r[15]=1,n._markAsUpdated()},e.Identity=function(){var t=e.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t},e.IdentityToRef=function(t){e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0)},e.Zero=function(){var t=e.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t},e.RotationX=function(t){var i=new e;return e.RotationXToRef(t,i),i},e.Invert=function(t){var i=new e;return t.invertToRef(i),i},e.RotationXToRef=function(t,i){var n=Math.sin(t),r=Math.cos(t);e.FromValuesToRef(1,0,0,0,0,r,n,0,0,-n,r,0,0,0,0,1,i),i._updateIdentityStatus(1===r&&0===n)},e.RotationY=function(t){var i=new e;return e.RotationYToRef(t,i),i},e.RotationYToRef=function(t,i){var n=Math.sin(t),r=Math.cos(t);e.FromValuesToRef(r,0,-n,0,0,1,0,0,n,0,r,0,0,0,0,1,i),i._updateIdentityStatus(1===r&&0===n)},e.RotationZ=function(t){var i=new e;return e.RotationZToRef(t,i),i},e.RotationZToRef=function(t,i){var n=Math.sin(t),r=Math.cos(t);e.FromValuesToRef(r,n,0,0,-n,r,0,0,0,0,1,0,0,0,0,1,i),i._updateIdentityStatus(1===r&&0===n)},e.RotationAxis=function(t,i){var n=new e;return e.RotationAxisToRef(t,i,n),n},e.RotationAxisToRef=function(e,t,i){var n=Math.sin(-t),r=Math.cos(-t),o=1-r;e.normalize();var a=i._m;a[0]=e._x*e._x*o+r,a[1]=e._x*e._y*o-e._z*n,a[2]=e._x*e._z*o+e._y*n,a[3]=0,a[4]=e._y*e._x*o+e._z*n,a[5]=e._y*e._y*o+r,a[6]=e._y*e._z*o-e._x*n,a[7]=0,a[8]=e._z*e._x*o-e._y*n,a[9]=e._z*e._y*o+e._x*n,a[10]=e._z*e._z*o+r,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,i._markAsUpdated()},e.RotationAlignToRef=function(e,t,i){var n=l.Cross(t,e),r=l.Dot(t,e),o=1/(1+r),a=i._m;a[0]=n._x*n._x*o+r,a[1]=n._y*n._x*o-n._z,a[2]=n._z*n._x*o+n._y,a[3]=0,a[4]=n._x*n._y*o+n._z,a[5]=n._y*n._y*o+r,a[6]=n._z*n._y*o-n._x,a[7]=0,a[8]=n._x*n._z*o-n._y,a[9]=n._y*n._z*o+n._x,a[10]=n._z*n._z*o+r,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,i._markAsUpdated()},e.RotationYawPitchRoll=function(t,i,n){var r=new e;return e.RotationYawPitchRollToRef(t,i,n,r),r},e.RotationYawPitchRollToRef=function(e,t,i,n){h.RotationYawPitchRollToRef(e,t,i,f.Quaternion[0]),f.Quaternion[0].toRotationMatrix(n)},e.Scaling=function(t,i,n){var r=new e;return e.ScalingToRef(t,i,n,r),r},e.ScalingToRef=function(t,i,n,r){e.FromValuesToRef(t,0,0,0,0,i,0,0,0,0,n,0,0,0,0,1,r),r._updateIdentityStatus(1===t&&1===i&&1===n)},e.Translation=function(t,i,n){var r=new e;return e.TranslationToRef(t,i,n,r),r},e.TranslationToRef=function(t,i,n,r){e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t,i,n,1,r),r._updateIdentityStatus(0===t&&0===i&&0===n)},e.Lerp=function(t,i,n){var r=new e;return e.LerpToRef(t,i,n,r),r},e.LerpToRef=function(e,t,i,n){for(var r=n._m,o=e.m,a=t.m,s=0;s<16;s++)r[s]=o[s]*(1-i)+a[s]*i;n._markAsUpdated()},e.DecomposeLerp=function(t,i,n){var r=new e;return e.DecomposeLerpToRef(t,i,n,r),r},e.DecomposeLerpToRef=function(t,i,n,r){var o=f.Vector3[0],a=f.Quaternion[0],s=f.Vector3[1];t.decompose(o,a,s);var c=f.Vector3[2],u=f.Quaternion[1],d=f.Vector3[3];i.decompose(c,u,d);var p=f.Vector3[4];l.LerpToRef(o,c,n,p);var _=f.Quaternion[2];h.SlerpToRef(a,u,n,_);var m=f.Vector3[5];l.LerpToRef(s,d,n,m),e.ComposeToRef(p,_,m,r)},e.LookAtLH=function(t,i,n){var r=new e;return e.LookAtLHToRef(t,i,n,r),r},e.LookAtLHToRef=function(t,i,n,r){var o=f.Vector3[0],a=f.Vector3[1],s=f.Vector3[2];i.subtractToRef(t,s),s.normalize(),l.CrossToRef(n,s,o);var c=o.lengthSquared();0===c?o.x=1:o.normalizeFromLength(Math.sqrt(c)),l.CrossToRef(s,o,a),a.normalize();var u=-l.Dot(o,t),h=-l.Dot(a,t),d=-l.Dot(s,t);e.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,u,h,d,1,r)},e.LookAtRH=function(t,i,n){var r=new e;return e.LookAtRHToRef(t,i,n,r),r},e.LookAtRHToRef=function(t,i,n,r){var o=f.Vector3[0],a=f.Vector3[1],s=f.Vector3[2];t.subtractToRef(i,s),s.normalize(),l.CrossToRef(n,s,o);var c=o.lengthSquared();0===c?o.x=1:o.normalizeFromLength(Math.sqrt(c)),l.CrossToRef(s,o,a),a.normalize();var u=-l.Dot(o,t),h=-l.Dot(a,t),d=-l.Dot(s,t);e.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,u,h,d,1,r)},e.OrthoLH=function(t,i,n,r){var o=new e;return e.OrthoLHToRef(t,i,n,r,o),o},e.OrthoLHToRef=function(t,i,n,r,o){var a=2/t,s=2/i,c=2/(r-n),l=-(r+n)/(r-n);e.FromValuesToRef(a,0,0,0,0,s,0,0,0,0,c,0,0,0,l,1,o),o._updateIdentityStatus(1===a&&1===s&&1===c&&0===l)},e.OrthoOffCenterLH=function(t,i,n,r,o,a){var s=new e;return e.OrthoOffCenterLHToRef(t,i,n,r,o,a,s),s},e.OrthoOffCenterLHToRef=function(t,i,n,r,o,a,s){var c=2/(i-t),l=2/(r-n),u=2/(a-o),h=-(a+o)/(a-o),d=(t+i)/(t-i),f=(r+n)/(n-r);e.FromValuesToRef(c,0,0,0,0,l,0,0,0,0,u,0,d,f,h,1,s),s._markAsUpdated()},e.OrthoOffCenterRH=function(t,i,n,r,o,a){var s=new e;return e.OrthoOffCenterRHToRef(t,i,n,r,o,a,s),s},e.OrthoOffCenterRHToRef=function(t,i,n,r,o,a,s){e.OrthoOffCenterLHToRef(t,i,n,r,o,a,s),s._m[10]*=-1},e.PerspectiveLH=function(t,i,n,r){var o=new e,a=2*n/t,s=2*n/i,c=(r+n)/(r-n),l=-2*r*n/(r-n);return e.FromValuesToRef(a,0,0,0,0,s,0,0,0,0,c,1,0,0,l,0,o),o._updateIdentityStatus(!1),o},e.PerspectiveFovLH=function(t,i,n,r){var o=new e;return e.PerspectiveFovLHToRef(t,i,n,r,o),o},e.PerspectiveFovLHToRef=function(t,i,n,r,o,a){void 0===a&&(a=!0);var s=n,c=r,l=1/Math.tan(.5*t),u=a?l/i:l,h=a?l:l*i,d=(c+s)/(c-s),f=-2*c*s/(c-s);e.FromValuesToRef(u,0,0,0,0,h,0,0,0,0,d,1,0,0,f,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovReverseLHToRef=function(t,i,n,r,o,a){void 0===a&&(a=!0);var s=1/Math.tan(.5*t),c=a?s/i:s,l=a?s:s*i;e.FromValuesToRef(c,0,0,0,0,l,0,0,0,0,-n,1,0,0,1,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovRH=function(t,i,n,r){var o=new e;return e.PerspectiveFovRHToRef(t,i,n,r,o),o},e.PerspectiveFovRHToRef=function(t,i,n,r,o,a){void 0===a&&(a=!0);var s=n,c=r,l=1/Math.tan(.5*t),u=a?l/i:l,h=a?l:l*i,d=-(c+s)/(c-s),f=-2*c*s/(c-s);e.FromValuesToRef(u,0,0,0,0,h,0,0,0,0,d,-1,0,0,f,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovReverseRHToRef=function(t,i,n,r,o,a){void 0===a&&(a=!0);var s=1/Math.tan(.5*t),c=a?s/i:s,l=a?s:s*i;e.FromValuesToRef(c,0,0,0,0,l,0,0,0,0,-n,-1,0,0,-1,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovWebVRToRef=function(e,t,i,n,r){void 0===r&&(r=!1);var o=r?-1:1,a=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),c=Math.tan(e.leftDegrees*Math.PI/180),l=Math.tan(e.rightDegrees*Math.PI/180),u=2/(c+l),h=2/(a+s),d=n._m;d[0]=u,d[1]=d[2]=d[3]=d[4]=0,d[5]=h,d[6]=d[7]=0,d[8]=(c-l)*u*.5,d[9]=-(a-s)*h*.5,d[10]=-i/(t-i),d[11]=1*o,d[12]=d[13]=d[15]=0,d[14]=-2*i*t/(i-t),n._markAsUpdated()},e.GetFinalMatrix=function(t,i,n,r,o,a){var s=t.width,c=t.height,l=t.x,u=t.y,h=e.FromValues(s/2,0,0,0,0,-c/2,0,0,0,0,a-o,0,l+s/2,c/2+u,o,1),d=f.Matrix[0];return i.multiplyToRef(n,d),d.multiplyToRef(r,d),d.multiply(h)},e.GetAsMatrix2x2=function(e){var t=e.m,i=[t[0],t[1],t[4],t[5]];return s.a.MatrixUse64Bits?i:new Float32Array(i)},e.GetAsMatrix3x3=function(e){var t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return s.a.MatrixUse64Bits?i:new Float32Array(i)},e.Transpose=function(t){var i=new e;return e.TransposeToRef(t,i),i},e.TransposeToRef=function(e,t){var i=t._m,n=e.m;i[0]=n[0],i[1]=n[4],i[2]=n[8],i[3]=n[12],i[4]=n[1],i[5]=n[5],i[6]=n[9],i[7]=n[13],i[8]=n[2],i[9]=n[6],i[10]=n[10],i[11]=n[14],i[12]=n[3],i[13]=n[7],i[14]=n[11],i[15]=n[15],t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty)},e.Reflection=function(t){var i=new e;return e.ReflectionToRef(t,i),i},e.ReflectionToRef=function(t,i){t.normalize();var n=t.normal.x,r=t.normal.y,o=t.normal.z,a=-2*n,s=-2*r,c=-2*o;e.FromValuesToRef(a*n+1,s*n,c*n,0,a*r,s*r+1,c*r,0,a*o,s*o,c*o+1,0,a*t.d,s*t.d,c*t.d,1,i)},e.FromXYZAxesToRef=function(t,i,n,r){e.FromValuesToRef(t._x,t._y,t._z,0,i._x,i._y,i._z,0,n._x,n._y,n._z,0,0,0,0,1,r)},e.FromQuaternionToRef=function(e,t){var i=e._x*e._x,n=e._y*e._y,r=e._z*e._z,o=e._x*e._y,a=e._z*e._w,s=e._z*e._x,c=e._y*e._w,l=e._y*e._z,u=e._x*e._w;t._m[0]=1-2*(n+r),t._m[1]=2*(o+a),t._m[2]=2*(s-c),t._m[3]=0,t._m[4]=2*(o-a),t._m[5]=1-2*(r+i),t._m[6]=2*(l+u),t._m[7]=0,t._m[8]=2*(s+c),t._m[9]=2*(l-u),t._m[10]=1-2*(n+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t._markAsUpdated()},e._updateFlagSeed=0,e._identityReadOnly=e.Identity(),e}(),f=function(){function e(){}return e.Vector3=o.a.BuildArray(6,l.Zero),e.Matrix=o.a.BuildArray(2,d.Identity),e.Quaternion=o.a.BuildArray(3,h.Zero),e}(),p=function(){function e(){}return e.Vector2=o.a.BuildArray(3,c.Zero),e.Vector3=o.a.BuildArray(13,l.Zero),e.Vector4=o.a.BuildArray(3,u.Zero),e.Quaternion=o.a.BuildArray(2,h.Zero),e.Matrix=o.a.BuildArray(8,d.Identity),e}();a.a.RegisteredTypes["BABYLON.Vector2"]=c,a.a.RegisteredTypes["BABYLON.Vector3"]=l,a.a.RegisteredTypes["BABYLON.Vector4"]=u,a.a.RegisteredTypes["BABYLON.Matrix"]=d},function(e,t,i){"use strict";i.d(t,"d",function(){return r}),i.d(t,"a",function(){return o}),i.d(t,"c",function(){return a}),i.d(t,"b",function(){return s}),i.d(t,"e",function(){return c}),i.d(t,"f",function(){return l});var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function r(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var o=function(){return(o=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function a(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a}function s(e,t,i,n){return new(i||(i=Promise))(function(r,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function c(e,t){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function l(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var n=Array(e),r=0;for(t=0;t<i;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)n[r]=o[a];return n}Object.create,Object.create},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.ALPHA_DISABLE=0,e.ALPHA_ADD=1,e.ALPHA_COMBINE=2,e.ALPHA_SUBTRACT=3,e.ALPHA_MULTIPLY=4,e.ALPHA_MAXIMIZED=5,e.ALPHA_ONEONE=6,e.ALPHA_PREMULTIPLIED=7,e.ALPHA_PREMULTIPLIED_PORTERDUFF=8,e.ALPHA_INTERPOLATE=9,e.ALPHA_SCREENMODE=10,e.ALPHA_ONEONE_ONEONE=11,e.ALPHA_ALPHATOCOLOR=12,e.ALPHA_REVERSEONEMINUS=13,e.ALPHA_SRC_DSTONEMINUSSRCALPHA=14,e.ALPHA_ONEONE_ONEZERO=15,e.ALPHA_EXCLUSION=16,e.ALPHA_EQUATION_ADD=0,e.ALPHA_EQUATION_SUBSTRACT=1,e.ALPHA_EQUATION_REVERSE_SUBTRACT=2,e.ALPHA_EQUATION_MAX=3,e.ALPHA_EQUATION_MIN=4,e.ALPHA_EQUATION_DARKEN=5,e.DELAYLOADSTATE_NONE=0,e.DELAYLOADSTATE_LOADED=1,e.DELAYLOADSTATE_LOADING=2,e.DELAYLOADSTATE_NOTLOADED=4,e.NEVER=512,e.ALWAYS=519,e.LESS=513,e.EQUAL=514,e.LEQUAL=515,e.GREATER=516,e.GEQUAL=518,e.NOTEQUAL=517,e.KEEP=7680,e.REPLACE=7681,e.INCR=7682,e.DECR=7683,e.INVERT=5386,e.INCR_WRAP=34055,e.DECR_WRAP=34056,e.TEXTURE_CLAMP_ADDRESSMODE=0,e.TEXTURE_WRAP_ADDRESSMODE=1,e.TEXTURE_MIRROR_ADDRESSMODE=2,e.TEXTUREFORMAT_ALPHA=0,e.TEXTUREFORMAT_LUMINANCE=1,e.TEXTUREFORMAT_LUMINANCE_ALPHA=2,e.TEXTUREFORMAT_RGB=4,e.TEXTUREFORMAT_RGBA=5,e.TEXTUREFORMAT_RED=6,e.TEXTUREFORMAT_R=6,e.TEXTUREFORMAT_RG=7,e.TEXTUREFORMAT_RED_INTEGER=8,e.TEXTUREFORMAT_R_INTEGER=8,e.TEXTUREFORMAT_RG_INTEGER=9,e.TEXTUREFORMAT_RGB_INTEGER=10,e.TEXTUREFORMAT_RGBA_INTEGER=11,e.TEXTURETYPE_UNSIGNED_BYTE=0,e.TEXTURETYPE_UNSIGNED_INT=0,e.TEXTURETYPE_FLOAT=1,e.TEXTURETYPE_HALF_FLOAT=2,e.TEXTURETYPE_BYTE=3,e.TEXTURETYPE_SHORT=4,e.TEXTURETYPE_UNSIGNED_SHORT=5,e.TEXTURETYPE_INT=6,e.TEXTURETYPE_UNSIGNED_INTEGER=7,e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8,e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9,e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10,e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11,e.TEXTURETYPE_UNSIGNED_INT_24_8=12,e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13,e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14,e.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15,e.TEXTURE_NEAREST_SAMPLINGMODE=1,e.TEXTURE_NEAREST_NEAREST=1,e.TEXTURE_BILINEAR_SAMPLINGMODE=2,e.TEXTURE_LINEAR_LINEAR=2,e.TEXTURE_TRILINEAR_SAMPLINGMODE=3,e.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3,e.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4,e.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5,e.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6,e.TEXTURE_NEAREST_LINEAR=7,e.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8,e.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,e.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,e.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11,e.TEXTURE_LINEAR_NEAREST=12,e.TEXTURE_EXPLICIT_MODE=0,e.TEXTURE_SPHERICAL_MODE=1,e.TEXTURE_PLANAR_MODE=2,e.TEXTURE_CUBIC_MODE=3,e.TEXTURE_PROJECTION_MODE=4,e.TEXTURE_SKYBOX_MODE=5,e.TEXTURE_INVCUBIC_MODE=6,e.TEXTURE_EQUIRECTANGULAR_MODE=7,e.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8,e.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,e.TEXTURE_FILTERING_QUALITY_OFFLINE=4096,e.TEXTURE_FILTERING_QUALITY_HIGH=64,e.TEXTURE_FILTERING_QUALITY_MEDIUM=16,e.TEXTURE_FILTERING_QUALITY_LOW=8,e.SCALEMODE_FLOOR=1,e.SCALEMODE_NEAREST=2,e.SCALEMODE_CEILING=3,e.MATERIAL_TextureDirtyFlag=1,e.MATERIAL_LightDirtyFlag=2,e.MATERIAL_FresnelDirtyFlag=4,e.MATERIAL_AttributesDirtyFlag=8,e.MATERIAL_MiscDirtyFlag=16,e.MATERIAL_PrePassDirtyFlag=32,e.MATERIAL_AllDirtyFlag=63,e.MATERIAL_TriangleFillMode=0,e.MATERIAL_WireFrameFillMode=1,e.MATERIAL_PointFillMode=2,e.MATERIAL_PointListDrawMode=3,e.MATERIAL_LineListDrawMode=4,e.MATERIAL_LineLoopDrawMode=5,e.MATERIAL_LineStripDrawMode=6,e.MATERIAL_TriangleStripDrawMode=7,e.MATERIAL_TriangleFanDrawMode=8,e.MATERIAL_ClockWiseSideOrientation=0,e.MATERIAL_CounterClockWiseSideOrientation=1,e.ACTION_NothingTrigger=0,e.ACTION_OnPickTrigger=1,e.ACTION_OnLeftPickTrigger=2,e.ACTION_OnRightPickTrigger=3,e.ACTION_OnCenterPickTrigger=4,e.ACTION_OnPickDownTrigger=5,e.ACTION_OnDoublePickTrigger=6,e.ACTION_OnPickUpTrigger=7,e.ACTION_OnPickOutTrigger=16,e.ACTION_OnLongPressTrigger=8,e.ACTION_OnPointerOverTrigger=9,e.ACTION_OnPointerOutTrigger=10,e.ACTION_OnEveryFrameTrigger=11,e.ACTION_OnIntersectionEnterTrigger=12,e.ACTION_OnIntersectionExitTrigger=13,e.ACTION_OnKeyDownTrigger=14,e.ACTION_OnKeyUpTrigger=15,e.PARTICLES_BILLBOARDMODE_Y=2,e.PARTICLES_BILLBOARDMODE_ALL=7,e.PARTICLES_BILLBOARDMODE_STRETCHED=8,e.MESHES_CULLINGSTRATEGY_STANDARD=0,e.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,e.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,e.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,e.SCENELOADER_NO_LOGGING=0,e.SCENELOADER_MINIMAL_LOGGING=1,e.SCENELOADER_SUMMARY_LOGGING=2,e.SCENELOADER_DETAILED_LOGGING=3,e.PREPASS_IRRADIANCE_TEXTURE_TYPE=0,e.PREPASS_POSITION_TEXTURE_TYPE=1,e.PREPASS_VELOCITY_TEXTURE_TYPE=2,e.PREPASS_REFLECTIVITY_TEXTURE_TYPE=3,e.PREPASS_COLOR_TEXTURE_TYPE=4,e.PREPASS_DEPTHNORMAL_TEXTURE_TYPE=5,e.PREPASS_ALBEDO_TEXTURE_TYPE=6,e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return d}),i.d(t,"c",function(){return f}),i.d(t,"m",function(){return p}),i.d(t,"e",function(){return _}),i.d(t,"h",function(){return m}),i.d(t,"n",function(){return g}),i.d(t,"o",function(){return v}),i.d(t,"k",function(){return b}),i.d(t,"g",function(){return y}),i.d(t,"f",function(){return T}),i.d(t,"i",function(){return E}),i.d(t,"l",function(){return S}),i.d(t,"j",function(){return A}),i.d(t,"d",function(){return P}),i.d(t,"a",function(){return C});var n=i(37),r=i(0),o=i(21),a=i(9),s={},c={},l=function(e,t,i){var r=e();n.a&&n.a.AddTagsTo(r,t.tags);var o=u(r);for(var a in o){var s=o[a],c=t[a],l=s.type;if(null!=c&&"uniqueId"!==a)switch(l){case 0:case 6:case 11:r[a]=c;break;case 1:r[a]=i||c.isRenderTarget?c:c.clone();break;case 2:case 3:case 4:case 5:case 7:case 10:case 12:r[a]=i?c:c.clone()}}return r};function u(e){var t=e.getClassName();if(c[t])return c[t];c[t]={};for(var i=c[t],n=e,r=t;r;){var o=s[r];for(var a in o)i[a]=o[a];var l=void 0,u=!1;do{if(!(l=Object.getPrototypeOf(n)).getClassName){u=!0;break}if(l.getClassName()!==r)break;n=l}while(l);if(u)break;r=l.getClassName(),n=l}return i}function h(e,t){return function(i,n){var r=function(e){var t=i.getClassName();return s[t]||(s[t]={}),s[t]}();r[n]||(r[n]={type:e,sourceName:t})}}function d(e,t){return void 0===t&&(t=null),function(e,t){return void 0===t&&(t=null),function(i,n){var r=t||"_"+n;Object.defineProperty(i,n,{get:function(){return this[r]},set:function(t){this[r]!==t&&(this[r]=t,i[e].apply(this))},enumerable:!0,configurable:!0})}}(e,t)}function f(e){return h(0,e)}function p(e){return h(1,e)}function _(e){return h(2,e)}function m(e){return h(3,e)}function g(e){return h(4,e)}function v(e){return h(5,e)}function b(e){return h(6,e)}function y(e){return h(7,e)}function T(e){return h(8,e)}function E(e){return h(9,e)}function S(e){return h(10,e)}function A(e){return h(12,e)}function P(e){return h(11,e)}var C=function(){function e(){}return e.AppendSerializedAnimations=function(e,t){if(e.animations){t.animations=[];for(var i=0;i<e.animations.length;i++){var n=e.animations[i];t.animations.push(n.serialize())}}},e.Serialize=function(e,t){t||(t={}),n.a&&(t.tags=n.a.GetTags(e));var i=u(e);for(var r in i){var o=i[r],a=o.sourceName||r,s=o.type,c=e[r];if(null!=c&&"uniqueId"!==r)switch(s){case 0:t[a]=c;break;case 1:t[a]=c.serialize();break;case 2:t[a]=c.asArray();break;case 3:t[a]=c.serialize();break;case 4:case 5:t[a]=c.asArray();break;case 6:t[a]=c.id;break;case 7:t[a]=c.serialize();break;case 8:t[a]=c.asArray();break;case 9:t[a]=c.serialize();break;case 10:t[a]=c.asArray();break;case 11:t[a]=c.id;case 12:t[a]=c.asArray()}}return t},e.Parse=function(t,i,o,s){void 0===s&&(s=null);var c=t();s||(s=""),n.a&&n.a.AddTagsTo(c,i.tags);var l=u(c);for(var h in l){var d=l[h],f=i[d.sourceName||h],p=d.type;if(null!=f&&"uniqueId"!==h){var _=c;switch(p){case 0:_[h]=f;break;case 1:o&&(_[h]=e._TextureParser(f,o,s));break;case 2:_[h]=a.a.FromArray(f);break;case 3:_[h]=e._FresnelParametersParser(f);break;case 4:_[h]=r.d.FromArray(f);break;case 5:_[h]=r.e.FromArray(f);break;case 6:o&&(_[h]=o.getLastMeshByID(f));break;case 7:_[h]=e._ColorCurvesParser(f);break;case 8:_[h]=a.b.FromArray(f);break;case 9:_[h]=e._ImageProcessingConfigurationParser(f);break;case 10:_[h]=r.b.FromArray(f);break;case 11:o&&(_[h]=o.getCameraByID(f));case 12:_[h]=r.a.FromArray(f)}}}return c},e.Clone=function(e,t){return l(e,t,!1)},e.Instanciate=function(e,t){return l(e,t,!0)},e._ImageProcessingConfigurationParser=function(e){throw o.a.WarnImport("ImageProcessingConfiguration")},e._FresnelParametersParser=function(e){throw o.a.WarnImport("FresnelParameters")},e._ColorCurvesParser=function(e){throw o.a.WarnImport("ColorCurves")},e._TextureParser=function(e,t,i){throw o.a.WarnImport("Texture")},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return r});var n=function(){function e(e,t,i,n,r,o,a,s){void 0===n&&(n=0),void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===a&&(a=!1),this._isAlreadyOwned=!1,e.getScene?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=i,this._instanced=o,this._divisor=s||1,this._data=t,this.byteStride=a?n:n*Float32Array.BYTES_PER_ELEMENT,r||this.create()}return e.prototype.createVertexBuffer=function(e,t,i,n,o,a,s){void 0===a&&(a=!1);var c=a?t:t*Float32Array.BYTES_PER_ELEMENT,l=n?a?n:n*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new r(this._engine,this,e,this._updatable,!0,l,void 0===o?this._instanced:o,c,i,void 0,void 0,!0,this._divisor||s)},e.prototype.isUpdatable=function(){return this._updatable},e.prototype.getData=function(){return this._data},e.prototype.getBuffer=function(){return this._buffer},e.prototype.getStrideSize=function(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT},e.prototype.create=function(e){void 0===e&&(e=null),!e&&this._buffer||(e=e||this._data)&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e),this._data=e):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(e),this._data=e):this._buffer=this._engine.createVertexBuffer(e))},e.prototype._rebuild=function(){this._buffer=null,this.create(this._data)},e.prototype.update=function(e){this.create(e)},e.prototype.updateDirectly=function(e,t,i,n){void 0===n&&(n=!1),this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,n?t:t*Float32Array.BYTES_PER_ELEMENT,i?i*this.byteStride:void 0),this._data=null)},e.prototype._increaseReferences=function(){this._buffer&&(this._isAlreadyOwned?this._buffer.references++:this._isAlreadyOwned=!0)},e.prototype.dispose=function(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)},e}(),r=function(){function e(t,i,r,o,a,s,c,l,u,h,d,f,p,_){if(void 0===d&&(d=!1),void 0===f&&(f=!1),void 0===p&&(p=1),void 0===_&&(_=!1),i instanceof n?(this._buffer=i,this._ownsBuffer=_,_&&this._buffer._increaseReferences()):(this._buffer=new n(t,i,o,s,a,c,f),this._ownsBuffer=!0),this._kind=r,null==h){var m=this.getData();this.type=e.FLOAT,m instanceof Int8Array?this.type=e.BYTE:m instanceof Uint8Array?this.type=e.UNSIGNED_BYTE:m instanceof Int16Array?this.type=e.SHORT:m instanceof Uint16Array?this.type=e.UNSIGNED_SHORT:m instanceof Int32Array?this.type=e.INT:m instanceof Uint32Array&&(this.type=e.UNSIGNED_INT)}else this.type=h;var g=e.GetTypeByteLength(this.type);f?(this._size=u||(s?s/g:e.DeduceStride(r)),this.byteStride=s||this._buffer.byteStride||this._size*g,this.byteOffset=l||0):(this._size=u||s||e.DeduceStride(r),this.byteStride=s?s*g:this._buffer.byteStride||this._size*g,this.byteOffset=(l||0)*g),this.normalized=d,this._instanced=void 0!==c&&c,this._instanceDivisor=c?p:0}return Object.defineProperty(e.prototype,"instanceDivisor",{get:function(){return this._instanceDivisor},set:function(e){this._instanceDivisor=e,this._instanced=0!=e},enumerable:!1,configurable:!0}),e.prototype._rebuild=function(){this._buffer&&this._buffer._rebuild()},e.prototype.getKind=function(){return this._kind},e.prototype.isUpdatable=function(){return this._buffer.isUpdatable()},e.prototype.getData=function(){return this._buffer.getData()},e.prototype.getBuffer=function(){return this._buffer.getBuffer()},e.prototype.getStrideSize=function(){return this.byteStride/e.GetTypeByteLength(this.type)},e.prototype.getOffset=function(){return this.byteOffset/e.GetTypeByteLength(this.type)},e.prototype.getSize=function(){return this._size},e.prototype.getIsInstanced=function(){return this._instanced},e.prototype.getInstanceDivisor=function(){return this._instanceDivisor},e.prototype.create=function(e){this._buffer.create(e)},e.prototype.update=function(e){this._buffer.update(e)},e.prototype.updateDirectly=function(e,t,i){void 0===i&&(i=!1),this._buffer.updateDirectly(e,t,void 0,i)},e.prototype.dispose=function(){this._ownsBuffer&&this._buffer.dispose()},e.prototype.forEach=function(t,i){e.ForEach(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,t,this.normalized,i)},e.DeduceStride=function(t){switch(t){case e.UVKind:case e.UV2Kind:case e.UV3Kind:case e.UV4Kind:case e.UV5Kind:case e.UV6Kind:return 2;case e.NormalKind:case e.PositionKind:return 3;case e.ColorKind:case e.MatricesIndicesKind:case e.MatricesIndicesExtraKind:case e.MatricesWeightsKind:case e.MatricesWeightsExtraKind:case e.TangentKind:return 4;default:throw new Error("Invalid kind '"+t+"'")}},e.GetTypeByteLength=function(t){switch(t){case e.BYTE:case e.UNSIGNED_BYTE:return 1;case e.SHORT:case e.UNSIGNED_SHORT:return 2;case e.INT:case e.UNSIGNED_INT:case e.FLOAT:return 4;default:throw new Error("Invalid type '"+t+"'")}},e.ForEach=function(t,i,n,r,o,a,s,c){if(t instanceof Array)for(var l=i/4,u=n/4,h=0;h<a;h+=r){for(var d=0;d<r;d++)c(t[l+d],h+d);l+=u}else{var f=t instanceof ArrayBuffer?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),p=e.GetTypeByteLength(o);for(h=0;h<a;h+=r){var _=i;for(d=0;d<r;d++)c(e._GetFloatValue(f,o,_,s),h+d),_+=p;i+=n}}},e._GetFloatValue=function(t,i,n,r){switch(i){case e.BYTE:var o=t.getInt8(n);return r&&(o=Math.max(o/127,-1)),o;case e.UNSIGNED_BYTE:return o=t.getUint8(n),r&&(o/=255),o;case e.SHORT:return o=t.getInt16(n,!0),r&&(o=Math.max(o/32767,-1)),o;case e.UNSIGNED_SHORT:return o=t.getUint16(n,!0),r&&(o/=65535),o;case e.INT:return t.getInt32(n,!0);case e.UNSIGNED_INT:return t.getUint32(n,!0);case e.FLOAT:return t.getFloat32(n,!0);default:throw new Error("Invalid component type "+i)}},e.BYTE=5120,e.UNSIGNED_BYTE=5121,e.SHORT=5122,e.UNSIGNED_SHORT=5123,e.INT=5124,e.UNSIGNED_INT=5125,e.FLOAT=5126,e.PositionKind="position",e.NormalKind="normal",e.TangentKind="tangent",e.UVKind="uv",e.UV2Kind="uv2",e.UV3Kind="uv3",e.UV4Kind="uv4",e.UV5Kind="uv5",e.UV6Kind="uv6",e.ColorKind="color",e.MatricesIndicesKind="matricesIndices",e.MatricesWeightsKind="matricesWeights",e.MatricesIndicesExtraKind="matricesIndicesExtra",e.MatricesWeightsExtraKind="matricesWeightsExtra",e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var n=i(6),r=i(2),o=i(38),a=i(8),s=i(128),c=function(){function e(t,i,r,a,c,l,u,h,d,f){var p,_=this;void 0===a&&(a=null),void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=null),void 0===d&&(d=null),this.name=null,this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new n.c,this.onErrorObservable=new n.c,this._onBindObservable=null,this._wasPreviouslyReady=!1,this._bonesComputationForcedToCPU=!1,this._multiTarget=!1,this._uniformBuffersNames={},this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._rawVertexSourceCode="",this._rawFragmentSourceCode="",this._pipelineContext=null,this._valueCache={},this.name=t;var m,g,v=null;if(i.attributes){var b=i;if(this._engine=r,this._attributesNames=b.attributes,this._uniformsNames=b.uniformsNames.concat(b.samplers),this._samplerList=b.samplers.slice(),this.defines=b.defines,this.onError=b.onError,this.onCompiled=b.onCompiled,this._fallbacks=b.fallbacks,this._indexParameters=b.indexParameters,this._transformFeedbackVaryings=b.transformFeedbackVaryings||null,this._multiTarget=!!b.multiTarget,b.uniformBuffersNames){this._uniformBuffersNamesList=b.uniformBuffersNames.slice();for(var y=0;y<b.uniformBuffersNames.length;y++)this._uniformBuffersNames[b.uniformBuffersNames[y]]=y}v=null!==(p=b.processFinalCode)&&void 0!==p?p:null}else this._engine=c,this.defines=null==l?"":l,this._uniformsNames=r.concat(a),this._samplerList=a?a.slice():[],this._attributesNames=i,this._uniformBuffersNamesList=[],this.onError=d,this.onCompiled=h,this._indexParameters=f,this._fallbacks=u;this._attributeLocationByName={},this.uniqueId=e._uniqueIdSeed++;var T=o.a.IsWindowObjectExist()?this._engine.getHostDocument():null;t.vertexSource?m="source:"+t.vertexSource:t.vertexElement?(m=T?T.getElementById(t.vertexElement):null)||(m=t.vertexElement):m=t.vertex||t,t.fragmentSource?g="source:"+t.fragmentSource:t.fragmentElement?(g=T?T.getElementById(t.fragmentElement):null)||(g=t.fragmentElement):g=t.fragment||t;var E={defines:this.defines.split("\n"),indexParameters:this._indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:this._engine._shaderProcessor,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:e.ShadersRepository,includesShadersStore:e.IncludesShadersStore,version:(100*this._engine.webGLVersion).toString(),platformName:this._engine.webGLVersion>=2?"WEBGL2":"WEBGL1"};this._loadShader(m,"Vertex","",function(e){_._rawVertexSourceCode=e,_._loadShader(g,"Fragment","Pixel",function(i){_._rawFragmentSourceCode=i,s.a.Process(e,E,function(e){v&&(e=v("vertex",e)),E.isFragment=!0,s.a.Process(i,E,function(i){v&&(i=v("fragment",i)),_._useFinalCode(e,i,t)},_._engine)},_._engine)})})}return Object.defineProperty(e.prototype,"onBindObservable",{get:function(){return this._onBindObservable||(this._onBindObservable=new n.c),this._onBindObservable},enumerable:!1,configurable:!0}),e.prototype._useFinalCode=function(e,t,i){if(i){var n=i.vertexElement||i.vertex||i.spectorName||i,r=i.fragmentElement||i.fragment||i.spectorName||i;this._vertexSourceCode="#define SHADER_NAME vertex:"+n+"\n"+e,this._fragmentSourceCode="#define SHADER_NAME fragment:"+r+"\n"+t}else this._vertexSourceCode=e,this._fragmentSourceCode=t;this._prepareEffect()},Object.defineProperty(e.prototype,"key",{get:function(){return this._key},enumerable:!1,configurable:!0}),e.prototype.isReady=function(){try{return this._isReadyInternal()}catch(e){return!1}},e.prototype._isReadyInternal=function(){return!!this._isReady||!!this._pipelineContext&&this._pipelineContext.isReady},e.prototype.getEngine=function(){return this._engine},e.prototype.getPipelineContext=function(){return this._pipelineContext},e.prototype.getAttributesNames=function(){return this._attributesNames},e.prototype.getAttributeLocation=function(e){return this._attributes[e]},e.prototype.getAttributeLocationByName=function(e){return this._attributeLocationByName[e]},e.prototype.getAttributesCount=function(){return this._attributes.length},e.prototype.getUniformIndex=function(e){return this._uniformsNames.indexOf(e)},e.prototype.getUniform=function(e){return this._uniforms[e]},e.prototype.getSamplers=function(){return this._samplerList},e.prototype.getUniformNames=function(){return this._uniformsNames},e.prototype.getUniformBuffersNames=function(){return this._uniformBuffersNamesList},e.prototype.getIndexParameters=function(){return this._indexParameters},e.prototype.getCompilationError=function(){return this._compilationError},e.prototype.allFallbacksProcessed=function(){return this._allFallbacksProcessed},e.prototype.executeWhenCompiled=function(e){var t=this;this.isReady()?e(this):(this.onCompileObservable.add(function(t){e(t)}),this._pipelineContext&&!this._pipelineContext.isAsync||setTimeout(function(){t._checkIsReady(null)},16))},e.prototype._checkIsReady=function(e){var t=this;try{if(this._isReadyInternal())return}catch(t){return void this._processCompilationErrors(t,e)}setTimeout(function(){t._checkIsReady(e)},16)},e.prototype._loadShader=function(t,i,n,r){var a;"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?r(o.a.GetDOMTextContent(t)):"source:"!==t.substr(0,7)?"base64:"!==t.substr(0,7)?e.ShadersStore[t+i+"Shader"]?r(e.ShadersStore[t+i+"Shader"]):n&&e.ShadersStore[t+n+"Shader"]?r(e.ShadersStore[t+n+"Shader"]):(a="."===t[0]||"/"===t[0]||t.indexOf("http")>-1?t:e.ShadersRepository+t,this._engine._loadFile(a+"."+i.toLowerCase()+".fx",r)):r(window.atob(t.substr(7))):r(t.substr(7))},Object.defineProperty(e.prototype,"vertexSourceCode",{get:function(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:this._vertexSourceCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fragmentSourceCode",{get:function(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:this._fragmentSourceCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawVertexSourceCode",{get:function(){return this._rawVertexSourceCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawFragmentSourceCode",{get:function(){return this._rawFragmentSourceCode},enumerable:!1,configurable:!0}),e.prototype._rebuildProgram=function(e,t,i,n){var o=this;this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=function(e,t){n&&n(t)},this.onCompiled=function(){var e=o.getEngine().scenes;if(e)for(var t=0;t<e.length;t++)e[t].markAllMaterialsAsDirty(r.a.MATERIAL_AllDirtyFlag);o._pipelineContext._handlesSpectorRebuildCallback(i)},this._fallbacks=null,this._prepareEffect()},e.prototype._prepareEffect=function(){var e=this,t=this._attributesNames,i=this.defines;this._valueCache={};var n=this._pipelineContext;try{var r=this._engine;this._pipelineContext=r.createPipelineContext();var o=this._rebuildProgram.bind(this);this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?r._preparePipelineContext(this._pipelineContext,this._vertexSourceCodeOverride,this._fragmentSourceCodeOverride,!0,o,null,this._transformFeedbackVaryings):r._preparePipelineContext(this._pipelineContext,this._vertexSourceCode,this._fragmentSourceCode,!1,o,i,this._transformFeedbackVaryings),r._executeWhenRenderingStateIsCompiled(this._pipelineContext,function(){if(r.supportsUniformBuffers)for(var i in e._uniformBuffersNames)e.bindUniformBlock(i,e._uniformBuffersNames[i]);var o;if(r.getUniforms(e._pipelineContext,e._uniformsNames).forEach(function(t,i){e._uniforms[e._uniformsNames[i]]=t}),e._attributes=r.getAttributes(e._pipelineContext,t),t)for(var a=0;a<t.length;a++){var s=t[a];e._attributeLocationByName[s]=e._attributes[a]}for(o=0;o<e._samplerList.length;o++)null==e.getUniform(e._samplerList[o])&&(e._samplerList.splice(o,1),o--);e._samplerList.forEach(function(t,i){e._samplers[t]=i}),r.bindSamplers(e),e._compilationError="",e._isReady=!0,e.onCompiled&&e.onCompiled(e),e.onCompileObservable.notifyObservers(e),e.onCompileObservable.clear(),e._fallbacks&&e._fallbacks.unBindMesh(),n&&e.getEngine()._deletePipelineContext(n)}),this._pipelineContext.isAsync&&this._checkIsReady(n)}catch(e){this._processCompilationErrors(e,n)}},e.prototype._getShaderCodeAndErrorLine=function(e,t,i){var n=i?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/,r=null;if(t&&e){var o=t.match(n);if(o&&2===o.length){var a=parseInt(o[1]),s=e.split("\n",-1);s.length>=a&&(r="Offending line ["+a+"] in "+(i?"fragment":"vertex")+" code: "+s[a-1])}}return[e,r]},e.prototype._processCompilationErrors=function(t,i){var n,r,o,s,c;void 0===i&&(i=null),this._compilationError=t.message;var l=this._attributesNames,u=this._fallbacks;if(a.a.Error("Unable to compile effect:"),a.a.Error("Uniforms: "+this._uniformsNames.map(function(e){return" "+e})),a.a.Error("Attributes: "+l.map(function(e){return" "+e})),a.a.Error("Defines:\r\n"+this.defines),e.LogShaderCodeOnCompilationError){var h=null,d=null,f=null;(null===(o=this._pipelineContext)||void 0===o?void 0:o._getVertexShaderCode())&&(f=(n=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1))[0],h=n[1],f&&(a.a.Error("Vertex code:"),a.a.Error(f))),(null===(s=this._pipelineContext)||void 0===s?void 0:s._getFragmentShaderCode())&&(f=(r=this._getShaderCodeAndErrorLine(null===(c=this._pipelineContext)||void 0===c?void 0:c._getFragmentShaderCode(),this._compilationError,!0))[0],d=r[1],f&&(a.a.Error("Fragment code:"),a.a.Error(f))),h&&a.a.Error(h),d&&a.a.Error(d)}a.a.Error("Error: "+this._compilationError),i&&(this._pipelineContext=i,this._isReady=!0,this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this)),u?(this._pipelineContext=null,u.hasMoreFallbacks?(this._allFallbacksProcessed=!1,a.a.Error("Trying next fallback."),this.defines=u.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):this._allFallbacksProcessed=!0},Object.defineProperty(e.prototype,"isSupported",{get:function(){return""===this._compilationError},enumerable:!1,configurable:!0}),e.prototype._bindTexture=function(e,t){this._engine._bindTexture(this._samplers[e],t)},e.prototype.setTexture=function(e,t){this._engine.setTexture(this._samplers[e],this._uniforms[e],t)},e.prototype.setDepthStencilTexture=function(e,t){this._engine.setDepthStencilTexture(this._samplers[e],this._uniforms[e],t)},e.prototype.setTextureArray=function(e,t){var i=e+"Ex";if(-1===this._samplerList.indexOf(i+"0")){for(var n=this._samplerList.indexOf(e),r=1;r<t.length;r++){var o=i+(r-1).toString();this._samplerList.splice(n+r,0,o)}for(var a=0,s=0,c=this._samplerList;s<c.length;s++){var l=c[s];this._samplers[l]=a,a+=1}}this._engine.setTextureArray(this._samplers[e],this._uniforms[e],t)},e.prototype.setTextureFromPostProcess=function(e,t){this._engine.setTextureFromPostProcess(this._samplers[e],t)},e.prototype.setTextureFromPostProcessOutput=function(e,t){this._engine.setTextureFromPostProcessOutput(this._samplers[e],t)},e.prototype._cacheMatrix=function(e,t){var i=this._valueCache[e],n=t.updateFlag;return(void 0===i||i!==n)&&(this._valueCache[e]=n,!0)},e.prototype._cacheFloat2=function(e,t,i){var n=this._valueCache[e];if(!n||2!==n.length)return n=[t,i],this._valueCache[e]=n,!0;var r=!1;return n[0]!==t&&(n[0]=t,r=!0),n[1]!==i&&(n[1]=i,r=!0),r},e.prototype._cacheFloat3=function(e,t,i,n){var r=this._valueCache[e];if(!r||3!==r.length)return r=[t,i,n],this._valueCache[e]=r,!0;var o=!1;return r[0]!==t&&(r[0]=t,o=!0),r[1]!==i&&(r[1]=i,o=!0),r[2]!==n&&(r[2]=n,o=!0),o},e.prototype._cacheFloat4=function(e,t,i,n,r){var o=this._valueCache[e];if(!o||4!==o.length)return o=[t,i,n,r],this._valueCache[e]=o,!0;var a=!1;return o[0]!==t&&(o[0]=t,a=!0),o[1]!==i&&(o[1]=i,a=!0),o[2]!==n&&(o[2]=n,a=!0),o[3]!==r&&(o[3]=r,a=!0),a},e.prototype.bindUniformBuffer=function(t,i){var n=this._uniformBuffersNames[i];void 0!==n&&e._baseCache[n]!==t&&(e._baseCache[n]=t,this._engine.bindUniformBufferBase(t,n))},e.prototype.bindUniformBlock=function(e,t){this._engine.bindUniformBlock(this._pipelineContext,e,t)},e.prototype.setInt=function(e,t){var i=this._valueCache[e];return void 0!==i&&i===t||this._engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t),this},e.prototype.setIntArray=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray(this._uniforms[e],t),this},e.prototype.setIntArray2=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray2(this._uniforms[e],t),this},e.prototype.setIntArray3=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray3(this._uniforms[e],t),this},e.prototype.setIntArray4=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray4(this._uniforms[e],t),this},e.prototype.setFloatArray=function(e,t){return this._valueCache[e]=null,this._engine.setArray(this._uniforms[e],t),this},e.prototype.setFloatArray2=function(e,t){return this._valueCache[e]=null,this._engine.setArray2(this._uniforms[e],t),this},e.prototype.setFloatArray3=function(e,t){return this._valueCache[e]=null,this._engine.setArray3(this._uniforms[e],t),this},e.prototype.setFloatArray4=function(e,t){return this._valueCache[e]=null,this._engine.setArray4(this._uniforms[e],t),this},e.prototype.setArray=function(e,t){return this._valueCache[e]=null,this._engine.setArray(this._uniforms[e],t),this},e.prototype.setArray2=function(e,t){return this._valueCache[e]=null,this._engine.setArray2(this._uniforms[e],t),this},e.prototype.setArray3=function(e,t){return this._valueCache[e]=null,this._engine.setArray3(this._uniforms[e],t),this},e.prototype.setArray4=function(e,t){return this._valueCache[e]=null,this._engine.setArray4(this._uniforms[e],t),this},e.prototype.setMatrices=function(e,t){return t?(this._valueCache[e]=null,this._engine.setMatrices(this._uniforms[e],t),this):this},e.prototype.setMatrix=function(e,t){return this._cacheMatrix(e,t)&&(this._engine.setMatrices(this._uniforms[e],t.toArray())||(this._valueCache[e]=null)),this},e.prototype.setMatrix3x3=function(e,t){return this._valueCache[e]=null,this._engine.setMatrix3x3(this._uniforms[e],t),this},e.prototype.setMatrix2x2=function(e,t){return this._valueCache[e]=null,this._engine.setMatrix2x2(this._uniforms[e],t),this},e.prototype.setFloat=function(e,t){var i=this._valueCache[e];return void 0!==i&&i===t||this._engine.setFloat(this._uniforms[e],t)&&(this._valueCache[e]=t),this},e.prototype.setBool=function(e,t){var i=this._valueCache[e];return void 0!==i&&i===t||this._engine.setInt(this._uniforms[e],t?1:0)&&(this._valueCache[e]=t),this},e.prototype.setVector2=function(e,t){return this._cacheFloat2(e,t.x,t.y)&&(this._engine.setFloat2(this._uniforms[e],t.x,t.y)||(this._valueCache[e]=null)),this},e.prototype.setFloat2=function(e,t,i){return this._cacheFloat2(e,t,i)&&(this._engine.setFloat2(this._uniforms[e],t,i)||(this._valueCache[e]=null)),this},e.prototype.setVector3=function(e,t){return this._cacheFloat3(e,t.x,t.y,t.z)&&(this._engine.setFloat3(this._uniforms[e],t.x,t.y,t.z)||(this._valueCache[e]=null)),this},e.prototype.setFloat3=function(e,t,i,n){return this._cacheFloat3(e,t,i,n)&&(this._engine.setFloat3(this._uniforms[e],t,i,n)||(this._valueCache[e]=null)),this},e.prototype.setVector4=function(e,t){return this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this._engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null)),this},e.prototype.setFloat4=function(e,t,i,n,r){return this._cacheFloat4(e,t,i,n,r)&&(this._engine.setFloat4(this._uniforms[e],t,i,n,r)||(this._valueCache[e]=null)),this},e.prototype.setColor3=function(e,t){return this._cacheFloat3(e,t.r,t.g,t.b)&&(this._engine.setFloat3(this._uniforms[e],t.r,t.g,t.b)||(this._valueCache[e]=null)),this},e.prototype.setColor4=function(e,t,i){return this._cacheFloat4(e,t.r,t.g,t.b,i)&&(this._engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,i)||(this._valueCache[e]=null)),this},e.prototype.setDirectColor4=function(e,t){return this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&(this._engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a)||(this._valueCache[e]=null)),this},e.prototype.dispose=function(){this._engine._releaseEffect(this)},e.RegisterShader=function(t,i,n){i&&(e.ShadersStore[t+"PixelShader"]=i),n&&(e.ShadersStore[t+"VertexShader"]=n)},e.ResetCache=function(){e._baseCache={}},e.ShadersRepository="src/Shaders/",e.LogShaderCodeOnCompilationError=!0,e._uniqueIdSeed=0,e._baseCache={},e.ShadersStore={},e.IncludesShadersStore={},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"d",function(){return r}),i.d(t,"b",function(){return o}),i.d(t,"c",function(){return a});var n=function(){function e(e,t,i,n){void 0===t&&(t=!1),this.initalize(e,t,i,n)}return e.prototype.initalize=function(e,t,i,n){return void 0===t&&(t=!1),this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=n,this},e}(),r=function(e,t,i){void 0===i&&(i=null),this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1},o=function(){function e(){}return e.prototype.dispose=function(){if(this._observers&&this._observables)for(var e=0;e<this._observers.length;e++)this._observables[e].remove(this._observers[e]);this._observers=null,this._observables=null},e.Watch=function(t,i,n,r){void 0===n&&(n=-1),void 0===r&&(r=null);var o=new e;o._observers=new Array,o._observables=t;for(var a=0,s=t;a<s.length;a++){var c=s[a].add(i,n,!1,r);c&&o._observers.push(c)}return o},e}(),a=function(){function e(e){this._observers=new Array,this._eventState=new n(0),e&&(this._onObserverAdded=e)}return Object.defineProperty(e.prototype,"observers",{get:function(){return this._observers},enumerable:!1,configurable:!0}),e.prototype.add=function(e,t,i,n,o){if(void 0===t&&(t=-1),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===o&&(o=!1),!e)return null;var a=new r(e,t,n);return a.unregisterOnNextCall=o,i?this._observers.unshift(a):this._observers.push(a),this._onObserverAdded&&this._onObserverAdded(a),a},e.prototype.addOnce=function(e){return this.add(e,void 0,void 0,void 0,!0)},e.prototype.remove=function(e){return!!e&&-1!==this._observers.indexOf(e)&&(this._deferUnregister(e),!0)},e.prototype.removeCallback=function(e,t){for(var i=0;i<this._observers.length;i++){var n=this._observers[i];if(!(n._willBeUnregistered||n.callback!==e||t&&t!==n.scope))return this._deferUnregister(n),!0}return!1},e.prototype._deferUnregister=function(e){var t=this;e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(function(){t._remove(e)},0)},e.prototype._remove=function(e){if(!e)return!1;var t=this._observers.indexOf(e);return-1!==t&&(this._observers.splice(t,1),!0)},e.prototype.makeObserverTopPriority=function(e){this._remove(e),this._observers.unshift(e)},e.prototype.makeObserverBottomPriority=function(e){this._remove(e),this._observers.push(e)},e.prototype.notifyObservers=function(e,t,i,n,r){if(void 0===t&&(t=-1),!this._observers.length)return!0;var o=this._eventState;o.mask=t,o.target=i,o.currentTarget=n,o.skipNextObservers=!1,o.lastReturnValue=e,o.userInfo=r;for(var a=0,s=this._observers;a<s.length;a++){var c=s[a];if(!c._willBeUnregistered&&(c.mask&t&&(c.scope?o.lastReturnValue=c.callback.apply(c.scope,[e,o]):o.lastReturnValue=c.callback(e,o),c.unregisterOnNextCall&&this._deferUnregister(c)),o.skipNextObservers))return!1}return!0},e.prototype.notifyObserversWithPromise=function(e,t,i,n,r){var o=this;void 0===t&&(t=-1);var a=Promise.resolve(e);if(!this._observers.length)return a;var s=this._eventState;return s.mask=t,s.target=i,s.currentTarget=n,s.skipNextObservers=!1,s.userInfo=r,this._observers.forEach(function(i){s.skipNextObservers||i._willBeUnregistered||i.mask&t&&(a=i.scope?a.then(function(t){return s.lastReturnValue=t,i.callback.apply(i.scope,[e,s])}):a.then(function(t){return s.lastReturnValue=t,i.callback(e,s)}),i.unregisterOnNextCall&&o._deferUnregister(i))}),a.then(function(){return e})},e.prototype.notifyObserver=function(e,t,i){void 0===i&&(i=-1);var n=this._eventState;n.mask=i,n.skipNextObservers=!1,e.callback(t,n)},e.prototype.hasObservers=function(){return this._observers.length>0},e.prototype.clear=function(){this._observers=new Array,this._onObserverAdded=null},e.prototype.clone=function(){var t=new e;return t._observers=this._observers.slice(0),t},e.prototype.hasSpecificMask=function(e){void 0===e&&(e=-1);for(var t=0,i=this._observers;t<i.length;t++){var n=i[t];if(n.mask&e||n.mask===e)return!0}return!1},e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return x}),i.d(t,"c",function(){return M}),i.d(t,"a",function(){return N});var n=i(1),r=i(6),o=i(12),a=i(41),s=i(37),c=i(0),l=i(9),u=i(29),h=i(4),d=i(16),f=i(71),p=i(31),_=i(61),m=i(43),g=i(25),v=i(68),b=i(69),y=i(2),T=i(3),E=i(8),S=i(11),A=i(21),P=i(17),C=i(149),R=i(70),x=function(){},O=function(){this.visibleInstances={},this.batchCache=new M,this.instancesBufferSize=2048},M=function(){this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=new Array,this.hardwareInstancedRendering=new Array},I=function(){this.instancesCount=0,this.matrixBuffer=null,this.matrixBufferSize=512,this.boundingVectors=[],this.worldMatrices=null},D=function(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=new Array,this._morphTargetManager=null},N=function(e){function t(i,n,r,o,c,l){void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=null),void 0===l&&(l=!0);var u=e.call(this,i,n)||this;if(u._internalMeshDataInfo=new D,u.delayLoadState=y.a.DELAYLOADSTATE_NONE,u.instances=new Array,u._creationDataStorage=null,u._geometry=null,u._instanceDataStorage=new O,u._thinInstanceDataStorage=new I,u._effectiveMaterial=null,u._shouldGenerateFlatShading=!1,u._originalBuilderSideOrientation=t.DEFAULTSIDE,u.overrideMaterialSideOrientation=null,n=u.getScene(),o){if(o._geometry&&o._geometry.applyToMesh(u),a.a.DeepCopy(o,u,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","source","worldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap"],["_poseMatrix"]),u._internalMeshDataInfo._source=o,n.useClonedMeshMap&&(o._internalMeshDataInfo.meshMap||(o._internalMeshDataInfo.meshMap={}),o._internalMeshDataInfo.meshMap[u.uniqueId]=u),u._originalBuilderSideOrientation=o._originalBuilderSideOrientation,u._creationDataStorage=o._creationDataStorage,o._ranges){var h=o._ranges;for(var i in h)h.hasOwnProperty(i)&&h[i]&&u.createAnimationRange(i,h[i].from,h[i].to)}var d;if(o.metadata&&o.metadata.clone?u.metadata=o.metadata.clone():u.metadata=o.metadata,s.a&&s.a.HasTags(o)&&s.a.AddTagsTo(u,s.a.GetTags(o,!0)),u.setEnabled(o.isEnabled()),u.parent=o.parent,u.setPivotMatrix(o.getPivotMatrix()),u.id=i+"."+o.id,u.material=o.material,!c)for(var f=o.getDescendants(!0),p=0;p<f.length;p++){var _=f[p];_.clone&&_.clone(i+"."+_.name,u)}if(o.morphTargetManager&&(u.morphTargetManager=o.morphTargetManager),n.getPhysicsEngine){var m=n.getPhysicsEngine();if(l&&m){var g=m.getImpostorForPhysicsObject(o);g&&(u.physicsImpostor=g.clone(u))}}for(d=0;d<n.particleSystems.length;d++){var v=n.particleSystems[d];v.emitter===o&&v.clone(v.name,u)}u.refreshBoundingInfo(),u.computeWorldMatrix(!0)}return null!==r&&(u.parent=r),u._instanceDataStorage.hardwareInstancedRendering=u.getEngine().getCaps().instancedArrays,u}return Object(n.d)(t,e),t._GetDefaultSideOrientation=function(e){return e||t.FRONTSIDE},Object.defineProperty(t.prototype,"computeBonesUsingShaders",{get:function(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders},set:function(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(h.b.PositionKind,this._internalMeshDataInfo._sourcePositions.slice(),!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(h.b.NormalKind,this._internalMeshDataInfo._sourceNormals.slice(),!0)),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeRenderObservable",{get:function(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new r.c),this._internalMeshDataInfo._onBeforeRenderObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeBindObservable",{get:function(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new r.c),this._internalMeshDataInfo._onBeforeBindObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAfterRenderObservable",{get:function(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new r.c),this._internalMeshDataInfo._onAfterRenderObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeDrawObservable",{get:function(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new r.c),this._internalMeshDataInfo._onBeforeDrawObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeDraw",{set:function(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasInstances",{get:function(){return this.instances.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasThinInstances",{get:function(){var e;return(null!==(e=this._thinInstanceDataStorage.instancesCount)&&void 0!==e?e:0)>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"morphTargetManager",{get:function(){return this._internalMeshDataInfo._morphTargetManager},set:function(e){this._internalMeshDataInfo._morphTargetManager!==e&&(this._internalMeshDataInfo._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._internalMeshDataInfo._source},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cloneMeshMap",{get:function(){return this._internalMeshDataInfo.meshMap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnIndexed",{get:function(){return this._unIndexed},set:function(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldMatrixInstancedBuffer",{get:function(){return this._instanceDataStorage.instancesData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"manualUpdateOfWorldMatrixInstancedBuffer",{get:function(){return this._instanceDataStorage.manualUpdate},set:function(e){this._instanceDataStorage.manualUpdate=e},enumerable:!1,configurable:!0}),t.prototype.instantiateHierarchy=function(e,t,i){void 0===e&&(e=null);var n=!(this.getTotalVertices()>0)||t&&t.doNotInstantiate?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));n&&(n.parent=e||this.parent,n.position=this.position.clone(),n.scaling=this.scaling.clone(),this.rotationQuaternion?n.rotationQuaternion=this.rotationQuaternion.clone():n.rotation=this.rotation.clone(),i&&i(this,n));for(var r=0,o=this.getChildTransformNodes(!0);r<o.length;r++)o[r].instantiateHierarchy(n,t,i);return n},t.prototype.getClassName=function(){return"Mesh"},Object.defineProperty(t.prototype,"_isMesh",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.toString=function(t){var i=e.prototype.toString.call(this,t);if(i+=", n vertices: "+this.getTotalVertices(),i+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(var n=0;n<this.animations.length;n++)i+=", animation[0]: "+this.animations[n].toString(t);if(t)if(this._geometry){var r=this.getIndices(),o=this.getVerticesData(h.b.PositionKind);o&&r&&(i+=", flat shading: "+(o.length/3===r.length?"YES":"NO"))}else i+=", flat shading: UNKNOWN";return i},t.prototype._unBindEffect=function(){e.prototype._unBindEffect.call(this);for(var t=0,i=this.instances;t<i.length;t++)i[t]._unBindEffect()},Object.defineProperty(t.prototype,"hasLODLevels",{get:function(){return this._internalMeshDataInfo._LODLevels.length>0},enumerable:!1,configurable:!0}),t.prototype.getLODLevels=function(){return this._internalMeshDataInfo._LODLevels},t.prototype._sortLODLevels=function(){this._internalMeshDataInfo._LODLevels.sort(function(e,t){return e.distance<t.distance?1:e.distance>t.distance?-1:0})},t.prototype.addLODLevel=function(e,t){if(t&&t._masterMesh)return E.a.Warn("You cannot use a mesh as LOD level twice"),this;var i=new C.a(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this},t.prototype.getLODLevelAtDistance=function(e){for(var t=this._internalMeshDataInfo,i=0;i<t._LODLevels.length;i++){var n=t._LODLevels[i];if(n.distance===e)return n.mesh}return null},t.prototype.removeLODLevel=function(e){for(var t=this._internalMeshDataInfo,i=0;i<t._LODLevels.length;i++)t._LODLevels[i].mesh===e&&(t._LODLevels.splice(i,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this},t.prototype.getLOD=function(e,t){var i=this._internalMeshDataInfo;if(!i._LODLevels||0===i._LODLevels.length)return this;var n=(t||this.getBoundingInfo().boundingSphere).centerWorld.subtract(e.globalPosition).length();if(i._LODLevels[i._LODLevels.length-1].distance>n)return this.onLODLevelSelection&&this.onLODLevelSelection(n,this,this),this;for(var r=0;r<i._LODLevels.length;r++){var o=i._LODLevels[r];if(o.distance<n){if(o.mesh){if(o.mesh.delayLoadState===y.a.DELAYLOADSTATE_NOTLOADED)return o.mesh._checkDelayState(),this;if(o.mesh.delayLoadState===y.a.DELAYLOADSTATE_LOADING)return this;o.mesh._preActivate(),o.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)}return this.onLODLevelSelection&&this.onLODLevelSelection(n,this,o.mesh),o.mesh}}return this.onLODLevelSelection&&this.onLODLevelSelection(n,this,this),this},Object.defineProperty(t.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),t.prototype.getTotalVertices=function(){return null===this._geometry||void 0===this._geometry?0:this._geometry.getTotalVertices()},t.prototype.getVerticesData=function(e,t,i){return this._geometry?this._geometry.getVerticesData(e,t,i):null},t.prototype.getVertexBuffer=function(e){return this._geometry?this._geometry.getVertexBuffer(e):null},t.prototype.isVerticesDataPresent=function(e){return this._geometry?this._geometry.isVerticesDataPresent(e):!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)},t.prototype.isVertexBufferUpdatable=function(e){return this._geometry?this._geometry.isVertexBufferUpdatable(e):!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)},t.prototype.getVerticesDataKinds=function(){if(!this._geometry){var e=new Array;return this._delayInfo&&this._delayInfo.forEach(function(t){e.push(t)}),e}return this._geometry.getVerticesDataKinds()},t.prototype.getTotalIndices=function(){return this._geometry?this._geometry.getTotalIndices():0},t.prototype.getIndices=function(e,t){return this._geometry?this._geometry.getIndices(e,t):[]},Object.defineProperty(t.prototype,"isBlocked",{get:function(){return null!==this._masterMesh&&void 0!==this._masterMesh},enumerable:!1,configurable:!0}),t.prototype.isReady=function(t,i){var n,r,o,a,s,c;if(void 0===t&&(t=!1),void 0===i&&(i=!1),this.delayLoadState===y.a.DELAYLOADSTATE_LOADING)return!1;if(!e.prototype.isReady.call(this,t))return!1;if(!this.subMeshes||0===this.subMeshes.length)return!0;if(!t)return!0;var l=this.getEngine(),u=this.getScene(),h=i||l.getCaps().instancedArrays&&(this.instances.length>0||this.hasThinInstances);this.computeWorldMatrix();var d=this.material||u.defaultMaterial;if(d)if(d._storeEffectOnSubMeshes)for(var f=0,p=this.subMeshes;f<p.length;f++){var _=(E=p[f]).getMaterial();if(_)if(_._storeEffectOnSubMeshes){if(!_.isReadyForSubMesh(this,E,h))return!1}else if(!_.isReady(this,h))return!1}else if(!d.isReady(this,h))return!1;for(var m=0,g=this.lightSources;m<g.length;m++){var v=g[m].getShadowGenerator();if(v&&(!(null===(n=v.getShadowMap())||void 0===n?void 0:n.renderList)||(null===(r=v.getShadowMap())||void 0===r?void 0:r.renderList)&&-1!==(null===(a=null===(o=v.getShadowMap())||void 0===o?void 0:o.renderList)||void 0===a?void 0:a.indexOf(this))))for(var b=0,T=this.subMeshes;b<T.length;b++){var E=T[b];if(!v.isReady(E,h,null!==(c=null===(s=E.getMaterial())||void 0===s?void 0:s.needAlphaBlendingForMesh(this))&&void 0!==c&&c))return!1}}for(var S=0,A=this._internalMeshDataInfo._LODLevels;S<A.length;S++){var P=A[S];if(P.mesh&&!P.mesh.isReady(h))return!1}return!0},Object.defineProperty(t.prototype,"areNormalsFrozen",{get:function(){return this._internalMeshDataInfo._areNormalsFrozen},enumerable:!1,configurable:!0}),t.prototype.freezeNormals=function(){return this._internalMeshDataInfo._areNormalsFrozen=!0,this},t.prototype.unfreezeNormals=function(){return this._internalMeshDataInfo._areNormalsFrozen=!1,this},Object.defineProperty(t.prototype,"overridenInstanceCount",{set:function(e){this._instanceDataStorage.overridenInstanceCount=e},enumerable:!1,configurable:!0}),t.prototype._preActivate=function(){var e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t||(e._preActivateId=t,this._instanceDataStorage.visibleInstances=null),this},t.prototype._preActivateForIntermediateRendering=function(e){return this._instanceDataStorage.visibleInstances&&(this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId=e),this},t.prototype._registerInstanceForRenderId=function(e,t){return this._instanceDataStorage.visibleInstances||(this._instanceDataStorage.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId}),this._instanceDataStorage.visibleInstances[t]||(void 0!==this._instanceDataStorage.previousRenderId&&this._instanceDataStorage.isFrozen&&(this._instanceDataStorage.visibleInstances[this._instanceDataStorage.previousRenderId]=null),this._instanceDataStorage.previousRenderId=t,this._instanceDataStorage.visibleInstances[t]=new Array),this._instanceDataStorage.visibleInstances[t].push(e),this},t.prototype._afterComputeWorldMatrix=function(){e.prototype._afterComputeWorldMatrix.call(this),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))},t.prototype._postActivate=function(){this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))},t.prototype.refreshBoundingInfo=function(e){if(void 0===e&&(e=!1),this._boundingInfo&&this._boundingInfo.isLocked)return this;var t=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getPositionData(e),t),this},t.prototype._createGlobalSubMesh=function(e){var t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){var i=this.getIndices();if(!i)return null;var n=i.length,r=!1;if(e)r=!0;else for(var o=0,a=this.subMeshes;o<a.length;o++){var s=a[o];if(s.indexStart+s.indexCount>n){r=!0;break}if(s.verticesStart+s.verticesCount>t){r=!0;break}}if(!r)return this.subMeshes[0]}return this.releaseSubMeshes(),new _.a(0,0,t,0,this.getTotalIndices(),this)},t.prototype.subdivide=function(e){if(!(e<1)){for(var t=this.getTotalIndices(),i=t/e|0,n=0;i%3!=0;)i++;this.releaseSubMeshes();for(var r=0;r<e&&!(n>=t);r++)_.a.CreateFromIndices(0,n,r===e-1?t-n:i,this),n+=i;this.synchronizeInstances()}},t.prototype.setVerticesData=function(e,t,i,n){if(void 0===i&&(i=!1),this._geometry)this._geometry.setVerticesData(e,t,i,n);else{var r=new d.a;r.set(t,e);var o=this.getScene();new f.a(f.a.RandomId(),o,r,i,this)}return this},t.prototype.removeVerticesData=function(e){this._geometry&&this._geometry.removeVerticesData(e)},t.prototype.markVerticesDataAsUpdatable=function(e,t){void 0===t&&(t=!0);var i=this.getVertexBuffer(e);i&&i.isUpdatable()!==t&&this.setVerticesData(e,this.getVerticesData(e),t)},t.prototype.setVerticesBuffer=function(e){return this._geometry||(this._geometry=f.a.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e),this},t.prototype.updateVerticesData=function(e,t,i,n){return this._geometry?(n?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this},t.prototype.updateMeshPositions=function(e,t){void 0===t&&(t=!0);var i=this.getVerticesData(h.b.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(h.b.PositionKind,i,!1,!1),t){var n=this.getIndices(),r=this.getVerticesData(h.b.NormalKind);if(!r)return this;d.a.ComputeNormals(i,n,r),this.updateVerticesData(h.b.NormalKind,r,!1,!1)}return this},t.prototype.makeGeometryUnique=function(){if(!this._geometry)return this;if(1===this._geometry.meshes.length)return this;var e=this._geometry,t=this._geometry.copy(f.a.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this},t.prototype.setIndices=function(e,t,i){if(void 0===t&&(t=null),void 0===i&&(i=!1),this._geometry)this._geometry.setIndices(e,t,i);else{var n=new d.a;n.indices=e;var r=this.getScene();new f.a(f.a.RandomId(),r,n,i,this)}return this},t.prototype.updateIndices=function(e,t,i){return void 0===i&&(i=!1),this._geometry?(this._geometry.updateIndices(e,t,i),this):this},t.prototype.toLeftHanded=function(){return this._geometry?(this._geometry.toLeftHanded(),this):this},t.prototype._bind=function(e,t,i){if(!this._geometry)return this;var n,r=this.getScene().getEngine();if(this._unIndexed)n=null;else switch(i){case g.a.PointFillMode:n=null;break;case g.a.WireFrameFillMode:n=e._getLinesIndexBuffer(this.getIndices(),r);break;default:case g.a.TriangleFillMode:n=this._geometry.getIndexBuffer()}return this._geometry._bind(t,n),this},t.prototype._draw=function(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);var n=this.getScene().getEngine();return this._unIndexed||t==g.a.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,i):t==g.a.WireFrameFillMode?n.drawElementsType(t,0,e._linesIndexCount,i):n.drawElementsType(t,e.indexStart,e.indexCount,i),this},t.prototype.registerBeforeRender=function(e){return this.onBeforeRenderObservable.add(e),this},t.prototype.unregisterBeforeRender=function(e){return this.onBeforeRenderObservable.removeCallback(e),this},t.prototype.registerAfterRender=function(e){return this.onAfterRenderObservable.add(e),this},t.prototype.unregisterAfterRender=function(e){return this.onAfterRenderObservable.removeCallback(e),this},t.prototype._getInstancesRenderList=function(e,t){if(void 0===t&&(t=!1),this._instanceDataStorage.isFrozen&&this._instanceDataStorage.previousBatch)return this._instanceDataStorage.previousBatch;var i=this.getScene(),n=i._isInIntermediateRendering(),r=n?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,o=this._instanceDataStorage.batchCache;if(o.mustReturn=!1,o.renderSelf[e]=t||!r&&this.isEnabled()&&this.isVisible,o.visibleInstances[e]=null,this._instanceDataStorage.visibleInstances&&!t){var a=this._instanceDataStorage.visibleInstances,s=i.getRenderId(),c=n?a.intermediateDefaultRenderId:a.defaultRenderId;o.visibleInstances[e]=a[s],!o.visibleInstances[e]&&c&&(o.visibleInstances[e]=a[c])}return o.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&null!==o.visibleInstances[e]&&void 0!==o.visibleInstances[e],this._instanceDataStorage.previousBatch=o,o},t.prototype._renderWithInstances=function(e,t,i,n,r){var o=i.visibleInstances[e._id];if(!o)return this;for(var a=this._instanceDataStorage,s=a.instancesBufferSize,c=a.instancesBuffer,l=16*(o.length+1)*4;a.instancesBufferSize<l;)a.instancesBufferSize*=2;a.instancesData&&s==a.instancesBufferSize||(a.instancesData=new Float32Array(a.instancesBufferSize/4));var u=0,d=0,f=i.renderSelf[e._id],p=!c||s!==a.instancesBufferSize;if(this._instanceDataStorage.manualUpdate||a.isFrozen&&!p)d=(f?1:0)+o.length;else{var _=this._effectiveMesh.getWorldMatrix();if(f&&(_.copyToArray(a.instancesData,u),u+=16,d++),o)for(var m=0;m<o.length;m++)o[m].getWorldMatrix().copyToArray(a.instancesData,u),u+=16,d++}return p?(c&&c.dispose(),c=new h.a(r,a.instancesData,!0,16,!1,!0),a.instancesBuffer=c,this.setVerticesBuffer(c.createVertexBuffer("world0",0,4)),this.setVerticesBuffer(c.createVertexBuffer("world1",4,4)),this.setVerticesBuffer(c.createVertexBuffer("world2",8,4)),this.setVerticesBuffer(c.createVertexBuffer("world3",12,4))):this._instanceDataStorage.isFrozen||c.updateDirectly(a.instancesData,0,d),this._processInstancedBuffers(o,f),this.getScene()._activeIndices.addCount(e.indexCount*d,!1),this._bind(e,n,t),this._draw(e,t,d),r.unbindInstanceAttributes(),this},t.prototype._renderWithThinInstances=function(e,t,i,n){var r,o,a=null!==(o=null===(r=this._thinInstanceDataStorage)||void 0===r?void 0:r.instancesCount)&&void 0!==o?o:0;this.getScene()._activeIndices.addCount(e.indexCount*a,!1),this._bind(e,i,t),this._draw(e,t,a),n.unbindInstanceAttributes()},t.prototype._processInstancedBuffers=function(e,t){},t.prototype._processRendering=function(e,t,i,n,r,o,a,s){var c=this.getScene(),l=c.getEngine();if(o&&t.getRenderingMesh().hasThinInstances)return this._renderWithThinInstances(t,n,i,l),this;if(o)this._renderWithInstances(t,n,r,i,l);else{var u=0;r.renderSelf[t._id]&&(a&&a(!1,e._effectiveMesh.getWorldMatrix(),s),u++,this._draw(t,n,this._instanceDataStorage.overridenInstanceCount));var h=r.visibleInstances[t._id];if(h){var d=h.length;u+=d;for(var f=0;f<d;f++){var p=h[f].getWorldMatrix();a&&a(!0,p,s),this._draw(t,n)}}c._activeIndices.addCount(t.indexCount*u,!1)}return this},t.prototype._rebuild=function(){this._instanceDataStorage.instancesBuffer&&(this._instanceDataStorage.instancesBuffer.dispose(),this._instanceDataStorage.instancesBuffer=null),e.prototype._rebuild.call(this)},t.prototype._freeze=function(){if(this.subMeshes){for(var e=0;e<this.subMeshes.length;e++)this._getInstancesRenderList(e);this._effectiveMaterial=null,this._instanceDataStorage.isFrozen=!0}},t.prototype._unFreeze=function(){this._instanceDataStorage.isFrozen=!1,this._instanceDataStorage.previousBatch=null},t.prototype.render=function(e,t,i){var n=this.getScene();if(this._internalAbstractMeshDataInfo._isActiveIntermediate?this._internalAbstractMeshDataInfo._isActiveIntermediate=!1:this._internalAbstractMeshDataInfo._isActive=!1,this._checkOcclusionQuery())return this;var r=this._getInstancesRenderList(e._id,!!i);if(r.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);var o,a=n.getEngine(),s=r.hardwareInstancedRendering[e._id]||e.getRenderingMesh().hasThinInstances,c=this._instanceDataStorage,l=e.getMaterial();if(!l)return this;if(!c.isFrozen||!this._effectiveMaterial||this._effectiveMaterial!==l){if(l._storeEffectOnSubMeshes){if(!l.isReadyForSubMesh(this,e,s))return this}else if(!l.isReady(this,s))return this;this._effectiveMaterial=l}t&&a.setAlphaMode(this._effectiveMaterial.alphaMode),o=this._effectiveMaterial._storeEffectOnSubMeshes?e.effect:this._effectiveMaterial.getEffect();for(var u=0,h=n._beforeRenderingMeshStage;u<h.length;u++)h[u].action(this,e,r,o);if(!o)return this;var d,f=i||this._effectiveMesh;if(c.isFrozen||!this._effectiveMaterial.backFaceCulling&&null===this.overrideMaterialSideOrientation)d=c.sideOrientation;else{var p=f._getWorldMatrixDeterminant();null==(d=this.overrideMaterialSideOrientation)&&(d=this._effectiveMaterial.sideOrientation),p<0&&(d=d===g.a.ClockWiseSideOrientation?g.a.CounterClockWiseSideOrientation:g.a.ClockWiseSideOrientation),c.sideOrientation=d}var _=this._effectiveMaterial._preBind(o,d);this._effectiveMaterial.forceDepthWrite&&a.setDepthWrite(!0);var m=n.forcePointsCloud?g.a.PointFillMode:n.forceWireframe?g.a.WireFrameFillMode:this._effectiveMaterial.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),s||this._bind(e,o,m);var v=f.getWorldMatrix();this._effectiveMaterial._storeEffectOnSubMeshes?this._effectiveMaterial.bindForSubMesh(v,this,e):this._effectiveMaterial.bind(v,this),!this._effectiveMaterial.backFaceCulling&&this._effectiveMaterial.separateCullingPass&&(a.setState(!0,this._effectiveMaterial.zOffset,!1,!_),this._processRendering(this,e,o,m,r,s,this._onBeforeDraw,this._effectiveMaterial),a.setState(!0,this._effectiveMaterial.zOffset,!1,_)),this._processRendering(this,e,o,m,r,s,this._onBeforeDraw,this._effectiveMaterial),this._effectiveMaterial.unbind();for(var b=0,y=n._afterRenderingMeshStage;b<y.length;b++)y[b].action(this,e,r,o);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),this},t.prototype._onBeforeDraw=function(e,t,i){e&&i&&i.bindOnlyWorldMatrix(t)},t.prototype.cleanMatrixWeights=function(){this.isVerticesDataPresent(h.b.MatricesWeightsKind)&&(this.isVerticesDataPresent(h.b.MatricesWeightsExtraKind)?this.normalizeSkinWeightsAndExtra():this.normalizeSkinFourWeights())},t.prototype.normalizeSkinFourWeights=function(){for(var e=this.getVerticesData(h.b.MatricesWeightsKind),t=e.length,i=0;i<t;i+=4){var n=e[i]+e[i+1]+e[i+2]+e[i+3];if(0===n)e[i]=1;else{var r=1/n;e[i]*=r,e[i+1]*=r,e[i+2]*=r,e[i+3]*=r}}this.setVerticesData(h.b.MatricesWeightsKind,e)},t.prototype.normalizeSkinWeightsAndExtra=function(){for(var e=this.getVerticesData(h.b.MatricesWeightsExtraKind),t=this.getVerticesData(h.b.MatricesWeightsKind),i=t.length,n=0;n<i;n+=4){var r=t[n]+t[n+1]+t[n+2]+t[n+3];if(0===(r+=e[n]+e[n+1]+e[n+2]+e[n+3]))t[n]=1;else{var o=1/r;t[n]*=o,t[n+1]*=o,t[n+2]*=o,t[n+3]*=o,e[n]*=o,e[n+1]*=o,e[n+2]*=o,e[n+3]*=o}}this.setVerticesData(h.b.MatricesWeightsKind,t),this.setVerticesData(h.b.MatricesWeightsKind,e)},t.prototype.validateSkinning=function(){var e=this.getVerticesData(h.b.MatricesWeightsExtraKind),t=this.getVerticesData(h.b.MatricesWeightsKind);if(null===t||null==this.skeleton)return{skinned:!1,valid:!0,report:"not skinned"};for(var i=t.length,n=0,r=0,o=0,a=0,s=null===e?4:8,c=new Array,l=0;l<=s;l++)c[l]=0;for(l=0;l<i;l+=4){for(var u=t[l],d=u,f=0===d?0:1,p=1;p<s;p++){var _=p<4?t[l+p]:e[l+p-4];_>u&&n++,0!==_&&f++,d+=_,u=_}if(c[f]++,f>o&&(o=f),0===d)r++;else{var m=1/d,g=0;for(p=0;p<s;p++)g+=p<4?Math.abs(t[l+p]-t[l+p]*m):Math.abs(e[l+p-4]-e[l+p-4]*m);g>.001&&a++}}var v=this.skeleton.bones.length,b=this.getVerticesData(h.b.MatricesIndicesKind),y=this.getVerticesData(h.b.MatricesIndicesExtraKind),T=0;for(l=0;l<i;l+=4)for(p=0;p<s;p++){var E=p<4?b[l+p]:y[l+p-4];(E>=v||E<0)&&T++}return{skinned:!0,valid:0===r&&0===a&&0===T,report:"Number of Weights = "+i/4+"\nMaximum influences = "+o+"\nMissing Weights = "+r+"\nNot Sorted = "+n+"\nNot Normalized = "+a+"\nWeightCounts = ["+c+"]\nNumber of bones = "+v+"\nBad Bone Indices = "+T}},t.prototype._checkDelayState=function(){var e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===y.a.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=y.a.DELAYLOADSTATE_LOADING,this._queueLoad(e)),this},t.prototype._queueLoad=function(e){var t=this;e._addPendingData(this);var i=-1!==this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return o.b.LoadFile(this.delayLoadingFile,function(i){i instanceof ArrayBuffer?t._delayLoadingFunction(i,t):t._delayLoadingFunction(JSON.parse(i),t),t.instances.forEach(function(e){e.refreshBoundingInfo(),e._syncSubMeshes()}),t.delayLoadState=y.a.DELAYLOADSTATE_LOADED,e._removePendingData(t)},function(){},e.offlineProvider,i),this},t.prototype.isInFrustum=function(t){return this.delayLoadState!==y.a.DELAYLOADSTATE_LOADING&&!!e.prototype.isInFrustum.call(this,t)&&(this._checkDelayState(),!0)},t.prototype.setMaterialByID=function(e){var t,i=this.getScene().materials;for(t=i.length-1;t>-1;t--)if(i[t].id===e)return this.material=i[t],this;var n=this.getScene().multiMaterials;for(t=n.length-1;t>-1;t--)if(n[t].id===e)return this.material=n[t],this;return this},t.prototype.getAnimatables=function(){var e=new Array;return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e},t.prototype.bakeTransformIntoVertices=function(e){if(!this.isVerticesDataPresent(h.b.PositionKind))return this;var t=this.subMeshes.splice(0);this._resetPointsArrayCache();var i,n=this.getVerticesData(h.b.PositionKind),r=new Array;for(i=0;i<n.length;i+=3)c.e.TransformCoordinates(c.e.FromArray(n,i),e).toArray(r,i);if(this.setVerticesData(h.b.PositionKind,r,this.getVertexBuffer(h.b.PositionKind).isUpdatable()),this.isVerticesDataPresent(h.b.NormalKind)){for(n=this.getVerticesData(h.b.NormalKind),r=[],i=0;i<n.length;i+=3)c.e.TransformNormal(c.e.FromArray(n,i),e).normalize().toArray(r,i);this.setVerticesData(h.b.NormalKind,r,this.getVertexBuffer(h.b.NormalKind).isUpdatable())}return e.m[0]*e.m[5]*e.m[10]<0&&this.flipFaces(),this.releaseSubMeshes(),this.subMeshes=t,this},t.prototype.bakeCurrentTransformIntoVertices=function(e){return void 0===e&&(e=!0),this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.resetLocalMatrix(e),this},Object.defineProperty(t.prototype,"_positions",{get:function(){return this._geometry?this._geometry._positions:null},enumerable:!1,configurable:!0}),t.prototype._resetPointsArrayCache=function(){return this._geometry&&this._geometry._resetPointsArrayCache(),this},t.prototype._generatePointsArray=function(){return!!this._geometry&&this._geometry._generatePointsArray()},t.prototype.clone=function(e,i,n,r){return void 0===e&&(e=""),void 0===i&&(i=null),void 0===r&&(r=!0),new t(e,this.getScene(),i,this,n,r)},t.prototype.dispose=function(t,i){void 0===i&&(i=!1),this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0);var n=this._internalMeshDataInfo;if(n._onBeforeDrawObservable&&n._onBeforeDrawObservable.clear(),n._onBeforeBindObservable&&n._onBeforeBindObservable.clear(),n._onBeforeRenderObservable&&n._onBeforeRenderObservable.clear(),n._onAfterRenderObservable&&n._onAfterRenderObservable.clear(),this._scene.useClonedMeshMap){if(n.meshMap)for(var r in n.meshMap)(s=n.meshMap[r])&&(s._internalMeshDataInfo._source=null,n.meshMap[r]=void 0);n._source&&n._source._internalMeshDataInfo.meshMap&&(n._source._internalMeshDataInfo.meshMap[this.uniqueId]=void 0)}else for(var o=0,a=this.getScene().meshes;o<a.length;o++){var s;(s=a[o])._internalMeshDataInfo&&s._internalMeshDataInfo._source&&s._internalMeshDataInfo._source===this&&(s._internalMeshDataInfo._source=null)}n._source=null,this._disposeInstanceSpecificData(),this._disposeThinInstanceSpecificData(),e.prototype.dispose.call(this,t,i)},t.prototype._disposeInstanceSpecificData=function(){},t.prototype._disposeThinInstanceSpecificData=function(){},t.prototype.applyDisplacementMap=function(e,t,i,n,r,a,s){var c=this;void 0===s&&(s=!1);var l=this.getScene();return o.b.LoadImage(e,function(e){var o=e.width,l=e.height,u=R.a.CreateCanvas(o,l).getContext("2d");u.drawImage(e,0,0);var h=u.getImageData(0,0,o,l).data;c.applyDisplacementMapFromBuffer(h,o,l,t,i,r,a,s),n&&n(c)},function(){},l.offlineProvider),this},t.prototype.applyDisplacementMapFromBuffer=function(e,t,i,n,r,o,a,s){if(void 0===s&&(s=!1),!this.isVerticesDataPresent(h.b.PositionKind)||!this.isVerticesDataPresent(h.b.NormalKind)||!this.isVerticesDataPresent(h.b.UVKind))return E.a.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;var l=this.getVerticesData(h.b.PositionKind,!0,!0),u=this.getVerticesData(h.b.NormalKind),f=this.getVerticesData(h.b.UVKind),p=c.e.Zero(),_=c.e.Zero(),m=c.d.Zero();o=o||c.d.Zero(),a=a||new c.d(1,1);for(var g=0;g<l.length;g+=3){c.e.FromArrayToRef(l,g,p),c.e.FromArrayToRef(u,g,_),c.d.FromArrayToRef(f,g/3*2,m);var v=4*((Math.abs(m.x*a.x+o.x%1)*(t-1)%t|0)+(Math.abs(m.y*a.y+o.y%1)*(i-1)%i|0)*t),b=e[v]/255*.3+e[v+1]/255*.59+e[v+2]/255*.11;_.normalize(),_.scaleInPlace(n+(r-n)*b),(p=p.add(_)).toArray(l,g)}return d.a.ComputeNormals(l,this.getIndices(),u),s?(this.setVerticesData(h.b.PositionKind,l),this.setVerticesData(h.b.NormalKind,u)):(this.updateVerticesData(h.b.PositionKind,l),this.updateVerticesData(h.b.NormalKind,u)),this},t.prototype.convertToFlatShadedMesh=function(){var e,t,i=this.getVerticesDataKinds(),n={},r={},o={},a=!1;for(e=0;e<i.length;e++){t=i[e];var s=this.getVertexBuffer(t);t!==h.b.NormalKind?(n[t]=s,r[t]=n[t].getData(),o[t]=[]):(a=s.isUpdatable(),i.splice(e,1),e--)}var l,u=this.subMeshes.slice(0),d=this.getIndices(),f=this.getTotalIndices();for(l=0;l<f;l++){var p=d[l];for(e=0;e<i.length;e++)for(var m=n[t=i[e]].getStrideSize(),g=0;g<m;g++)o[t].push(r[t][p*m+g])}var v=[],b=o[h.b.PositionKind];for(l=0;l<f;l+=3){d[l]=l,d[l+1]=l+1,d[l+2]=l+2;for(var y=c.e.FromArray(b,3*l),T=c.e.FromArray(b,3*(l+1)),E=c.e.FromArray(b,3*(l+2)),S=y.subtract(T),A=E.subtract(T),P=c.e.Normalize(c.e.Cross(S,A)),C=0;C<3;C++)v.push(P.x),v.push(P.y),v.push(P.z)}for(this.setIndices(d),this.setVerticesData(h.b.NormalKind,v,a),e=0;e<i.length;e++)t=i[e],this.setVerticesData(t,o[t],n[t].isUpdatable());this.releaseSubMeshes();for(var R=0;R<u.length;R++){var x=u[R];_.a.AddToMesh(x.materialIndex,x.indexStart,x.indexCount,x.indexStart,x.indexCount,this)}return this.synchronizeInstances(),this},t.prototype.convertToUnIndexedMesh=function(){var e,t,i=this.getVerticesDataKinds(),n={},r={},o={};for(e=0;e<i.length;e++){t=i[e];var a=this.getVertexBuffer(t);n[t]=a,r[t]=n[t].getData(),o[t]=[]}var s,c=this.subMeshes.slice(0),l=this.getIndices(),u=this.getTotalIndices();for(s=0;s<u;s++){var h=l[s];for(e=0;e<i.length;e++)for(var d=n[t=i[e]].getStrideSize(),f=0;f<d;f++)o[t].push(r[t][h*d+f])}for(s=0;s<u;s+=3)l[s]=s,l[s+1]=s+1,l[s+2]=s+2;for(this.setIndices(l),e=0;e<i.length;e++)t=i[e],this.setVerticesData(t,o[t],n[t].isUpdatable());this.releaseSubMeshes();for(var p=0;p<c.length;p++){var m=c[p];_.a.AddToMesh(m.materialIndex,m.indexStart,m.indexCount,m.indexStart,m.indexCount,this)}return this._unIndexed=!0,this.synchronizeInstances(),this},t.prototype.flipFaces=function(e){void 0===e&&(e=!1);var t,i,n=d.a.ExtractFromMesh(this);if(e&&this.isVerticesDataPresent(h.b.NormalKind)&&n.normals)for(t=0;t<n.normals.length;t++)n.normals[t]*=-1;if(n.indices)for(t=0;t<n.indices.length;t+=3)i=n.indices[t+1],n.indices[t+1]=n.indices[t+2],n.indices[t+2]=i;return n.applyToMesh(this,this.isVertexBufferUpdatable(h.b.PositionKind)),this},t.prototype.increaseVertices=function(e){var t=d.a.ExtractFromMesh(this),i=t.uvs,n=t.indices,r=t.positions,o=t.normals;if(n&&r&&o&&i){for(var a,s,l=e+1,u=new Array,f=0;f<l+1;f++)u[f]=new Array;var p,_=new c.e(0,0,0),m=new c.e(0,0,0),g=new c.d(0,0),v=new Array,b=new Array,y=new Array,T=r.length,S=i.length;for(f=0;f<n.length;f+=3){b[0]=n[f],b[1]=n[f+1],b[2]=n[f+2];for(var A=0;A<3;A++)if(a=b[A],s=b[(A+1)%3],void 0===y[a]&&void 0===y[s]?(y[a]=new Array,y[s]=new Array):(void 0===y[a]&&(y[a]=new Array),void 0===y[s]&&(y[s]=new Array)),void 0===y[a][s]&&void 0===y[s][a]){y[a][s]=[],_.x=(r[3*s]-r[3*a])/l,_.y=(r[3*s+1]-r[3*a+1])/l,_.z=(r[3*s+2]-r[3*a+2])/l,m.x=(o[3*s]-o[3*a])/l,m.y=(o[3*s+1]-o[3*a+1])/l,m.z=(o[3*s+2]-o[3*a+2])/l,g.x=(i[2*s]-i[2*a])/l,g.y=(i[2*s+1]-i[2*a+1])/l,y[a][s].push(a);for(var P=1;P<l;P++)y[a][s].push(r.length/3),r[T]=r[3*a]+P*_.x,o[T++]=o[3*a]+P*m.x,r[T]=r[3*a+1]+P*_.y,o[T++]=o[3*a+1]+P*m.y,r[T]=r[3*a+2]+P*_.z,o[T++]=o[3*a+2]+P*m.z,i[S++]=i[2*a]+P*g.x,i[S++]=i[2*a+1]+P*g.y;y[a][s].push(s),y[s][a]=new Array,p=y[a][s].length;for(var C=0;C<p;C++)y[s][a][C]=y[a][s][p-1-C]}for(u[0][0]=n[f],u[1][0]=y[n[f]][n[f+1]][1],u[1][1]=y[n[f]][n[f+2]][1],P=2;P<l;P++)for(u[P][0]=y[n[f]][n[f+1]][P],u[P][P]=y[n[f]][n[f+2]][P],_.x=(r[3*u[P][P]]-r[3*u[P][0]])/P,_.y=(r[3*u[P][P]+1]-r[3*u[P][0]+1])/P,_.z=(r[3*u[P][P]+2]-r[3*u[P][0]+2])/P,m.x=(o[3*u[P][P]]-o[3*u[P][0]])/P,m.y=(o[3*u[P][P]+1]-o[3*u[P][0]+1])/P,m.z=(o[3*u[P][P]+2]-o[3*u[P][0]+2])/P,g.x=(i[2*u[P][P]]-i[2*u[P][0]])/P,g.y=(i[2*u[P][P]+1]-i[2*u[P][0]+1])/P,A=1;A<P;A++)u[P][A]=r.length/3,r[T]=r[3*u[P][0]]+A*_.x,o[T++]=o[3*u[P][0]]+A*m.x,r[T]=r[3*u[P][0]+1]+A*_.y,o[T++]=o[3*u[P][0]+1]+A*m.y,r[T]=r[3*u[P][0]+2]+A*_.z,o[T++]=o[3*u[P][0]+2]+A*m.z,i[S++]=i[2*u[P][0]]+A*g.x,i[S++]=i[2*u[P][0]+1]+A*g.y;for(u[l]=y[n[f+1]][n[f+2]],v.push(u[0][0],u[1][0],u[1][1]),P=1;P<l;P++){for(A=0;A<P;A++)v.push(u[P][A],u[P+1][A],u[P+1][A+1]),v.push(u[P][A],u[P+1][A+1],u[P][A+1]);v.push(u[P][A],u[P+1][A],u[P+1][A+1])}}t.indices=v,t.applyToMesh(this,this.isVertexBufferUpdatable(h.b.PositionKind))}else E.a.Warn("VertexData contains null entries")},t.prototype.forceSharedVertices=function(){var e=d.a.ExtractFromMesh(this),t=e.uvs,i=e.indices,n=e.positions,r=e.colors;if(void 0===i||void 0===n||null===i||null===n)E.a.Warn("VertexData contains empty entries");else{for(var o,a,s=new Array,c=new Array,l=new Array,u=new Array,f=new Array,p=0,_={},m=0;m<i.length;m+=3){a=[i[m],i[m+1],i[m+2]],f=new Array;for(var g=0;g<3;g++){f[g]="";for(var v=0;v<3;v++)Math.abs(n[3*a[g]+v])<1e-8&&(n[3*a[g]+v]=0),f[g]+=n[3*a[g]+v]+"|"}if(f[0]!=f[1]&&f[0]!=f[2]&&f[1]!=f[2])for(g=0;g<3;g++){if(void 0===(o=_[f[g]])){for(_[f[g]]=p,o=p++,v=0;v<3;v++)s.push(n[3*a[g]+v]);if(null!=r)for(v=0;v<4;v++)u.push(r[4*a[g]+v]);if(null!=t)for(v=0;v<2;v++)l.push(t[2*a[g]+v])}c.push(o)}}var b=new Array;d.a.ComputeNormals(s,c,b),e.positions=s,e.indices=c,e.normals=b,null!=t&&(e.uvs=l),null!=r&&(e.colors=u),e.applyToMesh(this,this.isVertexBufferUpdatable(h.b.PositionKind))}},t._instancedMeshFactory=function(e,t){throw A.a.WarnImport("InstancedMesh")},t._PhysicsImpostorParser=function(e,t,i){throw A.a.WarnImport("PhysicsImpostor")},t.prototype.createInstance=function(e){var i=this.geometry;if(i&&i.meshes.length>1)for(var n=0,r=i.meshes.slice(0);n<r.length;n++){var o=r[n];o!==this&&o.makeGeometryUnique()}return t._instancedMeshFactory(e,this)},t.prototype.synchronizeInstances=function(){this._geometry&&1!==this._geometry.meshes.length&&this.instances.length&&this.makeGeometryUnique();for(var e=0;e<this.instances.length;e++)this.instances[e]._syncSubMeshes();return this},t.prototype.optimizeIndices=function(e){var t=this,i=this.getIndices(),n=this.getVerticesData(h.b.PositionKind);if(!n||!i)return this;for(var r=new Array,a=0;a<n.length;a+=3)r.push(c.e.FromArray(n,a));var s=new Array;return o.a.SyncAsyncForLoop(r.length,40,function(e){for(var t=r.length-1-e,i=r[t],n=0;n<t;++n){var o=r[n];if(i.equals(o)){s[t]=n;break}}},function(){for(var n=0;n<i.length;++n)i[n]=s[i[n]]||i[n];var r=t.subMeshes.slice(0);t.setIndices(i),t.subMeshes=r,e&&e(t)}),this},t.prototype.serialize=function(e){e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,e.type=this.getClassName(),s.a&&s.a.HasTags(this)&&(e.tags=s.a.GetTags(this)),e.position=this.position.asArray(),this.rotationQuaternion?e.rotationQuaternion=this.rotationQuaternion.asArray():this.rotation&&(e.rotation=this.rotation.asArray()),e.scaling=this.scaling.asArray(),this._postMultiplyPivotMatrix?e.pivotMatrix=this.getPivotMatrix().asArray():e.localMatrix=this.getPivotMatrix().asArray(),e.isEnabled=this.isEnabled(!1),e.isVisible=this.isVisible,e.infiniteDistance=this.infiniteDistance,e.pickable=this.isPickable,e.receiveShadows=this.receiveShadows,e.billboardMode=this.billboardMode,e.visibility=this.visibility,e.checkCollisions=this.checkCollisions,e.isBlocker=this.isBlocker,e.overrideMaterialSideOrientation=this.overrideMaterialSideOrientation,this.parent&&(e.parentId=this.parent.id),e.isUnIndexed=this.isUnIndexed;var t=this._geometry;if(t){var i=t.id;e.geometryId=i,e.subMeshes=[];for(var n=0;n<this.subMeshes.length;n++){var r=this.subMeshes[n];e.subMeshes.push({materialIndex:r.materialIndex,verticesStart:r.verticesStart,verticesCount:r.verticesCount,indexStart:r.indexStart,indexCount:r.indexCount})}}this.material?this.material.doNotSerialize||(e.materialId=this.material.id):this.material=null,this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id,e.numBoneInfluencers=this.numBoneInfluencers),this.getScene()._getComponent(P.a.NAME_PHYSICSENGINE)&&(l=this.getPhysicsImpostor())&&(e.physicsMass=l.getParam("mass"),e.physicsFriction=l.getParam("friction"),e.physicsRestitution=l.getParam("mass"),e.physicsImpostor=l.type),this.metadata&&(e.metadata=this.metadata),e.instances=[];for(var a=0;a<this.instances.length;a++){var c=this.instances[a];if(!c.doNotSerialize){var l,u={name:c.name,id:c.id,isEnabled:c.isEnabled(!1),isVisible:c.isVisible,isPickable:c.isPickable,checkCollisions:c.checkCollisions,position:c.position.asArray(),scaling:c.scaling.asArray()};c.parent&&(u.parentId=c.parent.id),c.rotationQuaternion?u.rotationQuaternion=c.rotationQuaternion.asArray():c.rotation&&(u.rotation=c.rotation.asArray()),this.getScene()._getComponent(P.a.NAME_PHYSICSENGINE)&&(l=c.getPhysicsImpostor())&&(u.physicsMass=l.getParam("mass"),u.physicsFriction=l.getParam("friction"),u.physicsRestitution=l.getParam("mass"),u.physicsImpostor=l.type),c.metadata&&(u.metadata=c.metadata),e.instances.push(u),T.a.AppendSerializedAnimations(c,u),u.ranges=c.serializeAnimationRanges()}}if(this._thinInstanceDataStorage.instancesCount&&this._thinInstanceDataStorage.matrixData&&(e.thinInstances={instancesCount:this._thinInstanceDataStorage.instancesCount,matrixData:o.b.SliceToArray(this._thinInstanceDataStorage.matrixData),matrixBufferSize:this._thinInstanceDataStorage.matrixBufferSize},this._userThinInstanceBuffersStorage)){var h={data:{},sizes:{},strides:{}};for(var d in this._userThinInstanceBuffersStorage.data)h.data[d]=o.b.SliceToArray(this._userThinInstanceBuffersStorage.data[d]),h.sizes[d]=this._userThinInstanceBuffersStorage.sizes[d],h.strides[d]=this._userThinInstanceBuffersStorage.strides[d];e.thinInstances.userThinInstance=h}T.a.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.layerMask=this.layerMask,e.alphaIndex=this.alphaIndex,e.hasVertexAlpha=this.hasVertexAlpha,e.overlayAlpha=this.overlayAlpha,e.overlayColor=this.overlayColor.asArray(),e.renderOverlay=this.renderOverlay,e.applyFog=this.applyFog,this.actionManager&&(e.actions=this.actionManager.serialize(this.name))},t.prototype._syncGeometryWithMorphTargetManager=function(){if(this.geometry){this._markSubMeshesAsAttributesDirty();var e=this._internalMeshDataInfo._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices())return E.a.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."),void(this.morphTargetManager=null);for(var t=0;t<e.numInfluencers;t++){var i=e.getActiveTarget(t),n=i.getPositions();if(!n)return void E.a.Error("Invalid morph target. Target must have positions.");this.geometry.setVerticesData(h.b.PositionKind+t,n,!1,3);var r=i.getNormals();r&&this.geometry.setVerticesData(h.b.NormalKind+t,r,!1,3);var o=i.getTangents();o&&this.geometry.setVerticesData(h.b.TangentKind+t,o,!1,3);var a=i.getUVs();a&&this.geometry.setVerticesData(h.b.UVKind+"_"+t,a,!1,2)}}else for(t=0;this.geometry.isVerticesDataPresent(h.b.PositionKind+t);)this.geometry.removeVerticesData(h.b.PositionKind+t),this.geometry.isVerticesDataPresent(h.b.NormalKind+t)&&this.geometry.removeVerticesData(h.b.NormalKind+t),this.geometry.isVerticesDataPresent(h.b.TangentKind+t)&&this.geometry.removeVerticesData(h.b.TangentKind+t),this.geometry.isVerticesDataPresent(h.b.UVKind+t)&&this.geometry.removeVerticesData(h.b.UVKind+"_"+t),t++}},t.Parse=function(e,i,n){var r;if((r=e.type&&"GroundMesh"===e.type?t._GroundMeshParser(e,i):new t(e.name,i)).id=e.id,s.a&&s.a.AddTagsTo(r,e.tags),r.position=c.e.FromArray(e.position),void 0!==e.metadata&&(r.metadata=e.metadata),e.rotationQuaternion?r.rotationQuaternion=c.b.FromArray(e.rotationQuaternion):e.rotation&&(r.rotation=c.e.FromArray(e.rotation)),r.scaling=c.e.FromArray(e.scaling),e.localMatrix?r.setPreTransformMatrix(c.a.FromArray(e.localMatrix)):e.pivotMatrix&&r.setPivotMatrix(c.a.FromArray(e.pivotMatrix)),r.setEnabled(e.isEnabled),r.isVisible=e.isVisible,r.infiniteDistance=e.infiniteDistance,r.showBoundingBox=e.showBoundingBox,r.showSubMeshesBoundingBox=e.showSubMeshesBoundingBox,void 0!==e.applyFog&&(r.applyFog=e.applyFog),void 0!==e.pickable&&(r.isPickable=e.pickable),void 0!==e.alphaIndex&&(r.alphaIndex=e.alphaIndex),r.receiveShadows=e.receiveShadows,r.billboardMode=e.billboardMode,void 0!==e.visibility&&(r.visibility=e.visibility),r.checkCollisions=e.checkCollisions,r.overrideMaterialSideOrientation=e.overrideMaterialSideOrientation,void 0!==e.isBlocker&&(r.isBlocker=e.isBlocker),r._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(r._waitingData.freezeWorldMatrix=e.freezeWorldMatrix),e.parentId&&(r._waitingParentId=e.parentId),void 0!==e.actions&&(r._waitingData.actions=e.actions),void 0!==e.overlayAlpha&&(r.overlayAlpha=e.overlayAlpha),void 0!==e.overlayColor&&(r.overlayColor=l.a.FromArray(e.overlayColor)),void 0!==e.renderOverlay&&(r.renderOverlay=e.renderOverlay),r.isUnIndexed=!!e.isUnIndexed,r.hasVertexAlpha=e.hasVertexAlpha,e.delayLoadingFile?(r.delayLoadState=y.a.DELAYLOADSTATE_NOTLOADED,r.delayLoadingFile=n+e.delayLoadingFile,r._boundingInfo=new m.a(c.e.FromArray(e.boundingBoxMinimum),c.e.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(r._binaryInfo=e._binaryInfo),r._delayInfo=[],e.hasUVs&&r._delayInfo.push(h.b.UVKind),e.hasUVs2&&r._delayInfo.push(h.b.UV2Kind),e.hasUVs3&&r._delayInfo.push(h.b.UV3Kind),e.hasUVs4&&r._delayInfo.push(h.b.UV4Kind),e.hasUVs5&&r._delayInfo.push(h.b.UV5Kind),e.hasUVs6&&r._delayInfo.push(h.b.UV6Kind),e.hasColors&&r._delayInfo.push(h.b.ColorKind),e.hasMatricesIndices&&r._delayInfo.push(h.b.MatricesIndicesKind),e.hasMatricesWeights&&r._delayInfo.push(h.b.MatricesWeightsKind),r._delayLoadingFunction=f.a._ImportGeometry,b.a.ForceFullSceneLoadingForIncremental&&r._checkDelayState()):f.a._ImportGeometry(e,r),e.materialId?r.setMaterialByID(e.materialId):r.material=null,e.morphTargetManagerId>-1&&(r.morphTargetManager=i.getMorphTargetManagerById(e.morphTargetManagerId)),void 0!==e.skeletonId&&null!==e.skeletonId&&(r.skeleton=i.getLastSkeletonByID(e.skeletonId),e.numBoneInfluencers&&(r.numBoneInfluencers=e.numBoneInfluencers)),e.animations){for(var o=0;o<e.animations.length;o++){var a=e.animations[o];(g=S.a.GetClass("BABYLON.Animation"))&&r.animations.push(g.Parse(a))}u.a.ParseAnimationRanges(r,e,i)}if(e.autoAnimate&&i.beginAnimation(r,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),e.layerMask&&!isNaN(e.layerMask)?r.layerMask=Math.abs(parseInt(e.layerMask)):r.layerMask=268435455,e.physicsImpostor&&t._PhysicsImpostorParser(i,r,e),e.lodMeshIds&&(r._waitingData.lods={ids:e.lodMeshIds,distances:e.lodDistances?e.lodDistances:null,coverages:e.lodCoverages?e.lodCoverages:null}),e.instances)for(var d=0;d<e.instances.length;d++){var p=e.instances[d],_=r.createInstance(p.name);if(p.id&&(_.id=p.id),s.a&&(p.tags?s.a.AddTagsTo(_,p.tags):s.a.AddTagsTo(_,e.tags)),_.position=c.e.FromArray(p.position),void 0!==p.metadata&&(_.metadata=p.metadata),p.parentId&&(_._waitingParentId=p.parentId),void 0!==p.isEnabled&&null!==p.isEnabled&&_.setEnabled(p.isEnabled),void 0!==p.isVisible&&null!==p.isVisible&&(_.isVisible=p.isVisible),void 0!==p.isPickable&&null!==p.isPickable&&(_.isPickable=p.isPickable),p.rotationQuaternion?_.rotationQuaternion=c.b.FromArray(p.rotationQuaternion):p.rotation&&(_.rotation=c.e.FromArray(p.rotation)),_.scaling=c.e.FromArray(p.scaling),null!=p.checkCollisions&&null!=p.checkCollisions&&(_.checkCollisions=p.checkCollisions),null!=p.pickable&&null!=p.pickable&&(_.isPickable=p.pickable),null!=p.showBoundingBox&&null!=p.showBoundingBox&&(_.showBoundingBox=p.showBoundingBox),null!=p.showSubMeshesBoundingBox&&null!=p.showSubMeshesBoundingBox&&(_.showSubMeshesBoundingBox=p.showSubMeshesBoundingBox),null!=p.alphaIndex&&null!=p.showSubMeshesBoundingBox&&(_.alphaIndex=p.alphaIndex),p.physicsImpostor&&t._PhysicsImpostorParser(i,_,p),p.animations){for(o=0;o<p.animations.length;o++){var g;a=p.animations[o],(g=S.a.GetClass("BABYLON.Animation"))&&_.animations.push(g.Parse(a))}u.a.ParseAnimationRanges(_,p,i),p.autoAnimate&&i.beginAnimation(_,p.autoAnimateFrom,p.autoAnimateTo,p.autoAnimateLoop,p.autoAnimateSpeed||1)}}if(e.thinInstances){var v=e.thinInstances;if(v.matrixData?(r.thinInstanceSetBuffer("matrix",new Float32Array(v.matrixData),16,!1),r._thinInstanceDataStorage.matrixBufferSize=v.matrixBufferSize,r._thinInstanceDataStorage.instancesCount=v.instancesCount):r._thinInstanceDataStorage.matrixBufferSize=v.matrixBufferSize,e.thinInstances.userThinInstance){var T=e.thinInstances.userThinInstance;for(var E in T.data)r.thinInstanceSetBuffer(E,new Float32Array(T.data[E]),T.strides[E],!1),r._userThinInstanceBuffersStorage.sizes[E]=T.sizes[E]}}return r},t.CreateRibbon=function(e,t,i,n,r,o,a,s,c){throw A.a.WarnImport("MeshBuilder")},t.CreateDisc=function(e,t,i,n,r,o){throw void 0===n&&(n=null),A.a.WarnImport("MeshBuilder")},t.CreateBox=function(e,t,i,n,r){throw void 0===i&&(i=null),A.a.WarnImport("MeshBuilder")},t.CreateSphere=function(e,t,i,n,r,o){throw A.a.WarnImport("MeshBuilder")},t.CreateHemisphere=function(e,t,i,n){throw A.a.WarnImport("MeshBuilder")},t.CreateCylinder=function(e,t,i,n,r,o,a,s,c){throw A.a.WarnImport("MeshBuilder")},t.CreateTorus=function(e,t,i,n,r,o,a){throw A.a.WarnImport("MeshBuilder")},t.CreateTorusKnot=function(e,t,i,n,r,o,a,s,c,l){throw A.a.WarnImport("MeshBuilder")},t.CreateLines=function(e,t,i,n,r){throw void 0===i&&(i=null),void 0===n&&(n=!1),void 0===r&&(r=null),A.a.WarnImport("MeshBuilder")},t.CreateDashedLines=function(e,t,i,n,r,o,a,s){throw void 0===o&&(o=null),A.a.WarnImport("MeshBuilder")},t.CreatePolygon=function(e,t,i,n,r,o,a){throw void 0===a&&(a=earcut),A.a.WarnImport("MeshBuilder")},t.ExtrudePolygon=function(e,t,i,n,r,o,a,s){throw void 0===s&&(s=earcut),A.a.WarnImport("MeshBuilder")},t.ExtrudeShape=function(e,t,i,n,r,o,a,s,c,l){throw void 0===a&&(a=null),A.a.WarnImport("MeshBuilder")},t.ExtrudeShapeCustom=function(e,t,i,n,r,o,a,s,c,l,u,h){throw A.a.WarnImport("MeshBuilder")},t.CreateLathe=function(e,t,i,n,r,o,a){throw A.a.WarnImport("MeshBuilder")},t.CreatePlane=function(e,t,i,n,r){throw A.a.WarnImport("MeshBuilder")},t.CreateGround=function(e,t,i,n,r,o){throw A.a.WarnImport("MeshBuilder")},t.CreateTiledGround=function(e,t,i,n,r,o,a,s,c){throw A.a.WarnImport("MeshBuilder")},t.CreateGroundFromHeightMap=function(e,t,i,n,r,o,a,s,c,l,u){throw A.a.WarnImport("MeshBuilder")},t.CreateTube=function(e,t,i,n,r,o,a,s,c,l){throw A.a.WarnImport("MeshBuilder")},t.CreatePolyhedron=function(e,t,i){throw A.a.WarnImport("MeshBuilder")},t.CreateIcoSphere=function(e,t,i){throw A.a.WarnImport("MeshBuilder")},t.CreateDecal=function(e,t,i,n,r,o){throw A.a.WarnImport("MeshBuilder")},t.CreateCapsule=function(e,t,i){throw A.a.WarnImport("MeshBuilder")},t.prototype.setPositionsForCPUSkinning=function(){var e=this._internalMeshDataInfo;if(!e._sourcePositions){var t=this.getVerticesData(h.b.PositionKind);if(!t)return e._sourcePositions;e._sourcePositions=new Float32Array(t),this.isVertexBufferUpdatable(h.b.PositionKind)||this.setVerticesData(h.b.PositionKind,t,!0)}return e._sourcePositions},t.prototype.setNormalsForCPUSkinning=function(){var e=this._internalMeshDataInfo;if(!e._sourceNormals){var t=this.getVerticesData(h.b.NormalKind);if(!t)return e._sourceNormals;e._sourceNormals=new Float32Array(t),this.isVertexBufferUpdatable(h.b.NormalKind)||this.setVerticesData(h.b.NormalKind,t,!0)}return e._sourceNormals},t.prototype.applySkeleton=function(e){if(!this.geometry)return this;if(this.geometry._softwareSkinningFrameId==this.getScene().getFrameId())return this;if(this.geometry._softwareSkinningFrameId=this.getScene().getFrameId(),!this.isVerticesDataPresent(h.b.PositionKind))return this;if(!this.isVerticesDataPresent(h.b.MatricesIndicesKind))return this;if(!this.isVerticesDataPresent(h.b.MatricesWeightsKind))return this;var t=this.isVerticesDataPresent(h.b.NormalKind),i=this._internalMeshDataInfo;if(!i._sourcePositions){var n=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=n}t&&!i._sourceNormals&&this.setNormalsForCPUSkinning();var r=this.getVerticesData(h.b.PositionKind);if(!r)return this;r instanceof Float32Array||(r=new Float32Array(r));var o=this.getVerticesData(h.b.NormalKind);if(t){if(!o)return this;o instanceof Float32Array||(o=new Float32Array(o))}var a=this.getVerticesData(h.b.MatricesIndicesKind),s=this.getVerticesData(h.b.MatricesWeightsKind);if(!s||!a)return this;for(var l,u=this.numBoneInfluencers>4,d=u?this.getVerticesData(h.b.MatricesIndicesExtraKind):null,f=u?this.getVerticesData(h.b.MatricesWeightsExtraKind):null,p=e.getTransformMatrices(this),_=c.e.Zero(),m=new c.a,g=new c.a,v=0,b=0;b<r.length;b+=3,v+=4){var y;for(l=0;l<4;l++)(y=s[v+l])>0&&(c.a.FromFloat32ArrayToRefScaled(p,Math.floor(16*a[v+l]),y,g),m.addToSelf(g));if(u)for(l=0;l<4;l++)(y=f[v+l])>0&&(c.a.FromFloat32ArrayToRefScaled(p,Math.floor(16*d[v+l]),y,g),m.addToSelf(g));c.e.TransformCoordinatesFromFloatsToRef(i._sourcePositions[b],i._sourcePositions[b+1],i._sourcePositions[b+2],m,_),_.toArray(r,b),t&&(c.e.TransformNormalFromFloatsToRef(i._sourceNormals[b],i._sourceNormals[b+1],i._sourceNormals[b+2],m,_),_.toArray(o,b)),m.reset()}return this.updateVerticesData(h.b.PositionKind,r),t&&this.updateVerticesData(h.b.NormalKind,o),this},t.MinMax=function(e){var t=null,i=null;return e.forEach(function(e){var n=e.getBoundingInfo().boundingBox;t&&i?(t.minimizeInPlace(n.minimumWorld),i.maximizeInPlace(n.maximumWorld)):(t=n.minimumWorld,i=n.maximumWorld)}),t&&i?{min:t,max:i}:{min:c.e.Zero(),max:c.e.Zero()}},t.Center=function(e){var i=e instanceof Array?t.MinMax(e):e;return c.e.Center(i.min,i.max)},t.MergeMeshes=function(e,i,n,r,o,a){var s;if(void 0===i&&(i=!0),!n){var c=0;for(s=0;s<e.length;s++)if(e[s]&&(c+=e[s].getTotalVertices())>=65536)return E.a.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}if(a){var l,u,h=null;o=!1}var f,p=new Array,m=new Array,g=null,b=new Array,y=null;for(s=0;s<e.length;s++)if(e[s]){var T=e[s];if(T.isAnInstance)return E.a.Warn("Cannot merge instance meshes."),null;var S=T.computeWorldMatrix(!0);if((f=d.a.ExtractFromMesh(T,!0,!0)).transform(S),g?g.merge(f,n):(g=f,y=T),o&&b.push(T.getTotalIndices()),a)if(T.material){var A=T.material;if(A instanceof v.a){for(u=0;u<A.subMaterials.length;u++)p.indexOf(A.subMaterials[u])<0&&p.push(A.subMaterials[u]);for(l=0;l<T.subMeshes.length;l++)m.push(p.indexOf(A.subMaterials[T.subMeshes[l].materialIndex])),b.push(T.subMeshes[l].indexCount)}else for(p.indexOf(A)<0&&p.push(A),l=0;l<T.subMeshes.length;l++)m.push(p.indexOf(A)),b.push(T.subMeshes[l].indexCount)}else for(l=0;l<T.subMeshes.length;l++)m.push(0),b.push(T.subMeshes[l].indexCount)}if(y=y,r||(r=new t(y.name+"_merged",y.getScene())),g.applyToMesh(r),r.checkCollisions=y.checkCollisions,r.overrideMaterialSideOrientation=y.overrideMaterialSideOrientation,i)for(s=0;s<e.length;s++)e[s]&&e[s].dispose();if(o||a){r.releaseSubMeshes(),s=0;for(var P=0;s<b.length;)_.a.CreateFromIndices(0,P,b[s],r),P+=b[s],s++}if(a){for((h=new v.a(y.name+"_merged",y.getScene())).subMaterials=p,l=0;l<r.subMeshes.length;l++)r.subMeshes[l].materialIndex=m[l];r.material=h}else r.material=y.material;return r},t.prototype.addInstance=function(e){e._indexInSourceMeshInstanceArray=this.instances.length,this.instances.push(e)},t.prototype.removeInstance=function(e){var t=e._indexInSourceMeshInstanceArray;if(-1!=t){if(t!==this.instances.length-1){var i=this.instances[this.instances.length-1];this.instances[t]=i,i._indexInSourceMeshInstanceArray=t}e._indexInSourceMeshInstanceArray=-1,this.instances.pop()}},t.FRONTSIDE=d.a.FRONTSIDE,t.BACKSIDE=d.a.BACKSIDE,t.DOUBLESIDE=d.a.DOUBLESIDE,t.DEFAULTSIDE=d.a.DEFAULTSIDE,t.NO_CAP=0,t.CAP_START=1,t.CAP_END=2,t.CAP_ALL=3,t.NO_FLIP=0,t.FLIP_TILE=1,t.ROTATE_TILE=2,t.FLIP_ROW=3,t.ROTATE_ROW=4,t.FLIP_N_ROTATE_TILE=5,t.FLIP_N_ROTATE_ROW=6,t.CENTER=0,t.LEFT=1,t.RIGHT=2,t.TOP=3,t.BOTTOM=4,t._GroundMeshParser=function(e,t){throw A.a.WarnImport("GroundMesh")},t}(p.a);S.a.RegisteredTypes["BABYLON.Mesh"]=N},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e._AddLogEntry=function(t){e._LogCache=t+e._LogCache,e.OnNewCacheEntry&&e.OnNewCacheEntry(t)},e._FormatMessage=function(e){var t=function(e){return e<10?"0"+e:""+e},i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e},e._LogDisabled=function(e){},e._LogEnabled=function(t){var i=e._FormatMessage(t);console.log("BJS - "+i);var n="<div style='color:white'>"+i+"</div><br>";e._AddLogEntry(n)},e._WarnDisabled=function(e){},e._WarnEnabled=function(t){var i=e._FormatMessage(t);console.warn("BJS - "+i);var n="<div style='color:orange'>"+i+"</div><br>";e._AddLogEntry(n)},e._ErrorDisabled=function(e){},e._ErrorEnabled=function(t){e.errorsCount++;var i=e._FormatMessage(t);console.error("BJS - "+i);var n="<div style='color:red'>"+i+"</div><br>";e._AddLogEntry(n)},Object.defineProperty(e,"LogCache",{get:function(){return e._LogCache},enumerable:!1,configurable:!0}),e.ClearLogCache=function(){e._LogCache="",e.errorsCount=0},Object.defineProperty(e,"LogLevels",{set:function(t){(t&e.MessageLogLevel)===e.MessageLogLevel?e.Log=e._LogEnabled:e.Log=e._LogDisabled,(t&e.WarningLogLevel)===e.WarningLogLevel?e.Warn=e._WarnEnabled:e.Warn=e._WarnDisabled,(t&e.ErrorLogLevel)===e.ErrorLogLevel?e.Error=e._ErrorEnabled:e.Error=e._ErrorDisabled},enumerable:!1,configurable:!0}),e.NoneLogLevel=0,e.MessageLogLevel=1,e.WarningLogLevel=2,e.ErrorLogLevel=4,e.AllLogLevel=7,e._LogCache="",e.errorsCount=0,e.Log=e._LogEnabled,e.Warn=e._WarnEnabled,e.Error=e._ErrorEnabled,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return c}),i.d(t,"c",function(){return l});var n=i(14),r=i(28),o=i(44),a=i(11),s=function(){function e(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),this.r=e,this.g=t,this.b=i}return e.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"},e.prototype.getClassName=function(){return"Color3"},e.prototype.getHashCode=function(){var e=255*this.r|0;return 397*(e=397*e^(255*this.g|0))^(255*this.b|0)},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.toColor4=function(e){return void 0===e&&(e=1),new c(this.r,this.g,this.b,e)},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.toLuminance=function(){return.3*this.r+.59*this.g+.11*this.b},e.prototype.multiply=function(t){return new e(this.r*t.r,this.g*t.g,this.b*t.b)},e.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,this},e.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b},e.prototype.equalsFloats=function(e,t,i){return this.r===e&&this.g===t&&this.b===i},e.prototype.scale=function(t){return new e(this.r*t,this.g*t,this.b*t)},e.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,this},e.prototype.clampToRef=function(e,t,i){return void 0===e&&(e=0),void 0===t&&(t=1),i.r=n.a.Clamp(this.r,e,t),i.g=n.a.Clamp(this.g,e,t),i.b=n.a.Clamp(this.b,e,t),this},e.prototype.add=function(t){return new e(this.r+t.r,this.g+t.g,this.b+t.b)},e.prototype.addToRef=function(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,this},e.prototype.subtract=function(t){return new e(this.r-t.r,this.g-t.g,this.b-t.b)},e.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,this},e.prototype.clone=function(){return new e(this.r,this.g,this.b)},e.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},e.prototype.copyFromFloats=function(e,t,i){return this.r=e,this.g=t,this.b=i,this},e.prototype.set=function(e,t,i){return this.copyFromFloats(e,t,i)},e.prototype.toHexString=function(){var e=255*this.r|0,t=255*this.g|0,i=255*this.b|0;return"#"+n.a.ToHex(e)+n.a.ToHex(t)+n.a.ToHex(i)},e.prototype.toLinearSpace=function(){var t=new e;return this.toLinearSpaceToRef(t),t},e.prototype.toHSV=function(){var t=new e;return this.toHSVToRef(t),t},e.prototype.toHSVToRef=function(e){var t=this.r,i=this.g,n=this.b,r=Math.max(t,i,n),o=Math.min(t,i,n),a=0,s=0,c=r,l=r-o;0!==r&&(s=l/r),r!=o&&(r==t?(a=(i-n)/l,i<n&&(a+=6)):r==i?a=(n-t)/l+2:r==n&&(a=(t-i)/l+4),a*=60),e.r=a,e.g=s,e.b=c},e.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,r.c),e.g=Math.pow(this.g,r.c),e.b=Math.pow(this.b,r.c),this},e.prototype.toGammaSpace=function(){var t=new e;return this.toGammaSpaceToRef(t),t},e.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,r.b),e.g=Math.pow(this.g,r.b),e.b=Math.pow(this.b,r.b),this},e.HSVtoRGBToRef=function(e,t,i,n){var r=i*t,o=e/60,a=r*(1-Math.abs(o%2-1)),s=0,c=0,l=0;o>=0&&o<=1?(s=r,c=a):o>=1&&o<=2?(s=a,c=r):o>=2&&o<=3?(c=r,l=a):o>=3&&o<=4?(c=a,l=r):o>=4&&o<=5?(s=a,l=r):o>=5&&o<=6&&(s=r,l=a);var u=i-r;n.set(s+u,c+u,l+u)},e.FromHexString=function(t){if("#"!==t.substring(0,1)||7!==t.length)return new e(0,0,0);var i=parseInt(t.substring(1,3),16),n=parseInt(t.substring(3,5),16),r=parseInt(t.substring(5,7),16);return e.FromInts(i,n,r)},e.FromArray=function(t,i){return void 0===i&&(i=0),new e(t[i],t[i+1],t[i+2])},e.FromArrayToRef=function(e,t,i){void 0===t&&(t=0),i.r=e[t],i.g=e[t+1],i.b=e[t+2]},e.FromInts=function(t,i,n){return new e(t/255,i/255,n/255)},e.Lerp=function(t,i,n){var r=new e(0,0,0);return e.LerpToRef(t,i,n,r),r},e.LerpToRef=function(e,t,i,n){n.r=e.r+(t.r-e.r)*i,n.g=e.g+(t.g-e.g)*i,n.b=e.b+(t.b-e.b)*i},e.Red=function(){return new e(1,0,0)},e.Green=function(){return new e(0,1,0)},e.Blue=function(){return new e(0,0,1)},e.Black=function(){return new e(0,0,0)},Object.defineProperty(e,"BlackReadOnly",{get:function(){return e._BlackReadOnly},enumerable:!1,configurable:!0}),e.White=function(){return new e(1,1,1)},e.Purple=function(){return new e(.5,0,.5)},e.Magenta=function(){return new e(1,0,1)},e.Yellow=function(){return new e(1,1,0)},e.Gray=function(){return new e(.5,.5,.5)},e.Teal=function(){return new e(0,1,1)},e.Random=function(){return new e(Math.random(),Math.random(),Math.random())},e._BlackReadOnly=e.Black(),e}(),c=function(){function e(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=1),this.r=e,this.g=t,this.b=i,this.a=n}return e.prototype.addInPlace=function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a},e.prototype.add=function(t){return new e(this.r+t.r,this.g+t.g,this.b+t.b,this.a+t.a)},e.prototype.subtract=function(t){return new e(this.r-t.r,this.g-t.g,this.b-t.b,this.a-t.a)},e.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,this},e.prototype.scale=function(t){return new e(this.r*t,this.g*t,this.b*t,this.a*t)},e.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,this},e.prototype.clampToRef=function(e,t,i){return void 0===e&&(e=0),void 0===t&&(t=1),i.r=n.a.Clamp(this.r,e,t),i.g=n.a.Clamp(this.g,e,t),i.b=n.a.Clamp(this.b,e,t),i.a=n.a.Clamp(this.a,e,t),this},e.prototype.multiply=function(t){return new e(this.r*t.r,this.g*t.g,this.b*t.b,this.a*t.a)},e.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t},e.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},e.prototype.getClassName=function(){return"Color4"},e.prototype.getHashCode=function(){var e=255*this.r|0;return 397*(e=397*(e=397*e^(255*this.g|0))^(255*this.b|0))^(255*this.a|0)},e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.a)},e.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this},e.prototype.copyFromFloats=function(e,t,i,n){return this.r=e,this.g=t,this.b=i,this.a=n,this},e.prototype.set=function(e,t,i,n){return this.copyFromFloats(e,t,i,n)},e.prototype.toHexString=function(e){void 0===e&&(e=!1);var t=255*this.r|0,i=255*this.g|0,r=255*this.b|0;if(e)return"#"+n.a.ToHex(t)+n.a.ToHex(i)+n.a.ToHex(r);var o=255*this.a|0;return"#"+n.a.ToHex(t)+n.a.ToHex(i)+n.a.ToHex(r)+n.a.ToHex(o)},e.prototype.toLinearSpace=function(){var t=new e;return this.toLinearSpaceToRef(t),t},e.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,r.c),e.g=Math.pow(this.g,r.c),e.b=Math.pow(this.b,r.c),e.a=this.a,this},e.prototype.toGammaSpace=function(){var t=new e;return this.toGammaSpaceToRef(t),t},e.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,r.b),e.g=Math.pow(this.g,r.b),e.b=Math.pow(this.b,r.b),e.a=this.a,this},e.FromHexString=function(t){if("#"!==t.substring(0,1)||9!==t.length)return new e(0,0,0,0);var i=parseInt(t.substring(1,3),16),n=parseInt(t.substring(3,5),16),r=parseInt(t.substring(5,7),16),o=parseInt(t.substring(7,9),16);return e.FromInts(i,n,r,o)},e.Lerp=function(t,i,n){var r=new e(0,0,0,0);return e.LerpToRef(t,i,n,r),r},e.LerpToRef=function(e,t,i,n){n.r=e.r+(t.r-e.r)*i,n.g=e.g+(t.g-e.g)*i,n.b=e.b+(t.b-e.b)*i,n.a=e.a+(t.a-e.a)*i},e.FromColor3=function(t,i){return void 0===i&&(i=1),new e(t.r,t.g,t.b,i)},e.FromArray=function(t,i){return void 0===i&&(i=0),new e(t[i],t[i+1],t[i+2],t[i+3])},e.FromArrayToRef=function(e,t,i){void 0===t&&(t=0),i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]},e.FromInts=function(t,i,n,r){return new e(t/255,i/255,n/255,r/255)},e.CheckColors4=function(e,t){if(e.length===3*t){for(var i=[],n=0;n<e.length;n+=3){var r=n/3*4;i[r]=e[n],i[r+1]=e[n+1],i[r+2]=e[n+2],i[r+3]=1}return i}return e},e}(),l=function(){function e(){}return e.Color3=o.a.BuildArray(3,s.Black),e.Color4=o.a.BuildArray(3,function(){return new c(0,0,0,0)}),e}();a.a.RegisteredTypes["BABYLON.Color3"]=s,a.a.RegisteredTypes["BABYLON.Color4"]=c},function(e,t,i){"use strict";i.d(t,"a",function(){return m});var n=i(1),r=i(3),o=i(6),a=i(0),s=i(52),c=i(2),l=i(11),u=i(21),h=i(104),d=i(122),f=i(64),p=i(34),_=i(150),m=function(e){function t(i,n,r,a,s,l,u,d,f,p,_,m){void 0===r&&(r=!1),void 0===a&&(a=!0),void 0===s&&(s=t.TRILINEAR_SAMPLINGMODE),void 0===l&&(l=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===f&&(f=!1);var g=e.call(this,n)||this;g.url=null,g.uOffset=0,g.vOffset=0,g.uScale=1,g.vScale=1,g.uAng=0,g.vAng=0,g.wAng=0,g.uRotationCenter=.5,g.vRotationCenter=.5,g.wRotationCenter=.5,g.homogeneousRotationInUVTransform=!1,g.inspectableCustomProperties=null,g._noMipmap=!1,g._invertY=!1,g._rowGenerationMatrix=null,g._cachedTextureMatrix=null,g._projectionModeMatrix=null,g._t0=null,g._t1=null,g._t2=null,g._cachedUOffset=-1,g._cachedVOffset=-1,g._cachedUScale=0,g._cachedVScale=0,g._cachedUAng=-1,g._cachedVAng=-1,g._cachedWAng=-1,g._cachedProjectionMatrixId=-1,g._cachedURotationCenter=-1,g._cachedVRotationCenter=-1,g._cachedWRotationCenter=-1,g._cachedHomogeneousRotationInUVTransform=!1,g._cachedCoordinatesMode=-1,g._initialSamplingMode=t.BILINEAR_SAMPLINGMODE,g._buffer=null,g._deleteBuffer=!1,g._format=null,g._delayedOnLoad=null,g._delayedOnError=null,g.onLoadObservable=new o.c,g._isBlocking=!0,g.name=i||"",g.url=i,g._noMipmap=r,g._invertY=a,g._initialSamplingMode=s,g._buffer=d,g._deleteBuffer=f,g._mimeType=_,g._loaderOptions=m,p&&(g._format=p);var v=g.getScene(),b=g._getEngine();if(!b)return g;b.onBeforeTextureInitObservable.notifyObservers(g);var y=function(){g._texture&&(g._texture._invertVScale&&(g.vScale*=-1,g.vOffset+=1),null!==g._texture._cachedWrapU&&(g.wrapU=g._texture._cachedWrapU,g._texture._cachedWrapU=null),null!==g._texture._cachedWrapV&&(g.wrapV=g._texture._cachedWrapV,g._texture._cachedWrapV=null),null!==g._texture._cachedWrapR&&(g.wrapR=g._texture._cachedWrapR,g._texture._cachedWrapR=null)),g.onLoadObservable.hasObservers()&&g.onLoadObservable.notifyObservers(g),l&&l(),!g.isBlocking&&v&&v.resetCachedMaterial()};return g.url?(g._texture=g._getFromCache(g.url,r,s,a),g._texture?g._texture.isReady?h.a.SetImmediate(function(){return y()}):g._texture.onLoadedObservable.add(y):v&&v.useDelayedTextureLoading?(g.delayLoadState=c.a.DELAYLOADSTATE_NOTLOADED,g._delayedOnLoad=y,g._delayedOnError=u):(g._texture=b.createTexture(g.url,r,a,v,s,y,u,g._buffer,void 0,g._format,null,_,m),f&&(g._buffer=null)),g):(g._delayedOnLoad=y,g._delayedOnError=u,g)}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"noMipmap",{get:function(){return this._noMipmap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mimeType",{get:function(){return this._mimeType},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isBlocking",{get:function(){return this._isBlocking},set:function(e){this._isBlocking=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"samplingMode",{get:function(){return this._texture?this._texture.samplingMode:this._initialSamplingMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"invertY",{get:function(){return this._invertY},enumerable:!1,configurable:!0}),t.prototype.updateURL=function(e,t,i){void 0===t&&(t=null),this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(c.a.MATERIAL_TextureDirtyFlag)),this.name&&!p.a.StartsWith(this.name,"data:")||(this.name=e),this.url=e,this._buffer=t,this.delayLoadState=c.a.DELAYLOADSTATE_NOTLOADED,i&&(this._delayedOnLoad=i),this.delayLoad()},t.prototype.delayLoad=function(){if(this.delayLoadState===c.a.DELAYLOADSTATE_NOTLOADED){var e=this.getScene();e&&(this.delayLoadState=c.a.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap,this.samplingMode,this._invertY),this._texture?this._delayedOnLoad&&(this._texture.isReady?h.a.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(this.url,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,null,this._mimeType,this._loaderOptions),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null)}},t.prototype._prepareRowForTextureGeneration=function(e,t,i,n){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,i-=this.wRotationCenter,a.e.TransformCoordinatesFromFloatsToRef(e,t,i,this._rowGenerationMatrix,n),n.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,n.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,n.z+=this.wRotationCenter},t.prototype.checkTransformsAreIdentical=function(e){return null!==e&&this.uOffset===e.uOffset&&this.vOffset===e.vOffset&&this.uScale===e.uScale&&this.vScale===e.vScale&&this.uAng===e.uAng&&this.vAng===e.vAng&&this.wAng===e.wAng},t.prototype.getTextureMatrix=function(e){var t=this;if(void 0===e&&(e=1),this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,this._cachedTextureMatrix&&this._rowGenerationMatrix||(this._cachedTextureMatrix=a.a.Zero(),this._rowGenerationMatrix=new a.a,this._t0=a.e.Zero(),this._t1=a.e.Zero(),this._t2=a.e.Zero()),a.a.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(a.a.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,a.c.Matrix[0]),a.a.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,a.c.Matrix[1]),a.a.ScalingToRef(this._cachedUScale,this._cachedVScale,0,a.c.Matrix[2]),a.a.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,a.c.Matrix[3]),a.c.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(a.c.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(a.c.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(a.c.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),a.a.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));var i=this.getScene();return i?(i.markAllMaterialsAsDirty(c.a.MATERIAL_TextureDirtyFlag,function(e){return e.hasTexture(t)}),this._cachedTextureMatrix):this._cachedTextureMatrix},t.prototype.getReflectionTextureMatrix=function(){var e=this,i=this.getScene();if(!i)return this._cachedTextureMatrix;if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale===this._cachedUScale&&this.vScale===this._cachedVScale&&this.coordinatesMode===this._cachedCoordinatesMode){if(this.coordinatesMode!==t.PROJECTION_MODE)return this._cachedTextureMatrix;if(this._cachedProjectionMatrixId===i.getProjectionMatrix().updateFlag)return this._cachedTextureMatrix}switch(this._cachedTextureMatrix||(this._cachedTextureMatrix=a.a.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=a.a.Zero()),this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale,this._cachedVScale=this.vScale,this._cachedCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case t.PLANAR_MODE:a.a.IdentityToRef(this._cachedTextureMatrix),this._cachedTextureMatrix[0]=this.uScale,this._cachedTextureMatrix[5]=this.vScale,this._cachedTextureMatrix[12]=this.uOffset,this._cachedTextureMatrix[13]=this.vOffset;break;case t.PROJECTION_MODE:a.a.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);var n=i.getProjectionMatrix();this._cachedProjectionMatrixId=n.updateFlag,n.multiplyToRef(this._projectionModeMatrix,this._cachedTextureMatrix);break;default:a.a.IdentityToRef(this._cachedTextureMatrix)}return i.markAllMaterialsAsDirty(c.a.MATERIAL_TextureDirtyFlag,function(t){return-1!==t.getActiveTextures().indexOf(e)}),this._cachedTextureMatrix},t.prototype.clone=function(){var e=this;return r.a.Clone(function(){return new t(e._texture?e._texture.url:null,e.getScene(),e._noMipmap,e._invertY,e.samplingMode,void 0,void 0,e._texture?e._texture._buffer:void 0)},this)},t.prototype.serialize=function(){var i=this.name;t.SerializeBuffers||p.a.StartsWith(this.name,"data:")&&(this.name=""),p.a.StartsWith(this.name,"data:")&&this.url===this.name&&(this.url="");var n=e.prototype.serialize.call(this);return n?((t.SerializeBuffers||t.ForceSerializeBuffers)&&("string"==typeof this._buffer&&"data:"===this._buffer.substr(0,5)?(n.base64String=this._buffer,n.name=n.name.replace("data:","")):this.url&&p.a.StartsWith(this.url,"data:")&&this._buffer instanceof Uint8Array?n.base64String="data:image/png;base64,"+p.a.EncodeArrayBufferToBase64(this._buffer):t.ForceSerializeBuffers&&(n.base64String=_.a.GenerateBase64StringFromTexture(this))),n.invertY=this._invertY,n.samplingMode=this.samplingMode,this.name=i,n):null},t.prototype.getClassName=function(){return"Texture"},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null},t.Parse=function(e,i,n){if(e.customType){var o=d.a.Instantiate(e.customType).Parse(e,i,n);return e.samplingMode&&o.updateSamplingMode&&o._samplingMode&&o._samplingMode!==e.samplingMode&&o.updateSamplingMode(e.samplingMode),o}if(e.isCube&&!e.isRenderTarget)return t._CubeTextureParser(e,i,n);if(!e.name&&!e.isRenderTarget)return null;var a=function(){if(s&&s._texture&&(s._texture._cachedWrapU=null,s._texture._cachedWrapV=null,s._texture._cachedWrapR=null),e.samplingMode){var t=e.samplingMode;s&&s.samplingMode!==t&&s.updateSamplingMode(t)}if(s&&e.animations)for(var i=0;i<e.animations.length;i++){var n=e.animations[i],r=l.a.GetClass("BABYLON.Animation");r&&s.animations.push(r.Parse(n))}},s=r.a.Parse(function(){var r,o=!0;if(e.noMipmap&&(o=!1),e.mirrorPlane){var s=t._CreateMirror(e.name,e.renderTargetSize,i,o);return s._waitingRenderList=e.renderList,s.mirrorPlane=f.a.FromArray(e.mirrorPlane),a(),s}if(e.isRenderTarget){var c=null;if(e.isCube){if(i.reflectionProbes)for(var l=0;l<i.reflectionProbes.length;l++){var u=i.reflectionProbes[l];if(u.name===e.name)return u.cubeTexture}}else(c=t._CreateRenderTargetTexture(e.name,e.renderTargetSize,i,o))._waitingRenderList=e.renderList;return a(),c}if(e.base64String)r=t.CreateFromBase64String(e.base64String,e.name,i,!o,e.invertY,void 0,a);else{var h=void 0;h=e.name&&e.name.indexOf("://")>0?e.name:n+e.name,(p.a.StartsWith(e.url,"data:")||t.UseSerializedUrlIfAny&&e.url)&&(h=e.url),r=new t(h,i,!o,e.invertY,void 0,a)}return r},e,i);return s},t.CreateFromBase64String=function(e,i,n,r,o,a,s,l,u){return void 0===a&&(a=t.TRILINEAR_SAMPLINGMODE),void 0===s&&(s=null),void 0===l&&(l=null),void 0===u&&(u=c.a.TEXTUREFORMAT_RGBA),new t("data:"+i,n,r,o,a,s,l,e,!1,u)},t.LoadFromDataString=function(e,i,n,r,o,a,s,l,u,h){return void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===a&&(a=!0),void 0===s&&(s=t.TRILINEAR_SAMPLINGMODE),void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=c.a.TEXTUREFORMAT_RGBA),"data:"!==e.substr(0,5)&&(e="data:"+e),new t(e,n,o,a,s,l,u,i,r,h)},t.SerializeBuffers=!0,t.ForceSerializeBuffers=!1,t._CubeTextureParser=function(e,t,i){throw u.a.WarnImport("CubeTexture")},t._CreateMirror=function(e,t,i,n){throw u.a.WarnImport("MirrorTexture")},t._CreateRenderTargetTexture=function(e,t,i,n){throw u.a.WarnImport("RenderTargetTexture")},t.NEAREST_SAMPLINGMODE=c.a.TEXTURE_NEAREST_SAMPLINGMODE,t.NEAREST_NEAREST_MIPLINEAR=c.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR,t.BILINEAR_SAMPLINGMODE=c.a.TEXTURE_BILINEAR_SAMPLINGMODE,t.LINEAR_LINEAR_MIPNEAREST=c.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST,t.TRILINEAR_SAMPLINGMODE=c.a.TEXTURE_TRILINEAR_SAMPLINGMODE,t.LINEAR_LINEAR_MIPLINEAR=c.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR,t.NEAREST_NEAREST_MIPNEAREST=c.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST,t.NEAREST_LINEAR_MIPNEAREST=c.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST,t.NEAREST_LINEAR_MIPLINEAR=c.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR,t.NEAREST_LINEAR=c.a.TEXTURE_NEAREST_LINEAR,t.NEAREST_NEAREST=c.a.TEXTURE_NEAREST_NEAREST,t.LINEAR_NEAREST_MIPNEAREST=c.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST,t.LINEAR_NEAREST_MIPLINEAR=c.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR,t.LINEAR_LINEAR=c.a.TEXTURE_LINEAR_LINEAR,t.LINEAR_NEAREST=c.a.TEXTURE_LINEAR_NEAREST,t.EXPLICIT_MODE=c.a.TEXTURE_EXPLICIT_MODE,t.SPHERICAL_MODE=c.a.TEXTURE_SPHERICAL_MODE,t.PLANAR_MODE=c.a.TEXTURE_PLANAR_MODE,t.CUBIC_MODE=c.a.TEXTURE_CUBIC_MODE,t.PROJECTION_MODE=c.a.TEXTURE_PROJECTION_MODE,t.SKYBOX_MODE=c.a.TEXTURE_SKYBOX_MODE,t.INVCUBIC_MODE=c.a.TEXTURE_INVCUBIC_MODE,t.EQUIRECTANGULAR_MODE=c.a.TEXTURE_EQUIRECTANGULAR_MODE,t.FIXED_EQUIRECTANGULAR_MODE=c.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,t.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=c.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,t.CLAMP_ADDRESSMODE=c.a.TEXTURE_CLAMP_ADDRESSMODE,t.WRAP_ADDRESSMODE=c.a.TEXTURE_WRAP_ADDRESSMODE,t.MIRROR_ADDRESSMODE=c.a.TEXTURE_MIRROR_ADDRESSMODE,t.UseSerializedUrlIfAny=!1,Object(n.c)([Object(r.c)()],t.prototype,"url",void 0),Object(n.c)([Object(r.c)()],t.prototype,"uOffset",void 0),Object(n.c)([Object(r.c)()],t.prototype,"vOffset",void 0),Object(n.c)([Object(r.c)()],t.prototype,"uScale",void 0),Object(n.c)([Object(r.c)()],t.prototype,"vScale",void 0),Object(n.c)([Object(r.c)()],t.prototype,"uAng",void 0),Object(n.c)([Object(r.c)()],t.prototype,"vAng",void 0),Object(n.c)([Object(r.c)()],t.prototype,"wAng",void 0),Object(n.c)([Object(r.c)()],t.prototype,"uRotationCenter",void 0),Object(n.c)([Object(r.c)()],t.prototype,"vRotationCenter",void 0),Object(n.c)([Object(r.c)()],t.prototype,"wRotationCenter",void 0),Object(n.c)([Object(r.c)()],t.prototype,"homogeneousRotationInUVTransform",void 0),Object(n.c)([Object(r.c)()],t.prototype,"isBlocking",null),t}(s.a);l.a.RegisteredTypes["BABYLON.Texture"]=m,r.a._TextureParser=m.Parse},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.GetClass=function(e){return this.RegisteredTypes&&this.RegisteredTypes[e]?this.RegisteredTypes[e]:null},e.RegisteredTypes={},e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return m}),i.d(t,"c",function(){return g}),i.d(t,"a",function(){return v});var n=i(6),r=i(38),o=i(8),a=i(41),s=i(57),c=i(21),l=i(49),u=i(22),h=i(56),d=i(145),f=i(104),p=i(122),_=i(120),m=function(){function e(){}return Object.defineProperty(e,"BaseUrl",{get:function(){return h.a.BaseUrl},set:function(e){h.a.BaseUrl=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DefaultRetryStrategy",{get:function(){return h.a.DefaultRetryStrategy},set:function(e){h.a.DefaultRetryStrategy=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CorsBehavior",{get:function(){return h.a.CorsBehavior},set:function(e){h.a.CorsBehavior=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"UseFallbackTexture",{get:function(){return u.a.UseFallbackTexture},set:function(e){u.a.UseFallbackTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"RegisteredExternalClasses",{get:function(){return p.a.RegisteredExternalClasses},set:function(e){p.a.RegisteredExternalClasses=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fallbackTexture",{get:function(){return u.a.FallbackTexture},set:function(e){u.a.FallbackTexture=e},enumerable:!1,configurable:!0}),e.FetchToRef=function(e,t,i,n,r,o){var a=4*((Math.abs(e)*i%i|0)+(Math.abs(t)*n%n|0)*i);o.r=r[a]/255,o.g=r[a+1]/255,o.b=r[a+2]/255,o.a=r[a+3]/255},e.Mix=function(e,t,i){return e*(1-i)+t*i},e.Instantiate=function(e){return p.a.Instantiate(e)},e.Slice=function(e,t,i){return e.slice?e.slice(t,i):Array.prototype.slice.call(e,t,i)},e.SliceToArray=function(e,t,i){return Array.isArray(e)?e.slice(t,i):Array.prototype.slice.call(e,t,i)},e.SetImmediate=function(e){f.a.SetImmediate(e)},e.IsExponentOfTwo=function(e){var t=1;do{t*=2}while(t<e);return t===e},e.FloatRound=function(t){return Math.fround?Math.fround(t):e._tmpFloatArray[0]=t},e.GetFilename=function(e){var t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)},e.GetFolderPath=function(e,t){void 0===t&&(t=!1);var i=e.lastIndexOf("/");return i<0?t?e:"":e.substring(0,i+1)},e.ToDegrees=function(e){return 180*e/Math.PI},e.ToRadians=function(e){return e*Math.PI/180},e.MakeArray=function(e,t){return!0===t||void 0!==e&&null!=e?Array.isArray(e)?e:[e]:null},e.GetPointerPrefix=function(e){var t="pointer";return r.a.IsWindowObjectExist()&&!window.PointerEvent&&r.a.IsNavigatorAvailable()&&!navigator.pointerEnabled&&(t="mouse"),!e._badDesktopOS||e._badOS||document&&"ontouchend"in document||(t="mouse"),t},e.SetCorsBehavior=function(e,t){h.a.SetCorsBehavior(e,t)},e.CleanUrl=function(e){return e.replace(/#/gm,"%23")},Object.defineProperty(e,"PreprocessUrl",{get:function(){return h.a.PreprocessUrl},set:function(e){h.a.PreprocessUrl=e},enumerable:!1,configurable:!0}),e.LoadImage=function(e,t,i,n,r){return h.a.LoadImage(e,t,i,n,r)},e.LoadFile=function(e,t,i,n,r,o){return h.a.LoadFile(e,t,i,n,r,o)},e.LoadFileAsync=function(e,t){return void 0===t&&(t=!0),new Promise(function(i,n){h.a.LoadFile(e,function(e){i(e)},void 0,void 0,t,function(e,t){n(t)})})},e.LoadScript=function(e,t,i,n){if(r.a.IsWindowObjectExist()){var o=document.getElementsByTagName("head")[0],a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("src",e),n&&(a.id=n),a.onload=function(){t&&t()},a.onerror=function(t){i&&i("Unable to load script '"+e+"'",t)},o.appendChild(a)}},e.LoadScriptAsync=function(e,t){var i=this;return new Promise(function(t,n){i.LoadScript(e,function(){t()},function(e,t){n(t)})})},e.ReadFileAsDataURL=function(e,t,i){var r=new FileReader,o={onCompleteObservable:new n.c,abort:function(){return r.abort()}};return r.onloadend=function(e){o.onCompleteObservable.notifyObservers(o)},r.onload=function(e){t(e.target.result)},r.onprogress=i,r.readAsDataURL(e),o},e.ReadFile=function(e,t,i,n,r){return h.a.ReadFile(e,t,i,n,r)},e.FileAsURL=function(e){var t=new Blob([e]);return(window.URL||window.webkitURL).createObjectURL(t)},e.Format=function(e,t){return void 0===t&&(t=2),e.toFixed(t)},e.DeepCopy=function(e,t,i,n){a.a.DeepCopy(e,t,i,n)},e.IsEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},e.RegisterTopRootEvents=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];e.addEventListener(n.name,n.handler,!1);try{window.parent&&window.parent.addEventListener(n.name,n.handler,!1)}catch(e){}}},e.UnregisterTopRootEvents=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];e.removeEventListener(n.name,n.handler);try{e.parent&&e.parent.removeEventListener(n.name,n.handler)}catch(e){}}},e.DumpFramebuffer=function(t,i,n,r,o,a){void 0===o&&(o="image/png");for(var s=4*t,c=i/2,l=n.readPixels(0,0,t,i),u=0;u<c;u++)for(var h=0;h<s;h++){var d=h+u*s,f=h+(i-u-1)*s,p=l[d];l[d]=l[f],l[f]=p}e._ScreenshotCanvas||(e._ScreenshotCanvas=document.createElement("canvas")),e._ScreenshotCanvas.width=t,e._ScreenshotCanvas.height=i;var _=e._ScreenshotCanvas.getContext("2d");if(_){var m=_.createImageData(t,i);m.data.set(l),_.putImageData(m,0,0),e.EncodeScreenshotCanvasData(r,o,a)}},e.ToBlob=function(e,t,i){void 0===i&&(i="image/png"),e.toBlob||(e.toBlob=function(e,t,i){var n=this;setTimeout(function(){for(var r=atob(n.toDataURL(t,i).split(",")[1]),o=r.length,a=new Uint8Array(o),s=0;s<o;s++)a[s]=r.charCodeAt(s);e(new Blob([a]))})}),e.toBlob(function(e){t(e)},i)},e.EncodeScreenshotCanvasData=function(t,i,n){void 0===i&&(i="image/png"),t?t(e._ScreenshotCanvas.toDataURL(i)):this.ToBlob(e._ScreenshotCanvas,function(t){if("download"in document.createElement("a")){if(!n){var i=new Date,r=(i.getFullYear()+"-"+(i.getMonth()+1)).slice(2)+"-"+i.getDate()+"_"+i.getHours()+"-"+("0"+i.getMinutes()).slice(-2);n="screenshot_"+r+".png"}e.Download(t,n)}else{var o=URL.createObjectURL(t),a=window.open("");if(!a)return;var s=a.document.createElement("img");s.onload=function(){URL.revokeObjectURL(o)},s.src=o,a.document.body.appendChild(s)}},i)},e.Download=function(e,t){if(navigator&&navigator.msSaveBlob)navigator.msSaveBlob(e,t);else{var i=window.URL.createObjectURL(e),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=i,n.download=t,n.addEventListener("click",function(){n.parentElement&&n.parentElement.removeChild(n)}),n.click(),window.URL.revokeObjectURL(i)}},e.BackCompatCameraNoPreventDefault=function(e){return"boolean"==typeof e[0]?e[0]:"boolean"==typeof e[1]&&e[1]},e.CreateScreenshot=function(e,t,i,n,r){throw void 0===r&&(r="image/png"),c.a.WarnImport("ScreenshotTools")},e.CreateScreenshotAsync=function(e,t,i,n){throw void 0===n&&(n="image/png"),c.a.WarnImport("ScreenshotTools")},e.CreateScreenshotUsingRenderTarget=function(e,t,i,n,r,o,a,s){throw void 0===r&&(r="image/png"),void 0===o&&(o=1),void 0===a&&(a=!1),c.a.WarnImport("ScreenshotTools")},e.CreateScreenshotUsingRenderTargetAsync=function(e,t,i,n,r,o,a){throw void 0===n&&(n="image/png"),void 0===r&&(r=1),void 0===o&&(o=!1),c.a.WarnImport("ScreenshotTools")},e.RandomId=function(){return _.a.RandomId()},e.IsBase64=function(e){return!(e.length<5)&&"data:"===e.substr(0,5)},e.DecodeBase64=function(e){for(var t=atob(e.split(",")[1]),i=t.length,n=new Uint8Array(new ArrayBuffer(i)),r=0;r<i;r++)n[r]=t.charCodeAt(r);return n.buffer},e.GetAbsoluteUrl=function(e){var t=document.createElement("a");return t.href=e,t.href},Object.defineProperty(e,"errorsCount",{get:function(){return o.a.errorsCount},enumerable:!1,configurable:!0}),e.Log=function(e){o.a.Log(e)},e.Warn=function(e){o.a.Warn(e)},e.Error=function(e){o.a.Error(e)},Object.defineProperty(e,"LogCache",{get:function(){return o.a.LogCache},enumerable:!1,configurable:!0}),e.ClearLogCache=function(){o.a.ClearLogCache()},Object.defineProperty(e,"LogLevels",{set:function(e){o.a.LogLevels=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"PerformanceLogLevel",{set:function(t){return(t&e.PerformanceUserMarkLogLevel)===e.PerformanceUserMarkLogLevel?(e.StartPerformanceCounter=e._StartUserMark,void(e.EndPerformanceCounter=e._EndUserMark)):(t&e.PerformanceConsoleLogLevel)===e.PerformanceConsoleLogLevel?(e.StartPerformanceCounter=e._StartPerformanceConsole,void(e.EndPerformanceCounter=e._EndPerformanceConsole)):(e.StartPerformanceCounter=e._StartPerformanceCounterDisabled,void(e.EndPerformanceCounter=e._EndPerformanceCounterDisabled))},enumerable:!1,configurable:!0}),e._StartPerformanceCounterDisabled=function(e,t){},e._EndPerformanceCounterDisabled=function(e,t){},e._StartUserMark=function(t,i){if(void 0===i&&(i=!0),!e._performance){if(!r.a.IsWindowObjectExist())return;e._performance=window.performance}i&&e._performance.mark&&e._performance.mark(t+"-Begin")},e._EndUserMark=function(t,i){void 0===i&&(i=!0),i&&e._performance.mark&&(e._performance.mark(t+"-End"),e._performance.measure(t,t+"-Begin",t+"-End"))},e._StartPerformanceConsole=function(t,i){void 0===i&&(i=!0),i&&(e._StartUserMark(t,i),console.time&&console.time(t))},e._EndPerformanceConsole=function(t,i){void 0===i&&(i=!0),i&&(e._EndUserMark(t,i),console.timeEnd(t))},Object.defineProperty(e,"Now",{get:function(){return s.a.Now},enumerable:!1,configurable:!0}),e.GetClassName=function(e,t){void 0===t&&(t=!1);var i=null;return!t&&e.getClassName?i=e.getClassName():(e instanceof Object&&(i=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),i||(i=typeof e)),i},e.First=function(e,t){for(var i=0,n=e;i<n.length;i++){var r=n[i];if(t(r))return r}return null},e.getFullClassName=function(e,t){void 0===t&&(t=!1);var i=null,n=null;if(!t&&e.getClassName)i=e.getClassName();else{if(e instanceof Object){var r=t?e:Object.getPrototypeOf(e);i=r.constructor.__bjsclassName__,n=r.constructor.__bjsmoduleName__}i||(i=typeof e)}return i?(null!=n?n+".":"")+i:null},e.DelayAsync=function(e){return new Promise(function(t){setTimeout(function(){t()},e)})},e.IsSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},e.UseCustomRequestHeaders=!1,e.CustomRequestHeaders=l.a.CustomRequestHeaders,e._tmpFloatArray=new Float32Array(1),e.GetDOMTextContent=r.a.GetDOMTextContent,e.NoneLogLevel=o.a.NoneLogLevel,e.MessageLogLevel=o.a.MessageLogLevel,e.WarningLogLevel=o.a.WarningLogLevel,e.ErrorLogLevel=o.a.ErrorLogLevel,e.AllLogLevel=o.a.AllLogLevel,e.IsWindowObjectExist=r.a.IsWindowObjectExist,e.PerformanceNoneLogLevel=0,e.PerformanceUserMarkLogLevel=1,e.PerformanceConsoleLogLevel=2,e.StartPerformanceCounter=e._StartPerformanceCounterDisabled,e.EndPerformanceCounter=e._EndPerformanceCounterDisabled,e}();function g(e,t){return function(i){i.__bjsclassName__=e,i.__bjsmoduleName__=null!=t?t:null}}var v=function(){function e(e,t,i,n){void 0===n&&(n=0),this.iterations=e,this.index=n-1,this._done=!1,this._fn=t,this._successCallback=i}return e.prototype.executeNext=function(){this._done||(this.index+1<this.iterations?(++this.index,this._fn(this)):this.breakLoop())},e.prototype.breakLoop=function(){this._done=!0,this._successCallback()},e.Run=function(t,i,n,r){void 0===r&&(r=0);var o=new e(t,i,n,r);return o.executeNext(),o},e.SyncAsyncForLoop=function(t,i,n,r,o,a){return void 0===a&&(a=0),e.Run(Math.ceil(t/i),function(e){o&&o()?e.breakLoop():setTimeout(function(){for(var r=0;r<i;++r){var a=e.index*i+r;if(a>=t)break;if(n(a),o&&o()){e.breakLoop();break}}e.executeNext()},a)},r)},e}();u.a.FallbackTexture="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z",d.a.Apply()},function(e,t,i){"use strict";i.d(t,"a",function(){return p});var n=i(1),r=i(6),o=i(38),a=i(22),s=i(21),c=i(26),l=i(2),u=i(146),h=i(55),d=i(88),f=i(8),p=(i(123),i(129),i(124),function(e){function t(i,n,a,s){void 0===s&&(s=!1);var c=e.call(this,i,n,a,s)||this;if(c.enableOfflineSupport=!1,c.disableManifestCheck=!1,c.scenes=new Array,c.onNewSceneAddedObservable=new r.c,c.postProcesses=new Array,c.isPointerLock=!1,c.onResizeObservable=new r.c,c.onCanvasBlurObservable=new r.c,c.onCanvasFocusObservable=new r.c,c.onCanvasPointerOutObservable=new r.c,c.onBeginFrameObservable=new r.c,c.customAnimationFrameRequester=null,c.onEndFrameObservable=new r.c,c.onBeforeShaderCompilationObservable=new r.c,c.onAfterShaderCompilationObservable=new r.c,c._deterministicLockstep=!1,c._lockstepMaxSteps=4,c._timeStep=1/60,c._fps=60,c._deltaTime=0,c._drawCalls=new h.a,c.canvasTabIndex=1,c.disablePerformanceMonitorInBackground=!1,c._performanceMonitor=new u.a,t.Instances.push(c),!i)return c;if(a=c._creationOptions,i.getContext){var l=i;if(c._onCanvasFocus=function(){c.onCanvasFocusObservable.notifyObservers(c)},c._onCanvasBlur=function(){c.onCanvasBlurObservable.notifyObservers(c)},l.addEventListener("focus",c._onCanvasFocus),l.addEventListener("blur",c._onCanvasBlur),c._onBlur=function(){c.disablePerformanceMonitorInBackground&&c._performanceMonitor.disable(),c._windowIsBackground=!0},c._onFocus=function(){c.disablePerformanceMonitorInBackground&&c._performanceMonitor.enable(),c._windowIsBackground=!1},c._onCanvasPointerOut=function(e){c.onCanvasPointerOutObservable.notifyObservers(e)},l.addEventListener("pointerout",c._onCanvasPointerOut),o.a.IsWindowObjectExist()){var d=c.getHostWindow();d.addEventListener("blur",c._onBlur),d.addEventListener("focus",c._onFocus);var f=document;c._onFullscreenChange=function(){void 0!==f.fullscreen?c.isFullscreen=f.fullscreen:void 0!==f.mozFullScreen?c.isFullscreen=f.mozFullScreen:void 0!==f.webkitIsFullScreen?c.isFullscreen=f.webkitIsFullScreen:void 0!==f.msIsFullScreen&&(c.isFullscreen=f.msIsFullScreen),c.isFullscreen&&c._pointerLockRequested&&l&&t._RequestPointerlock(l)},document.addEventListener("fullscreenchange",c._onFullscreenChange,!1),document.addEventListener("mozfullscreenchange",c._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",c._onFullscreenChange,!1),document.addEventListener("msfullscreenchange",c._onFullscreenChange,!1),c._onPointerLockChange=function(){c.isPointerLock=f.mozPointerLockElement===l||f.webkitPointerLockElement===l||f.msPointerLockElement===l||f.pointerLockElement===l},document.addEventListener("pointerlockchange",c._onPointerLockChange,!1),document.addEventListener("mspointerlockchange",c._onPointerLockChange,!1),document.addEventListener("mozpointerlockchange",c._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",c._onPointerLockChange,!1),!t.audioEngine&&a.audioEngine&&t.AudioEngineFactory&&(t.audioEngine=t.AudioEngineFactory(c.getRenderingCanvas()))}c._connectVREvents(),c.enableOfflineSupport=void 0!==t.OfflineProviderFactory,a.doNotHandleTouchAction||c._disableTouchAction(),c._deterministicLockstep=!!a.deterministicLockstep,c._lockstepMaxSteps=a.lockstepMaxSteps||0,c._timeStep=a.timeStep||1/60}return c._prepareVRComponent(),a.autoEnableWebVR&&c.initWebVR(),c}return Object(n.d)(t,e),Object.defineProperty(t,"NpmPackage",{get:function(){return c.a.NpmPackage},enumerable:!1,configurable:!0}),Object.defineProperty(t,"Version",{get:function(){return c.a.Version},enumerable:!1,configurable:!0}),Object.defineProperty(t,"Instances",{get:function(){return a.a.Instances},enumerable:!1,configurable:!0}),Object.defineProperty(t,"LastCreatedEngine",{get:function(){return a.a.LastCreatedEngine},enumerable:!1,configurable:!0}),Object.defineProperty(t,"LastCreatedScene",{get:function(){return a.a.LastCreatedScene},enumerable:!1,configurable:!0}),t.MarkAllMaterialsAsDirty=function(e,i){for(var n=0;n<t.Instances.length;n++)for(var r=t.Instances[n],o=0;o<r.scenes.length;o++)r.scenes[o].markAllMaterialsAsDirty(e,i)},t.DefaultLoadingScreenFactory=function(e){throw s.a.WarnImport("LoadingScreen")},Object.defineProperty(t.prototype,"_supportsHardwareTextureRescaling",{get:function(){return!!t._RescalePostProcessFactory},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"performanceMonitor",{get:function(){return this._performanceMonitor},enumerable:!1,configurable:!0}),t.prototype.getInputElement=function(){return this._renderingCanvas},t.prototype.getAspectRatio=function(e,t){void 0===t&&(t=!1);var i=e.viewport;return this.getRenderWidth(t)*i.width/(this.getRenderHeight(t)*i.height)},t.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},t.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},t.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},t.prototype.isDeterministicLockStep=function(){return this._deterministicLockstep},t.prototype.getLockstepMaxSteps=function(){return this._lockstepMaxSteps},t.prototype.getTimeStep=function(){return 1e3*this._timeStep},t.prototype.generateMipMapsForCubemap=function(e,t){if(void 0===t&&(t=!0),e.generateMipMaps){var i=this._gl;this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,e,!0),i.generateMipmap(i.TEXTURE_CUBE_MAP),t&&this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)}},t.prototype.setState=function(e,t,i,n){void 0===t&&(t=0),void 0===n&&(n=!1),(this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e);var r=this.cullBackFaces?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==r||i)&&(this._depthCullingState.cullFace=r),this.setZOffset(t);var o=n?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==o||i)&&(this._depthCullingState.frontFace=o)},t.prototype.setZOffset=function(e){this._depthCullingState.zOffset=e},t.prototype.getZOffset=function(){return this._depthCullingState.zOffset},t.prototype.setDepthBuffer=function(e){this._depthCullingState.depthTest=e},t.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},t.prototype.setDepthWrite=function(e){this._depthCullingState.depthMask=e},t.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},t.prototype.setStencilBuffer=function(e){this._stencilState.stencilTest=e},t.prototype.getStencilMask=function(){return this._stencilState.stencilMask},t.prototype.setStencilMask=function(e){this._stencilState.stencilMask=e},t.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},t.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},t.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},t.prototype.setStencilFunction=function(e){this._stencilState.stencilFunc=e},t.prototype.setStencilFunctionReference=function(e){this._stencilState.stencilFuncRef=e},t.prototype.setStencilFunctionMask=function(e){this._stencilState.stencilFuncMask=e},t.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},t.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},t.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},t.prototype.setStencilOperationFail=function(e){this._stencilState.stencilOpStencilFail=e},t.prototype.setStencilOperationDepthFail=function(e){this._stencilState.stencilOpDepthFail=e},t.prototype.setStencilOperationPass=function(e){this._stencilState.stencilOpStencilDepthPass=e},t.prototype.setDitheringState=function(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)},t.prototype.setRasterizerState=function(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)},t.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},t.prototype.setDepthFunction=function(e){this._depthCullingState.depthFunc=e},t.prototype.setDepthFunctionToGreater=function(){this._depthCullingState.depthFunc=this._gl.GREATER},t.prototype.setDepthFunctionToGreaterOrEqual=function(){this._depthCullingState.depthFunc=this._gl.GEQUAL},t.prototype.setDepthFunctionToLess=function(){this._depthCullingState.depthFunc=this._gl.LESS},t.prototype.setDepthFunctionToLessOrEqual=function(){this._depthCullingState.depthFunc=this._gl.LEQUAL},t.prototype.cacheStencilState=function(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},t.prototype.restoreStencilState=function(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)},t.prototype.setDirectViewport=function(e,t,i,n){var r=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,n),r},t.prototype.scissorClear=function(e,t,i,n,r){this.enableScissor(e,t,i,n),this.clear(r,!0,!0,!0),this.disableScissor()},t.prototype.enableScissor=function(e,t,i,n){var r=this._gl;r.enable(r.SCISSOR_TEST),r.scissor(e,t,i,n)},t.prototype.disableScissor=function(){var e=this._gl;e.disable(e.SCISSOR_TEST)},t.prototype._reportDrawCall=function(){this._drawCalls.addCount(1,!1)},t.prototype.initWebVR=function(){throw s.a.WarnImport("WebVRCamera")},t.prototype._prepareVRComponent=function(){},t.prototype._connectVREvents=function(e,t){},t.prototype._submitVRFrame=function(){},t.prototype.disableVR=function(){},t.prototype.isVRPresenting=function(){return!1},t.prototype._requestVRFrame=function(){},t.prototype._loadFileAsync=function(e,t,i){var n=this;return new Promise(function(r,o){n._loadFile(e,function(e){r(e)},void 0,t,i,function(e,t){o(t)})})},t.prototype.getVertexShaderSource=function(e){var t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null},t.prototype.getFragmentShaderSource=function(e){var t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null},t.prototype.setDepthStencilTexture=function(e,t,i){void 0!==e&&(t&&(this._boundUniforms[e]=t),i&&i.depthStencilTexture?this._setTexture(e,i,!1,!0):this._setTexture(e,null))},t.prototype.setTextureFromPostProcess=function(e,t){this._bindTexture(e,t?t._textures.data[t._currentRenderTextureInd]:null)},t.prototype.setTextureFromPostProcessOutput=function(e,t){this._bindTexture(e,t?t._outputTexture:null)},t.prototype._rebuildBuffers=function(){for(var t=0,i=this.scenes;t<i.length;t++){var n=i[t];n.resetCachedMaterial(),n._rebuildGeometries(),n._rebuildTextures()}e.prototype._rebuildBuffers.call(this)},t.prototype._renderFrame=function(){for(var e=0;e<this._activeRenderLoops.length;e++)(0,this._activeRenderLoops[e])()},t.prototype._renderLoop=function(){if(!this._contextWasLost){var e=!0;!this.renderEvenInBackground&&this._windowIsBackground&&(e=!1),e&&(this.beginFrame(),this._renderViews()||this._renderFrame(),this.endFrame())}this._activeRenderLoops.length>0?this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this.isVRPresenting()?this._requestVRFrame():this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1},t.prototype._renderViews=function(){return!1},t.prototype.switchFullscreen=function(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)},t.prototype.enterFullscreen=function(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&t._RequestFullscreen(this._renderingCanvas))},t.prototype.exitFullscreen=function(){this.isFullscreen&&t._ExitFullscreen()},t.prototype.enterPointerlock=function(){this._renderingCanvas&&t._RequestPointerlock(this._renderingCanvas)},t.prototype.exitPointerlock=function(){t._ExitPointerlock()},t.prototype.beginFrame=function(){this._measureFps(),this.onBeginFrameObservable.notifyObservers(this),e.prototype.beginFrame.call(this)},t.prototype.endFrame=function(){e.prototype.endFrame.call(this),this._submitVRFrame(),this.onEndFrameObservable.notifyObservers(this)},t.prototype.resize=function(){this.isVRPresenting()||e.prototype.resize.call(this)},t.prototype.setSize=function(t,i){if(!this._renderingCanvas)return!1;if(!e.prototype.setSize.call(this,t,i))return!1;if(this.scenes){for(var n=0;n<this.scenes.length;n++)for(var r=this.scenes[n],o=0;o<r.cameras.length;o++)r.cameras[o]._currentRenderId=0;this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this)}return!0},t.prototype._deletePipelineContext=function(t){var i=t;i&&i.program&&i.transformFeedback&&(this.deleteTransformFeedback(i.transformFeedback),i.transformFeedback=null),e.prototype._deletePipelineContext.call(this,t)},t.prototype.createShaderProgram=function(t,i,n,r,o,a){void 0===a&&(a=null),o=o||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);var s=e.prototype.createShaderProgram.call(this,t,i,n,r,o,a);return this.onAfterShaderCompilationObservable.notifyObservers(this),s},t.prototype._createShaderProgram=function(e,t,i,n,r){void 0===r&&(r=null);var o=n.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");if(n.attachShader(o,t),n.attachShader(o,i),this.webGLVersion>1&&r){var a=this.createTransformFeedback();this.bindTransformFeedback(a),this.setTranformFeedbackVaryings(o,r),e.transformFeedback=a}return n.linkProgram(o),this.webGLVersion>1&&r&&this.bindTransformFeedback(null),e.context=n,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),o},t.prototype._releaseTexture=function(t){e.prototype._releaseTexture.call(this,t),this.scenes.forEach(function(e){e.postProcesses.forEach(function(e){e._outputTexture==t&&(e._outputTexture=null)}),e.cameras.forEach(function(e){e._postProcesses.forEach(function(e){e&&e._outputTexture==t&&(e._outputTexture=null)})})})},t.prototype._rescaleTexture=function(e,i,n,r,o){var a=this;this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);var s=this.createRenderTargetTexture({width:i.width,height:i.height},{generateMipMaps:!1,type:l.a.TEXTURETYPE_UNSIGNED_INT,samplingMode:l.a.TEXTURE_BILINEAR_SAMPLINGMODE,generateDepthBuffer:!1,generateStencilBuffer:!1});!this._rescalePostProcess&&t._RescalePostProcessFactory&&(this._rescalePostProcess=t._RescalePostProcessFactory(this)),this._rescalePostProcess.getEffect().executeWhenCompiled(function(){a._rescalePostProcess.onApply=function(t){t._bindTexture("textureSampler",e)};var t=n;t||(t=a.scenes[a.scenes.length-1]),t.postProcessManager.directRender([a._rescalePostProcess],s,!0),a._bindTextureDirectly(a._gl.TEXTURE_2D,i,!0),a._gl.copyTexImage2D(a._gl.TEXTURE_2D,0,r,0,0,i.width,i.height,0),a.unBindFramebuffer(s),a._releaseTexture(s),o&&o()})},t.prototype.getFps=function(){return this._fps},t.prototype.getDeltaTime=function(){return this._deltaTime},t.prototype._measureFps=function(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0},t.prototype._uploadImageToTexture=function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var r=this._gl,o=this._getWebGLTextureType(e.type),a=this._getInternalFormat(e.format),s=this._getRGBABufferInternalSizedFormat(e.type,a),c=e.isCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D;this._bindTextureDirectly(c,e,!0),this._unpackFlipY(e.invertY);var l=r.TEXTURE_2D;e.isCube&&(l=r.TEXTURE_CUBE_MAP_POSITIVE_X+i),r.texImage2D(l,n,s,a,o,t),this._bindTextureDirectly(c,null,!0)},t.prototype.updateRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;var i=this._gl;if(t=Math.min(t,this.getCaps().maxMSAASamples),e._depthStencilBuffer&&(i.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(i.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null),e._MSAARenderBuffer&&(i.deleteRenderbuffer(e._MSAARenderBuffer),e._MSAARenderBuffer=null),t>1&&i.renderbufferStorageMultisample){var n=i.createFramebuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=n,this._bindUnboundFramebuffer(e._MSAAFramebuffer);var r=i.createRenderbuffer();if(!r)throw new Error("Unable to create multi sampled framebuffer");i.bindRenderbuffer(i.RENDERBUFFER,r),i.renderbufferStorageMultisample(i.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(e.type),e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,r),e._MSAARenderBuffer=r}else this._bindUnboundFramebuffer(e._framebuffer);return e.samples=t,e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t),this._bindUnboundFramebuffer(null),t},t.prototype.updateTextureComparisonFunction=function(e,t){if(1!==this.webGLVersion){var i=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),0===t?(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,l.a.LEQUAL),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),0===t?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,l.a.LEQUAL),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}else f.a.Error("WebGL 1 does not support texture comparison.")},t.prototype.createInstancesBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");var i=new d.a(t);return i.capacity=e,this.bindArrayBuffer(i),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),i},t.prototype.deleteInstancesBuffer=function(e){this._gl.deleteBuffer(e)},t.prototype._clientWaitAsync=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=10);var n=this._gl;return new Promise(function(r,o){var a=function(){var s=n.clientWaitSync(e,t,0);s!=n.WAIT_FAILED?s!=n.TIMEOUT_EXPIRED?r():setTimeout(a,i):o()};a()})},t.prototype._readPixelsAsync=function(e,t,i,n,r,o,a){if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");var s=this._gl,c=s.createBuffer();s.bindBuffer(s.PIXEL_PACK_BUFFER,c),s.bufferData(s.PIXEL_PACK_BUFFER,a.byteLength,s.STREAM_READ),s.readPixels(e,t,i,n,r,o,0),s.bindBuffer(s.PIXEL_PACK_BUFFER,null);var l=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);return l?(s.flush(),this._clientWaitAsync(l,0,10).then(function(){return s.deleteSync(l),s.bindBuffer(s.PIXEL_PACK_BUFFER,c),s.getBufferSubData(s.PIXEL_PACK_BUFFER,0,a),s.bindBuffer(s.PIXEL_PACK_BUFFER,null),s.deleteBuffer(c),a})):null},t.prototype.dispose=function(){for(this.hideLoadingUI(),this.onNewSceneAddedObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(this._rescalePostProcess&&this._rescalePostProcess.dispose();this.scenes.length;)this.scenes[0].dispose();1===t.Instances.length&&t.audioEngine&&t.audioEngine.dispose(),this.disableVR(),o.a.IsWindowObjectExist()&&(window.removeEventListener("blur",this._onBlur),window.removeEventListener("focus",this._onFocus),this._renderingCanvas&&(this._renderingCanvas.removeEventListener("focus",this._onCanvasFocus),this._renderingCanvas.removeEventListener("blur",this._onCanvasBlur),this._renderingCanvas.removeEventListener("pointerout",this._onCanvasPointerOut)),o.a.IsDocumentAvailable()&&(document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.removeEventListener("pointerlockchange",this._onPointerLockChange),document.removeEventListener("mspointerlockchange",this._onPointerLockChange),document.removeEventListener("mozpointerlockchange",this._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",this._onPointerLockChange))),e.prototype.dispose.call(this);var i=t.Instances.indexOf(this);i>=0&&t.Instances.splice(i,1),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()},t.prototype._disableTouchAction=function(){this._renderingCanvas&&this._renderingCanvas.setAttribute&&(this._renderingCanvas.setAttribute("touch-action","none"),this._renderingCanvas.style.touchAction="none",this._renderingCanvas.style.msTouchAction="none")},t.prototype.displayLoadingUI=function(){if(o.a.IsWindowObjectExist()){var e=this.loadingScreen;e&&e.displayLoadingUI()}},t.prototype.hideLoadingUI=function(){if(o.a.IsWindowObjectExist()){var e=this._loadingScreen;e&&e.hideLoadingUI()}},Object.defineProperty(t.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=t.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(e){this._loadingScreen=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadingUIText",{set:function(e){this.loadingScreen.loadingUIText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadingUIBackgroundColor",{set:function(e){this.loadingScreen.loadingUIBackgroundColor=e},enumerable:!1,configurable:!0}),t._RequestPointerlock=function(e){e.requestPointerLock=e.requestPointerLock||e.msRequestPointerLock||e.mozRequestPointerLock||e.webkitRequestPointerLock,e.requestPointerLock&&e.requestPointerLock()},t._ExitPointerlock=function(){var e=document;document.exitPointerLock=document.exitPointerLock||e.msExitPointerLock||e.mozExitPointerLock||e.webkitExitPointerLock,document.exitPointerLock&&document.exitPointerLock()},t._RequestFullscreen=function(e){var t=e.requestFullscreen||e.msRequestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen;t&&t.call(e)},t._ExitFullscreen=function(){var e=document;document.exitFullscreen?document.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.msCancelFullScreen&&e.msCancelFullScreen()},t.ALPHA_DISABLE=l.a.ALPHA_DISABLE,t.ALPHA_ADD=l.a.ALPHA_ADD,t.ALPHA_COMBINE=l.a.ALPHA_COMBINE,t.ALPHA_SUBTRACT=l.a.ALPHA_SUBTRACT,t.ALPHA_MULTIPLY=l.a.ALPHA_MULTIPLY,t.ALPHA_MAXIMIZED=l.a.ALPHA_MAXIMIZED,t.ALPHA_ONEONE=l.a.ALPHA_ONEONE,t.ALPHA_PREMULTIPLIED=l.a.ALPHA_PREMULTIPLIED,t.ALPHA_PREMULTIPLIED_PORTERDUFF=l.a.ALPHA_PREMULTIPLIED_PORTERDUFF,t.ALPHA_INTERPOLATE=l.a.ALPHA_INTERPOLATE,t.ALPHA_SCREENMODE=l.a.ALPHA_SCREENMODE,t.DELAYLOADSTATE_NONE=l.a.DELAYLOADSTATE_NONE,t.DELAYLOADSTATE_LOADED=l.a.DELAYLOADSTATE_LOADED,t.DELAYLOADSTATE_LOADING=l.a.DELAYLOADSTATE_LOADING,t.DELAYLOADSTATE_NOTLOADED=l.a.DELAYLOADSTATE_NOTLOADED,t.NEVER=l.a.NEVER,t.ALWAYS=l.a.ALWAYS,t.LESS=l.a.LESS,t.EQUAL=l.a.EQUAL,t.LEQUAL=l.a.LEQUAL,t.GREATER=l.a.GREATER,t.GEQUAL=l.a.GEQUAL,t.NOTEQUAL=l.a.NOTEQUAL,t.KEEP=l.a.KEEP,t.REPLACE=l.a.REPLACE,t.INCR=l.a.INCR,t.DECR=l.a.DECR,t.INVERT=l.a.INVERT,t.INCR_WRAP=l.a.INCR_WRAP,t.DECR_WRAP=l.a.DECR_WRAP,t.TEXTURE_CLAMP_ADDRESSMODE=l.a.TEXTURE_CLAMP_ADDRESSMODE,t.TEXTURE_WRAP_ADDRESSMODE=l.a.TEXTURE_WRAP_ADDRESSMODE,t.TEXTURE_MIRROR_ADDRESSMODE=l.a.TEXTURE_MIRROR_ADDRESSMODE,t.TEXTUREFORMAT_ALPHA=l.a.TEXTUREFORMAT_ALPHA,t.TEXTUREFORMAT_LUMINANCE=l.a.TEXTUREFORMAT_LUMINANCE,t.TEXTUREFORMAT_LUMINANCE_ALPHA=l.a.TEXTUREFORMAT_LUMINANCE_ALPHA,t.TEXTUREFORMAT_RGB=l.a.TEXTUREFORMAT_RGB,t.TEXTUREFORMAT_RGBA=l.a.TEXTUREFORMAT_RGBA,t.TEXTUREFORMAT_RED=l.a.TEXTUREFORMAT_RED,t.TEXTUREFORMAT_R=l.a.TEXTUREFORMAT_R,t.TEXTUREFORMAT_RG=l.a.TEXTUREFORMAT_RG,t.TEXTUREFORMAT_RED_INTEGER=l.a.TEXTUREFORMAT_RED_INTEGER,t.TEXTUREFORMAT_R_INTEGER=l.a.TEXTUREFORMAT_R_INTEGER,t.TEXTUREFORMAT_RG_INTEGER=l.a.TEXTUREFORMAT_RG_INTEGER,t.TEXTUREFORMAT_RGB_INTEGER=l.a.TEXTUREFORMAT_RGB_INTEGER,t.TEXTUREFORMAT_RGBA_INTEGER=l.a.TEXTUREFORMAT_RGBA_INTEGER,t.TEXTURETYPE_UNSIGNED_BYTE=l.a.TEXTURETYPE_UNSIGNED_BYTE,t.TEXTURETYPE_UNSIGNED_INT=l.a.TEXTURETYPE_UNSIGNED_INT,t.TEXTURETYPE_FLOAT=l.a.TEXTURETYPE_FLOAT,t.TEXTURETYPE_HALF_FLOAT=l.a.TEXTURETYPE_HALF_FLOAT,t.TEXTURETYPE_BYTE=l.a.TEXTURETYPE_BYTE,t.TEXTURETYPE_SHORT=l.a.TEXTURETYPE_SHORT,t.TEXTURETYPE_UNSIGNED_SHORT=l.a.TEXTURETYPE_UNSIGNED_SHORT,t.TEXTURETYPE_INT=l.a.TEXTURETYPE_INT,t.TEXTURETYPE_UNSIGNED_INTEGER=l.a.TEXTURETYPE_UNSIGNED_INTEGER,t.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=l.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4,t.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=l.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1,t.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=l.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,t.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=l.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV,t.TEXTURETYPE_UNSIGNED_INT_24_8=l.a.TEXTURETYPE_UNSIGNED_INT_24_8,t.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=l.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV,t.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=l.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV,t.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=l.a.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV,t.TEXTURE_NEAREST_SAMPLINGMODE=l.a.TEXTURE_NEAREST_SAMPLINGMODE,t.TEXTURE_BILINEAR_SAMPLINGMODE=l.a.TEXTURE_BILINEAR_SAMPLINGMODE,t.TEXTURE_TRILINEAR_SAMPLINGMODE=l.a.TEXTURE_TRILINEAR_SAMPLINGMODE,t.TEXTURE_NEAREST_NEAREST_MIPLINEAR=l.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR,t.TEXTURE_LINEAR_LINEAR_MIPNEAREST=l.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST,t.TEXTURE_LINEAR_LINEAR_MIPLINEAR=l.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR,t.TEXTURE_NEAREST_NEAREST_MIPNEAREST=l.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST,t.TEXTURE_NEAREST_LINEAR_MIPNEAREST=l.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST,t.TEXTURE_NEAREST_LINEAR_MIPLINEAR=l.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR,t.TEXTURE_NEAREST_LINEAR=l.a.TEXTURE_NEAREST_LINEAR,t.TEXTURE_NEAREST_NEAREST=l.a.TEXTURE_NEAREST_NEAREST,t.TEXTURE_LINEAR_NEAREST_MIPNEAREST=l.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST,t.TEXTURE_LINEAR_NEAREST_MIPLINEAR=l.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR,t.TEXTURE_LINEAR_LINEAR=l.a.TEXTURE_LINEAR_LINEAR,t.TEXTURE_LINEAR_NEAREST=l.a.TEXTURE_LINEAR_NEAREST,t.TEXTURE_EXPLICIT_MODE=l.a.TEXTURE_EXPLICIT_MODE,t.TEXTURE_SPHERICAL_MODE=l.a.TEXTURE_SPHERICAL_MODE,t.TEXTURE_PLANAR_MODE=l.a.TEXTURE_PLANAR_MODE,t.TEXTURE_CUBIC_MODE=l.a.TEXTURE_CUBIC_MODE,t.TEXTURE_PROJECTION_MODE=l.a.TEXTURE_PROJECTION_MODE,t.TEXTURE_SKYBOX_MODE=l.a.TEXTURE_SKYBOX_MODE,t.TEXTURE_INVCUBIC_MODE=l.a.TEXTURE_INVCUBIC_MODE,t.TEXTURE_EQUIRECTANGULAR_MODE=l.a.TEXTURE_EQUIRECTANGULAR_MODE,t.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=l.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,t.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=l.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,t.SCALEMODE_FLOOR=l.a.SCALEMODE_FLOOR,t.SCALEMODE_NEAREST=l.a.SCALEMODE_NEAREST,t.SCALEMODE_CEILING=l.a.SCALEMODE_CEILING,t._RescalePostProcessFactory=null,t}(c.a))},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.WithinEpsilon=function(e,t,i){void 0===i&&(i=1.401298e-45);var n=e-t;return-i<=n&&n<=i},e.ToHex=function(e){var t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},e.Sign=function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},e.Clamp=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=1),Math.min(i,Math.max(t,e))},e.Log2=function(e){return Math.log(e)*Math.LOG2E},e.Repeat=function(e,t){return e-Math.floor(e/t)*t},e.Normalize=function(e,t,i){return(e-t)/(i-t)},e.Denormalize=function(e,t,i){return e*(i-t)+t},e.DeltaAngle=function(t,i){var n=e.Repeat(i-t,360);return n>180&&(n-=360),n},e.PingPong=function(t,i){var n=e.Repeat(t,2*i);return i-Math.abs(n-i)},e.SmoothStep=function(t,i,n){var r=e.Clamp(n);return i*(r=-2*r*r*r+3*r*r)+t*(1-r)},e.MoveTowards=function(t,i,n){return Math.abs(i-t)<=n?i:t+e.Sign(i-t)*n},e.MoveTowardsAngle=function(t,i,n){var r=e.DeltaAngle(t,i),o=0;return-n<r&&r<n?o=i:(i=t+r,o=e.MoveTowards(t,i,n)),o},e.Lerp=function(e,t,i){return e+(t-e)*i},e.LerpAngle=function(t,i,n){var r=e.Repeat(i-t,360);return r>180&&(r-=360),t+r*e.Clamp(n)},e.InverseLerp=function(t,i,n){return t!=i?e.Clamp((n-t)/(i-t)):0},e.Hermite=function(e,t,i,n,r){var o=r*r,a=r*o;return e*(2*a-3*o+1)+i*(-2*a+3*o)+t*(a-2*o+r)+n*(a-o)},e.RandomRange=function(e,t){return e===t?e:Math.random()*(t-e)+e},e.RangeToPercent=function(e,t,i){return(e-t)/(i-t)},e.PercentToRange=function(e,t,i){return(i-t)*e+t},e.NormalizeRadians=function(t){return t-e.TwoPi*Math.floor((t+Math.PI)/e.TwoPi)},e.TwoPi=2*Math.PI,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return h});var n=i(8),r=i(20),o=i(22),a=i(4),s=i(48),c=i(2),l=i(9),u=i(119),h=function(){function e(){}return e.BindEyePosition=function(e,t,i){if(void 0===i&&(i="vEyePosition"),t._forcedViewPosition)e.setVector3(i,t._forcedViewPosition);else{var n=t.activeCamera.globalPosition;n||(n=t.activeCamera.devicePosition),e.setVector3(i,t._mirroredCameraPosition?t._mirroredCameraPosition:n)}},e.PrepareDefinesForMergedUV=function(e,t,i){t._needUVs=!0,t[i]=!0,e.getTextureMatrix().isIdentityAs3x2()?(t[i+"DIRECTUV"]=e.coordinatesIndex+1,0===e.coordinatesIndex?t.MAINUV1=!0:t.MAINUV2=!0):t[i+"DIRECTUV"]=0},e.BindTextureMatrix=function(e,t,i){var n=e.getTextureMatrix();t.updateMatrix(i+"Matrix",n)},e.GetFogState=function(e,t){return t.fogEnabled&&e.applyFog&&t.fogMode!==r.a.FOGMODE_NONE},e.PrepareDefinesForMisc=function(e,t,i,n,r,o,a){a._areMiscDirty&&(a.LOGARITHMICDEPTH=i,a.POINTSIZE=n,a.FOG=r&&this.GetFogState(e,t),a.NONUNIFORMSCALING=e.nonUniformScaling,a.ALPHATEST=o)},e.PrepareDefinesForFrameBoundValues=function(e,t,i,n,r,o){void 0===r&&(r=null),void 0===o&&(o=!1);var a,s,c,l,u,h,d=!1;a=null==r?void 0!==e.clipPlane&&null!==e.clipPlane:r,s=null==r?void 0!==e.clipPlane2&&null!==e.clipPlane2:r,c=null==r?void 0!==e.clipPlane3&&null!==e.clipPlane3:r,l=null==r?void 0!==e.clipPlane4&&null!==e.clipPlane4:r,u=null==r?void 0!==e.clipPlane5&&null!==e.clipPlane5:r,h=null==r?void 0!==e.clipPlane6&&null!==e.clipPlane6:r,i.CLIPPLANE!==a&&(i.CLIPPLANE=a,d=!0),i.CLIPPLANE2!==s&&(i.CLIPPLANE2=s,d=!0),i.CLIPPLANE3!==c&&(i.CLIPPLANE3=c,d=!0),i.CLIPPLANE4!==l&&(i.CLIPPLANE4=l,d=!0),i.CLIPPLANE5!==u&&(i.CLIPPLANE5=u,d=!0),i.CLIPPLANE6!==h&&(i.CLIPPLANE6=h,d=!0),i.DEPTHPREPASS!==!t.getColorWrite()&&(i.DEPTHPREPASS=!i.DEPTHPREPASS,d=!0),i.INSTANCES!==n&&(i.INSTANCES=n,d=!0),i.THIN_INSTANCES!==o&&(i.THIN_INSTANCES=o,d=!0),d&&i.markAsUnprocessed()},e.PrepareDefinesForBones=function(e,t){if(e.useBones&&e.computeBonesUsingShaders&&e.skeleton){t.NUM_BONE_INFLUENCERS=e.numBoneInfluencers;var i=void 0!==t.BONETEXTURE;if(e.skeleton.isUsingTextureForMatrices&&i)t.BONETEXTURE=!0;else{t.BonesPerMesh=e.skeleton.bones.length+1,t.BONETEXTURE=!i&&void 0;var n=e.getScene().prePassRenderer;if(n&&n.enabled){var r=-1===n.excludedSkinnedMesh.indexOf(e);t.BONES_VELOCITY_ENABLED=r}}}else t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0},e.PrepareDefinesForMorphTargets=function(e,t){var i=e.morphTargetManager;i?(t.MORPHTARGETS_UV=i.supportsUVs&&t.UV1,t.MORPHTARGETS_TANGENT=i.supportsTangents&&t.TANGENT,t.MORPHTARGETS_NORMAL=i.supportsNormals&&t.NORMAL,t.MORPHTARGETS=i.numInfluencers>0,t.NUM_MORPH_INFLUENCERS=i.numInfluencers):(t.MORPHTARGETS_UV=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)},e.PrepareDefinesForAttributes=function(e,t,i,n,r,o){if(void 0===r&&(r=!1),void 0===o&&(o=!0),!t._areAttributesDirty&&t._needNormals===t._normals&&t._needUVs===t._uvs)return!1;if(t._normals=t._needNormals,t._uvs=t._needUVs,t.NORMAL=t._needNormals&&e.isVerticesDataPresent(a.b.NormalKind),t._needNormals&&e.isVerticesDataPresent(a.b.TangentKind)&&(t.TANGENT=!0),t._needUVs?(t.UV1=e.isVerticesDataPresent(a.b.UVKind),t.UV2=e.isVerticesDataPresent(a.b.UV2Kind)):(t.UV1=!1,t.UV2=!1),i){var s=e.useVertexColors&&e.isVerticesDataPresent(a.b.ColorKind);t.VERTEXCOLOR=s,t.VERTEXALPHA=e.hasVertexAlpha&&s&&o}return n&&this.PrepareDefinesForBones(e,t),r&&this.PrepareDefinesForMorphTargets(e,t),!0},e.PrepareDefinesForMultiview=function(e,t){if(e.activeCamera){var i=t.MULTIVIEW;t.MULTIVIEW=null!==e.activeCamera.outputRenderTarget&&e.activeCamera.outputRenderTarget.getViewCount()>1,t.MULTIVIEW!=i&&t.markAsUnprocessed()}},e.PrepareDefinesForPrePass=function(e,t,i){var n=t.PREPASS;if(t._arePrePassDirty){var r=[{type:c.a.PREPASS_POSITION_TEXTURE_TYPE,define:"PREPASS_POSITION",index:"PREPASS_POSITION_INDEX"},{type:c.a.PREPASS_VELOCITY_TEXTURE_TYPE,define:"PREPASS_VELOCITY",index:"PREPASS_VELOCITY_INDEX"},{type:c.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE,define:"PREPASS_REFLECTIVITY",index:"PREPASS_REFLECTIVITY_INDEX"},{type:c.a.PREPASS_IRRADIANCE_TEXTURE_TYPE,define:"PREPASS_IRRADIANCE",index:"PREPASS_IRRADIANCE_INDEX"},{type:c.a.PREPASS_ALBEDO_TEXTURE_TYPE,define:"PREPASS_ALBEDO",index:"PREPASS_ALBEDO_INDEX"},{type:c.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE,define:"PREPASS_DEPTHNORMAL",index:"PREPASS_DEPTHNORMAL_INDEX"}];if(e.prePassRenderer&&e.prePassRenderer.enabled&&i){t.PREPASS=!0,t.SCENE_MRT_COUNT=e.prePassRenderer.mrtCount;for(var o=0;o<r.length;o++){var a=e.prePassRenderer.getIndex(r[o].type);-1!==a?(t[r[o].define]=!0,t[r[o].index]=a):t[r[o].define]=!1}}else for(t.PREPASS=!1,o=0;o<r.length;o++)t[r[o].define]=!1;t.PREPASS!=n&&(t.markAsUnprocessed(),t.markAsImageProcessingDirty())}},e.PrepareDefinesForLight=function(e,t,i,n,r,o,a){switch(a.needNormals=!0,void 0===r["LIGHT"+n]&&(a.needRebuild=!0),r["LIGHT"+n]=!0,r["SPOTLIGHT"+n]=!1,r["HEMILIGHT"+n]=!1,r["POINTLIGHT"+n]=!1,r["DIRLIGHT"+n]=!1,i.prepareLightSpecificDefines(r,n),r["LIGHT_FALLOFF_PHYSICAL"+n]=!1,r["LIGHT_FALLOFF_GLTF"+n]=!1,r["LIGHT_FALLOFF_STANDARD"+n]=!1,i.falloffType){case s.a.FALLOFF_GLTF:r["LIGHT_FALLOFF_GLTF"+n]=!0;break;case s.a.FALLOFF_PHYSICAL:r["LIGHT_FALLOFF_PHYSICAL"+n]=!0;break;case s.a.FALLOFF_STANDARD:r["LIGHT_FALLOFF_STANDARD"+n]=!0}if(o&&!i.specular.equalsFloats(0,0,0)&&(a.specularEnabled=!0),r["SHADOW"+n]=!1,r["SHADOWCSM"+n]=!1,r["SHADOWCSMDEBUG"+n]=!1,r["SHADOWCSMNUM_CASCADES"+n]=!1,r["SHADOWCSMUSESHADOWMAXZ"+n]=!1,r["SHADOWCSMNOBLEND"+n]=!1,r["SHADOWCSM_RIGHTHANDED"+n]=!1,r["SHADOWPCF"+n]=!1,r["SHADOWPCSS"+n]=!1,r["SHADOWPOISSON"+n]=!1,r["SHADOWESM"+n]=!1,r["SHADOWCLOSEESM"+n]=!1,r["SHADOWCUBE"+n]=!1,r["SHADOWLOWQUALITY"+n]=!1,r["SHADOWMEDIUMQUALITY"+n]=!1,t&&t.receiveShadows&&e.shadowsEnabled&&i.shadowEnabled){var c=i.getShadowGenerator();if(c){var l=c.getShadowMap();l&&l.renderList&&l.renderList.length>0&&(a.shadowEnabled=!0,c.prepareDefines(r,n))}}i.lightmapMode!=s.a.LIGHTMAP_DEFAULT?(a.lightmapMode=!0,r["LIGHTMAPEXCLUDED"+n]=!0,r["LIGHTMAPNOSPECULAR"+n]=i.lightmapMode==s.a.LIGHTMAP_SHADOWSONLY):(r["LIGHTMAPEXCLUDED"+n]=!1,r["LIGHTMAPNOSPECULAR"+n]=!1)},e.PrepareDefinesForLights=function(e,t,i,n,r,o){if(void 0===r&&(r=4),void 0===o&&(o=!1),!i._areLightsDirty)return i._needNormals;var a=0,s={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(e.lightsEnabled&&!o)for(var c=0,l=t.lightSources;c<l.length;c++){var u=l[c];if(this.PrepareDefinesForLight(e,t,u,a,i,n,s),++a===r)break}i.SPECULARTERM=s.specularEnabled,i.SHADOWS=s.shadowEnabled;for(var h=a;h<r;h++)void 0!==i["LIGHT"+h]&&(i["LIGHT"+h]=!1,i["HEMILIGHT"+h]=!1,i["POINTLIGHT"+h]=!1,i["DIRLIGHT"+h]=!1,i["SPOTLIGHT"+h]=!1,i["SHADOW"+h]=!1,i["SHADOWCSM"+h]=!1,i["SHADOWCSMDEBUG"+h]=!1,i["SHADOWCSMNUM_CASCADES"+h]=!1,i["SHADOWCSMUSESHADOWMAXZ"+h]=!1,i["SHADOWCSMNOBLEND"+h]=!1,i["SHADOWCSM_RIGHTHANDED"+h]=!1,i["SHADOWPCF"+h]=!1,i["SHADOWPCSS"+h]=!1,i["SHADOWPOISSON"+h]=!1,i["SHADOWESM"+h]=!1,i["SHADOWCLOSEESM"+h]=!1,i["SHADOWCUBE"+h]=!1,i["SHADOWLOWQUALITY"+h]=!1,i["SHADOWMEDIUMQUALITY"+h]=!1);var d=e.getEngine().getCaps();return void 0===i.SHADOWFLOAT&&(s.needRebuild=!0),i.SHADOWFLOAT=s.shadowEnabled&&(d.textureFloatRender&&d.textureFloatLinearFiltering||d.textureHalfFloatRender&&d.textureHalfFloatLinearFiltering),i.LIGHTMAPEXCLUDED=s.lightmapMode,s.needRebuild&&i.rebuild(),s.needNormals},e.PrepareUniformsAndSamplersForLight=function(e,t,i,n,r,o){void 0===r&&(r=null),void 0===o&&(o=!1),r&&r.push("Light"+e),o||(t.push("vLightData"+e,"vLightDiffuse"+e,"vLightSpecular"+e,"vLightDirection"+e,"vLightFalloff"+e,"vLightGround"+e,"lightMatrix"+e,"shadowsInfo"+e,"depthValues"+e),i.push("shadowSampler"+e),i.push("depthSampler"+e),t.push("viewFrustumZ"+e,"cascadeBlendFactor"+e,"lightSizeUVCorrection"+e,"depthCorrection"+e,"penumbraDarkness"+e,"frustumLengths"+e),n&&(i.push("projectionLightSampler"+e),t.push("textureProjectionMatrix"+e)))},e.PrepareUniformsAndSamplersList=function(e,t,i,n){var r;void 0===n&&(n=4);var o=null;if(e.uniformsNames){var a=e;r=a.uniformsNames,o=a.uniformBuffersNames,t=a.samplers,i=a.defines,n=a.maxSimultaneousLights||0}else r=e,t||(t=[]);for(var s=0;s<n&&i["LIGHT"+s];s++)this.PrepareUniformsAndSamplersForLight(s,r,t,i["PROJECTEDLIGHTTEXTURE"+s],o);i.NUM_MORPH_INFLUENCERS&&r.push("morphTargetInfluences")},e.HandleFallbacksForShadows=function(e,t,i,n){void 0===i&&(i=4),void 0===n&&(n=0);for(var r=0,o=0;o<i&&e["LIGHT"+o];o++)o>0&&(r=n+o,t.addFallback(r,"LIGHT"+o)),e.SHADOWS||(e["SHADOW"+o]&&t.addFallback(n,"SHADOW"+o),e["SHADOWPCF"+o]&&t.addFallback(n,"SHADOWPCF"+o),e["SHADOWPCSS"+o]&&t.addFallback(n,"SHADOWPCSS"+o),e["SHADOWPOISSON"+o]&&t.addFallback(n,"SHADOWPOISSON"+o),e["SHADOWESM"+o]&&t.addFallback(n,"SHADOWESM"+o),e["SHADOWCLOSEESM"+o]&&t.addFallback(n,"SHADOWCLOSEESM"+o));return r++},e.PrepareAttributesForMorphTargetsInfluencers=function(e,t,i){this._TmpMorphInfluencers.NUM_MORPH_INFLUENCERS=i,this.PrepareAttributesForMorphTargets(e,t,this._TmpMorphInfluencers)},e.PrepareAttributesForMorphTargets=function(e,t,i){var r=i.NUM_MORPH_INFLUENCERS;if(r>0&&o.a.LastCreatedEngine)for(var s=o.a.LastCreatedEngine.getCaps().maxVertexAttribs,c=t.morphTargetManager,l=c&&c.supportsNormals&&i.NORMAL,u=c&&c.supportsTangents&&i.TANGENT,h=c&&c.supportsUVs&&i.UV1,d=0;d<r;d++)e.push(a.b.PositionKind+d),l&&e.push(a.b.NormalKind+d),u&&e.push(a.b.TangentKind+d),h&&e.push(a.b.UVKind+"_"+d),e.length>s&&n.a.Error("Cannot add more vertex attributes for mesh "+t.name)},e.PrepareAttributesForBones=function(e,t,i,n){i.NUM_BONE_INFLUENCERS>0&&(n.addCPUSkinningFallback(0,t),e.push(a.b.MatricesIndicesKind),e.push(a.b.MatricesWeightsKind),i.NUM_BONE_INFLUENCERS>4&&(e.push(a.b.MatricesIndicesExtraKind),e.push(a.b.MatricesWeightsExtraKind)))},e.PrepareAttributesForInstances=function(e,t){(t.INSTANCES||t.THIN_INSTANCES)&&this.PushAttributesForInstances(e)},e.PushAttributesForInstances=function(e){e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3")},e.BindLightProperties=function(e,t,i){e.transferToEffect(t,i+"")},e.BindLight=function(e,t,i,n,r,o){void 0===o&&(o=!1),e._bindLight(t,i,n,r,o)},e.BindLights=function(e,t,i,n,r,o){void 0===r&&(r=4),void 0===o&&(o=!1);for(var a=Math.min(t.lightSources.length,r),s=0;s<a;s++){var c=t.lightSources[s];this.BindLight(c,s,e,i,"boolean"==typeof n?n:n.SPECULARTERM,o)}},e.BindFogParameters=function(e,t,i,n){void 0===n&&(n=!1),e.fogEnabled&&t.applyFog&&e.fogMode!==r.a.FOGMODE_NONE&&(i.setFloat4("vFogInfos",e.fogMode,e.fogStart,e.fogEnd,e.fogDensity),n?(e.fogColor.toLinearSpaceToRef(this._tempFogColor),i.setColor3("vFogColor",this._tempFogColor)):i.setColor3("vFogColor",e.fogColor))},e.BindBonesParameters=function(t,i,n){if(i&&t&&(t.computeBonesUsingShaders&&i._bonesComputationForcedToCPU&&(t.computeBonesUsingShaders=!1),t.useBones&&t.computeBonesUsingShaders&&t.skeleton)){var r=t.skeleton;if(r.isUsingTextureForMatrices&&i.getUniformIndex("boneTextureWidth")>-1){var o=r.getTransformMatrixTexture(t);i.setTexture("boneSampler",o),i.setFloat("boneTextureWidth",4*(r.bones.length+1))}else{var a=r.getTransformMatrices(t);a&&(i.setMatrices("mBones",a),n&&t.getScene().prePassRenderer&&t.getScene().prePassRenderer.getIndex(c.a.PREPASS_VELOCITY_TEXTURE_TYPE)&&(n.previousBones[t.uniqueId]&&i.setMatrices("mPreviousBones",n.previousBones[t.uniqueId]),e._CopyBonesTransformationMatrices(a,n.previousBones[t.uniqueId])))}}},e._CopyBonesTransformationMatrices=function(e,t){return t.set(e),t},e.BindMorphTargetParameters=function(e,t){var i=e.morphTargetManager;e&&i&&t.setFloatArray("morphTargetInfluences",i.influences)},e.BindLogDepth=function(e,t,i){e.LOGARITHMICDEPTH&&t.setFloat("logarithmicDepthConstant",2/(Math.log(i.activeCamera.maxZ+1)/Math.LN2))},e.BindClipPlane=function(e,t){u.a.BindClipPlane(e,t)},e._TmpMorphInfluencers={NUM_MORPH_INFLUENCERS:0},e._tempFogColor=l.a.Black(),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var n=i(0),r=i(4),o=i(21),a=i(9),s=i(8),c=function(){function e(){}return e.prototype.set=function(e,t){switch(e.length||s.a.Warn("Setting vertex data kind '"+t+"' with an empty array"),t){case r.b.PositionKind:this.positions=e;break;case r.b.NormalKind:this.normals=e;break;case r.b.TangentKind:this.tangents=e;break;case r.b.UVKind:this.uvs=e;break;case r.b.UV2Kind:this.uvs2=e;break;case r.b.UV3Kind:this.uvs3=e;break;case r.b.UV4Kind:this.uvs4=e;break;case r.b.UV5Kind:this.uvs5=e;break;case r.b.UV6Kind:this.uvs6=e;break;case r.b.ColorKind:this.colors=e;break;case r.b.MatricesIndicesKind:this.matricesIndices=e;break;case r.b.MatricesWeightsKind:this.matricesWeights=e;break;case r.b.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case r.b.MatricesWeightsExtraKind:this.matricesWeightsExtra=e}},e.prototype.applyToMesh=function(e,t){return this._applyTo(e,t),this},e.prototype.applyToGeometry=function(e,t){return this._applyTo(e,t),this},e.prototype.updateMesh=function(e){return this._update(e),this},e.prototype.updateGeometry=function(e){return this._update(e),this},e.prototype._applyTo=function(e,t){return void 0===t&&(t=!1),this.positions&&e.setVerticesData(r.b.PositionKind,this.positions,t),this.normals&&e.setVerticesData(r.b.NormalKind,this.normals,t),this.tangents&&e.setVerticesData(r.b.TangentKind,this.tangents,t),this.uvs&&e.setVerticesData(r.b.UVKind,this.uvs,t),this.uvs2&&e.setVerticesData(r.b.UV2Kind,this.uvs2,t),this.uvs3&&e.setVerticesData(r.b.UV3Kind,this.uvs3,t),this.uvs4&&e.setVerticesData(r.b.UV4Kind,this.uvs4,t),this.uvs5&&e.setVerticesData(r.b.UV5Kind,this.uvs5,t),this.uvs6&&e.setVerticesData(r.b.UV6Kind,this.uvs6,t),this.colors&&e.setVerticesData(r.b.ColorKind,this.colors,t),this.matricesIndices&&e.setVerticesData(r.b.MatricesIndicesKind,this.matricesIndices,t),this.matricesWeights&&e.setVerticesData(r.b.MatricesWeightsKind,this.matricesWeights,t),this.matricesIndicesExtra&&e.setVerticesData(r.b.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),this.matricesWeightsExtra&&e.setVerticesData(r.b.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),this.indices?e.setIndices(this.indices,null,t):e.setIndices([],null),this},e.prototype._update=function(e,t,i){return this.positions&&e.updateVerticesData(r.b.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(r.b.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(r.b.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(r.b.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(r.b.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(r.b.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(r.b.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(r.b.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(r.b.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(r.b.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(r.b.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(r.b.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(r.b.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(r.b.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this},e.prototype.transform=function(e){var t,i=e.determinant()<0,r=n.e.Zero();if(this.positions){var o=n.e.Zero();for(t=0;t<this.positions.length;t+=3)n.e.FromArrayToRef(this.positions,t,o),n.e.TransformCoordinatesToRef(o,e,r),this.positions[t]=r.x,this.positions[t+1]=r.y,this.positions[t+2]=r.z}if(this.normals){var a=n.e.Zero();for(t=0;t<this.normals.length;t+=3)n.e.FromArrayToRef(this.normals,t,a),n.e.TransformNormalToRef(a,e,r),this.normals[t]=r.x,this.normals[t+1]=r.y,this.normals[t+2]=r.z}if(this.tangents){var s=n.f.Zero(),c=n.f.Zero();for(t=0;t<this.tangents.length;t+=4)n.f.FromArrayToRef(this.tangents,t,s),n.f.TransformNormalToRef(s,e,c),this.tangents[t]=c.x,this.tangents[t+1]=c.y,this.tangents[t+2]=c.z,this.tangents[t+3]=c.w}if(i&&this.indices)for(t=0;t<this.indices.length;t+=3){var l=this.indices[t+1];this.indices[t+1]=this.indices[t+2],this.indices[t+2]=l}return this},e.prototype.merge=function(e,t){if(void 0===t&&(t=!1),this._validate(),e._validate(),!this.normals!=!e.normals||!this.tangents!=!e.tangents||!this.uvs!=!e.uvs||!this.uvs2!=!e.uvs2||!this.uvs3!=!e.uvs3||!this.uvs4!=!e.uvs4||!this.uvs5!=!e.uvs5||!this.uvs6!=!e.uvs6||!this.colors!=!e.colors||!this.matricesIndices!=!e.matricesIndices||!this.matricesWeights!=!e.matricesWeights||!this.matricesIndicesExtra!=!e.matricesIndicesExtra||!this.matricesWeightsExtra!=!e.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes");if(e.indices){this.indices||(this.indices=[]);var i=this.positions?this.positions.length/3:0;if(void 0!==this.indices.BYTES_PER_ELEMENT){var n=this.indices.length+e.indices.length,r=t||this.indices instanceof Uint32Array?new Uint32Array(n):new Uint16Array(n);r.set(this.indices);for(var o=this.indices.length,a=0;a<e.indices.length;a++)r[o+a]=e.indices[a]+i;this.indices=r}else for(a=0;a<e.indices.length;a++)this.indices.push(e.indices[a]+i)}return this.positions=this._mergeElement(this.positions,e.positions),this.normals=this._mergeElement(this.normals,e.normals),this.tangents=this._mergeElement(this.tangents,e.tangents),this.uvs=this._mergeElement(this.uvs,e.uvs),this.uvs2=this._mergeElement(this.uvs2,e.uvs2),this.uvs3=this._mergeElement(this.uvs3,e.uvs3),this.uvs4=this._mergeElement(this.uvs4,e.uvs4),this.uvs5=this._mergeElement(this.uvs5,e.uvs5),this.uvs6=this._mergeElement(this.uvs6,e.uvs6),this.colors=this._mergeElement(this.colors,e.colors),this.matricesIndices=this._mergeElement(this.matricesIndices,e.matricesIndices),this.matricesWeights=this._mergeElement(this.matricesWeights,e.matricesWeights),this.matricesIndicesExtra=this._mergeElement(this.matricesIndicesExtra,e.matricesIndicesExtra),this.matricesWeightsExtra=this._mergeElement(this.matricesWeightsExtra,e.matricesWeightsExtra),this},e.prototype._mergeElement=function(e,t){if(!e)return t;if(!t)return e;var i=t.length+e.length,n=e instanceof Float32Array,r=t instanceof Float32Array;if(n){var o=new Float32Array(i);return o.set(e),o.set(t,e.length),o}if(r){var a=e.slice(0),s=0;for(i=t.length;s<i;s++)a.push(t[s]);return a}return e.concat(t)},e.prototype._validate=function(){if(!this.positions)throw new Error("Positions are required");var e=function(e,t){var i=r.b.DeduceStride(e);if(t.length%i!=0)throw new Error("The "+e+"s array count must be a multiple of "+i);return t.length/i},t=e(r.b.PositionKind,this.positions),i=function(i,n){var r=e(i,n);if(r!==t)throw new Error("The "+i+"s element count ("+r+") does not match the positions count ("+t+")")};this.normals&&i(r.b.NormalKind,this.normals),this.tangents&&i(r.b.TangentKind,this.tangents),this.uvs&&i(r.b.UVKind,this.uvs),this.uvs2&&i(r.b.UV2Kind,this.uvs2),this.uvs3&&i(r.b.UV3Kind,this.uvs3),this.uvs4&&i(r.b.UV4Kind,this.uvs4),this.uvs5&&i(r.b.UV5Kind,this.uvs5),this.uvs6&&i(r.b.UV6Kind,this.uvs6),this.colors&&i(r.b.ColorKind,this.colors),this.matricesIndices&&i(r.b.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&i(r.b.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&i(r.b.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&i(r.b.MatricesWeightsExtraKind,this.matricesWeightsExtra)},e.prototype.serialize=function(){var e=this.serialize();return this.positions&&(e.positions=this.positions),this.normals&&(e.normals=this.normals),this.tangents&&(e.tangents=this.tangents),this.uvs&&(e.uvs=this.uvs),this.uvs2&&(e.uvs2=this.uvs2),this.uvs3&&(e.uvs3=this.uvs3),this.uvs4&&(e.uvs4=this.uvs4),this.uvs5&&(e.uvs5=this.uvs5),this.uvs6&&(e.uvs6=this.uvs6),this.colors&&(e.colors=this.colors),this.matricesIndices&&(e.matricesIndices=this.matricesIndices,e.matricesIndices._isExpanded=!0),this.matricesWeights&&(e.matricesWeights=this.matricesWeights),this.matricesIndicesExtra&&(e.matricesIndicesExtra=this.matricesIndicesExtra,e.matricesIndicesExtra._isExpanded=!0),this.matricesWeightsExtra&&(e.matricesWeightsExtra=this.matricesWeightsExtra),e.indices=this.indices,e},e.ExtractFromMesh=function(t,i,n){return e._ExtractFrom(t,i,n)},e.ExtractFromGeometry=function(t,i,n){return e._ExtractFrom(t,i,n)},e._ExtractFrom=function(t,i,n){var o=new e;return t.isVerticesDataPresent(r.b.PositionKind)&&(o.positions=t.getVerticesData(r.b.PositionKind,i,n)),t.isVerticesDataPresent(r.b.NormalKind)&&(o.normals=t.getVerticesData(r.b.NormalKind,i,n)),t.isVerticesDataPresent(r.b.TangentKind)&&(o.tangents=t.getVerticesData(r.b.TangentKind,i,n)),t.isVerticesDataPresent(r.b.UVKind)&&(o.uvs=t.getVerticesData(r.b.UVKind,i,n)),t.isVerticesDataPresent(r.b.UV2Kind)&&(o.uvs2=t.getVerticesData(r.b.UV2Kind,i,n)),t.isVerticesDataPresent(r.b.UV3Kind)&&(o.uvs3=t.getVerticesData(r.b.UV3Kind,i,n)),t.isVerticesDataPresent(r.b.UV4Kind)&&(o.uvs4=t.getVerticesData(r.b.UV4Kind,i,n)),t.isVerticesDataPresent(r.b.UV5Kind)&&(o.uvs5=t.getVerticesData(r.b.UV5Kind,i,n)),t.isVerticesDataPresent(r.b.UV6Kind)&&(o.uvs6=t.getVerticesData(r.b.UV6Kind,i,n)),t.isVerticesDataPresent(r.b.ColorKind)&&(o.colors=t.getVerticesData(r.b.ColorKind,i,n)),t.isVerticesDataPresent(r.b.MatricesIndicesKind)&&(o.matricesIndices=t.getVerticesData(r.b.MatricesIndicesKind,i,n)),t.isVerticesDataPresent(r.b.MatricesWeightsKind)&&(o.matricesWeights=t.getVerticesData(r.b.MatricesWeightsKind,i,n)),t.isVerticesDataPresent(r.b.MatricesIndicesExtraKind)&&(o.matricesIndicesExtra=t.getVerticesData(r.b.MatricesIndicesExtraKind,i,n)),t.isVerticesDataPresent(r.b.MatricesWeightsExtraKind)&&(o.matricesWeightsExtra=t.getVerticesData(r.b.MatricesWeightsExtraKind,i,n)),o.indices=t.getIndices(i,n),o},e.CreateRibbon=function(e){throw o.a.WarnImport("ribbonBuilder")},e.CreateBox=function(e){throw o.a.WarnImport("boxBuilder")},e.CreateTiledBox=function(e){throw o.a.WarnImport("tiledBoxBuilder")},e.CreateTiledPlane=function(e){throw o.a.WarnImport("tiledPlaneBuilder")},e.CreateSphere=function(e){throw o.a.WarnImport("sphereBuilder")},e.CreateCylinder=function(e){throw o.a.WarnImport("cylinderBuilder")},e.CreateTorus=function(e){throw o.a.WarnImport("torusBuilder")},e.CreateLineSystem=function(e){throw o.a.WarnImport("linesBuilder")},e.CreateDashedLines=function(e){throw o.a.WarnImport("linesBuilder")},e.CreateGround=function(e){throw o.a.WarnImport("groundBuilder")},e.CreateTiledGround=function(e){throw o.a.WarnImport("groundBuilder")},e.CreateGroundFromHeightMap=function(e){throw o.a.WarnImport("groundBuilder")},e.CreatePlane=function(e){throw o.a.WarnImport("planeBuilder")},e.CreateDisc=function(e){throw o.a.WarnImport("discBuilder")},e.CreatePolygon=function(e,t,i,n,r,a,s){throw o.a.WarnImport("polygonBuilder")},e.CreateIcoSphere=function(e){throw o.a.WarnImport("icoSphereBuilder")},e.CreatePolyhedron=function(e){throw o.a.WarnImport("polyhedronBuilder")},e.CreateCapsule=function(e){throw void 0===e&&(e={orientation:n.e.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}),o.a.WarnImport("capsuleBuilder")},e.CreateTorusKnot=function(e){throw o.a.WarnImport("torusKnotBuilder")},e.ComputeNormals=function(e,t,i,r){var o=0,a=0,s=0,c=0,l=0,u=0,h=0,d=0,f=0,p=0,_=0,m=0,g=0,v=0,b=0,y=0,T=0,E=0,S=0,A=0,P=!1,C=!1,R=!1,x=!1,O=1,M=0,I=null;if(r&&(P=!!r.facetNormals,C=!!r.facetPositions,R=!!r.facetPartitioning,O=!0===r.useRightHandedSystem?-1:1,M=r.ratio||0,x=!!r.depthSort,I=r.distanceTo,x)){void 0===I&&(I=n.e.Zero());var D=r.depthSortedFacets}var N=0,L=0,w=0,F=0;if(R&&r&&r.bbSize){var B=0,U=0,V=0,k=0,G=0,z=0,j=0,W=0,H=0,X=0,Y=0,K=0,Q=0,q=0,Z=0,J=0,$=r.bbSize.x>r.bbSize.y?r.bbSize.x:r.bbSize.y;$=$>r.bbSize.z?$:r.bbSize.z,N=r.subDiv.X*M/r.bbSize.x,L=r.subDiv.Y*M/r.bbSize.y,w=r.subDiv.Z*M/r.bbSize.z,F=r.subDiv.max*r.subDiv.max,r.facetPartitioning.length=0}for(o=0;o<e.length;o++)i[o]=0;var ee=t.length/3|0;for(o=0;o<ee;o++){if(g=1+(m=3*t[3*o]),v=m+2,y=1+(b=3*t[3*o+1]),T=b+2,S=1+(E=3*t[3*o+2]),A=E+2,a=e[m]-e[b],s=e[g]-e[y],c=e[v]-e[T],l=e[E]-e[b],u=e[S]-e[y],d=O*(s*(h=e[A]-e[T])-c*u),f=O*(c*l-a*h),p=O*(a*u-s*l),d/=_=0===(_=Math.sqrt(d*d+f*f+p*p))?1:_,f/=_,p/=_,P&&r&&(r.facetNormals[o].x=d,r.facetNormals[o].y=f,r.facetNormals[o].z=p),C&&r&&(r.facetPositions[o].x=(e[m]+e[b]+e[E])/3,r.facetPositions[o].y=(e[g]+e[y]+e[S])/3,r.facetPositions[o].z=(e[v]+e[T]+e[A])/3),R&&r&&(B=Math.floor((r.facetPositions[o].x-r.bInfo.minimum.x*M)*N),U=Math.floor((r.facetPositions[o].y-r.bInfo.minimum.y*M)*L),V=Math.floor((r.facetPositions[o].z-r.bInfo.minimum.z*M)*w),k=Math.floor((e[m]-r.bInfo.minimum.x*M)*N),G=Math.floor((e[g]-r.bInfo.minimum.y*M)*L),z=Math.floor((e[v]-r.bInfo.minimum.z*M)*w),j=Math.floor((e[b]-r.bInfo.minimum.x*M)*N),W=Math.floor((e[y]-r.bInfo.minimum.y*M)*L),H=Math.floor((e[T]-r.bInfo.minimum.z*M)*w),X=Math.floor((e[E]-r.bInfo.minimum.x*M)*N),Y=Math.floor((e[S]-r.bInfo.minimum.y*M)*L),K=Math.floor((e[A]-r.bInfo.minimum.z*M)*w),q=k+r.subDiv.max*G+F*z,Z=j+r.subDiv.max*W+F*H,J=X+r.subDiv.max*Y+F*K,Q=B+r.subDiv.max*U+F*V,r.facetPartitioning[Q]=r.facetPartitioning[Q]?r.facetPartitioning[Q]:new Array,r.facetPartitioning[q]=r.facetPartitioning[q]?r.facetPartitioning[q]:new Array,r.facetPartitioning[Z]=r.facetPartitioning[Z]?r.facetPartitioning[Z]:new Array,r.facetPartitioning[J]=r.facetPartitioning[J]?r.facetPartitioning[J]:new Array,r.facetPartitioning[q].push(o),Z!=q&&r.facetPartitioning[Z].push(o),J!=Z&&J!=q&&r.facetPartitioning[J].push(o),Q!=q&&Q!=Z&&Q!=J&&r.facetPartitioning[Q].push(o)),x&&r&&r.facetPositions){var te=D[o];te.ind=3*o,te.sqDistance=n.e.DistanceSquared(r.facetPositions[o],I)}i[m]+=d,i[g]+=f,i[v]+=p,i[b]+=d,i[y]+=f,i[T]+=p,i[E]+=d,i[S]+=f,i[A]+=p}for(o=0;o<i.length/3;o++)d=i[3*o],f=i[3*o+1],p=i[3*o+2],d/=_=0===(_=Math.sqrt(d*d+f*f+p*p))?1:_,f/=_,p/=_,i[3*o]=d,i[3*o+1]=f,i[3*o+2]=p},e._ComputeSides=function(t,i,r,o,a,s,c){var l,u,h=r.length,d=o.length;switch(t=t||e.DEFAULTSIDE){case e.FRONTSIDE:break;case e.BACKSIDE:var f;for(l=0;l<h;l+=3)f=r[l],r[l]=r[l+2],r[l+2]=f;for(u=0;u<d;u++)o[u]=-o[u];break;case e.DOUBLESIDE:for(var p=i.length,_=p/3,m=0;m<p;m++)i[p+m]=i[m];for(l=0;l<h;l+=3)r[l+h]=r[l+2]+_,r[l+1+h]=r[l+1]+_,r[l+2+h]=r[l]+_;for(u=0;u<d;u++)o[d+u]=-o[u];var g=a.length,v=0;for(v=0;v<g;v++)a[v+g]=a[v];for(s=s||new n.f(0,0,1,1),c=c||new n.f(0,0,1,1),v=0,l=0;l<g/2;l++)a[v]=s.x+(s.z-s.x)*a[v],a[v+1]=s.y+(s.w-s.y)*a[v+1],a[v+g]=c.x+(c.z-c.x)*a[v+g],a[v+g+1]=c.y+(c.w-c.y)*a[v+g+1],v+=2}},e.ImportVertexData=function(t,i){var n=new e,o=t.positions;o&&n.set(o,r.b.PositionKind);var s=t.normals;s&&n.set(s,r.b.NormalKind);var c=t.tangents;c&&n.set(c,r.b.TangentKind);var l=t.uvs;l&&n.set(l,r.b.UVKind);var u=t.uv2s;u&&n.set(u,r.b.UV2Kind);var h=t.uv3s;h&&n.set(h,r.b.UV3Kind);var d=t.uv4s;d&&n.set(d,r.b.UV4Kind);var f=t.uv5s;f&&n.set(f,r.b.UV5Kind);var p=t.uv6s;p&&n.set(p,r.b.UV6Kind);var _=t.colors;_&&n.set(a.b.CheckColors4(_,o.length/3),r.b.ColorKind);var m=t.matricesIndices;m&&n.set(m,r.b.MatricesIndicesKind);var g=t.matricesWeights;g&&n.set(g,r.b.MatricesWeightsKind);var v=t.indices;v&&(n.indices=v),i.setAllVerticesData(n,t.updatable)},e.FRONTSIDE=0,e.BACKSIDE=1,e.DOUBLESIDE=2,e.DEFAULTSIDE=0,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r}),i.d(t,"b",function(){return o});var n=i(1),r=function(){function e(){}return e.NAME_EFFECTLAYER="EffectLayer",e.NAME_LAYER="Layer",e.NAME_LENSFLARESYSTEM="LensFlareSystem",e.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer",e.NAME_PARTICLESYSTEM="ParticleSystem",e.NAME_GAMEPAD="Gamepad",e.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue",e.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer",e.NAME_PREPASSRENDERER="PrePassRenderer",e.NAME_DEPTHRENDERER="DepthRenderer",e.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager",e.NAME_SPRITE="Sprite",e.NAME_SUBSURFACE="SubSurface",e.NAME_OUTLINERENDERER="Outline",e.NAME_PROCEDURALTEXTURE="ProceduralTexture",e.NAME_SHADOWGENERATOR="ShadowGenerator",e.NAME_OCTREE="Octree",e.NAME_PHYSICSENGINE="PhysicsEngine",e.NAME_AUDIO="Audio",e.STEP_ISREADYFORMESH_EFFECTLAYER=0,e.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0,e.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0,e.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0,e.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1,e.STEP_BEFORECAMERADRAW_EFFECTLAYER=0,e.STEP_BEFORECAMERADRAW_LAYER=1,e.STEP_BEFORECAMERADRAW_PREPASS=2,e.STEP_BEFORERENDERTARGETDRAW_LAYER=0,e.STEP_BEFORERENDERINGMESH_PREPASS=0,e.STEP_BEFORERENDERINGMESH_OUTLINE=1,e.STEP_AFTERRENDERINGMESH_PREPASS=0,e.STEP_AFTERRENDERINGMESH_OUTLINE=1,e.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0,e.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1,e.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0,e.STEP_BEFORECAMERAUPDATE_GAMEPAD=1,e.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0,e.STEP_AFTERRENDERTARGETDRAW_LAYER=0,e.STEP_AFTERCAMERADRAW_EFFECTLAYER=0,e.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=1,e.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=2,e.STEP_AFTERCAMERADRAW_LAYER=3,e.STEP_AFTERCAMERADRAW_PREPASS=4,e.STEP_AFTERRENDER_AUDIO=0,e.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0,e.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1,e.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2,e.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3,e.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0,e.STEP_BEFORECLEARSTAGE_PREPASS=0,e.STEP_POINTERMOVE_SPRITE=0,e.STEP_POINTERDOWN_SPRITE=0,e.STEP_POINTERUP_SPRITE=0,e}(),o=function(e){function t(t){return e.apply(this,t)||this}return Object(n.d)(t,e),t.Create=function(){return Object.create(t.prototype)},t.prototype.registerStep=function(e,t,i){var n=0;for(Number.MAX_VALUE;n<this.length&&!(e<this[n].index);n++);this.splice(n,0,{index:e,component:t,action:i.bind(t)})},t.prototype.clear=function(){this.length=0},t}(Array)},function(e,t,i){"use strict";i.d(t,"a",function(){return o}),i.d(t,"c",function(){return a}),i.d(t,"d",function(){return s}),i.d(t,"b",function(){return c});var n=i(1),r=i(0),o=function(){function e(){}return e.POINTERDOWN=1,e.POINTERUP=2,e.POINTERMOVE=4,e.POINTERWHEEL=8,e.POINTERPICK=16,e.POINTERTAP=32,e.POINTERDOUBLETAP=64,e}(),a=function(e,t){this.type=e,this.event=t},s=function(e){function t(t,i,n,o){var a=e.call(this,t,i)||this;return a.ray=null,a.skipOnPointerObservable=!1,a.localPosition=new r.d(n,o),a}return Object(n.d)(t,e),t}(a),c=function(e){function t(t,i,n){var r=e.call(this,t,i)||this;return r.pickInfo=n,r}return Object(n.d)(t,e),t}(a)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(13),r=i(2),o=function(){function e(){}return Object.defineProperty(e,"DiffuseTextureEnabled",{get:function(){return this._DiffuseTextureEnabled},set:function(e){this._DiffuseTextureEnabled!==e&&(this._DiffuseTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DetailTextureEnabled",{get:function(){return this._DetailTextureEnabled},set:function(e){this._DetailTextureEnabled!==e&&(this._DetailTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AmbientTextureEnabled",{get:function(){return this._AmbientTextureEnabled},set:function(e){this._AmbientTextureEnabled!==e&&(this._AmbientTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"OpacityTextureEnabled",{get:function(){return this._OpacityTextureEnabled},set:function(e){this._OpacityTextureEnabled!==e&&(this._OpacityTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ReflectionTextureEnabled",{get:function(){return this._ReflectionTextureEnabled},set:function(e){this._ReflectionTextureEnabled!==e&&(this._ReflectionTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EmissiveTextureEnabled",{get:function(){return this._EmissiveTextureEnabled},set:function(e){this._EmissiveTextureEnabled!==e&&(this._EmissiveTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"SpecularTextureEnabled",{get:function(){return this._SpecularTextureEnabled},set:function(e){this._SpecularTextureEnabled!==e&&(this._SpecularTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"BumpTextureEnabled",{get:function(){return this._BumpTextureEnabled},set:function(e){this._BumpTextureEnabled!==e&&(this._BumpTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LightmapTextureEnabled",{get:function(){return this._LightmapTextureEnabled},set:function(e){this._LightmapTextureEnabled!==e&&(this._LightmapTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"RefractionTextureEnabled",{get:function(){return this._RefractionTextureEnabled},set:function(e){this._RefractionTextureEnabled!==e&&(this._RefractionTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ColorGradingTextureEnabled",{get:function(){return this._ColorGradingTextureEnabled},set:function(e){this._ColorGradingTextureEnabled!==e&&(this._ColorGradingTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"FresnelEnabled",{get:function(){return this._FresnelEnabled},set:function(e){this._FresnelEnabled!==e&&(this._FresnelEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_FresnelDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ClearCoatTextureEnabled",{get:function(){return this._ClearCoatTextureEnabled},set:function(e){this._ClearCoatTextureEnabled!==e&&(this._ClearCoatTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ClearCoatBumpTextureEnabled",{get:function(){return this._ClearCoatBumpTextureEnabled},set:function(e){this._ClearCoatBumpTextureEnabled!==e&&(this._ClearCoatBumpTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ClearCoatTintTextureEnabled",{get:function(){return this._ClearCoatTintTextureEnabled},set:function(e){this._ClearCoatTintTextureEnabled!==e&&(this._ClearCoatTintTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"SheenTextureEnabled",{get:function(){return this._SheenTextureEnabled},set:function(e){this._SheenTextureEnabled!==e&&(this._SheenTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AnisotropicTextureEnabled",{get:function(){return this._AnisotropicTextureEnabled},set:function(e){this._AnisotropicTextureEnabled!==e&&(this._AnisotropicTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ThicknessTextureEnabled",{get:function(){return this._ThicknessTextureEnabled},set:function(e){this._ThicknessTextureEnabled!==e&&(this._ThicknessTextureEnabled=e,n.a.MarkAllMaterialsAsDirty(r.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),e._DiffuseTextureEnabled=!0,e._DetailTextureEnabled=!0,e._AmbientTextureEnabled=!0,e._OpacityTextureEnabled=!0,e._ReflectionTextureEnabled=!0,e._EmissiveTextureEnabled=!0,e._SpecularTextureEnabled=!0,e._BumpTextureEnabled=!0,e._LightmapTextureEnabled=!0,e._RefractionTextureEnabled=!0,e._ColorGradingTextureEnabled=!0,e._FresnelEnabled=!0,e._ClearCoatTextureEnabled=!0,e._ClearCoatBumpTextureEnabled=!0,e._ClearCoatTintTextureEnabled=!0,e._SheenTextureEnabled=!0,e._AnisotropicTextureEnabled=!0,e._ThicknessTextureEnabled=!0,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return U});var n=i(1),r=i(12),o=i(57),a=i(6),s=i(33),c=i(112),l=i(37),u=i(0),h=i(46),d=i(31),f=i(24),p=i(35),_=i(42),m=i(85),g=i(48),v=i(54),b=i(47),y=i(95),T=i(96),E=i(17),S=i(2),A=i(38),P=i(8),C=i(22),R=i(21),x=i(18),O=i(91),M=i(66),I=function(){function e(){this._singleClick=!1,this._doubleClick=!1,this._hasSwiped=!1,this._ignore=!1}return Object.defineProperty(e.prototype,"singleClick",{get:function(){return this._singleClick},set:function(e){this._singleClick=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doubleClick",{get:function(){return this._doubleClick},set:function(e){this._doubleClick=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasSwiped",{get:function(){return this._hasSwiped},set:function(e){this._hasSwiped=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ignore",{get:function(){return this._ignore},set:function(e){this._ignore=e},enumerable:!1,configurable:!0}),e}(),D=function(){function e(e){this._alreadyAttached=!1,this._wheelEventName="",this._meshPickProceed=!1,this._currentPickResult=null,this._previousPickResult=null,this._totalPointersPressed=0,this._doubleClickOccured=!1,this._pointerX=0,this._pointerY=0,this._startingPointerPosition=new u.d(0,0),this._previousStartingPointerPosition=new u.d(0,0),this._startingPointerTime=0,this._previousStartingPointerTime=0,this._pointerCaptures={},this._meshUnderPointerId=[],this._keyboardIsAttached=!1,this._scene=e}return Object.defineProperty(e.prototype,"meshUnderPointer",{get:function(){return this._pointerOverMesh},enumerable:!1,configurable:!0}),e.prototype.getMeshUnderPointerByPointerId=function(e){return this._meshUnderPointerId[e]},Object.defineProperty(e.prototype,"unTranslatedPointer",{get:function(){return new u.d(this._unTranslatedPointerX,this._unTranslatedPointerY)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointerX",{get:function(){return this._pointerX},set:function(e){this._pointerX=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointerY",{get:function(){return this._pointerY},set:function(e){this._pointerY=e},enumerable:!1,configurable:!0}),e.prototype._updatePointerPosition=function(e){var t=this._scene.getEngine().getInputElementClientRect();t&&(this._pointerX=e.clientX-t.left,this._pointerY=e.clientY-t.top,this._unTranslatedPointerX=this._pointerX,this._unTranslatedPointerY=this._pointerY)},e.prototype._processPointerMove=function(e,t){var i=this._scene,n=i.getEngine(),r=n.getInputElement();if(r){r.tabIndex=n.canvasTabIndex,i.doNotHandleCursors||(r.style.cursor=i.defaultCursor);var o=!!(e&&e.hit&&e.pickedMesh);o?(i.setPointerOverMesh(e.pickedMesh,t.pointerId),this._pointerOverMesh&&this._pointerOverMesh.actionManager&&this._pointerOverMesh.actionManager.hasPointerTriggers&&(i.doNotHandleCursors||(this._pointerOverMesh.actionManager.hoverCursor?r.style.cursor=this._pointerOverMesh.actionManager.hoverCursor:r.style.cursor=i.hoverCursor))):i.setPointerOverMesh(null,t.pointerId);for(var a=0,s=i._pointerMoveStage;a<s.length;a++)e=s[a].action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,o,r);if(e){var c=t.type===this._wheelEventName?x.a.POINTERWHEEL:x.a.POINTERMOVE;if(i.onPointerMove&&i.onPointerMove(t,e,c),i.onPointerObservable.hasObservers()){var l=new x.b(c,t,e);this._setRayOnPointerInfo(l),i.onPointerObservable.notifyObservers(l,c)}}}},e.prototype._setRayOnPointerInfo=function(e){var t=this._scene;e.pickInfo&&!e.pickInfo._pickingUnavailable&&(e.pickInfo.ray||(e.pickInfo.ray=t.createPickingRay(e.event.offsetX,e.event.offsetY,u.a.Identity(),t.activeCamera)))},e.prototype._checkPrePointerObservable=function(e,t,i){var n=this._scene,r=new x.d(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(r.ray=e.ray),n.onPrePointerObservable.notifyObservers(r,i),!!r.skipOnPointerObservable},e.prototype.simulatePointerMove=function(e,t){var i=new PointerEvent("pointermove",t);this._checkPrePointerObservable(e,i,x.a.POINTERMOVE)||this._processPointerMove(e,i)},e.prototype.simulatePointerDown=function(e,t){var i=new PointerEvent("pointerdown",t);this._checkPrePointerObservable(e,i,x.a.POINTERDOWN)||this._processPointerDown(e,i)},e.prototype._processPointerDown=function(t,i){var n=this,r=this._scene;if(t&&t.hit&&t.pickedMesh){this._pickedDownMesh=t.pickedMesh;var o=t.pickedMesh._getActionManagerForTrigger();if(o){if(o.hasPickTriggers)switch(o.processTrigger(S.a.ACTION_OnPickDownTrigger,b.a.CreateNew(t.pickedMesh,i)),i.button){case 0:o.processTrigger(S.a.ACTION_OnLeftPickTrigger,b.a.CreateNew(t.pickedMesh,i));break;case 1:o.processTrigger(S.a.ACTION_OnCenterPickTrigger,b.a.CreateNew(t.pickedMesh,i));break;case 2:o.processTrigger(S.a.ACTION_OnRightPickTrigger,b.a.CreateNew(t.pickedMesh,i))}o.hasSpecificTrigger(S.a.ACTION_OnLongPressTrigger)&&window.setTimeout(function(){var t=r.pick(n._unTranslatedPointerX,n._unTranslatedPointerY,function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.actionManager&&e.actionManager.hasSpecificTrigger(S.a.ACTION_OnLongPressTrigger)&&e==n._pickedDownMesh},!1,r.cameraToUseForPointers);t&&t.hit&&t.pickedMesh&&o&&0!==n._totalPointersPressed&&Date.now()-n._startingPointerTime>e.LongPressDelay&&!n._isPointerSwiping()&&(n._startingPointerTime=0,o.processTrigger(S.a.ACTION_OnLongPressTrigger,b.a.CreateNew(t.pickedMesh,i)))},e.LongPressDelay)}}else for(var a=0,s=r._pointerDownStage;a<s.length;a++)t=s[a].action(this._unTranslatedPointerX,this._unTranslatedPointerY,t,i);if(t){var c=x.a.POINTERDOWN;if(r.onPointerDown&&r.onPointerDown(i,t,c),r.onPointerObservable.hasObservers()){var l=new x.b(c,i,t);this._setRayOnPointerInfo(l),r.onPointerObservable.notifyObservers(l,c)}}},e.prototype._isPointerSwiping=function(){return Math.abs(this._startingPointerPosition.x-this._pointerX)>e.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>e.DragMovementThreshold},e.prototype.simulatePointerUp=function(e,t,i){var n=new PointerEvent("pointerup",t),r=new I;i?r.doubleClick=!0:r.singleClick=!0,this._checkPrePointerObservable(e,n,x.a.POINTERUP)||this._processPointerUp(e,n,r)},e.prototype._processPointerUp=function(e,t,i){var n=this._scene;if(e&&e&&e.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(n.onPointerPick&&n.onPointerPick(t,e),i.singleClick&&!i.ignore&&n.onPointerObservable.hasObservers())){var r=x.a.POINTERPICK,o=new x.b(r,t,e);this._setRayOnPointerInfo(o),n.onPointerObservable.notifyObservers(o,r)}var a=e.pickedMesh._getActionManagerForTrigger();if(a&&!i.ignore){a.processTrigger(S.a.ACTION_OnPickUpTrigger,b.a.CreateNew(e.pickedMesh,t)),!i.hasSwiped&&i.singleClick&&a.processTrigger(S.a.ACTION_OnPickTrigger,b.a.CreateNew(e.pickedMesh,t));var s=e.pickedMesh._getActionManagerForTrigger(S.a.ACTION_OnDoublePickTrigger);i.doubleClick&&s&&s.processTrigger(S.a.ACTION_OnDoublePickTrigger,b.a.CreateNew(e.pickedMesh,t))}}else if(!i.ignore)for(var c=0,l=n._pointerUpStage;c<l.length;c++)e=l[c].action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){var u=this._pickedDownMesh._getActionManagerForTrigger(S.a.ACTION_OnPickOutTrigger);u&&u.processTrigger(S.a.ACTION_OnPickOutTrigger,b.a.CreateNew(this._pickedDownMesh,t))}var h=0;n.onPointerObservable.hasObservers()&&(i.ignore||i.hasSwiped||(i.singleClick&&n.onPointerObservable.hasSpecificMask(x.a.POINTERTAP)?h=x.a.POINTERTAP:i.doubleClick&&n.onPointerObservable.hasSpecificMask(x.a.POINTERDOUBLETAP)&&(h=x.a.POINTERDOUBLETAP),!h)||(o=new x.b(h,t,e),this._setRayOnPointerInfo(o),n.onPointerObservable.notifyObservers(o,h)),i.ignore||(h=x.a.POINTERUP,o=new x.b(h,t,e),this._setRayOnPointerInfo(o),n.onPointerObservable.notifyObservers(o,h))),n.onPointerUp&&!i.ignore&&n.onPointerUp(t,e,h)},e.prototype.isPointerCaptured=function(e){return void 0===e&&(e=0),this._pointerCaptures[e]},e.prototype.attachControl=function(t,i,n,o){var a=this;void 0===t&&(t=!0),void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===o&&(o=null);var s=this._scene;if(o||(o=s.getEngine().getInputElement()),o){this._alreadyAttached&&this.detachControl(),this._alreadyAttachedTo=o;var c=s.getEngine();this._initActionManager=function(e,t){if(!a._meshPickProceed){var i=s.pick(a._unTranslatedPointerX,a._unTranslatedPointerY,s.pointerDownPredicate,!1,s.cameraToUseForPointers);a._currentPickResult=i,i&&(e=i.hit&&i.pickedMesh?i.pickedMesh._getActionManagerForTrigger():null),a._meshPickProceed=!0}return e},this._delayedSimpleClick=function(t,i,n){(Date.now()-a._previousStartingPointerTime>e.DoubleClickDelay&&!a._doubleClickOccured||t!==a._previousButtonPressed)&&(a._doubleClickOccured=!1,i.singleClick=!0,i.ignore=!1,n(i,a._currentPickResult))},this._initClickEvent=function(t,i,n,r){var o=new I;a._currentPickResult=null;var s=null,c=t.hasSpecificMask(x.a.POINTERPICK)||i.hasSpecificMask(x.a.POINTERPICK)||t.hasSpecificMask(x.a.POINTERTAP)||i.hasSpecificMask(x.a.POINTERTAP)||t.hasSpecificMask(x.a.POINTERDOUBLETAP)||i.hasSpecificMask(x.a.POINTERDOUBLETAP);!c&&O.a&&(s=a._initActionManager(s,o))&&(c=s.hasPickTriggers);var l=!1;if(c){var u=n.button;if(o.hasSwiped=a._isPointerSwiping(),!o.hasSwiped){var h=!e.ExclusiveDoubleClickMode;h||(h=!t.hasSpecificMask(x.a.POINTERDOUBLETAP)&&!i.hasSpecificMask(x.a.POINTERDOUBLETAP))&&!O.a.HasSpecificTrigger(S.a.ACTION_OnDoublePickTrigger)&&(s=a._initActionManager(s,o))&&(h=!s.hasSpecificTrigger(S.a.ACTION_OnDoublePickTrigger)),h?(Date.now()-a._previousStartingPointerTime>e.DoubleClickDelay||u!==a._previousButtonPressed)&&(o.singleClick=!0,r(o,a._currentPickResult),l=!0):(a._previousDelayedSimpleClickTimeout=a._delayedSimpleClickTimeout,a._delayedSimpleClickTimeout=window.setTimeout(a._delayedSimpleClick.bind(a,u,o,r),e.DoubleClickDelay));var d=t.hasSpecificMask(x.a.POINTERDOUBLETAP)||i.hasSpecificMask(x.a.POINTERDOUBLETAP);!d&&O.a.HasSpecificTrigger(S.a.ACTION_OnDoublePickTrigger)&&(s=a._initActionManager(s,o))&&(d=s.hasSpecificTrigger(S.a.ACTION_OnDoublePickTrigger)),d&&(u===a._previousButtonPressed&&Date.now()-a._previousStartingPointerTime<e.DoubleClickDelay&&!a._doubleClickOccured?(o.hasSwiped||a._isPointerSwiping()?(a._doubleClickOccured=!1,a._previousStartingPointerTime=a._startingPointerTime,a._previousStartingPointerPosition.x=a._startingPointerPosition.x,a._previousStartingPointerPosition.y=a._startingPointerPosition.y,a._previousButtonPressed=u,e.ExclusiveDoubleClickMode?(a._previousDelayedSimpleClickTimeout&&clearTimeout(a._previousDelayedSimpleClickTimeout),a._previousDelayedSimpleClickTimeout=a._delayedSimpleClickTimeout,r(o,a._previousPickResult)):r(o,a._currentPickResult)):(a._previousStartingPointerTime=0,a._doubleClickOccured=!0,o.doubleClick=!0,o.ignore=!1,e.ExclusiveDoubleClickMode&&a._previousDelayedSimpleClickTimeout&&clearTimeout(a._previousDelayedSimpleClickTimeout),a._previousDelayedSimpleClickTimeout=a._delayedSimpleClickTimeout,r(o,a._currentPickResult)),l=!0):(a._doubleClickOccured=!1,a._previousStartingPointerTime=a._startingPointerTime,a._previousStartingPointerPosition.x=a._startingPointerPosition.x,a._previousStartingPointerPosition.y=a._startingPointerPosition.y,a._previousButtonPressed=u))}}l||r(o,a._currentPickResult)},this._onPointerMove=function(e){if(void 0===e.pointerId&&(e.pointerId=0),a._updatePointerPosition(e),!a._checkPrePointerObservable(null,e,e.type===a._wheelEventName?x.a.POINTERWHEEL:x.a.POINTERMOVE)&&(s.cameraToUseForPointers||s.activeCamera)){s.pointerMovePredicate||(s.pointerMovePredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(e.enablePointerMoveEvents||s.constantlyUpdateMeshUnderPointer||null!=e._getActionManagerForTrigger())&&(!s.cameraToUseForPointers||0!=(s.cameraToUseForPointers.layerMask&e.layerMask))});var t=s.pick(a._unTranslatedPointerX,a._unTranslatedPointerY,s.pointerMovePredicate,!1,s.cameraToUseForPointers);a._processPointerMove(t,e)}},this._onPointerDown=function(e){if(a._totalPointersPressed++,a._pickedDownMesh=null,a._meshPickProceed=!1,void 0===e.pointerId&&(e.pointerId=0),a._updatePointerPosition(e),s.preventDefaultOnPointerDown&&o&&(e.preventDefault(),o.focus()),a._startingPointerPosition.x=a._pointerX,a._startingPointerPosition.y=a._pointerY,a._startingPointerTime=Date.now(),!a._checkPrePointerObservable(null,e,x.a.POINTERDOWN)&&(s.cameraToUseForPointers||s.activeCamera)){a._pointerCaptures[e.pointerId]=!0,s.pointerDownPredicate||(s.pointerDownPredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!s.cameraToUseForPointers||0!=(s.cameraToUseForPointers.layerMask&e.layerMask))}),a._pickedDownMesh=null;var t=s.pick(a._unTranslatedPointerX,a._unTranslatedPointerY,s.pointerDownPredicate,!1,s.cameraToUseForPointers);a._processPointerDown(t,e)}},this._onPointerUp=function(e){0!==a._totalPointersPressed&&(a._totalPointersPressed--,a._pickedUpMesh=null,a._meshPickProceed=!1,void 0===e.pointerId&&(e.pointerId=0),a._updatePointerPosition(e),s.preventDefaultOnPointerUp&&o&&(e.preventDefault(),o.focus()),a._initClickEvent(s.onPrePointerObservable,s.onPointerObservable,e,function(t,i){if(s.onPrePointerObservable.hasObservers()&&!t.ignore){if(!t.hasSwiped){if(t.singleClick&&s.onPrePointerObservable.hasSpecificMask(x.a.POINTERTAP)&&a._checkPrePointerObservable(null,e,x.a.POINTERTAP))return;if(t.doubleClick&&s.onPrePointerObservable.hasSpecificMask(x.a.POINTERDOUBLETAP)&&a._checkPrePointerObservable(null,e,x.a.POINTERDOUBLETAP))return}if(a._checkPrePointerObservable(null,e,x.a.POINTERUP))return}a._pointerCaptures[e.pointerId]&&(a._pointerCaptures[e.pointerId]=!1,(s.cameraToUseForPointers||s.activeCamera)&&(s.pointerUpPredicate||(s.pointerUpPredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!s.cameraToUseForPointers||0!=(s.cameraToUseForPointers.layerMask&e.layerMask))}),!a._meshPickProceed&&(O.a&&O.a.HasTriggers||s.onPointerObservable.hasObservers())&&a._initActionManager(null,t),i||(i=a._currentPickResult),a._processPointerUp(i,e,t),a._previousPickResult=a._currentPickResult))}))},this._onKeyDown=function(e){var t=M.a.KEYDOWN;if(s.onPreKeyboardObservable.hasObservers()){var i=new M.c(t,e);if(s.onPreKeyboardObservable.notifyObservers(i,t),i.skipOnPointerObservable)return}s.onKeyboardObservable.hasObservers()&&(i=new M.b(t,e),s.onKeyboardObservable.notifyObservers(i,t)),s.actionManager&&s.actionManager.processTrigger(S.a.ACTION_OnKeyDownTrigger,b.a.CreateNewFromScene(s,e))},this._onKeyUp=function(e){var t=M.a.KEYUP;if(s.onPreKeyboardObservable.hasObservers()){var i=new M.c(t,e);if(s.onPreKeyboardObservable.notifyObservers(i,t),i.skipOnPointerObservable)return}s.onKeyboardObservable.hasObservers()&&(i=new M.b(t,e),s.onKeyboardObservable.notifyObservers(i,t)),s.actionManager&&s.actionManager.processTrigger(S.a.ACTION_OnKeyUpTrigger,b.a.CreateNewFromScene(s,e))};var l=function(){o&&!a._keyboardIsAttached&&(o.addEventListener("keydown",a._onKeyDown,!1),o.addEventListener("keyup",a._onKeyUp,!1),a._keyboardIsAttached=!0)};this._onCanvasFocusObserver=c.onCanvasFocusObservable.add((document.activeElement===o&&l(),l)),this._onCanvasBlurObserver=c.onCanvasBlurObservable.add(function(){o&&(o.removeEventListener("keydown",a._onKeyDown),o.removeEventListener("keyup",a._onKeyUp),a._keyboardIsAttached=!1)}),l();var u=r.b.GetPointerPrefix(c);if(n&&(o.addEventListener(u+"move",this._onPointerMove,!1),this._wheelEventName="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",o.addEventListener(this._wheelEventName,this._onPointerMove,!1)),i&&o.addEventListener(u+"down",this._onPointerDown,!1),t){var h=s.getEngine().getHostWindow();h&&h.addEventListener(u+"up",this._onPointerUp,!1)}this._alreadyAttached=!0}},e.prototype.detachControl=function(){var e=this._scene.getEngine(),t=r.b.GetPointerPrefix(e);this._alreadyAttachedTo&&this._alreadyAttached&&(this._alreadyAttachedTo.removeEventListener(t+"move",this._onPointerMove),this._alreadyAttachedTo.removeEventListener(this._wheelEventName,this._onPointerMove),this._alreadyAttachedTo.removeEventListener(t+"down",this._onPointerDown),window.removeEventListener(t+"up",this._onPointerUp),this._onCanvasBlurObserver&&e.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onCanvasFocusObserver&&e.onCanvasFocusObservable.remove(this._onCanvasFocusObserver),this._alreadyAttachedTo.removeEventListener("keydown",this._onKeyDown),this._alreadyAttachedTo.removeEventListener("keyup",this._onKeyUp),this._scene.doNotHandleCursors||(this._alreadyAttachedTo.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1)},e.prototype.setPointerOverMesh=function(e,t){if(void 0===t&&(t=0),t<0&&(t=0),this._meshUnderPointerId[t]!==e){var i,n=this._meshUnderPointerId[t];n&&(i=n._getActionManagerForTrigger(S.a.ACTION_OnPointerOutTrigger))&&i.processTrigger(S.a.ACTION_OnPointerOutTrigger,b.a.CreateNew(n,void 0,{pointerId:t})),this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,(n=this._meshUnderPointerId[t])&&(i=n._getActionManagerForTrigger(S.a.ACTION_OnPointerOverTrigger))&&i.processTrigger(S.a.ACTION_OnPointerOverTrigger,b.a.CreateNew(n,void 0,{pointerId:t}))}},e.prototype.getPointerOverMesh=function(){return this._pointerOverMesh},e.DragMovementThreshold=10,e.LongPressDelay=500,e.DoubleClickDelay=300,e.ExclusiveDoubleClickMode=!1,e}(),N=i(55),L=i(9),w=i(90),F=i(152),B=i(56),U=function(e){function t(i,r){var o=e.call(this)||this;o._inputManager=new D(o),o.cameraToUseForPointers=null,o._isScene=!0,o._blockEntityCollection=!1,o.autoClear=!0,o.autoClearDepthAndStencil=!0,o.clearColor=new L.b(.2,.2,.3,1),o.ambientColor=new L.a(0,0,0),o._environmentIntensity=1,o._forceWireframe=!1,o._skipFrustumClipping=!1,o._forcePointsCloud=!1,o.animationsEnabled=!0,o._animationPropertiesOverride=null,o.useConstantAnimationDeltaTime=!1,o.constantlyUpdateMeshUnderPointer=!1,o.hoverCursor="pointer",o.defaultCursor="",o.doNotHandleCursors=!1,o.preventDefaultOnPointerDown=!0,o.preventDefaultOnPointerUp=!0,o.metadata=null,o.reservedDataStore=null,o.disableOfflineSupportExceptionRules=new Array,o.onDisposeObservable=new a.c,o._onDisposeObserver=null,o.onBeforeRenderObservable=new a.c,o._onBeforeRenderObserver=null,o.onAfterRenderObservable=new a.c,o.onAfterRenderCameraObservable=new a.c,o._onAfterRenderObserver=null,o.onBeforeAnimationsObservable=new a.c,o.onAfterAnimationsObservable=new a.c,o.onBeforeDrawPhaseObservable=new a.c,o.onAfterDrawPhaseObservable=new a.c,o.onReadyObservable=new a.c,o.onBeforeCameraRenderObservable=new a.c,o._onBeforeCameraRenderObserver=null,o.onAfterCameraRenderObservable=new a.c,o._onAfterCameraRenderObserver=null,o.onBeforeActiveMeshesEvaluationObservable=new a.c,o.onAfterActiveMeshesEvaluationObservable=new a.c,o.onBeforeParticlesRenderingObservable=new a.c,o.onAfterParticlesRenderingObservable=new a.c,o.onDataLoadedObservable=new a.c,o.onNewCameraAddedObservable=new a.c,o.onCameraRemovedObservable=new a.c,o.onNewLightAddedObservable=new a.c,o.onLightRemovedObservable=new a.c,o.onNewGeometryAddedObservable=new a.c,o.onGeometryRemovedObservable=new a.c,o.onNewTransformNodeAddedObservable=new a.c,o.onTransformNodeRemovedObservable=new a.c,o.onNewMeshAddedObservable=new a.c,o.onMeshRemovedObservable=new a.c,o.onNewSkeletonAddedObservable=new a.c,o.onSkeletonRemovedObservable=new a.c,o.onNewMaterialAddedObservable=new a.c,o.onNewMultiMaterialAddedObservable=new a.c,o.onMaterialRemovedObservable=new a.c,o.onMultiMaterialRemovedObservable=new a.c,o.onNewTextureAddedObservable=new a.c,o.onTextureRemovedObservable=new a.c,o.onBeforeRenderTargetsRenderObservable=new a.c,o.onAfterRenderTargetsRenderObservable=new a.c,o.onBeforeStepObservable=new a.c,o.onAfterStepObservable=new a.c,o.onActiveCameraChanged=new a.c,o.onBeforeRenderingGroupObservable=new a.c,o.onAfterRenderingGroupObservable=new a.c,o.onMeshImportedObservable=new a.c,o.onAnimationFileImportedObservable=new a.c,o._registeredForLateAnimationBindings=new s.b(256),o.onPrePointerObservable=new a.c,o.onPointerObservable=new a.c,o.onPreKeyboardObservable=new a.c,o.onKeyboardObservable=new a.c,o._useRightHandedSystem=!1,o._timeAccumulator=0,o._currentStepId=0,o._currentInternalStep=0,o._fogEnabled=!0,o._fogMode=t.FOGMODE_NONE,o.fogColor=new L.a(.2,.2,.3),o.fogDensity=.1,o.fogStart=0,o.fogEnd=1e3,o.prePass=!1,o._shadowsEnabled=!0,o._lightsEnabled=!0,o.activeCameras=new Array,o._texturesEnabled=!0,o.physicsEnabled=!0,o.particlesEnabled=!0,o.spritesEnabled=!0,o._skeletonsEnabled=!0,o.lensFlaresEnabled=!0,o.collisionsEnabled=!0,o.gravity=new u.e(0,-9.807,0),o.postProcessesEnabled=!0,o.renderTargetsEnabled=!0,o.dumpNextRenderTargets=!1,o.customRenderTargets=new Array,o.importedMeshesFiles=new Array,o.probesEnabled=!0,o._meshesForIntersections=new s.b(256),o.proceduralTexturesEnabled=!0,o._totalVertices=new N.a,o._activeIndices=new N.a,o._activeParticles=new N.a,o._activeBones=new N.a,o._animationTime=0,o.animationTimeScale=1,o._renderId=0,o._frameId=0,o._executeWhenReadyTimeoutId=-1,o._intermediateRendering=!1,o._viewUpdateFlag=-1,o._projectionUpdateFlag=-1,o._toBeDisposed=new Array(256),o._activeRequests=new Array,o._pendingData=new Array,o._isDisposed=!1,o.dispatchAllSubMeshesOfActiveMeshes=!1,o._activeMeshes=new s.a(256),o._processedMaterials=new s.a(256),o._renderTargets=new s.b(256),o._activeParticleSystems=new s.a(256),o._activeSkeletons=new s.b(32),o._softwareSkinnedMeshes=new s.b(32),o._activeAnimatables=new Array,o._transformMatrix=u.a.Zero(),o.requireLightSorting=!1,o._components=[],o._serializableComponents=[],o._transientComponents=[],o._beforeCameraUpdateStage=E.b.Create(),o._beforeClearStage=E.b.Create(),o._gatherRenderTargetsStage=E.b.Create(),o._gatherActiveCameraRenderTargetsStage=E.b.Create(),o._isReadyForMeshStage=E.b.Create(),o._beforeEvaluateActiveMeshStage=E.b.Create(),o._evaluateSubMeshStage=E.b.Create(),o._preActiveMeshStage=E.b.Create(),o._cameraDrawRenderTargetStage=E.b.Create(),o._beforeCameraDrawStage=E.b.Create(),o._beforeRenderTargetDrawStage=E.b.Create(),o._beforeRenderingGroupDrawStage=E.b.Create(),o._beforeRenderingMeshStage=E.b.Create(),o._afterRenderingMeshStage=E.b.Create(),o._afterRenderingGroupDrawStage=E.b.Create(),o._afterCameraDrawStage=E.b.Create(),o._afterRenderTargetDrawStage=E.b.Create(),o._afterRenderStage=E.b.Create(),o._pointerMoveStage=E.b.Create(),o._pointerDownStage=E.b.Create(),o._pointerUpStage=E.b.Create(),o.geometriesByUniqueId=null,o._defaultMeshCandidates={data:[],length:0},o._defaultSubMeshCandidates={data:[],length:0},o._preventFreeActiveMeshesAndRenderingGroups=!1,o._activeMeshesFrozen=!1,o._skipEvaluateActiveMeshesCompletely=!1,o._allowPostProcessClearColor=!0,o.getDeterministicFrameTime=function(){return o._engine.getTimeStep()},o._blockMaterialDirtyMechanism=!1;var c=Object(n.a)({useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1},r);return o._engine=i||C.a.LastCreatedEngine,c.virtual||(C.a._LastCreatedScene=o,o._engine.scenes.push(o)),o._uid=null,o._renderingManager=new T.b(o),y.a&&(o.postProcessManager=new y.a(o)),A.a.IsWindowObjectExist()&&o.attachControl(),o._createUbo(),_.a&&(o._imageProcessingConfiguration=new _.a),o.setDefaultCandidateProviders(),c.useGeometryUniqueIdsMap&&(o.geometriesByUniqueId={}),o.useMaterialMeshMap=c.useMaterialMeshMap,o.useClonedMeshMap=c.useClonedMeshMap,r&&r.virtual||o._engine.onNewSceneAddedObservable.notifyObservers(o),o}return Object(n.d)(t,e),t.DefaultMaterialFactory=function(e){throw R.a.WarnImport("StandardMaterial")},t.CollisionCoordinatorFactory=function(){throw R.a.WarnImport("DefaultCollisionCoordinator")},Object.defineProperty(t.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"environmentIntensity",{get:function(){return this._environmentIntensity},set:function(e){this._environmentIntensity!==e&&(this._environmentIntensity=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forceWireframe",{get:function(){return this._forceWireframe},set:function(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipFrustumClipping",{get:function(){return this._skipFrustumClipping},set:function(e){this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forcePointsCloud",{get:function(){return this._forcePointsCloud},set:function(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"afterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforeCameraRender",{set:function(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"afterCameraRender",{set:function(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unTranslatedPointer",{get:function(){return this._inputManager.unTranslatedPointer},enumerable:!1,configurable:!0}),Object.defineProperty(t,"DragMovementThreshold",{get:function(){return D.DragMovementThreshold},set:function(e){D.DragMovementThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"LongPressDelay",{get:function(){return D.LongPressDelay},set:function(e){D.LongPressDelay=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"DoubleClickDelay",{get:function(){return D.DoubleClickDelay},set:function(e){D.DoubleClickDelay=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ExclusiveDoubleClickMode",{get:function(){return D.ExclusiveDoubleClickMode},set:function(e){D.ExclusiveDoubleClickMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useRightHandedSystem",{get:function(){return this._useRightHandedSystem},set:function(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),t.prototype.setStepId=function(e){this._currentStepId=e},t.prototype.getStepId=function(){return this._currentStepId},t.prototype.getInternalStep=function(){return this._currentInternalStep},Object.defineProperty(t.prototype,"fogEnabled",{get:function(){return this._fogEnabled},set:function(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fogMode",{get:function(){return this._fogMode},set:function(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowsEnabled",{get:function(){return this._shadowsEnabled},set:function(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_LightDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightsEnabled",{get:function(){return this._lightsEnabled},set:function(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_LightDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeCamera",{get:function(){return this._activeCamera},set:function(e){e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultMaterial",{get:function(){return this._defaultMaterial||(this._defaultMaterial=t.DefaultMaterialFactory(this)),this._defaultMaterial},set:function(e){this._defaultMaterial=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texturesEnabled",{get:function(){return this._texturesEnabled},set:function(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skeletonsEnabled",{get:function(){return this._skeletonsEnabled},set:function(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(S.a.MATERIAL_AttributesDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collisionCoordinator",{get:function(){return this._collisionCoordinator||(this._collisionCoordinator=t.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frustumPlanes",{get:function(){return this._frustumPlanes},enumerable:!1,configurable:!0}),t.prototype._registerTransientComponents=function(){if(this._transientComponents.length>0){for(var e=0,t=this._transientComponents;e<t.length;e++)t[e].register();this._transientComponents=[]}},t.prototype._addComponent=function(e){this._components.push(e),this._transientComponents.push(e);var t=e;t.addFromContainer&&t.serialize&&this._serializableComponents.push(t)},t.prototype._getComponent=function(e){for(var t=0,i=this._components;t<i.length;t++){var n=i[t];if(n.name===e)return n}return null},t.prototype.getClassName=function(){return"Scene"},t.prototype._getDefaultMeshCandidates=function(){return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates},t.prototype._getDefaultSubMeshCandidates=function(e){return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates},t.prototype.setDefaultCandidateProviders=function(){this.getActiveMeshCandidates=this._getDefaultMeshCandidates.bind(this),this.getActiveSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this),this.getIntersectingSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this),this.getCollidingSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this)},Object.defineProperty(t.prototype,"meshUnderPointer",{get:function(){return this._inputManager.meshUnderPointer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerX",{get:function(){return this._inputManager.pointerX},set:function(e){this._inputManager.pointerX=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerY",{get:function(){return this._inputManager.pointerY},set:function(e){this._inputManager.pointerY=e},enumerable:!1,configurable:!0}),t.prototype.getCachedMaterial=function(){return this._cachedMaterial},t.prototype.getCachedEffect=function(){return this._cachedEffect},t.prototype.getCachedVisibility=function(){return this._cachedVisibility},t.prototype.isCachedMaterialInvalid=function(e,t,i){return void 0===i&&(i=1),this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==i},t.prototype.getEngine=function(){return this._engine},t.prototype.getTotalVertices=function(){return this._totalVertices.current},Object.defineProperty(t.prototype,"totalVerticesPerfCounter",{get:function(){return this._totalVertices},enumerable:!1,configurable:!0}),t.prototype.getActiveIndices=function(){return this._activeIndices.current},Object.defineProperty(t.prototype,"totalActiveIndicesPerfCounter",{get:function(){return this._activeIndices},enumerable:!1,configurable:!0}),t.prototype.getActiveParticles=function(){return this._activeParticles.current},Object.defineProperty(t.prototype,"activeParticlesPerfCounter",{get:function(){return this._activeParticles},enumerable:!1,configurable:!0}),t.prototype.getActiveBones=function(){return this._activeBones.current},Object.defineProperty(t.prototype,"activeBonesPerfCounter",{get:function(){return this._activeBones},enumerable:!1,configurable:!0}),t.prototype.getActiveMeshes=function(){return this._activeMeshes},t.prototype.getAnimationRatio=function(){return void 0!==this._animationRatio?this._animationRatio:1},t.prototype.getRenderId=function(){return this._renderId},t.prototype.getFrameId=function(){return this._frameId},t.prototype.incrementRenderId=function(){this._renderId++},t.prototype._createUbo=function(){this._sceneUbo=new m.a(this._engine,void 0,!0),this._sceneUbo.addUniform("viewProjection",16),this._sceneUbo.addUniform("view",16)},t.prototype.simulatePointerMove=function(e,t){return this._inputManager.simulatePointerMove(e,t),this},t.prototype.simulatePointerDown=function(e,t){return this._inputManager.simulatePointerDown(e,t),this},t.prototype.simulatePointerUp=function(e,t,i){return this._inputManager.simulatePointerUp(e,t,i),this},t.prototype.isPointerCaptured=function(e){return void 0===e&&(e=0),this._inputManager.isPointerCaptured(e)},t.prototype.attachControl=function(e,t,i){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===i&&(i=!0),this._inputManager.attachControl(e,t,i)},t.prototype.detachControl=function(){this._inputManager.detachControl()},t.prototype.isReady=function(){if(this._isDisposed)return!1;var e,t=this.getEngine();if(!t.areAllEffectsReady())return!1;if(this._pendingData.length>0)return!1;for(e=0;e<this.meshes.length;e++){var i=this.meshes[e];if(i.isEnabled()&&i.subMeshes&&0!==i.subMeshes.length){if(!i.isReady(!0))return!1;for(var n=i.hasThinInstances||"InstancedMesh"===i.getClassName()||"InstancedLinesMesh"===i.getClassName()||t.getCaps().instancedArrays&&i.instances.length>0,r=0,o=this._isReadyForMeshStage;r<o.length;r++)if(!o[r].action(i,n))return!1}}for(e=0;e<this.geometries.length;e++)if(this.geometries[e].delayLoadState===S.a.DELAYLOADSTATE_LOADING)return!1;if(this.activeCameras&&this.activeCameras.length>0){for(var a=0,s=this.activeCameras;a<s.length;a++)if(!s[a].isReady(!0))return!1}else if(this.activeCamera&&!this.activeCamera.isReady(!0))return!1;for(var c=0,l=this.particleSystems;c<l.length;c++)if(!l[c].isReady())return!1;return!0},t.prototype.resetCachedMaterial=function(){this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null},t.prototype.registerBeforeRender=function(e){this.onBeforeRenderObservable.add(e)},t.prototype.unregisterBeforeRender=function(e){this.onBeforeRenderObservable.removeCallback(e)},t.prototype.registerAfterRender=function(e){this.onAfterRenderObservable.add(e)},t.prototype.unregisterAfterRender=function(e){this.onAfterRenderObservable.removeCallback(e)},t.prototype._executeOnceBeforeRender=function(e){var t=this,i=function(){e(),setTimeout(function(){t.unregisterBeforeRender(i)})};this.registerBeforeRender(i)},t.prototype.executeOnceBeforeRender=function(e,t){var i=this;void 0!==t?setTimeout(function(){i._executeOnceBeforeRender(e)},t):this._executeOnceBeforeRender(e)},t.prototype._addPendingData=function(e){this._pendingData.push(e)},t.prototype._removePendingData=function(e){var t=this.isLoading,i=this._pendingData.indexOf(e);-1!==i&&this._pendingData.splice(i,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)},t.prototype.getWaitingItemsCount=function(){return this._pendingData.length},Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._pendingData.length>0},enumerable:!1,configurable:!0}),t.prototype.executeWhenReady=function(e){var t=this;this.onReadyObservable.add(e),-1===this._executeWhenReadyTimeoutId&&(this._executeWhenReadyTimeoutId=setTimeout(function(){t._checkIsReady()},150))},t.prototype.whenReadyAsync=function(){var e=this;return new Promise(function(t){e.executeWhenReady(function(){t()})})},t.prototype._checkIsReady=function(){var e=this;return this._registerTransientComponents(),this.isReady()?(this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1)):this._isDisposed?(this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1)):void(this._executeWhenReadyTimeoutId=setTimeout(function(){e._checkIsReady()},150))},Object.defineProperty(t.prototype,"animatables",{get:function(){return this._activeAnimatables},enumerable:!1,configurable:!0}),t.prototype.resetLastAnimationTimeFrame=function(){this._animationTimeLast=o.a.Now},t.prototype.getViewMatrix=function(){return this._viewMatrix},t.prototype.getProjectionMatrix=function(){return this._projectionMatrix},t.prototype.getTransformMatrix=function(){return this._transformMatrix},t.prototype.setTransformMatrix=function(e,t,i,n){this._viewUpdateFlag===e.updateFlag&&this._projectionUpdateFlag===t.updateFlag||(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?w.a.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=w.a.GetPlanes(this._transformMatrix),this._multiviewSceneUbo&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(i,n):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.update()))},t.prototype.getSceneUniformBuffer=function(){return this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo},t.prototype.getUniqueId=function(){return F.a.UniqueId},t.prototype.addMesh=function(e,t){var i=this;void 0===t&&(t=!1),this._blockEntityCollection||(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),this.onNewMeshAddedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){i.addMesh(e)}))},t.prototype.removeMesh=function(e,t){var i=this;void 0===t&&(t=!1);var n=this.meshes.indexOf(e);return-1!==n&&(this.meshes[n]=this.meshes[this.meshes.length-1],this.meshes.pop(),e.parent||e._removeFromSceneRootNodes()),this.onMeshRemovedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){i.removeMesh(e)}),n},t.prototype.addTransformNode=function(e){this._blockEntityCollection||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))},t.prototype.removeTransformNode=function(e){var t=e._indexInSceneTransformNodesArray;if(-1!==t){if(t!==this.transformNodes.length-1){var i=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=i,i._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t},t.prototype.removeSkeleton=function(e){var t=this.skeletons.indexOf(e);return-1!==t&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e)),t},t.prototype.removeMorphTargetManager=function(e){var t=this.morphTargetManagers.indexOf(e);return-1!==t&&this.morphTargetManagers.splice(t,1),t},t.prototype.removeLight=function(e){var t=this.lights.indexOf(e);if(-1!==t){for(var i=0,n=this.meshes;i<n.length;i++)n[i]._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes()}return this.onLightRemovedObservable.notifyObservers(e),t},t.prototype.removeCamera=function(e){var t=this.cameras.indexOf(e);if(-1!==t&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes()),this.activeCameras){var i=this.activeCameras.indexOf(e);-1!==i&&this.activeCameras.splice(i,1)}return this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t},t.prototype.removeParticleSystem=function(e){var t=this.particleSystems.indexOf(e);return-1!==t&&this.particleSystems.splice(t,1),t},t.prototype.removeAnimation=function(e){var t=this.animations.indexOf(e);return-1!==t&&this.animations.splice(t,1),t},t.prototype.stopAnimation=function(e,t,i){},t.prototype.removeAnimationGroup=function(e){var t=this.animationGroups.indexOf(e);return-1!==t&&this.animationGroups.splice(t,1),t},t.prototype.removeMultiMaterial=function(e){var t=this.multiMaterials.indexOf(e);return-1!==t&&this.multiMaterials.splice(t,1),this.onMultiMaterialRemovedObservable.notifyObservers(e),t},t.prototype.removeMaterial=function(e){var t=e._indexInSceneMaterialArray;if(-1!==t&&t<this.materials.length){if(t!==this.materials.length-1){var i=this.materials[this.materials.length-1];this.materials[t]=i,i._indexInSceneMaterialArray=t}e._indexInSceneMaterialArray=-1,this.materials.pop()}return this.onMaterialRemovedObservable.notifyObservers(e),t},t.prototype.removeActionManager=function(e){var t=this.actionManagers.indexOf(e);return-1!==t&&this.actionManagers.splice(t,1),t},t.prototype.removeTexture=function(e){var t=this.textures.indexOf(e);return-1!==t&&this.textures.splice(t,1),this.onTextureRemovedObservable.notifyObservers(e),t},t.prototype.addLight=function(e){if(!this._blockEntityCollection){this.lights.push(e),this.sortLightsByPriority(),e.parent||e._addToSceneRootNodes();for(var t=0,i=this.meshes;t<i.length;t++){var n=i[t];-1===n.lightSources.indexOf(e)&&(n.lightSources.push(e),n._resyncLightSources())}this.onNewLightAddedObservable.notifyObservers(e)}},t.prototype.sortLightsByPriority=function(){this.requireLightSorting&&this.lights.sort(g.a.CompareLightsPriority)},t.prototype.addCamera=function(e){this._blockEntityCollection||(this.cameras.push(e),this.onNewCameraAddedObservable.notifyObservers(e),e.parent||e._addToSceneRootNodes())},t.prototype.addSkeleton=function(e){this._blockEntityCollection||(this.skeletons.push(e),this.onNewSkeletonAddedObservable.notifyObservers(e))},t.prototype.addParticleSystem=function(e){this._blockEntityCollection||this.particleSystems.push(e)},t.prototype.addAnimation=function(e){this._blockEntityCollection||this.animations.push(e)},t.prototype.addAnimationGroup=function(e){this._blockEntityCollection||this.animationGroups.push(e)},t.prototype.addMultiMaterial=function(e){this._blockEntityCollection||(this.multiMaterials.push(e),this.onNewMultiMaterialAddedObservable.notifyObservers(e))},t.prototype.addMaterial=function(e){this._blockEntityCollection||(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),this.onNewMaterialAddedObservable.notifyObservers(e))},t.prototype.addMorphTargetManager=function(e){this._blockEntityCollection||this.morphTargetManagers.push(e)},t.prototype.addGeometry=function(e){this._blockEntityCollection||(this.geometriesByUniqueId&&(this.geometriesByUniqueId[e.uniqueId]=this.geometries.length),this.geometries.push(e))},t.prototype.addActionManager=function(e){this.actionManagers.push(e)},t.prototype.addTexture=function(e){this._blockEntityCollection||(this.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e))},t.prototype.switchActiveCamera=function(e,t){void 0===t&&(t=!0),this._engine.getInputElement()&&(this.activeCamera&&this.activeCamera.detachControl(),this.activeCamera=e,t&&e.attachControl())},t.prototype.setActiveCameraByID=function(e){var t=this.getCameraByID(e);return t?(this.activeCamera=t,t):null},t.prototype.setActiveCameraByName=function(e){var t=this.getCameraByName(e);return t?(this.activeCamera=t,t):null},t.prototype.getAnimationGroupByName=function(e){for(var t=0;t<this.animationGroups.length;t++)if(this.animationGroups[t].name===e)return this.animationGroups[t];return null},t.prototype.getMaterialByUniqueID=function(e){for(var t=0;t<this.materials.length;t++)if(this.materials[t].uniqueId===e)return this.materials[t];return null},t.prototype.getMaterialByID=function(e){for(var t=0;t<this.materials.length;t++)if(this.materials[t].id===e)return this.materials[t];return null},t.prototype.getLastMaterialByID=function(e){for(var t=this.materials.length-1;t>=0;t--)if(this.materials[t].id===e)return this.materials[t];return null},t.prototype.getMaterialByName=function(e){for(var t=0;t<this.materials.length;t++)if(this.materials[t].name===e)return this.materials[t];return null},t.prototype.getTextureByUniqueID=function(e){for(var t=0;t<this.textures.length;t++)if(this.textures[t].uniqueId===e)return this.textures[t];return null},t.prototype.getCameraByID=function(e){for(var t=0;t<this.cameras.length;t++)if(this.cameras[t].id===e)return this.cameras[t];return null},t.prototype.getCameraByUniqueID=function(e){for(var t=0;t<this.cameras.length;t++)if(this.cameras[t].uniqueId===e)return this.cameras[t];return null},t.prototype.getCameraByName=function(e){for(var t=0;t<this.cameras.length;t++)if(this.cameras[t].name===e)return this.cameras[t];return null},t.prototype.getBoneByID=function(e){for(var t=0;t<this.skeletons.length;t++)for(var i=this.skeletons[t],n=0;n<i.bones.length;n++)if(i.bones[n].id===e)return i.bones[n];return null},t.prototype.getBoneByName=function(e){for(var t=0;t<this.skeletons.length;t++)for(var i=this.skeletons[t],n=0;n<i.bones.length;n++)if(i.bones[n].name===e)return i.bones[n];return null},t.prototype.getLightByName=function(e){for(var t=0;t<this.lights.length;t++)if(this.lights[t].name===e)return this.lights[t];return null},t.prototype.getLightByID=function(e){for(var t=0;t<this.lights.length;t++)if(this.lights[t].id===e)return this.lights[t];return null},t.prototype.getLightByUniqueID=function(e){for(var t=0;t<this.lights.length;t++)if(this.lights[t].uniqueId===e)return this.lights[t];return null},t.prototype.getParticleSystemByID=function(e){for(var t=0;t<this.particleSystems.length;t++)if(this.particleSystems[t].id===e)return this.particleSystems[t];return null},t.prototype.getGeometryByID=function(e){for(var t=0;t<this.geometries.length;t++)if(this.geometries[t].id===e)return this.geometries[t];return null},t.prototype._getGeometryByUniqueID=function(e){if(this.geometriesByUniqueId){var t=this.geometriesByUniqueId[e];if(void 0!==t)return this.geometries[t]}else for(var i=0;i<this.geometries.length;i++)if(this.geometries[i].uniqueId===e)return this.geometries[i];return null},t.prototype.pushGeometry=function(e,t){return!(!t&&this._getGeometryByUniqueID(e.uniqueId)||(this.addGeometry(e),this.onNewGeometryAddedObservable.notifyObservers(e),0))},t.prototype.removeGeometry=function(e){var t;if(this.geometriesByUniqueId){if(void 0===(t=this.geometriesByUniqueId[e.uniqueId]))return!1}else if((t=this.geometries.indexOf(e))<0)return!1;if(t!==this.geometries.length-1){var i=this.geometries[this.geometries.length-1];i&&(this.geometries[t]=i,this.geometriesByUniqueId&&(this.geometriesByUniqueId[i.uniqueId]=t,this.geometriesByUniqueId[e.uniqueId]=void 0))}return this.geometries.pop(),this.onGeometryRemovedObservable.notifyObservers(e),!0},t.prototype.getGeometries=function(){return this.geometries},t.prototype.getMeshByID=function(e){for(var t=0;t<this.meshes.length;t++)if(this.meshes[t].id===e)return this.meshes[t];return null},t.prototype.getMeshesByID=function(e){return this.meshes.filter(function(t){return t.id===e})},t.prototype.getTransformNodeByID=function(e){for(var t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null},t.prototype.getTransformNodeByUniqueID=function(e){for(var t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].uniqueId===e)return this.transformNodes[t];return null},t.prototype.getTransformNodesByID=function(e){return this.transformNodes.filter(function(t){return t.id===e})},t.prototype.getMeshByUniqueID=function(e){for(var t=0;t<this.meshes.length;t++)if(this.meshes[t].uniqueId===e)return this.meshes[t];return null},t.prototype.getLastMeshByID=function(e){for(var t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null},t.prototype.getLastEntryByID=function(e){var t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];return null},t.prototype.getNodeByID=function(e){var t=this.getMeshByID(e);if(t)return t;var i=this.getTransformNodeByID(e);if(i)return i;var n=this.getLightByID(e);if(n)return n;var r=this.getCameraByID(e);return r||(this.getBoneByID(e)||null)},t.prototype.getNodeByName=function(e){var t=this.getMeshByName(e);if(t)return t;var i=this.getTransformNodeByName(e);if(i)return i;var n=this.getLightByName(e);if(n)return n;var r=this.getCameraByName(e);return r||(this.getBoneByName(e)||null)},t.prototype.getMeshByName=function(e){for(var t=0;t<this.meshes.length;t++)if(this.meshes[t].name===e)return this.meshes[t];return null},t.prototype.getTransformNodeByName=function(e){for(var t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].name===e)return this.transformNodes[t];return null},t.prototype.getLastSkeletonByID=function(e){for(var t=this.skeletons.length-1;t>=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null},t.prototype.getSkeletonByUniqueId=function(e){for(var t=0;t<this.skeletons.length;t++)if(this.skeletons[t].uniqueId===e)return this.skeletons[t];return null},t.prototype.getSkeletonById=function(e){for(var t=0;t<this.skeletons.length;t++)if(this.skeletons[t].id===e)return this.skeletons[t];return null},t.prototype.getSkeletonByName=function(e){for(var t=0;t<this.skeletons.length;t++)if(this.skeletons[t].name===e)return this.skeletons[t];return null},t.prototype.getMorphTargetManagerById=function(e){for(var t=0;t<this.morphTargetManagers.length;t++)if(this.morphTargetManagers[t].uniqueId===e)return this.morphTargetManagers[t];return null},t.prototype.getMorphTargetById=function(e){for(var t=0;t<this.morphTargetManagers.length;++t)for(var i=this.morphTargetManagers[t],n=0;n<i.numTargets;++n){var r=i.getTarget(n);if(r.id===e)return r}return null},t.prototype.getMorphTargetByName=function(e){for(var t=0;t<this.morphTargetManagers.length;++t)for(var i=this.morphTargetManagers[t],n=0;n<i.numTargets;++n){var r=i.getTarget(n);if(r.name===e)return r}return null},t.prototype.getPostProcessByName=function(e){for(var t=0;t<this.postProcesses.length;++t){var i=this.postProcesses[t];if(i.name===e)return i}return null},t.prototype.isActiveMesh=function(e){return-1!==this._activeMeshes.indexOf(e)},Object.defineProperty(t.prototype,"uid",{get:function(){return this._uid||(this._uid=r.b.RandomId()),this._uid},enumerable:!1,configurable:!0}),t.prototype.addExternalData=function(e,t){return this._externalData||(this._externalData=new c.a),this._externalData.add(e,t)},t.prototype.getExternalData=function(e){return this._externalData?this._externalData.get(e):null},t.prototype.getOrAddExternalDataWithFactory=function(e,t){return this._externalData||(this._externalData=new c.a),this._externalData.getOrAddWithFactory(e,t)},t.prototype.removeExternalData=function(e){return this._externalData.remove(e)},t.prototype._evaluateSubMesh=function(e,t,i){if(i.hasInstances||i.isAnInstance||this.dispatchAllSubMeshesOfActiveMeshes||this._skipFrustumClipping||t.alwaysSelectAsActiveMesh||1===t.subMeshes.length||e.isInFrustum(this._frustumPlanes)){for(var n=0,r=this._evaluateSubMeshStage;n<r.length;n++)r[n].action(t,e);var o=e.getMaterial();null!=o&&(o.hasRenderTargetTextures&&null!=o.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(o)&&(this._processedMaterials.push(o),this._renderTargets.concatWithNoDuplicate(o.getRenderTargetTextures())),this._renderingManager.dispatch(e,t,o))}},t.prototype.freeProcessedMaterials=function(){this._processedMaterials.dispose()},Object.defineProperty(t.prototype,"blockfreeActiveMeshesAndRenderingGroups",{get:function(){return this._preventFreeActiveMeshesAndRenderingGroups},set:function(e){this._preventFreeActiveMeshesAndRenderingGroups!==e&&(e&&(this.freeActiveMeshes(),this.freeRenderingGroups()),this._preventFreeActiveMeshesAndRenderingGroups=e)},enumerable:!1,configurable:!0}),t.prototype.freeActiveMeshes=function(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._activeMeshes.dispose(),this.activeCamera&&this.activeCamera._activeMeshes&&this.activeCamera._activeMeshes.dispose(),this.activeCameras))for(var e=0;e<this.activeCameras.length;e++){var t=this.activeCameras[e];t&&t._activeMeshes&&t._activeMeshes.dispose()}},t.prototype.freeRenderingGroups=function(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._renderingManager&&this._renderingManager.freeRenderingGroups(),this.textures))for(var e=0;e<this.textures.length;e++){var t=this.textures[e];t&&t.renderList&&t.freeRenderingGroups()}},t.prototype._isInIntermediateRendering=function(){return this._intermediateRendering},t.prototype.freezeActiveMeshes=function(e,t,i){var n=this;return void 0===e&&(e=!1),this.executeWhenReady(function(){if(n.activeCamera){n._frustumPlanes||n.setTransformMatrix(n.activeCamera.getViewMatrix(),n.activeCamera.getProjectionMatrix()),n._evaluateActiveMeshes(),n._activeMeshesFrozen=!0,n._skipEvaluateActiveMeshesCompletely=e;for(var r=0;r<n._activeMeshes.length;r++)n._activeMeshes.data[r]._freeze();t&&t()}else i&&i("No active camera found")}),this},t.prototype.unfreezeActiveMeshes=function(){for(var e=0;e<this.meshes.length;e++){var t=this.meshes[e];t._internalAbstractMeshDataInfo&&(t._internalAbstractMeshDataInfo._isActive=!1)}for(e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();return this._activeMeshesFrozen=!1,this},t.prototype._evaluateActiveMeshes=function(){if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely)for(var e=this._activeMeshes.length,t=0;t<e;t++)(s=this._activeMeshes.data[t]).computeWorldMatrix();if(this._activeParticleSystems){var i=this._activeParticleSystems.length;for(t=0;t<i;t++)this._activeParticleSystems.data[t].animate()}}else if(this.activeCamera){this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this),this.activeCamera._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();for(var n=0,r=this._beforeEvaluateActiveMeshStage;n<r.length;n++)r[n].action();var o=this.getActiveMeshCandidates(),a=o.length;for(t=0;t<a;t++){var s;if((s=o.data[t])._internalAbstractMeshDataInfo._currentLODIsUpToDate=!1,!s.isBlocked&&(this._totalVertices.addCount(s.getTotalVertices(),!1),s.isReady()&&s.isEnabled()&&0!==s.scaling.lengthSquared())){s.computeWorldMatrix(),s.actionManager&&s.actionManager.hasSpecificTriggers2(S.a.ACTION_OnIntersectionEnterTrigger,S.a.ACTION_OnIntersectionExitTrigger)&&this._meshesForIntersections.pushNoDuplicate(s);var c=this.customLODSelector?this.customLODSelector(s,this.activeCamera):s.getLOD(this.activeCamera);if(s._internalAbstractMeshDataInfo._currentLOD=c,s._internalAbstractMeshDataInfo._currentLODIsUpToDate=!0,null!=c&&(c!==s&&c.billboardMode!==h.a.BILLBOARDMODE_NONE&&c.computeWorldMatrix(),s._preActivate(),s.isVisible&&s.visibility>0&&0!=(s.layerMask&this.activeCamera.layerMask)&&(this._skipFrustumClipping||s.alwaysSelectAsActiveMesh||s.isInFrustum(this._frustumPlanes)))){this._activeMeshes.push(s),this.activeCamera._activeMeshes.push(s),c!==s&&c._activate(this._renderId,!1);for(var l=0,u=this._preActiveMeshStage;l<u.length;l++)u[l].action(s);s._activate(this._renderId,!1)&&(s.isAnInstance?s._internalAbstractMeshDataInfo._actAsRegularMesh&&(c=s):c._internalAbstractMeshDataInfo._onlyForInstances=!1,c._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(s,c)),s._postActivate()}}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(var d=0;d<this.particleSystems.length;d++){var f=this.particleSystems[d];if(f.isStarted()&&f.emitter){var p=f.emitter;p.position&&!p.isEnabled()||(this._activeParticleSystems.push(f),f.animate(),this._renderingManager.dispatchParticles(f))}}this.onAfterParticlesRenderingObservable.notifyObservers(this)}}},t.prototype._activeMesh=function(e,t){if(this._skeletonsEnabled&&null!==t.skeleton&&void 0!==t.skeleton&&(this._activeSkeletons.pushNoDuplicate(t.skeleton)&&t.skeleton.prepare(),t.computeBonesUsingShaders||this._softwareSkinnedMeshes.pushNoDuplicate(t)),null!=t&&void 0!==t.subMeshes&&null!==t.subMeshes&&t.subMeshes.length>0)for(var i=this.getActiveSubMeshCandidates(t),n=i.length,r=0;r<n;r++){var o=i.data[r];this._evaluateSubMesh(o,t,e)}},t.prototype.updateTransformMatrix=function(e){this.activeCamera&&this.setTransformMatrix(this.activeCamera.getViewMatrix(),this.activeCamera.getProjectionMatrix(e))},t.prototype._bindFrameBuffer=function(){if(this.activeCamera&&this.activeCamera._multiviewTexture)this.activeCamera._multiviewTexture._bindFrameBuffer();else if(this.activeCamera&&this.activeCamera.outputRenderTarget)if(this.getEngine().getCaps().multiview&&this.activeCamera.outputRenderTarget&&this.activeCamera.outputRenderTarget.getViewCount()>1)this.activeCamera.outputRenderTarget._bindFrameBuffer();else{var e=this.activeCamera.outputRenderTarget.getInternalTexture();e?this.getEngine().bindFramebuffer(e):P.a.Error("Camera contains invalid customDefaultRenderTarget")}else this.getEngine().restoreDefaultFramebuffer()},t.prototype._renderForCamera=function(e,t){if(!e||!e._skipRendering){var i=this._engine;if(this._activeCamera=e,!this.activeCamera)throw new Error("Active camera not set");i.setViewport(this.activeCamera.viewport),this.resetCachedMaterial(),this._renderId++,this.getEngine().getCaps().multiview&&e.outputRenderTarget&&e.outputRenderTarget.getViewCount()>1?this.setTransformMatrix(e._rigCameras[0].getViewMatrix(),e._rigCameras[0].getProjectionMatrix(),e._rigCameras[1].getViewMatrix(),e._rigCameras[1].getProjectionMatrix()):this.updateTransformMatrix(),this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera),this._evaluateActiveMeshes();for(var n=0;n<this._softwareSkinnedMeshes.length;n++){var o=this._softwareSkinnedMeshes.data[n];o.applySkeleton(o.skeleton)}this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),e.customRenderTargets&&e.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets);for(var a=0,s=this._gatherActiveCameraRenderTargetsStage;a<s.length;a++)s[a].action(this._renderTargets);var c=!1;if(this.renderTargetsEnabled){if(this._intermediateRendering=!0,this._renderTargets.length>0){r.b.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(var l=0;l<this._renderTargets.length;l++){var u=this._renderTargets.data[l];if(u._shouldRender()){this._renderId++;var h=u.activeCamera&&u.activeCamera!==this.activeCamera;u.render(h,this.dumpNextRenderTargets),c=!0}}r.b.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}for(var d=0,f=this._cameraDrawRenderTargetStage;d<f.length;d++)c=f[d].action(this.activeCamera)||c;this._intermediateRendering=!1,this.activeCamera&&this.activeCamera.outputRenderTarget&&(c=!0)}c&&!this.prePass&&this._bindFrameBuffer(),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),!this.postProcessManager||e._multiviewTexture||this.prePass||this.postProcessManager._prepareFrame();for(var p=0,_=this._beforeCameraDrawStage;p<_.length;p++)_[p].action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this),this._renderingManager.render(null,null,!0,!0),this.onAfterDrawPhaseObservable.notifyObservers(this);for(var m=0,g=this._afterCameraDrawStage;m<g.length;m++)g[m].action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){var v=e.outputRenderTarget?e.outputRenderTarget.getInternalTexture():void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,v)}this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}},t.prototype._processSubCameras=function(e){if(e.cameraRigMode===f.a.RIG_MODE_NONE||e.outputRenderTarget&&e.outputRenderTarget.getViewCount()>1&&this.getEngine().getCaps().multiview)return this._renderForCamera(e),void this.onAfterRenderCameraObservable.notifyObservers(e);if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else for(var t=0;t<e._rigCameras.length;t++)this._renderForCamera(e._rigCameras[t],e);this._activeCamera=e,this.setTransformMatrix(this._activeCamera.getViewMatrix(),this._activeCamera.getProjectionMatrix()),this.onAfterRenderCameraObservable.notifyObservers(e)},t.prototype._checkIntersections=function(){for(var e=0;e<this._meshesForIntersections.length;e++){var t=this._meshesForIntersections.data[e];if(t.actionManager)for(var i=0;t.actionManager&&i<t.actionManager.actions.length;i++){var n=t.actionManager.actions[i];if(n.trigger===S.a.ACTION_OnIntersectionEnterTrigger||n.trigger===S.a.ACTION_OnIntersectionExitTrigger){var r=n.getTriggerParameter(),o=r instanceof d.a?r:r.mesh,a=o.intersectsMesh(t,r.usePreciseIntersection),s=t._intersectionsInProgress.indexOf(o);a&&-1===s?n.trigger===S.a.ACTION_OnIntersectionEnterTrigger?(n._executeCurrent(b.a.CreateNew(t,void 0,o)),t._intersectionsInProgress.push(o)):n.trigger===S.a.ACTION_OnIntersectionExitTrigger&&t._intersectionsInProgress.push(o):!a&&s>-1&&(n.trigger===S.a.ACTION_OnIntersectionExitTrigger&&n._executeCurrent(b.a.CreateNew(t,void 0,o)),t.actionManager.hasSpecificTrigger(S.a.ACTION_OnIntersectionExitTrigger,function(e){var t=e instanceof d.a?e:e.mesh;return o===t})&&n.trigger!==S.a.ACTION_OnIntersectionExitTrigger||t._intersectionsInProgress.splice(s,1))}}}},t.prototype._advancePhysicsEngineStep=function(e){},t.prototype._animate=function(){},t.prototype.animate=function(){if(this._engine.isDeterministicLockStep()){var e=Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime))+this._timeAccumulator,i=this._engine.getTimeStep(),n=1e3/i/1e3,r=0,o=this._engine.getLockstepMaxSteps(),a=Math.floor(e/i);for(a=Math.min(a,o);e>0&&r<a;)this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=i*n,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(i),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,r++,e-=i;this._timeAccumulator=e<0?0:e}else e=this.useConstantAnimationDeltaTime?16:Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime)),this._animationRatio=.06*e,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(e)},t.prototype.render=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!1),!this.isDisposed){this.onReadyObservable.hasObservers()&&-1===this._executeWhenReadyTimeoutId&&this._checkIsReady(),this._frameId++,this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(S.a.ACTION_OnEveryFrameTrigger),t||this.animate();for(var i=0,n=this._beforeCameraUpdateStage;i<n.length;i++)n[i].action();if(e)if(this.activeCameras&&this.activeCameras.length>0)for(var o=0;o<this.activeCameras.length;o++){var a=this.activeCameras[o];if(a.update(),a.cameraRigMode!==f.a.RIG_MODE_NONE)for(var s=0;s<a._rigCameras.length;s++)a._rigCameras[s].update()}else if(this.activeCamera&&(this.activeCamera.update(),this.activeCamera.cameraRigMode!==f.a.RIG_MODE_NONE))for(s=0;s<this.activeCamera._rigCameras.length;s++)this.activeCamera._rigCameras[s].update();this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);var c=this.getEngine(),l=this.activeCamera;if(this.renderTargetsEnabled){r.b.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._intermediateRendering=!0;for(var u=0;u<this.customRenderTargets.length;u++){var h=this.customRenderTargets[u];if(h._shouldRender()){if(this._renderId++,this.activeCamera=h.activeCamera||this.activeCamera,!this.activeCamera)throw new Error("Active camera not set");c.setViewport(this.activeCamera.viewport),this.updateTransformMatrix(),h.render(l!==this.activeCamera,this.dumpNextRenderTargets)}}r.b.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._intermediateRendering=!1,this._renderId++}this.activeCamera=l,this._activeCamera&&this._activeCamera.cameraRigMode!==f.a.RIG_MODE_CUSTOM&&!this.prePass&&this._bindFrameBuffer(),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(var d=0,p=this._beforeClearStage;d<p.length;d++)p[d].action();!this.autoClearDepthAndStencil&&!this.autoClear||this.prePass||this._engine.clear(this.clearColor,this.autoClear||this.forceWireframe||this.forcePointsCloud,this.autoClearDepthAndStencil,this.autoClearDepthAndStencil);for(var _=0,m=this._gatherRenderTargetsStage;_<m.length;_++)m[_].action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(o=0;o<this.activeCameras.length;o++)o>0&&this._engine.clear(null,!1,!0,!0),this._processSubCameras(this.activeCameras[o]);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera)}this._checkIntersections();for(var g=0,v=this._afterRenderStage;g<v.length;g++)v[g].action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(s=0;s<this._toBeDisposed.length;s++){var b=this._toBeDisposed[s];b&&b.dispose()}this._toBeDisposed=[]}this.dumpNextRenderTargets&&(this.dumpNextRenderTargets=!1),this._activeBones.addCount(0,!0),this._activeIndices.addCount(0,!0),this._activeParticles.addCount(0,!0)}},t.prototype.freezeMaterials=function(){for(var e=0;e<this.materials.length;e++)this.materials[e].freeze()},t.prototype.unfreezeMaterials=function(){for(var e=0;e<this.materials.length;e++)this.materials[e].unfreeze()},t.prototype.dispose=function(){this.beforeRender=null,this.afterRender=null,C.a._LastCreatedScene===this&&(C.a._LastCreatedScene=null),this.skeletons=[],this.morphTargetManagers=[],this._transientComponents=[],this._isReadyForMeshStage.clear(),this._beforeEvaluateActiveMeshStage.clear(),this._evaluateSubMeshStage.clear(),this._preActiveMeshStage.clear(),this._cameraDrawRenderTargetStage.clear(),this._beforeCameraDrawStage.clear(),this._beforeRenderTargetDrawStage.clear(),this._beforeRenderingGroupDrawStage.clear(),this._beforeRenderingMeshStage.clear(),this._afterRenderingMeshStage.clear(),this._afterRenderingGroupDrawStage.clear(),this._afterCameraDrawStage.clear(),this._afterRenderTargetDrawStage.clear(),this._afterRenderStage.clear(),this._beforeCameraUpdateStage.clear(),this._beforeClearStage.clear(),this._gatherRenderTargetsStage.clear(),this._gatherActiveCameraRenderTargetsStage.clear(),this._pointerMoveStage.clear(),this._pointerDownStage.clear(),this._pointerUpStage.clear();for(var e=0,t=this._components;e<t.length;e++)t[e].dispose();this.importedMeshesFiles=new Array,this.stopAllAnimations&&this.stopAllAnimations(),this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed=[];for(var i=0,n=this._activeRequests;i<n.length;i++)n[i].abort();var r;if(this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onNewMultiMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onMultiMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.detachControl(),this._engine.getInputElement())for(r=0;r<this.cameras.length;r++)this.cameras[r].detachControl();for(;this.animationGroups.length;)this.animationGroups[0].dispose();for(;this.lights.length;)this.lights[0].dispose();for(;this.meshes.length;)this.meshes[0].dispose(!0);for(;this.transformNodes.length;)this.transformNodes[0].dispose(!0);for(;this.cameras.length;)this.cameras[0].dispose();for(this._defaultMaterial&&this._defaultMaterial.dispose();this.multiMaterials.length;)this.multiMaterials[0].dispose();for(;this.materials.length;)this.materials[0].dispose();for(;this.particleSystems.length;)this.particleSystems[0].dispose();for(;this.postProcesses.length;)this.postProcesses[0].dispose();for(;this.textures.length;)this.textures[0].dispose();this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),(r=this._engine.scenes.indexOf(this))>-1&&this._engine.scenes.splice(r,1),this._engine.wipeCaches(!0),this._isDisposed=!0},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),t.prototype.clearCachedVertexData=function(){for(var e=0;e<this.meshes.length;e++){var t=this.meshes[e].geometry;if(t)for(var i in t._indices=[],t._vertexBuffers)t._vertexBuffers.hasOwnProperty(i)&&(t._vertexBuffers[i]._buffer._data=null)}},t.prototype.cleanCachedTextureBuffer=function(){for(var e=0,t=this.textures;e<t.length;e++){var i=t[e];i._buffer&&(i._buffer=null)}},t.prototype.getWorldExtends=function(e){var t=new u.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new u.e(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return e=e||function(){return!0},this.meshes.filter(e).forEach(function(e){if(e.computeWorldMatrix(!0),e.subMeshes&&0!==e.subMeshes.length&&!e.infiniteDistance){var n=e.getBoundingInfo(),r=n.boundingBox.minimumWorld,o=n.boundingBox.maximumWorld;u.e.CheckExtends(r,t,i),u.e.CheckExtends(o,t,i)}}),{min:t,max:i}},t.prototype.createPickingRay=function(e,t,i,n,r){throw void 0===r&&(r=!1),R.a.WarnImport("Ray")},t.prototype.createPickingRayToRef=function(e,t,i,n,r,o){throw void 0===o&&(o=!1),R.a.WarnImport("Ray")},t.prototype.createPickingRayInCameraSpace=function(e,t,i){throw R.a.WarnImport("Ray")},t.prototype.createPickingRayInCameraSpaceToRef=function(e,t,i,n){throw R.a.WarnImport("Ray")},t.prototype.pick=function(e,t,i,n,r,o){var a=new v.a;return a._pickingUnavailable=!0,a},t.prototype.pickWithBoundingInfo=function(e,t,i,n,r){var o=new v.a;return o._pickingUnavailable=!0,o},t.prototype.pickWithRay=function(e,t,i,n){throw R.a.WarnImport("Ray")},t.prototype.multiPick=function(e,t,i,n,r){throw R.a.WarnImport("Ray")},t.prototype.multiPickWithRay=function(e,t,i){throw R.a.WarnImport("Ray")},t.prototype.setPointerOverMesh=function(e,t){this._inputManager.setPointerOverMesh(e,t)},t.prototype.getPointerOverMesh=function(){return this._inputManager.getPointerOverMesh()},t.prototype._rebuildGeometries=function(){for(var e=0,t=this.geometries;e<t.length;e++)t[e]._rebuild();for(var i=0,n=this.meshes;i<n.length;i++)n[i]._rebuild();this.postProcessManager&&this.postProcessManager._rebuild();for(var r=0,o=this._components;r<o.length;r++)o[r].rebuild();for(var a=0,s=this.particleSystems;a<s.length;a++)s[a].rebuild()},t.prototype._rebuildTextures=function(){for(var e=0,t=this.textures;e<t.length;e++)t[e]._rebuild();this.markAllMaterialsAsDirty(S.a.MATERIAL_TextureDirtyFlag)},t.prototype._getByTags=function(e,t,i){if(void 0===t)return e;var n=[];for(var r in i=i||function(e){},e){var o=e[r];l.a&&l.a.MatchesQuery(o,t)&&(n.push(o),i(o))}return n},t.prototype.getMeshesByTags=function(e,t){return this._getByTags(this.meshes,e,t)},t.prototype.getCamerasByTags=function(e,t){return this._getByTags(this.cameras,e,t)},t.prototype.getLightsByTags=function(e,t){return this._getByTags(this.lights,e,t)},t.prototype.getMaterialByTags=function(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))},t.prototype.getTransformNodesByTags=function(e,t){return this._getByTags(this.transformNodes,e,t)},t.prototype.setRenderingOrder=function(e,t,i,n){void 0===t&&(t=null),void 0===i&&(i=null),void 0===n&&(n=null),this._renderingManager.setRenderingOrder(e,t,i,n)},t.prototype.setRenderingAutoClearDepthStencil=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!0),this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,n)},t.prototype.getAutoClearDepthStencilSetup=function(e){return this._renderingManager.getAutoClearDepthStencilSetup(e)},Object.defineProperty(t.prototype,"blockMaterialDirtyMechanism",{get:function(){return this._blockMaterialDirtyMechanism},set:function(e){this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(S.a.MATERIAL_AllDirtyFlag))},enumerable:!1,configurable:!0}),t.prototype.markAllMaterialsAsDirty=function(e,t){if(!this._blockMaterialDirtyMechanism)for(var i=0,n=this.materials;i<n.length;i++){var r=n[i];t&&!t(r)||r.markAsDirty(e)}},t.prototype._loadFile=function(e,t,i,n,r,o){var a=this,s=B.a.LoadFile(e,t,i,n?this.offlineProvider:void 0,r,o);return this._activeRequests.push(s),s.onCompleteObservable.add(function(e){a._activeRequests.splice(a._activeRequests.indexOf(e),1)}),s},t.prototype._loadFileAsync=function(e,t,i,n){var r=this;return new Promise(function(o,a){r._loadFile(e,function(e){o(e)},t,i,n,function(e,t){a(t)})})},t.prototype._requestFile=function(e,t,i,n,r,o,a){var s=this,c=B.a.RequestFile(e,t,i,n?this.offlineProvider:void 0,r,o,a);return this._activeRequests.push(c),c.onCompleteObservable.add(function(e){s._activeRequests.splice(s._activeRequests.indexOf(e),1)}),c},t.prototype._requestFileAsync=function(e,t,i,n,r){var o=this;return new Promise(function(a,s){o._requestFile(e,function(e){a(e)},t,i,n,function(e){s(e)},r)})},t.prototype._readFile=function(e,t,i,n,r){var o=this,a=B.a.ReadFile(e,t,i,n,r);return this._activeRequests.push(a),a.onCompleteObservable.add(function(e){o._activeRequests.splice(o._activeRequests.indexOf(e),1)}),a},t.prototype._readFileAsync=function(e,t,i){var n=this;return new Promise(function(r,o){n._readFile(e,function(e){r(e)},t,i,function(e){o(e)})})},t.FOGMODE_NONE=0,t.FOGMODE_EXP=1,t.FOGMODE_EXP2=2,t.FOGMODE_LINEAR=3,t.MinDeltaTime=1,t.MaxDeltaTime=1e3,t}(p.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.WarnImport=function(e){return e+" needs to be imported before as it contains a side-effect required by your code."},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return Object.defineProperty(e,"LastCreatedEngine",{get:function(){return 0===this.Instances.length?null:this.Instances[this.Instances.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LastCreatedScene",{get:function(){return this._LastCreatedScene},enumerable:!1,configurable:!0}),e.Instances=new Array,e._LastCreatedScene=null,e.UseFallbackTexture=!0,e.FallbackTexture="",e}()},function(e,t,i){"use strict";i.d(t,"c",function(){return n}),i.d(t,"a",function(){return a}),i.d(t,"b",function(){return o});var n,r=i(0);!function(e){e[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD",e[e.BONE=2]="BONE"}(n||(n={}));var o,a=function(){function e(){}return e.X=new r.e(1,0,0),e.Y=new r.e(0,1,0),e.Z=new r.e(0,0,1),e}();!function(e){e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(o||(o={}))},function(e,t,i){"use strict";i.d(t,"a",function(){return _});var n=i(1),r=i(3),o=i(33),a=i(12),s=i(6),c=i(0),l=i(29),u=i(8),h=i(11),d=i(21),f=i(58),p=i(90),_=function(e){function t(i,n,r,a){void 0===a&&(a=!0);var l=e.call(this,i,r)||this;return l._position=c.e.Zero(),l._upVector=c.e.Up(),l.orthoLeft=null,l.orthoRight=null,l.orthoBottom=null,l.orthoTop=null,l.fov=.8,l.minZ=1,l.maxZ=1e4,l.inertia=.9,l.mode=t.PERSPECTIVE_CAMERA,l.isIntermediate=!1,l.viewport=new f.a(0,0,1,1),l.layerMask=268435455,l.fovMode=t.FOVMODE_VERTICAL_FIXED,l.cameraRigMode=t.RIG_MODE_NONE,l.customRenderTargets=new Array,l.outputRenderTarget=null,l.onViewMatrixChangedObservable=new s.c,l.onProjectionMatrixChangedObservable=new s.c,l.onAfterCheckInputsObservable=new s.c,l.onRestoreStateObservable=new s.c,l.isRigCamera=!1,l._rigCameras=new Array,l._webvrViewMatrix=c.a.Identity(),l._skipRendering=!1,l._projectionMatrix=new c.a,l._postProcesses=new Array,l._activeMeshes=new o.a(256),l._globalPosition=c.e.Zero(),l._computedViewMatrix=c.a.Identity(),l._doNotComputeProjectionMatrix=!1,l._transformMatrix=c.a.Zero(),l._refreshFrustumPlanes=!0,l._isCamera=!0,l._isLeftCamera=!1,l._isRightCamera=!1,l.getScene().addCamera(l),a&&!l.getScene().activeCamera&&(l.getScene().activeCamera=l),l.position=n,l}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"upVector",{get:function(){return this._upVector},set:function(e){this._upVector=e},enumerable:!1,configurable:!0}),t.prototype.storeState=function(){return this._stateStored=!0,this._storedFov=this.fov,this},t.prototype._restoreStateValues=function(){return!!this._stateStored&&(this.fov=this._storedFov,!0)},t.prototype.restoreState=function(){return!!this._restoreStateValues()&&(this.onRestoreStateObservable.notifyObservers(this),!0)},t.prototype.getClassName=function(){return"Camera"},t.prototype.toString=function(e){var t="Name: "+this.name;if(t+=", type: "+this.getClassName(),this.animations)for(var i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);return t},Object.defineProperty(t.prototype,"globalPosition",{get:function(){return this._globalPosition},enumerable:!1,configurable:!0}),t.prototype.getActiveMeshes=function(){return this._activeMeshes},t.prototype.isActiveMesh=function(e){return-1!==this._activeMeshes.indexOf(e)},t.prototype.isReady=function(t){if(void 0===t&&(t=!1),t)for(var i=0,n=this._postProcesses;i<n.length;i++){var r=n[i];if(r&&!r.isReady())return!1}return e.prototype.isReady.call(this,t)},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.position=new c.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new c.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.mode=void 0,this._cache.minZ=void 0,this._cache.maxZ=void 0,this._cache.fov=void 0,this._cache.fovMode=void 0,this._cache.aspectRatio=void 0,this._cache.orthoLeft=void 0,this._cache.orthoRight=void 0,this._cache.orthoBottom=void 0,this._cache.orthoTop=void 0,this._cache.renderWidth=void 0,this._cache.renderHeight=void 0},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this),this._cache.position.copyFrom(this.position),this._cache.upVector.copyFrom(this.upVector)},t.prototype._isSynchronized=function(){return this._isSynchronizedViewMatrix()&&this._isSynchronizedProjectionMatrix()},t.prototype._isSynchronizedViewMatrix=function(){return!!e.prototype._isSynchronized.call(this)&&this._cache.position.equals(this.position)&&this._cache.upVector.equals(this.upVector)&&this.isSynchronizedWithParent()},t.prototype._isSynchronizedProjectionMatrix=function(){var e=this._cache.mode===this.mode&&this._cache.minZ===this.minZ&&this._cache.maxZ===this.maxZ;if(!e)return!1;var i=this.getEngine();return this.mode===t.PERSPECTIVE_CAMERA?this._cache.fov===this.fov&&this._cache.fovMode===this.fovMode&&this._cache.aspectRatio===i.getAspectRatio(this):this._cache.orthoLeft===this.orthoLeft&&this._cache.orthoRight===this.orthoRight&&this._cache.orthoBottom===this.orthoBottom&&this._cache.orthoTop===this.orthoTop&&this._cache.renderWidth===i.getRenderWidth()&&this._cache.renderHeight===i.getRenderHeight()},t.prototype.attachControl=function(e,t){},t.prototype.detachControl=function(e){},t.prototype.update=function(){this._checkInputs(),this.cameraRigMode!==t.RIG_MODE_NONE&&this._updateRigCameras()},t.prototype._checkInputs=function(){this.onAfterCheckInputsObservable.notifyObservers(this)},Object.defineProperty(t.prototype,"rigCameras",{get:function(){return this._rigCameras},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rigPostProcess",{get:function(){return this._rigPostProcess},enumerable:!1,configurable:!0}),t.prototype._getFirstPostProcess=function(){for(var e=0;e<this._postProcesses.length;e++)if(null!==this._postProcesses[e])return this._postProcesses[e];return null},t.prototype._cascadePostProcessesToRigCams=function(){var e=this._getFirstPostProcess();e&&e.markTextureDirty();for(var t=0,i=this._rigCameras.length;t<i;t++){var n=this._rigCameras[t],r=n._rigPostProcess;r?("pass"===r.getEffectName()&&(n.isIntermediate=0===this._postProcesses.length),n._postProcesses=this._postProcesses.slice(0).concat(r),r.markTextureDirty()):n._postProcesses=this._postProcesses.slice(0)}},t.prototype.attachPostProcess=function(e,t){return void 0===t&&(t=null),!e.isReusable()&&this._postProcesses.indexOf(e)>-1?(u.a.Error("You're trying to reuse a post process not defined as reusable."),0):(null==t||t<0?this._postProcesses.push(e):null===this._postProcesses[t]?this._postProcesses[t]=e:this._postProcesses.splice(t,0,e),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(e))},t.prototype.detachPostProcess=function(e){var t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses[t]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()},t.prototype.getWorldMatrix=function(){return this._isSynchronizedViewMatrix()||this.getViewMatrix(),this._worldMatrix},t.prototype._getViewMatrix=function(){return c.a.Identity()},t.prototype.getViewMatrix=function(e){return!e&&this._isSynchronizedViewMatrix()||(this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix)),this._computedViewMatrix},t.prototype.freezeProjectionMatrix=function(e){this._doNotComputeProjectionMatrix=!0,void 0!==e&&(this._projectionMatrix=e)},t.prototype.unfreezeProjectionMatrix=function(){this._doNotComputeProjectionMatrix=!1},t.prototype.getProjectionMatrix=function(e){var i,n,r,o,a,s,l,u;if(this._doNotComputeProjectionMatrix||!e&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=this.maxZ,this._refreshFrustumPlanes=!0;var h=this.getEngine(),d=this.getScene();if(this.mode===t.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=h.getAspectRatio(this),this.minZ<=0&&(this.minZ=.1);var f=h.useReverseDepthBuffer;(d.useRightHandedSystem?f?c.a.PerspectiveFovReverseRHToRef:c.a.PerspectiveFovRHToRef:f?c.a.PerspectiveFovReverseLHToRef:c.a.PerspectiveFovLHToRef)(this.fov,h.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED)}else{var p=h.getRenderWidth()/2,_=h.getRenderHeight()/2;d.useRightHandedSystem?c.a.OrthoOffCenterRHToRef(null!==(i=this.orthoLeft)&&void 0!==i?i:-p,null!==(n=this.orthoRight)&&void 0!==n?n:p,null!==(r=this.orthoBottom)&&void 0!==r?r:-_,null!==(o=this.orthoTop)&&void 0!==o?o:_,this.minZ,this.maxZ,this._projectionMatrix):c.a.OrthoOffCenterLHToRef(null!==(a=this.orthoLeft)&&void 0!==a?a:-p,null!==(s=this.orthoRight)&&void 0!==s?s:p,null!==(l=this.orthoBottom)&&void 0!==l?l:-_,null!==(u=this.orthoTop)&&void 0!==u?u:_,this.minZ,this.maxZ,this._projectionMatrix),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.renderWidth=h.getRenderWidth(),this._cache.renderHeight=h.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix},t.prototype.getTransformationMatrix=function(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix},t.prototype._updateFrustumPlanes=function(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?p.a.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=p.a.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)},t.prototype.isInFrustum=function(e,t){if(void 0===t&&(t=!1),this._updateFrustumPlanes(),t&&this.rigCameras.length>0){var i=!1;return this.rigCameras.forEach(function(t){t._updateFrustumPlanes(),i=i||e.isInFrustum(t._frustumPlanes)}),i}return e.isInFrustum(this._frustumPlanes)},t.prototype.isCompletelyInFrustum=function(e){return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)},t.prototype.getForwardRay=function(e,t,i){throw void 0===e&&(e=100),d.a.WarnImport("Ray")},t.prototype.getForwardRayToRef=function(e,t,i,n){throw void 0===t&&(t=100),d.a.WarnImport("Ray")},t.prototype.dispose=function(i,n){for(void 0===n&&(n=!1),this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.getScene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){var r=this._rigCameras.pop();r&&r.dispose()}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses=[];else if(this.cameraRigMode!==t.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses=[];else for(var o=this._postProcesses.length;--o>=0;){var a=this._postProcesses[o];a&&a.dispose(this)}for(o=this.customRenderTargets.length;--o>=0;)this.customRenderTargets[o].dispose();this.customRenderTargets=[],this._activeMeshes.dispose(),e.prototype.dispose.call(this,i,n)},Object.defineProperty(t.prototype,"isLeftCamera",{get:function(){return this._isLeftCamera},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRightCamera",{get:function(){return this._isRightCamera},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftCamera",{get:function(){return this._rigCameras.length<1?null:this._rigCameras[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightCamera",{get:function(){return this._rigCameras.length<2?null:this._rigCameras[1]},enumerable:!1,configurable:!0}),t.prototype.getLeftTarget=function(){return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()},t.prototype.getRightTarget=function(){return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()},t.prototype.setCameraRigMode=function(e,i){if(this.cameraRigMode!==e){for(;this._rigCameras.length>0;){var n=this._rigCameras.pop();n&&n.dispose()}if(this.cameraRigMode=e,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=i.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=a.b.ToRadians(this._cameraRigParams.interaxialDistance/.0637),this.cameraRigMode!==t.RIG_MODE_NONE){var r=this.createRigCamera(this.name+"_L",0);r&&(r._isLeftCamera=!0);var o=this.createRigCamera(this.name+"_R",1);o&&(o._isRightCamera=!0),r&&o&&(this._rigCameras.push(r),this._rigCameras.push(o))}switch(this.cameraRigMode){case t.RIG_MODE_STEREOSCOPIC_ANAGLYPH:t._setStereoscopicAnaglyphRigMode(this);break;case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case t.RIG_MODE_STEREOSCOPIC_OVERUNDER:case t.RIG_MODE_STEREOSCOPIC_INTERLACED:t._setStereoscopicRigMode(this);break;case t.RIG_MODE_VR:t._setVRRigMode(this,i);break;case t.RIG_MODE_WEBVR:t._setWebVRRigMode(this,i)}this._cascadePostProcessesToRigCams(),this.update()}},t._setStereoscopicRigMode=function(e){throw"Import Cameras/RigModes/stereoscopicRigMode before using stereoscopic rig mode"},t._setStereoscopicAnaglyphRigMode=function(e){throw"Import Cameras/RigModes/stereoscopicAnaglyphRigMode before using stereoscopic anaglyph rig mode"},t._setVRRigMode=function(e,t){throw"Import Cameras/RigModes/vrRigMode before using VR rig mode"},t._setWebVRRigMode=function(e,t){throw"Import Cameras/RigModes/WebVRRigMode before using Web VR rig mode"},t.prototype._getVRProjectionMatrix=function(){return c.a.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.maxZ,this._cameraRigParams.vrWorkMatrix),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix},t.prototype._updateCameraRotationMatrix=function(){},t.prototype._updateWebVRCameraRotationMatrix=function(){},t.prototype._getWebVRProjectionMatrix=function(){return c.a.Identity()},t.prototype._getWebVRViewMatrix=function(){return c.a.Identity()},t.prototype.setCameraRigParameter=function(e,t){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,"interaxialDistance"===e&&(this._cameraRigParams.stereoHalfAngle=a.b.ToRadians(t/.0637))},t.prototype.createRigCamera=function(e,t){return null},t.prototype._updateRigCameras=function(){for(var e=0;e<this._rigCameras.length;e++)this._rigCameras[e].minZ=this.minZ,this._rigCameras[e].maxZ=this.maxZ,this._rigCameras[e].fov=this.fov,this._rigCameras[e].upVector.copyFrom(this.upVector);this.cameraRigMode===t.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)},t.prototype._setupInputs=function(){},t.prototype.serialize=function(){var e=r.a.Serialize(this);return e.type=this.getClassName(),this.parent&&(e.parentId=this.parent.id),this.inputs&&this.inputs.serialize(e),r.a.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e},t.prototype.clone=function(e){return r.a.Clone(t.GetConstructorFromName(this.getClassName(),e,this.getScene(),this.interaxialDistance,this.isStereoscopicSideBySide),this)},t.prototype.getDirection=function(e){var t=c.e.Zero();return this.getDirectionToRef(e,t),t},Object.defineProperty(t.prototype,"absoluteRotation",{get:function(){var e=c.b.Zero();return this.getWorldMatrix().decompose(void 0,e),e},enumerable:!1,configurable:!0}),t.prototype.getDirectionToRef=function(e,t){c.e.TransformNormalToRef(e,this.getWorldMatrix(),t)},t.GetConstructorFromName=function(e,i,n,r,o){return void 0===r&&(r=0),void 0===o&&(o=!0),l.a.Construct(e,i,n,{interaxial_distance:r,isStereoscopicSideBySide:o})||function(){return t._createDefaultParsedCamera(i,n)}},t.prototype.computeWorldMatrix=function(){return this.getWorldMatrix()},t.Parse=function(e,i){var n=e.type,o=t.GetConstructorFromName(n,e.name,i,e.interaxial_distance,e.isStereoscopicSideBySide),a=r.a.Parse(o,e,i);if(e.parentId&&(a._waitingParentId=e.parentId),a.inputs&&(a.inputs.parse(e),a._setupInputs()),e.upVector&&(a.upVector=c.e.FromArray(e.upVector)),a.setPosition&&(a.position.copyFromFloats(0,0,0),a.setPosition(c.e.FromArray(e.position))),e.target&&a.setTarget&&a.setTarget(c.e.FromArray(e.target)),e.cameraRigMode){var s=e.interaxial_distance?{interaxialDistance:e.interaxial_distance}:{};a.setCameraRigMode(e.cameraRigMode,s)}if(e.animations){for(var u=0;u<e.animations.length;u++){var d=e.animations[u],f=h.a.GetClass("BABYLON.Animation");f&&a.animations.push(f.Parse(d))}l.a.ParseAnimationRanges(a,e,i)}return e.autoAnimate&&i.beginAnimation(a,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),a},t._createDefaultParsedCamera=function(e,t){throw d.a.WarnImport("UniversalCamera")},t.PERSPECTIVE_CAMERA=0,t.ORTHOGRAPHIC_CAMERA=1,t.FOVMODE_VERTICAL_FIXED=0,t.FOVMODE_HORIZONTAL_FIXED=1,t.RIG_MODE_NONE=0,t.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,t.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,t.RIG_MODE_STEREOSCOPIC_INTERLACED=14,t.RIG_MODE_VR=20,t.RIG_MODE_WEBVR=21,t.RIG_MODE_CUSTOM=22,t.ForceAttachControlToAlwaysPreventDefault=!1,Object(n.c)([Object(r.o)("position")],t.prototype,"_position",void 0),Object(n.c)([Object(r.o)("upVector")],t.prototype,"_upVector",void 0),Object(n.c)([Object(r.c)()],t.prototype,"orthoLeft",void 0),Object(n.c)([Object(r.c)()],t.prototype,"orthoRight",void 0),Object(n.c)([Object(r.c)()],t.prototype,"orthoBottom",void 0),Object(n.c)([Object(r.c)()],t.prototype,"orthoTop",void 0),Object(n.c)([Object(r.c)()],t.prototype,"fov",void 0),Object(n.c)([Object(r.c)()],t.prototype,"minZ",void 0),Object(n.c)([Object(r.c)()],t.prototype,"maxZ",void 0),Object(n.c)([Object(r.c)()],t.prototype,"inertia",void 0),Object(n.c)([Object(r.c)()],t.prototype,"mode",void 0),Object(n.c)([Object(r.c)()],t.prototype,"layerMask",void 0),Object(n.c)([Object(r.c)()],t.prototype,"fovMode",void 0),Object(n.c)([Object(r.c)()],t.prototype,"cameraRigMode",void 0),Object(n.c)([Object(r.c)()],t.prototype,"interaxialDistance",void 0),Object(n.c)([Object(r.c)()],t.prototype,"isStereoscopicSideBySide",void 0),t}(l.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return f});var n=i(1),r=i(3),o=i(12),a=i(6),s=i(22),c=i(61),l=i(85),u=i(2),h=i(8),d=i(64),f=function(){function e(t,i,n){this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this.metadata=null,this.reservedDataStore=null,this.checkReadyOnEveryCall=!1,this.checkReadyOnlyOnce=!1,this.state="",this._alpha=1,this._backFaceCulling=!0,this.onCompiled=null,this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new a.c,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=u.a.ALPHA_COMBINE,this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.disableColorWrite=!1,this.forceDepthWrite=!1,this.depthFunction=0,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this._effect=null,this._useUBO=!1,this._fillMode=e.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedColorWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this._forceAlphaTest=!1,this._transparencyMode=null,this.name=t;var r=1;for(this._scene=i||s.a.LastCreatedScene,this.id=t||o.b.RandomId();this._scene.getMaterialByID(this.id);)this.id=t+" "+r++;this.uniqueId=this._scene.getUniqueId(),this._scene.useRightHandedSystem?this.sideOrientation=e.ClockWiseSideOrientation:this.sideOrientation=e.CounterClockWiseSideOrientation,this._uniformBuffer=new l.a(this._scene.getEngine()),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,n||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={})}return Object.defineProperty(e.prototype,"canRenderToMRT",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backFaceCulling",{get:function(){return this._backFaceCulling},set:function(t){this._backFaceCulling!==t&&(this._backFaceCulling=t,this.markAsDirty(e.TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRenderTargetTextures",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBindObservable",{get:function(){return this._onBindObservable||(this._onBindObservable=new a.c),this._onBindObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBind",{set:function(e){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onUnBindObservable",{get:function(){return this._onUnBindObservable||(this._onUnBindObservable=new a.c),this._onUnBindObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onEffectCreatedObservable",{get:function(){return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new a.c),this._onEffectCreatedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaMode",{get:function(){return this._alphaMode},set:function(t){this._alphaMode!==t&&(this._alphaMode=t,this.markAsDirty(e.TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needDepthPrePass",{get:function(){return this._needDepthPrePass},set:function(e){this._needDepthPrePass!==e&&(this._needDepthPrePass=e,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fogEnabled",{get:function(){return this._fogEnabled},set:function(t){this._fogEnabled!==t&&(this._fogEnabled=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wireframe",{get:function(){switch(this._fillMode){case e.WireFrameFillMode:case e.LineListDrawMode:case e.LineLoopDrawMode:case e.LineStripDrawMode:return!0}return this._scene.forceWireframe},set:function(t){this.fillMode=t?e.WireFrameFillMode:e.TriangleFillMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsCloud",{get:function(){switch(this._fillMode){case e.PointFillMode:case e.PointListDrawMode:return!0}return this._scene.forcePointsCloud},set:function(t){this.fillMode=t?e.PointFillMode:e.TriangleFillMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(t){this._fillMode!==t&&(this._fillMode=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!1,configurable:!0}),e.prototype.toString=function(e){return"Name: "+this.name},e.prototype.getClassName=function(){return"Material"},Object.defineProperty(e.prototype,"isFrozen",{get:function(){return this.checkReadyOnlyOnce},enumerable:!1,configurable:!0}),e.prototype.freeze=function(){this.markDirty(),this.checkReadyOnlyOnce=!0},e.prototype.unfreeze=function(){this.markDirty(),this.checkReadyOnlyOnce=!1},e.prototype.isReady=function(e,t){return!0},e.prototype.isReadyForSubMesh=function(e,t,i){return!1},e.prototype.getEffect=function(){return this._effect},e.prototype.getScene=function(){return this._scene},Object.defineProperty(e.prototype,"transparencyMode",{get:function(){return this._transparencyMode},set:function(t){this._transparencyMode!==t&&(this._transparencyMode=t,this._forceAlphaTest=t===e.MATERIAL_ALPHATESTANDBLEND,this._markAllSubMeshesAsTexturesAndMiscDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_disableAlphaBlending",{get:function(){return this._transparencyMode===e.MATERIAL_OPAQUE||this._transparencyMode===e.MATERIAL_ALPHATEST},enumerable:!1,configurable:!0}),e.prototype.needAlphaBlending=function(){return!this._disableAlphaBlending&&this.alpha<1},e.prototype.needAlphaBlendingForMesh=function(e){return!(this._disableAlphaBlending&&e.visibility>=1)&&(this.needAlphaBlending()||e.visibility<1||e.hasVertexAlpha)},e.prototype.needAlphaTesting=function(){return!!this._forceAlphaTest},e.prototype._shouldTurnAlphaTestOn=function(e){return!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.markDirty=function(){for(var e=0,t=this.getScene().meshes;e<t.length;e++){var i=t[e];if(i.subMeshes)for(var n=0,r=i.subMeshes;n<r.length;n++){var o=r[n];o.getMaterial()===this&&o.effect&&(o.effect._wasPreviouslyReady=!1)}}},e.prototype._preBind=function(t,i){void 0===i&&(i=null);var n=this._scene.getEngine(),r=(null==i?this.sideOrientation:i)===e.ClockWiseSideOrientation;return n.enableEffect(t||this._effect),n.setState(this.backFaceCulling,this.zOffset,!1,r),r},e.prototype.bind=function(e,t){},e.prototype.bindForSubMesh=function(e,t,i){},e.prototype.bindOnlyWorldMatrix=function(e){},e.prototype.bindSceneUniformBuffer=function(e,t){t.bindToEffect(e,"Scene")},e.prototype.bindView=function(e){this._useUBO?this.bindSceneUniformBuffer(e,this.getScene().getSceneUniformBuffer()):e.setMatrix("view",this.getScene().getViewMatrix())},e.prototype.bindViewProjection=function(e){this._useUBO?this.bindSceneUniformBuffer(e,this.getScene().getSceneUniformBuffer()):e.setMatrix("viewProjection",this.getScene().getTransformMatrix())},e.prototype._afterBind=function(e){if(this._scene._cachedMaterial=this,this._scene._cachedVisibility=e?e.visibility:1,this._onBindObservable&&e&&this._onBindObservable.notifyObservers(e),this.disableDepthWrite){var t=this._scene.getEngine();this._cachedDepthWriteState=t.getDepthWrite(),t.setDepthWrite(!1)}this.disableColorWrite&&(t=this._scene.getEngine(),this._cachedColorWriteState=t.getColorWrite(),t.setColorWrite(!1)),0!==this.depthFunction&&(t=this._scene.getEngine(),this._cachedDepthFunctionState=t.getDepthFunction()||0,t.setDepthFunction(this.depthFunction))},e.prototype.unbind=function(){this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),0!==this.depthFunction&&this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState),this.disableDepthWrite&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState),this.disableColorWrite&&this._scene.getEngine().setColorWrite(this._cachedColorWriteState)},e.prototype.getActiveTextures=function(){return[]},e.prototype.hasTexture=function(e){return!1},e.prototype.clone=function(e){return null},e.prototype.getBindedMeshes=function(){var e=this;if(this.meshMap){var t=new Array;for(var i in this.meshMap){var n=this.meshMap[i];n&&t.push(n)}return t}return this._scene.meshes.filter(function(t){return t.material===e})},e.prototype.forceCompilation=function(e,t,i,r){var o=this,a=Object(n.a)({clipPlane:!1,useInstances:!1},i),s=this.getScene(),l=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;var u=function(){if(o._scene&&o._scene.getEngine()){var i=s.clipPlane;if(a.clipPlane&&(s.clipPlane=new d.a(0,0,0,1)),o._storeEffectOnSubMeshes){var n=!0,h=null;if(e.subMeshes){var f=new c.a(0,0,0,0,0,e,void 0,!1,!1);f._materialDefines&&(f._materialDefines._renderId=-1),o.isReadyForSubMesh(e,f,a.useInstances)||(f.effect&&f.effect.getCompilationError()&&f.effect.allFallbacksProcessed()?h=f.effect.getCompilationError():(n=!1,setTimeout(u,16)))}n&&(o.allowShaderHotSwapping=l,h&&r&&r(h),t&&t(o))}else o.isReady()?(o.allowShaderHotSwapping=l,t&&t(o)):setTimeout(u,16);a.clipPlane&&(s.clipPlane=i)}};u()},e.prototype.forceCompilationAsync=function(e,t){var i=this;return new Promise(function(n,r){i.forceCompilation(e,function(){n()},t,function(e){r(e)})})},e.prototype.markAsDirty=function(t){this.getScene().blockMaterialDirtyMechanism||(e._DirtyCallbackArray.length=0,t&e.TextureDirtyFlag&&e._DirtyCallbackArray.push(e._TextureDirtyCallBack),t&e.LightDirtyFlag&&e._DirtyCallbackArray.push(e._LightsDirtyCallBack),t&e.FresnelDirtyFlag&&e._DirtyCallbackArray.push(e._FresnelDirtyCallBack),t&e.AttributesDirtyFlag&&e._DirtyCallbackArray.push(e._AttributeDirtyCallBack),t&e.MiscDirtyFlag&&e._DirtyCallbackArray.push(e._MiscDirtyCallBack),t&e.PrePassDirtyFlag&&e._DirtyCallbackArray.push(e._PrePassDirtyCallBack),e._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(e._RunDirtyCallBacks),this.getScene().resetCachedMaterial())},e.prototype._markAllSubMeshesAsDirty=function(e){if(!this.getScene().blockMaterialDirtyMechanism)for(var t=0,i=this.getScene().meshes;t<i.length;t++){var n=i[t];if(n.subMeshes)for(var r=0,o=n.subMeshes;r<o.length;r++){var a=o[r];a.getMaterial()===this&&a._materialDefines&&e(a._materialDefines)}}},e.prototype._markScenePrePassDirty=function(){if(!this.getScene().blockMaterialDirtyMechanism){var e=this.getScene().enablePrePassRenderer();e&&e.markAsDirty()}},e.prototype._markAllSubMeshesAsAllDirty=function(){this._markAllSubMeshesAsDirty(e._AllDirtyCallBack)},e.prototype._markAllSubMeshesAsImageProcessingDirty=function(){this._markAllSubMeshesAsDirty(e._ImageProcessingDirtyCallBack)},e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._markAllSubMeshesAsDirty(e._TextureDirtyCallBack)},e.prototype._markAllSubMeshesAsFresnelDirty=function(){this._markAllSubMeshesAsDirty(e._FresnelDirtyCallBack)},e.prototype._markAllSubMeshesAsFresnelAndMiscDirty=function(){this._markAllSubMeshesAsDirty(e._FresnelAndMiscDirtyCallBack)},e.prototype._markAllSubMeshesAsLightsDirty=function(){this._markAllSubMeshesAsDirty(e._LightsDirtyCallBack)},e.prototype._markAllSubMeshesAsAttributesDirty=function(){this._markAllSubMeshesAsDirty(e._AttributeDirtyCallBack)},e.prototype._markAllSubMeshesAsMiscDirty=function(){this._markAllSubMeshesAsDirty(e._MiscDirtyCallBack)},e.prototype._markAllSubMeshesAsPrePassDirty=function(){this._markAllSubMeshesAsDirty(e._MiscDirtyCallBack)},e.prototype._markAllSubMeshesAsTexturesAndMiscDirty=function(){this._markAllSubMeshesAsDirty(e._TextureAndMiscDirtyCallBack)},e.prototype.setPrePassRenderer=function(e){return!1},e.prototype.dispose=function(e,t,i){var n=this.getScene();if(n.stopAnimation(this),n.freeProcessedMaterials(),n.removeMaterial(this),!0!==i)if(this.meshMap)for(var r in this.meshMap)(s=this.meshMap[r])&&(s.material=null,this.releaseVertexArrayObject(s,e));else for(var o=0,a=n.meshes;o<a.length;o++){var s;(s=a[o]).material!==this||s.sourceMesh||(s.material=null,this.releaseVertexArrayObject(s,e))}this._uniformBuffer.dispose(),e&&this._effect&&(this._storeEffectOnSubMeshes||this._effect.dispose(),this._effect=null),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear()},e.prototype.releaseVertexArrayObject=function(e,t){if(e.geometry){var i=e.geometry;if(this._storeEffectOnSubMeshes)for(var n=0,r=e.subMeshes;n<r.length;n++){var o=r[n];i._releaseVertexArrayObject(o._materialEffect),t&&o._materialEffect&&o._materialEffect.dispose()}else i._releaseVertexArrayObject(this._effect)}},e.prototype.serialize=function(){return r.a.Serialize(this)},e.Parse=function(e,t,i){if(e.customType){if("BABYLON.PBRMaterial"===e.customType&&e.overloadedAlbedo&&(e.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return h.a.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null}else e.customType="BABYLON.StandardMaterial";return o.b.Instantiate(e.customType).Parse(e,t,i)},e.TriangleFillMode=u.a.MATERIAL_TriangleFillMode,e.WireFrameFillMode=u.a.MATERIAL_WireFrameFillMode,e.PointFillMode=u.a.MATERIAL_PointFillMode,e.PointListDrawMode=u.a.MATERIAL_PointListDrawMode,e.LineListDrawMode=u.a.MATERIAL_LineListDrawMode,e.LineLoopDrawMode=u.a.MATERIAL_LineLoopDrawMode,e.LineStripDrawMode=u.a.MATERIAL_LineStripDrawMode,e.TriangleStripDrawMode=u.a.MATERIAL_TriangleStripDrawMode,e.TriangleFanDrawMode=u.a.MATERIAL_TriangleFanDrawMode,e.ClockWiseSideOrientation=u.a.MATERIAL_ClockWiseSideOrientation,e.CounterClockWiseSideOrientation=u.a.MATERIAL_CounterClockWiseSideOrientation,e.TextureDirtyFlag=u.a.MATERIAL_TextureDirtyFlag,e.LightDirtyFlag=u.a.MATERIAL_LightDirtyFlag,e.FresnelDirtyFlag=u.a.MATERIAL_FresnelDirtyFlag,e.AttributesDirtyFlag=u.a.MATERIAL_AttributesDirtyFlag,e.MiscDirtyFlag=u.a.MATERIAL_MiscDirtyFlag,e.PrePassDirtyFlag=u.a.MATERIAL_PrePassDirtyFlag,e.AllDirtyFlag=u.a.MATERIAL_AllDirtyFlag,e.MATERIAL_OPAQUE=0,e.MATERIAL_ALPHATEST=1,e.MATERIAL_ALPHABLEND=2,e.MATERIAL_ALPHATESTANDBLEND=3,e.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0,e.MATERIAL_NORMALBLENDMETHOD_RNM=1,e._AllDirtyCallBack=function(e){return e.markAllAsDirty()},e._ImageProcessingDirtyCallBack=function(e){return e.markAsImageProcessingDirty()},e._TextureDirtyCallBack=function(e){return e.markAsTexturesDirty()},e._FresnelDirtyCallBack=function(e){return e.markAsFresnelDirty()},e._MiscDirtyCallBack=function(e){return e.markAsMiscDirty()},e._PrePassDirtyCallBack=function(e){return e.markAsPrePassDirty()},e._LightsDirtyCallBack=function(e){return e.markAsLightDirty()},e._AttributeDirtyCallBack=function(e){return e.markAsAttributesDirty()},e._FresnelAndMiscDirtyCallBack=function(t){e._FresnelDirtyCallBack(t),e._MiscDirtyCallBack(t)},e._TextureAndMiscDirtyCallBack=function(t){e._TextureDirtyCallBack(t),e._MiscDirtyCallBack(t)},e._DirtyCallbackArray=[],e._RunDirtyCallBacks=function(t){for(var i=0,n=e._DirtyCallbackArray;i<n.length;i++)(0,n[i])(t)},Object(n.c)([Object(r.c)()],e.prototype,"id",void 0),Object(n.c)([Object(r.c)()],e.prototype,"uniqueId",void 0),Object(n.c)([Object(r.c)()],e.prototype,"name",void 0),Object(n.c)([Object(r.c)()],e.prototype,"checkReadyOnEveryCall",void 0),Object(n.c)([Object(r.c)()],e.prototype,"checkReadyOnlyOnce",void 0),Object(n.c)([Object(r.c)()],e.prototype,"state",void 0),Object(n.c)([Object(r.c)("alpha")],e.prototype,"_alpha",void 0),Object(n.c)([Object(r.c)("backFaceCulling")],e.prototype,"_backFaceCulling",void 0),Object(n.c)([Object(r.c)()],e.prototype,"sideOrientation",void 0),Object(n.c)([Object(r.c)("alphaMode")],e.prototype,"_alphaMode",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_needDepthPrePass",void 0),Object(n.c)([Object(r.c)()],e.prototype,"disableDepthWrite",void 0),Object(n.c)([Object(r.c)()],e.prototype,"disableColorWrite",void 0),Object(n.c)([Object(r.c)()],e.prototype,"forceDepthWrite",void 0),Object(n.c)([Object(r.c)()],e.prototype,"depthFunction",void 0),Object(n.c)([Object(r.c)()],e.prototype,"separateCullingPass",void 0),Object(n.c)([Object(r.c)("fogEnabled")],e.prototype,"_fogEnabled",void 0),Object(n.c)([Object(r.c)()],e.prototype,"pointSize",void 0),Object(n.c)([Object(r.c)()],e.prototype,"zOffset",void 0),Object(n.c)([Object(r.c)()],e.prototype,"pointsCloud",null),Object(n.c)([Object(r.c)()],e.prototype,"fillMode",null),Object(n.c)([Object(r.c)()],e.prototype,"transparencyMode",null),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return T});var n=i(22),r=i(5),o=i(21),a=i(6),s=i(141),c=i(142),l=i(143),u=i(2),h=i(27),d=i(8),f=i(38),p=function(){function e(){}return e.prototype.postProcessor=function(e,t,i,n){return n.getCaps().drawBuffersExtension||(e=e.replace(/#extension.+GL_EXT_draw_buffers.+(enable|require)/g,"")),e},e}(),_=i(118),m=i(88),g=i(144),v=i(70),b=i(74),y=function(){},T=function(){function e(t,i,n,r){var o=this;void 0===r&&(r=!1),this.forcePOTTextures=!1,this.isFullscreen=!1,this.cullBackFaces=!0,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this.validateShaderPrograms=!1,this.useReverseDepthBuffer=!1,this.disableUniformBuffers=!1,this._uniformBuffers=new Array,this._webGLVersion=1,this._windowIsBackground=!1,this._highPrecisionShadersAllowed=!0,this._badOS=!1,this._badDesktopOS=!1,this._renderingQueueLaunched=!1,this._activeRenderLoops=new Array,this.onContextLostObservable=new a.c,this.onContextRestoredObservable=new a.c,this._contextWasLost=!1,this._doNotHandleContextLost=!1,this.disableVertexArrayObjects=!1,this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new s.a,this._stencilState=new c.a,this._alphaState=new l.a,this._alphaMode=u.a.ALPHA_ADD,this._alphaEquation=u.a.ALPHA_DISABLE,this._internalTexturesCache=new Array,this._activeChannel=0,this._currentTextureChannel=-1,this._boundTexturesCache={},this._compiledEffects={},this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._activeRequests=new Array,this._transformTextureUrl=null,this.hostInformation={isMobile:!1},this.premultipliedAlpha=!0,this.onBeforeTextureInitObservable=new a.c,this._viewportCached={x:0,y:0,z:0,w:0},this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._getDepthStencilBuffer=function(e,t,i,n,r,a){var s=o._gl,c=s.createRenderbuffer();return s.bindRenderbuffer(s.RENDERBUFFER,c),i>1&&s.renderbufferStorageMultisample?s.renderbufferStorageMultisample(s.RENDERBUFFER,i,r,e,t):s.renderbufferStorage(s.RENDERBUFFER,n,e,t),s.framebufferRenderbuffer(s.FRAMEBUFFER,a,s.RENDERBUFFER,c),s.bindRenderbuffer(s.RENDERBUFFER,null),c},this._boundUniforms={};var h=null;if(t){if(n=n||{},b.a.SetMatrixPrecision(!!n.useHighPrecisionMatrix),t.getContext){if(h=t,this._renderingCanvas=h,null!=i&&(n.antialias=i),void 0===n.deterministicLockstep&&(n.deterministicLockstep=!1),void 0===n.lockstepMaxSteps&&(n.lockstepMaxSteps=4),void 0===n.timeStep&&(n.timeStep=1/60),void 0===n.preserveDrawingBuffer&&(n.preserveDrawingBuffer=!1),void 0===n.audioEngine&&(n.audioEngine=!0),void 0===n.stencil&&(n.stencil=!0),!1===n.premultipliedAlpha&&(this.premultipliedAlpha=!1),void 0===n.xrCompatible&&(n.xrCompatible=!0),this._doNotHandleContextLost=!!n.doNotHandleContextLost,navigator&&navigator.userAgent){var m=navigator.userAgent;this.hostInformation.isMobile=-1!==m.indexOf("Mobile");for(var g=0,v=e.ExceptionList;g<v.length;g++){var T=v[g],E=T.key,S=T.targets;if(new RegExp(E).test(m)){if(T.capture&&T.captureConstraint){var A=T.capture,P=T.captureConstraint,C=new RegExp(A).exec(m);if(C&&C.length>0&&parseInt(C[C.length-1])>=P)continue}for(var R=0,x=S;R<x.length;R++)switch(x[R]){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0}}}}if(this._doNotHandleContextLost||(this._onContextLost=function(e){e.preventDefault(),o._contextWasLost=!0,d.a.Warn("WebGL context lost."),o.onContextLostObservable.notifyObservers(o)},this._onContextRestored=function(){setTimeout(function(){o._initGLContext(),o._rebuildEffects(),o._rebuildInternalTextures(),o._rebuildBuffers(),o.wipeCaches(!0),d.a.Warn("WebGL context successfully restored."),o.onContextRestoredObservable.notifyObservers(o),o._contextWasLost=!1},0)},h.addEventListener("webglcontextlost",this._onContextLost,!1),h.addEventListener("webglcontextrestored",this._onContextRestored,!1),n.powerPreference="high-performance"),!n.disableWebGL2Support)try{this._gl=h.getContext("webgl2",n)||h.getContext("experimental-webgl2",n),this._gl&&(this._webGLVersion=2,this._gl.deleteQuery||(this._webGLVersion=1))}catch(e){}if(!this._gl){if(!h)throw new Error("The provided canvas is null or undefined.");try{this._gl=h.getContext("webgl",n)||h.getContext("experimental-webgl",n)}catch(e){throw new Error("WebGL not supported")}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=t,this._renderingCanvas=this._gl.canvas,this._gl.renderbufferStorageMultisample&&(this._webGLVersion=2);var O=this._gl.getContextAttributes();O&&(n.stencil=O.stencil)}this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),void 0!==n.useHighPrecisionFloats&&(this._highPrecisionShadersAllowed=n.useHighPrecisionFloats);var M=f.a.IsWindowObjectExist()&&window.devicePixelRatio||1,I=n.limitDeviceRatio||M;this._hardwareScalingLevel=r?1/Math.min(I,M):1,this.resize(),this._isStencilEnable=!!n.stencil,this._initGLContext();for(var D=0;D<this._caps.maxVertexAttribs;D++)this._currentBufferPointers[D]=new y;this.webGLVersion>1?this._shaderProcessor=new _.a:this._shaderProcessor=new p,this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),this._creationOptions=n,console.log("Babylon.js v"+e.Version+" - "+this.description)}}return Object.defineProperty(e,"NpmPackage",{get:function(){return"babylonjs@4.2.0"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"Version",{get:function(){return"4.2.0"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){var e="WebGL"+this.webGLVersion;return this._caps.parallelShaderCompile&&(e+=" - Parallel shader compilation"),e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ShadersRepository",{get:function(){return r.a.ShadersRepository},set:function(e){r.a.ShadersRepository=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsUniformBuffers",{get:function(){return this.webGLVersion>1&&!this.disableUniformBuffers},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_shouldUseHighPrecisionShader",{get:function(){return!(!this._caps.highPrecisionShaderSupported||!this._highPrecisionShadersAllowed)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needPOTTextures",{get:function(){return this._webGLVersion<2||this.forcePOTTextures},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doNotHandleContextLost",{get:function(){return this._doNotHandleContextLost},set:function(e){this._doNotHandleContextLost=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_supportsHardwareTextureRescaling",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"framebufferDimensionsObject",{set:function(e){this._framebufferDimensionsObject=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentViewport",{get:function(){return this._cachedViewport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture",{get:function(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,u.a.TEXTUREFORMAT_RGBA,!1,!1,u.a.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture3D",{get:function(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,u.a.TEXTUREFORMAT_RGBA,!1,!1,u.a.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture3D},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture2DArray",{get:function(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,u.a.TEXTUREFORMAT_RGBA,!1,!1,u.a.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture2DArray},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyCubeTexture",{get:function(){if(!this._emptyCubeTexture){var e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,u.a.TEXTUREFORMAT_RGBA,u.a.TEXTURETYPE_UNSIGNED_INT,!1,!1,u.a.TEXTURE_NEAREST_SAMPLINGMODE)}return this._emptyCubeTexture},enumerable:!1,configurable:!0}),e.prototype._rebuildInternalTextures=function(){for(var e=0,t=this._internalTexturesCache.slice();e<t.length;e++)t[e]._rebuild()},e.prototype._rebuildEffects=function(){for(var e in this._compiledEffects)this._compiledEffects[e]._prepareEffect();r.a.ResetCache()},e.prototype.areAllEffectsReady=function(){for(var e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0},e.prototype._rebuildBuffers=function(){for(var e=0,t=this._uniformBuffers;e<t.length;e++)t[e]._rebuild()},e.prototype._initGLContext=function(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile"),standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float"),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1},this._glVersion=this._gl.getParameter(this._gl.VERSION);var e=this._gl.getExtension("WEBGL_debug_renderer_info");if(null!=e&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor="Unknown vendor"),this._glRenderer||(this._glRenderer="Unknown renderer"),36193!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=36193),34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!(!this._caps.textureFloat||!this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!(!this._caps.textureFloat||!this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._webGLVersion>1&&5131!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=this._gl.getParameter(this._gl.MAX_SAMPLES);else{var t=this._gl.getExtension("WEBGL_draw_buffers");if(null!==t){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=t.drawBuffersWEBGL.bind(t),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(var i=0;i<16;i++)this._gl["COLOR_ATTACHMENT"+i+"_WEBGL"]=t["COLOR_ATTACHMENT"+i+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{var n=this._gl.getExtension("WEBGL_depth_texture");null!=n&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=n.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{var r=this._gl.getExtension("OES_vertex_array_object");null!=r&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=r.createVertexArrayOES.bind(r),this._gl.bindVertexArray=r.bindVertexArrayOES.bind(r),this._gl.deleteVertexArray=r.deleteVertexArrayOES.bind(r))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{var o=this._gl.getExtension("ANGLE_instanced_arrays");null!=o?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=o.drawArraysInstancedANGLE.bind(o),this._gl.drawElementsInstanced=o.drawElementsInstancedANGLE.bind(o),this._gl.vertexAttribDivisor=o.vertexAttribDivisorANGLE.bind(o)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){var a=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),s=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);a&&s&&(this._caps.highPrecisionShaderSupported=0!==a.precision&&0!==s.precision)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{var c=this._gl.getExtension("EXT_blend_minmax");null!=c&&(this._caps.blendMinMax=!0,this._gl.MAX=c.MAX_EXT,this._gl.MIN=c.MIN_EXT)}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(var l=0;l<this._maxSimultaneousTextures;l++)this._nextFreeTextureSlots.push(l)},Object.defineProperty(e.prototype,"webGLVersion",{get:function(){return this._webGLVersion},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"ThinEngine"},Object.defineProperty(e.prototype,"isStencilEnable",{get:function(){return this._isStencilEnable},enumerable:!1,configurable:!0}),e.prototype._prepareWorkingCanvas=function(){if(!this._workingCanvas){this._workingCanvas=v.a.CreateCanvas(1,1);var e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}},e.prototype.resetTextureCache=function(){for(var e in this._boundTexturesCache)this._boundTexturesCache.hasOwnProperty(e)&&(this._boundTexturesCache[e]=null);this._currentTextureChannel=-1},e.prototype.getGlInfo=function(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}},e.prototype.setHardwareScalingLevel=function(e){this._hardwareScalingLevel=e,this.resize()},e.prototype.getHardwareScalingLevel=function(){return this._hardwareScalingLevel},e.prototype.getLoadedTexturesCache=function(){return this._internalTexturesCache},e.prototype.getCaps=function(){return this._caps},e.prototype.stopRenderLoop=function(e){if(e){var t=this._activeRenderLoops.indexOf(e);t>=0&&this._activeRenderLoops.splice(t,1)}else this._activeRenderLoops=[]},e.prototype._renderLoop=function(){if(!this._contextWasLost){var e=!0;if(!this.renderEvenInBackground&&this._windowIsBackground&&(e=!1),e){this.beginFrame();for(var t=0;t<this._activeRenderLoops.length;t++)(0,this._activeRenderLoops[t])();this.endFrame()}}this._activeRenderLoops.length>0?this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1},e.prototype.getRenderingCanvas=function(){return this._renderingCanvas},e.prototype.getHostWindow=function(){return f.a.IsWindowObjectExist()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null},e.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth},e.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight},e.prototype._queueNewFrame=function(t,i){return e.QueueNewFrame(t,i)},e.prototype.runRenderLoop=function(e){-1===this._activeRenderLoops.indexOf(e)&&(this._activeRenderLoops.push(e),this._renderingQueueLaunched||(this._renderingQueueLaunched=!0,this._boundRenderFunction=this._renderLoop.bind(this),this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())))},e.prototype.clear=function(e,t,i,n){void 0===n&&(n=!1),this.applyStates();var r=0;t&&e&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),r|=this._gl.COLOR_BUFFER_BIT),i&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GREATER,this._gl.clearDepth(0)):this._gl.clearDepth(1),r|=this._gl.DEPTH_BUFFER_BIT),n&&(this._gl.clearStencil(0),r|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(r)},e.prototype._viewport=function(e,t,i,n){e===this._viewportCached.x&&t===this._viewportCached.y&&i===this._viewportCached.z&&n===this._viewportCached.w||(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=n,this._gl.viewport(e,t,i,n))},e.prototype.setViewport=function(e,t,i){var n=t||this.getRenderWidth(),r=i||this.getRenderHeight(),o=e.x||0,a=e.y||0;this._cachedViewport=e,this._viewport(o*n,a*r,n*e.width,r*e.height)},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){this._badOS&&this.flushFramebuffer()},e.prototype.resize=function(){var e,t;f.a.IsWindowObjectExist()?(e=this._renderingCanvas?this._renderingCanvas.clientWidth||this._renderingCanvas.width:window.innerWidth,t=this._renderingCanvas?this._renderingCanvas.clientHeight||this._renderingCanvas.height:window.innerHeight):(e=this._renderingCanvas?this._renderingCanvas.width:100,t=this._renderingCanvas?this._renderingCanvas.height:100),this.setSize(e/this._hardwareScalingLevel,t/this._hardwareScalingLevel)},e.prototype.setSize=function(e,t){return!(!this._renderingCanvas||(e|=0,t|=0,this._renderingCanvas.width===e&&this._renderingCanvas.height===t||(this._renderingCanvas.width=e,this._renderingCanvas.height=t,0)))},e.prototype.bindFramebuffer=function(e,t,i,n,r,o,a){void 0===t&&(t=0),void 0===o&&(o=0),void 0===a&&(a=0),this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(e._MSAAFramebuffer?e._MSAAFramebuffer:e._framebuffer);var s=this._gl;e.is2DArray?s.framebufferTextureLayer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,e._webGLTexture,o,a):e.isCube&&s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+t,e._webGLTexture,o);var c=e._depthStencilTexture;if(c){var l=c._generateStencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;e.is2DArray?s.framebufferTextureLayer(s.FRAMEBUFFER,l,c._webGLTexture,o,a):e.isCube?s.framebufferTexture2D(s.FRAMEBUFFER,l,s.TEXTURE_CUBE_MAP_POSITIVE_X+t,c._webGLTexture,o):s.framebufferTexture2D(s.FRAMEBUFFER,l,s.TEXTURE_2D,c._webGLTexture,o)}this._cachedViewport&&!r?this.setViewport(this._cachedViewport,i,n):(i||(i=e.width,o&&(i/=Math.pow(2,o))),n||(n=e.height,o&&(n/=Math.pow(2,o))),this._viewport(0,0,i,n)),this.wipeCaches()},e.prototype._bindUnboundFramebuffer=function(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)},e.prototype.unBindFramebuffer=function(e,t,i){void 0===t&&(t=!1),this._currentRenderTarget=null;var n=this._gl;if(e._MSAAFramebuffer){if(e._textureArray)return void this.unBindMultiColorAttachmentFramebuffer(e._textureArray,t,i);n.bindFramebuffer(n.READ_FRAMEBUFFER,e._MSAAFramebuffer),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,e._framebuffer),n.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,n.COLOR_BUFFER_BIT,n.NEAREST)}!e.generateMipMaps||t||e.isCube||(this._bindTextureDirectly(n.TEXTURE_2D,e,!0),n.generateMipmap(n.TEXTURE_2D),this._bindTextureDirectly(n.TEXTURE_2D,null)),i&&(e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._framebuffer),i()),this._bindUnboundFramebuffer(null)},e.prototype.flushFramebuffer=function(){this._gl.flush()},e.prototype.restoreDefaultFramebuffer=function(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()},e.prototype._resetVertexBufferBinding=function(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null},e.prototype.createVertexBuffer=function(e){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)},e.prototype._createVertexBuffer=function(e,t){var i=this._gl.createBuffer();if(!i)throw new Error("Unable to create vertex buffer");var n=new m.a(i);return this.bindArrayBuffer(n),e instanceof Array?this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.STATIC_DRAW),this._resetVertexBufferBinding(),n.references=1,n},e.prototype.createDynamicVertexBuffer=function(e){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)},e.prototype._resetIndexBufferBinding=function(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null},e.prototype.createIndexBuffer=function(e,t){var i=this._gl.createBuffer(),n=new m.a(i);if(!i)throw new Error("Unable to create index buffer");this.bindIndexBuffer(n);var r=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,r,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),n.references=1,n.is32Bits=4===r.BYTES_PER_ELEMENT,n},e.prototype._normalizeIndexData=function(e){if(e instanceof Uint16Array)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(var t=0;t<e.length;t++)if(e[t]>=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)},e.prototype.bindArrayBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ARRAY_BUFFER)},e.prototype.bindUniformBlock=function(e,t,i){var n=e.program,r=this._gl.getUniformBlockIndex(n,t);this._gl.uniformBlockBinding(n,r,i)},e.prototype.bindIndexBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)},e.prototype.bindBuffer=function(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)},e.prototype.updateArrayBuffer=function(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)},e.prototype._vertexAttribPointer=function(e,t,i,n,r,o,a){var s=this._currentBufferPointers[t];if(s){var c=!1;s.active?(s.buffer!==e&&(s.buffer=e,c=!0),s.size!==i&&(s.size=i,c=!0),s.type!==n&&(s.type=n,c=!0),s.normalized!==r&&(s.normalized=r,c=!0),s.stride!==o&&(s.stride=o,c=!0),s.offset!==a&&(s.offset=a,c=!0)):(c=!0,s.active=!0,s.index=t,s.size=i,s.type=n,s.normalized=r,s.stride=o,s.offset=a,s.buffer=e),(c||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),this._gl.vertexAttribPointer(t,i,n,r,o,a))}},e.prototype._bindIndexBufferWithCache=function(e){null!=e&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)},e.prototype._bindVertexBuffersAttributes=function(e,t){var i=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(var n=0;n<i.length;n++){var r=t.getAttributeLocation(n);if(r>=0){var o=e[i[n]];if(!o)continue;this._gl.enableVertexAttribArray(r),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[r]=!0);var a=o.getBuffer();a&&(this._vertexAttribPointer(a,r,o.getSize(),o.type,o.normalized,o.byteStride,o.byteOffset),o.getIsInstanced()&&(this._gl.vertexAttribDivisor(r,o.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(r),this._currentInstanceBuffers.push(a))))}}},e.prototype.recordVertexArrayObject=function(e,t,i){var n=this._gl.createVertexArray();return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(n),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),n},e.prototype.bindVertexArrayObject=function(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=null!=t&&t.is32Bits,this._mustWipeVertexAttributes=!0)},e.prototype.bindBuffersDirectly=function(e,t,i,n,r){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==r){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=r;var o=r.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();for(var a=0,s=0;s<o;s++)if(s<i.length){var c=r.getAttributeLocation(s);c>=0&&(this._gl.enableVertexAttribArray(c),this._vertexAttribArraysEnabled[c]=!0,this._vertexAttribPointer(e,c,i[s],this._gl.FLOAT,!1,n,a)),a+=4*i[s]}}this._bindIndexBufferWithCache(t)},e.prototype._unbindVertexArrayObject=function(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))},e.prototype.bindBuffers=function(e,t,i){this._cachedVertexBuffers===e&&this._cachedEffectForVertexBuffers===i||(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i)),this._bindIndexBufferWithCache(t)},e.prototype.unbindInstanceAttributes=function(){for(var e,t=0,i=this._currentInstanceLocations.length;t<i;t++){var n=this._currentInstanceBuffers[t];e!=n&&n.references&&(e=n,this.bindArrayBuffer(n));var r=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(r,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0},e.prototype.releaseVertexArrayObject=function(e){this._gl.deleteVertexArray(e)},e.prototype._releaseBuffer=function(e){return e.references--,0===e.references&&(this._deleteBuffer(e),!0)},e.prototype._deleteBuffer=function(e){this._gl.deleteBuffer(e.underlyingResource)},e.prototype.updateAndBindInstancesBuffer=function(e,t,i){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),void 0!==i[0].index)this.bindInstancesBuffer(e,i,!0);else for(var n=0;n<4;n++){var r=i[n];this._vertexAttribArraysEnabled[r]||(this._gl.enableVertexAttribArray(r),this._vertexAttribArraysEnabled[r]=!0),this._vertexAttribPointer(e,r,4,this._gl.FLOAT,!1,64,16*n),this._gl.vertexAttribDivisor(r,1),this._currentInstanceLocations.push(r),this._currentInstanceBuffers.push(e)}},e.prototype.bindInstancesBuffer=function(e,t,i){void 0===i&&(i=!0),this.bindArrayBuffer(e);var n=0;if(i)for(var r=0;r<t.length;r++)n+=4*(o=t[r]).attributeSize;for(r=0;r<t.length;r++){var o;void 0===(o=t[r]).index&&(o.index=this._currentEffect.getAttributeLocationByName(o.attributeName)),o.index<0||(this._vertexAttribArraysEnabled[o.index]||(this._gl.enableVertexAttribArray(o.index),this._vertexAttribArraysEnabled[o.index]=!0),this._vertexAttribPointer(e,o.index,o.attributeSize,o.attributeType||this._gl.FLOAT,o.normalized||!1,n,o.offset),this._gl.vertexAttribDivisor(o.index,void 0===o.divisor?1:o.divisor),this._currentInstanceLocations.push(o.index),this._currentInstanceBuffers.push(e))}},e.prototype.disableInstanceAttributeByName=function(e){if(this._currentEffect){var t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}},e.prototype.disableInstanceAttribute=function(e){for(var t,i=!1;-1!==(t=this._currentInstanceLocations.indexOf(e));)this._currentInstanceLocations.splice(t,1),this._currentInstanceBuffers.splice(t,1),i=!0,t=this._currentInstanceLocations.indexOf(e);i&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))},e.prototype.disableAttributeByIndex=function(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1},e.prototype.draw=function(e,t,i,n){this.drawElementsType(e?u.a.MATERIAL_TriangleFillMode:u.a.MATERIAL_WireFrameFillMode,t,i,n)},e.prototype.drawPointClouds=function(e,t,i){this.drawArraysType(u.a.MATERIAL_PointFillMode,e,t,i)},e.prototype.drawUnIndexed=function(e,t,i,n){this.drawArraysType(e?u.a.MATERIAL_TriangleFillMode:u.a.MATERIAL_WireFrameFillMode,t,i,n)},e.prototype.drawElementsType=function(e,t,i,n){this.applyStates(),this._reportDrawCall();var r=this._drawMode(e),o=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,a=this._uintIndicesCurrentlySet?4:2;n?this._gl.drawElementsInstanced(r,i,o,t*a,n):this._gl.drawElements(r,i,o,t*a)},e.prototype.drawArraysType=function(e,t,i,n){this.applyStates(),this._reportDrawCall();var r=this._drawMode(e);n?this._gl.drawArraysInstanced(r,t,i,n):this._gl.drawArrays(r,t,i)},e.prototype._drawMode=function(e){switch(e){case u.a.MATERIAL_TriangleFillMode:return this._gl.TRIANGLES;case u.a.MATERIAL_PointFillMode:return this._gl.POINTS;case u.a.MATERIAL_WireFrameFillMode:return this._gl.LINES;case u.a.MATERIAL_PointListDrawMode:return this._gl.POINTS;case u.a.MATERIAL_LineListDrawMode:return this._gl.LINES;case u.a.MATERIAL_LineLoopDrawMode:return this._gl.LINE_LOOP;case u.a.MATERIAL_LineStripDrawMode:return this._gl.LINE_STRIP;case u.a.MATERIAL_TriangleStripDrawMode:return this._gl.TRIANGLE_STRIP;case u.a.MATERIAL_TriangleFanDrawMode:return this._gl.TRIANGLE_FAN;default:return this._gl.TRIANGLES}},e.prototype._reportDrawCall=function(){},e.prototype._releaseEffect=function(e){this._compiledEffects[e._key]&&(delete this._compiledEffects[e._key],this._deletePipelineContext(e.getPipelineContext()))},e.prototype._deletePipelineContext=function(e){var t=e;t&&t.program&&(t.program.__SPECTOR_rebuildProgram=null,this._gl.deleteProgram(t.program))},e.prototype.createEffect=function(e,t,i,n,o,a,s,c,l){var u=(e.vertexElement||e.vertex||e.vertexToken||e.vertexSource||e)+"+"+(e.fragmentElement||e.fragment||e.fragmentToken||e.fragmentSource||e)+"@"+(o||t.defines);if(this._compiledEffects[u]){var h=this._compiledEffects[u];return s&&h.isReady()&&s(h),h}var d=new r.a(e,t,i,n,this,o,a,s,c,l);return d._key=u,this._compiledEffects[u]=d,d},e._ConcatenateShader=function(e,t,i){return void 0===i&&(i=""),i+(t?t+"\n":"")+e},e.prototype._compileShader=function(t,i,n,r){return this._compileRawShader(e._ConcatenateShader(t,n,r),i)},e.prototype._compileRawShader=function(e,t){var i=this._gl,n=i.createShader("vertex"===t?i.VERTEX_SHADER:i.FRAGMENT_SHADER);if(!n)throw new Error("Something went wrong while compile the shader.");return i.shaderSource(n,e),i.compileShader(n),n},e.prototype._getShaderSource=function(e){return this._gl.getShaderSource(e)},e.prototype.createRawShaderProgram=function(e,t,i,n,r){void 0===r&&(r=null),n=n||this._gl;var o=this._compileRawShader(t,"vertex"),a=this._compileRawShader(i,"fragment");return this._createShaderProgram(e,o,a,n,r)},e.prototype.createShaderProgram=function(e,t,i,n,r,o){void 0===o&&(o=null),r=r||this._gl;var a=this._webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"",s=this._compileShader(t,"vertex",n,a),c=this._compileShader(i,"fragment",n,a);return this._createShaderProgram(e,s,c,r,o)},e.prototype.createPipelineContext=function(){var e=new g.a;return e.engine=this,this._caps.parallelShaderCompile&&(e.isParallelCompiled=!0),e},e.prototype._createShaderProgram=function(e,t,i,n,r){void 0===r&&(r=null);var o=n.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");return n.attachShader(o,t),n.attachShader(o,i),n.linkProgram(o),e.context=n,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),o},e.prototype._finalizePipelineContext=function(e){var t=e.context,i=e.vertexShader,n=e.fragmentShader,r=e.program;if(!t.getProgramParameter(r,t.LINK_STATUS)){var o,a;if(!this._gl.getShaderParameter(i,this._gl.COMPILE_STATUS)&&(o=this._gl.getShaderInfoLog(i)))throw e.vertexCompilationError=o,new Error("VERTEX SHADER "+o);if(!this._gl.getShaderParameter(n,this._gl.COMPILE_STATUS)&&(o=this._gl.getShaderInfoLog(n)))throw e.fragmentCompilationError=o,new Error("FRAGMENT SHADER "+o);if(a=t.getProgramInfoLog(r))throw e.programLinkError=a,new Error(a)}if(this.validateShaderPrograms&&(t.validateProgram(r),!t.getProgramParameter(r,t.VALIDATE_STATUS)&&(a=t.getProgramInfoLog(r))))throw e.programValidationError=a,new Error(a);t.deleteShader(i),t.deleteShader(n),e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)},e.prototype._preparePipelineContext=function(e,t,i,n,r,o,a){var s=e;s.program=n?this.createRawShaderProgram(s,t,i,void 0,a):this.createShaderProgram(s,t,i,o,void 0,a),s.program.__SPECTOR_rebuildProgram=r},e.prototype._isRenderingStateCompiled=function(e){var t=e;return!!this._gl.getProgramParameter(t.program,this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR)&&(this._finalizePipelineContext(t),!0)},e.prototype._executeWhenRenderingStateIsCompiled=function(e,t){var i=e;if(i.isParallelCompiled){var n=i.onCompiled;i.onCompiled=n?function(){n(),t()}:t}else t()},e.prototype.getUniforms=function(e,t){for(var i=new Array,n=e,r=0;r<t.length;r++)i.push(this._gl.getUniformLocation(n.program,t[r]));return i},e.prototype.getAttributes=function(e,t){for(var i=[],n=e,r=0;r<t.length;r++)try{i.push(this._gl.getAttribLocation(n.program,t[r]))}catch(e){i.push(-1)}return i},e.prototype.enableEffect=function(e){e&&e!==this._currentEffect&&(this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))},e.prototype.setInt=function(e,t){return!!e&&(this._gl.uniform1i(e,t),!0)},e.prototype.setIntArray=function(e,t){return!!e&&(this._gl.uniform1iv(e,t),!0)},e.prototype.setIntArray2=function(e,t){return!(!e||t.length%2!=0||(this._gl.uniform2iv(e,t),0))},e.prototype.setIntArray3=function(e,t){return!(!e||t.length%3!=0||(this._gl.uniform3iv(e,t),0))},e.prototype.setIntArray4=function(e,t){return!(!e||t.length%4!=0||(this._gl.uniform4iv(e,t),0))},e.prototype.setArray=function(e,t){return!!e&&(this._gl.uniform1fv(e,t),!0)},e.prototype.setArray2=function(e,t){return!(!e||t.length%2!=0||(this._gl.uniform2fv(e,t),0))},e.prototype.setArray3=function(e,t){return!(!e||t.length%3!=0||(this._gl.uniform3fv(e,t),0))},e.prototype.setArray4=function(e,t){return!(!e||t.length%4!=0||(this._gl.uniform4fv(e,t),0))},e.prototype.setMatrices=function(e,t){return!!e&&(this._gl.uniformMatrix4fv(e,!1,t),!0)},e.prototype.setMatrix3x3=function(e,t){return!!e&&(this._gl.uniformMatrix3fv(e,!1,t),!0)},e.prototype.setMatrix2x2=function(e,t){return!!e&&(this._gl.uniformMatrix2fv(e,!1,t),!0)},e.prototype.setFloat=function(e,t){return!!e&&(this._gl.uniform1f(e,t),!0)},e.prototype.setFloat2=function(e,t,i){return!!e&&(this._gl.uniform2f(e,t,i),!0)},e.prototype.setFloat3=function(e,t,i,n){return!!e&&(this._gl.uniform3f(e,t,i,n),!0)},e.prototype.setFloat4=function(e,t,i,n,r){return!!e&&(this._gl.uniform4f(e,t,i,n,r),!0)},e.prototype.applyStates=function(){if(this._depthCullingState.apply(this._gl),this._stencilState.apply(this._gl),this._alphaState.apply(this._gl),this._colorWriteChanged){this._colorWriteChanged=!1;var e=this._colorWrite;this._gl.colorMask(e,e,e,e)}},e.prototype.setColorWrite=function(e){e!==this._colorWrite&&(this._colorWriteChanged=!0,this._colorWrite=e)},e.prototype.getColorWrite=function(){return this._colorWrite},Object.defineProperty(e.prototype,"depthCullingState",{get:function(){return this._depthCullingState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaState",{get:function(){return this._alphaState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilState",{get:function(){return this._stencilState},enumerable:!1,configurable:!0}),e.prototype.clearInternalTexturesCache=function(){this._internalTexturesCache=[]},e.prototype.wipeCaches=function(e){this.preventCacheWipeBetweenFrames&&!e||(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilState.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._alphaMode=u.a.ALPHA_ADD,this._alphaEquation=u.a.ALPHA_DISABLE,this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))},e.prototype._getSamplingParameters=function(e,t){var i=this._gl,n=i.NEAREST,r=i.NEAREST;switch(e){case u.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST:n=i.LINEAR,r=t?i.LINEAR_MIPMAP_NEAREST:i.LINEAR;break;case u.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR:n=i.LINEAR,r=t?i.LINEAR_MIPMAP_LINEAR:i.LINEAR;break;case u.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR:n=i.NEAREST,r=t?i.NEAREST_MIPMAP_LINEAR:i.NEAREST;break;case u.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST:n=i.NEAREST,r=t?i.NEAREST_MIPMAP_NEAREST:i.NEAREST;break;case u.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST:n=i.NEAREST,r=t?i.LINEAR_MIPMAP_NEAREST:i.LINEAR;break;case u.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR:n=i.NEAREST,r=t?i.LINEAR_MIPMAP_LINEAR:i.LINEAR;break;case u.a.TEXTURE_NEAREST_LINEAR:n=i.NEAREST,r=i.LINEAR;break;case u.a.TEXTURE_NEAREST_NEAREST:n=i.NEAREST,r=i.NEAREST;break;case u.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST:n=i.LINEAR,r=t?i.NEAREST_MIPMAP_NEAREST:i.NEAREST;break;case u.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR:n=i.LINEAR,r=t?i.NEAREST_MIPMAP_LINEAR:i.NEAREST;break;case u.a.TEXTURE_LINEAR_LINEAR:n=i.LINEAR,r=i.LINEAR;break;case u.a.TEXTURE_LINEAR_NEAREST:n=i.LINEAR,r=i.NEAREST}return{min:r,mag:n}},e.prototype._createTexture=function(){var e=this._gl.createTexture();if(!e)throw new Error("Unable to create texture");return e},e.prototype.createTexture=function(t,i,r,o,a,s,c,l,f,p,_,m,g){var v=this;void 0===a&&(a=u.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===s&&(s=null),void 0===c&&(c=null),void 0===l&&(l=null),void 0===f&&(f=null),void 0===p&&(p=null),void 0===_&&(_=null);var b="data:"===(t=t||"").substr(0,5),y="blob:"===t.substr(0,5),T=b&&-1!==t.indexOf(";base64,"),E=f||new h.a(this,h.b.Url),S=t;!this._transformTextureUrl||T||f||l||(t=this._transformTextureUrl(t)),S!==t&&(E._originalUrl=S);var A=t.lastIndexOf("."),P=_||(A>-1?t.substring(A).toLowerCase():""),C=null;P.indexOf("?")>-1&&(P=P.split("?")[0]);for(var R=0,x=e._TextureLoaders;R<x.length;R++){var O=x[R];if(O.canLoad(P,m)){C=O;break}}o&&o._addPendingData(E),E.url=t,E.generateMipMaps=!i,E.samplingMode=a,E.invertY=r,this._doNotHandleContextLost||(E._buffer=l);var M=null;s&&!f&&(M=E.onLoadedObservable.add(s)),f||this._internalTexturesCache.push(E);var I=function(e,r){o&&o._removePendingData(E),t===S?(M&&E.onLoadedObservable.remove(M),n.a.UseFallbackTexture&&v.createTexture(n.a.FallbackTexture,i,E.invertY,o,a,null,c,l,E),c&&c((e||"Unknown error")+(n.a.UseFallbackTexture?" - Fallback texture was used":""),r)):(d.a.Warn("Failed to load "+t+", falling back to "+S),v.createTexture(S,i,E.invertY,o,a,s,c,l,E,p,_,m,g))};if(C){var D=function(e){C.loadData(e,E,function(e,t,i,n,r,s){s?I("TextureLoader failed to load data"):v._prepareWebGLTexture(E,o,e,t,E.invertY,!i,n,function(){return r(),!1},a)},g)};l?l instanceof ArrayBuffer?D(new Uint8Array(l)):ArrayBuffer.isView(l)?D(l):c&&c("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null):this._loadFile(t,function(e){return D(new Uint8Array(e))},void 0,o?o.offlineProvider:void 0,!0,function(e,t){I("Unable to load "+(e&&e.responseURL,t))})}else{var N=function(e){y&&!v._doNotHandleContextLost&&(E._buffer=e),v._prepareWebGLTexture(E,o,e.width,e.height,E.invertY,i,!1,function(t,i,n){var r=v._gl,a=e.width===t&&e.height===i,s=p?v._getInternalFormat(p):".jpg"===P?r.RGB:r.RGBA;if(a)return r.texImage2D(r.TEXTURE_2D,0,s,s,r.UNSIGNED_BYTE,e),!1;var c=v._caps.maxTextureSize;if(e.width>c||e.height>c||!v._supportsHardwareTextureRescaling)return v._prepareWorkingCanvas(),!(!v._workingCanvas||!v._workingContext||(v._workingCanvas.width=t,v._workingCanvas.height=i,v._workingContext.drawImage(e,0,0,e.width,e.height,0,0,t,i),r.texImage2D(r.TEXTURE_2D,0,s,s,r.UNSIGNED_BYTE,v._workingCanvas),E.width=t,E.height=i,1));var l=new h.a(v,h.b.Temp);return v._bindTextureDirectly(r.TEXTURE_2D,l,!0),r.texImage2D(r.TEXTURE_2D,0,s,s,r.UNSIGNED_BYTE,e),v._rescaleTexture(l,E,o,s,function(){v._releaseTexture(l),v._bindTextureDirectly(r.TEXTURE_2D,E,!0),n()}),!0},a)};!b||T?l&&(l.decoding||l.close)?N(l):e._FileToolsLoadImage(t,N,I,o?o.offlineProvider:null,m):"string"==typeof l||l instanceof ArrayBuffer||ArrayBuffer.isView(l)||l instanceof Blob?e._FileToolsLoadImage(l,N,I,o?o.offlineProvider:null,m):l&&N(l)}return E},e._FileToolsLoadImage=function(e,t,i,n,r){throw o.a.WarnImport("FileTools")},e.prototype._rescaleTexture=function(e,t,i,n,r){},e.prototype.createRawTexture=function(e,t,i,n,r,a,s,c,l){throw void 0===c&&(c=null),void 0===l&&(l=u.a.TEXTURETYPE_UNSIGNED_INT),o.a.WarnImport("Engine.RawTexture")},e.prototype.createRawCubeTexture=function(e,t,i,n,r,a,s,c){throw void 0===c&&(c=null),o.a.WarnImport("Engine.RawTexture")},e.prototype.createRawTexture3D=function(e,t,i,n,r,a,s,c,l,h){throw void 0===l&&(l=null),void 0===h&&(h=u.a.TEXTURETYPE_UNSIGNED_INT),o.a.WarnImport("Engine.RawTexture")},e.prototype.createRawTexture2DArray=function(e,t,i,n,r,a,s,c,l,h){throw void 0===l&&(l=null),void 0===h&&(h=u.a.TEXTURETYPE_UNSIGNED_INT),o.a.WarnImport("Engine.RawTexture")},e.prototype._unpackFlipY=function(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))},e.prototype._getUnpackAlignement=function(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)},e.prototype._getTextureTarget=function(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D},e.prototype.updateTextureSamplingMode=function(e,t,i){void 0===i&&(i=!1);var n=this._getTextureTarget(t),r=this._getSamplingParameters(e,t.generateMipMaps||i);this._setTextureParameterInteger(n,this._gl.TEXTURE_MAG_FILTER,r.mag,t),this._setTextureParameterInteger(n,this._gl.TEXTURE_MIN_FILTER,r.min),i&&(t.generateMipMaps=!0,this._gl.generateMipmap(n)),this._bindTextureDirectly(n,null),t.samplingMode=e},e.prototype.updateTextureWrappingMode=function(e,t,i,n){void 0===i&&(i=null),void 0===n&&(n=null);var r=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==i&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i),e),e._cachedWrapV=i),(e.is2DArray||e.is3D)&&null!==n&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(n),e),e._cachedWrapR=n),this._bindTextureDirectly(r,null)},e.prototype._setupDepthStencilTexture=function(e,t,i,n,r){var o=t.width||t,a=t.height||t,s=t.layers||0;e.baseWidth=o,e.baseHeight=a,e.width=o,e.height=a,e.is2DArray=s>0,e.depth=s,e.isReady=!0,e.samples=1,e.generateMipMaps=!1,e._generateDepthBuffer=!0,e._generateStencilBuffer=i,e.samplingMode=n?u.a.TEXTURE_BILINEAR_SAMPLINGMODE:u.a.TEXTURE_NEAREST_SAMPLINGMODE,e.type=u.a.TEXTURETYPE_UNSIGNED_INT,e._comparisonFunction=r;var c=this._gl,l=this._getTextureTarget(e),h=this._getSamplingParameters(e.samplingMode,!1);c.texParameteri(l,c.TEXTURE_MAG_FILTER,h.mag),c.texParameteri(l,c.TEXTURE_MIN_FILTER,h.min),c.texParameteri(l,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(l,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),0===r?(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,u.a.LEQUAL),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.NONE)):(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,r),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.COMPARE_REF_TO_TEXTURE))},e.prototype._uploadCompressedDataToTextureDirectly=function(e,t,i,n,r,o,a){void 0===o&&(o=0),void 0===a&&(a=0);var s=this._gl,c=s.TEXTURE_2D;e.isCube&&(c=s.TEXTURE_CUBE_MAP_POSITIVE_X+o),this._gl.compressedTexImage2D(c,a,t,i,n,0,r)},e.prototype._uploadDataToTextureDirectly=function(e,t,i,n,r,o){void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=!1);var a=this._gl,s=this._getWebGLTextureType(e.type),c=this._getInternalFormat(e.format),l=void 0===r?this._getRGBABufferInternalSizedFormat(e.type,e.format):this._getInternalFormat(r);this._unpackFlipY(e.invertY);var u=a.TEXTURE_2D;e.isCube&&(u=a.TEXTURE_CUBE_MAP_POSITIVE_X+i);var h=Math.round(Math.log(e.width)*Math.LOG2E),d=Math.round(Math.log(e.height)*Math.LOG2E),f=o?e.width:Math.pow(2,Math.max(h-n,0)),p=o?e.height:Math.pow(2,Math.max(d-n,0));a.texImage2D(u,n,l,f,p,0,c,s,t)},e.prototype.updateTextureData=function(e,t,i,n,r,o,a,s){void 0===a&&(a=0),void 0===s&&(s=0);var c=this._gl,l=this._getWebGLTextureType(e.type),u=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);var h=c.TEXTURE_2D;e.isCube&&(h=c.TEXTURE_CUBE_MAP_POSITIVE_X+a),c.texSubImage2D(h,s,i,n,r,o,u,l,t)},e.prototype._uploadArrayBufferViewToTexture=function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var r=this._gl,o=e.isCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,i,n),this._bindTextureDirectly(o,null,!0)},e.prototype._prepareWebGLTextureContinuation=function(e,t,i,n,r){var o=this._gl;if(o){var a=this._getSamplingParameters(r,!i);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,a.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,a.min),i||n||o.generateMipmap(o.TEXTURE_2D),this._bindTextureDirectly(o.TEXTURE_2D,null),t&&t._removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}},e.prototype._prepareWebGLTexture=function(t,i,n,r,o,a,s,c,l){var h=this;void 0===l&&(l=u.a.TEXTURE_TRILINEAR_SAMPLINGMODE);var d=this.getCaps().maxTextureSize,f=Math.min(d,this.needPOTTextures?e.GetExponentOfTwo(n,d):n),p=Math.min(d,this.needPOTTextures?e.GetExponentOfTwo(r,d):r),_=this._gl;_&&(t._webGLTexture?(this._bindTextureDirectly(_.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===o||!!o),t.baseWidth=n,t.baseHeight=r,t.width=f,t.height=p,t.isReady=!0,c(f,p,function(){h._prepareWebGLTextureContinuation(t,i,a,s,l)})||this._prepareWebGLTextureContinuation(t,i,a,s,l)):i&&i._removePendingData(t))},e.prototype._setupFramebufferDepthAttachments=function(e,t,i,n,r){void 0===r&&(r=1);var o=this._gl;if(e&&t)return this._getDepthStencilBuffer(i,n,r,o.DEPTH_STENCIL,o.DEPTH24_STENCIL8,o.DEPTH_STENCIL_ATTACHMENT);if(t){var a=o.DEPTH_COMPONENT16;return this._webGLVersion>1&&(a=o.DEPTH_COMPONENT32F),this._getDepthStencilBuffer(i,n,r,a,a,o.DEPTH_ATTACHMENT)}return e?this._getDepthStencilBuffer(i,n,r,o.STENCIL_INDEX8,o.STENCIL_INDEX8,o.STENCIL_ATTACHMENT):null},e.prototype._releaseFramebufferObjects=function(e){var t=this._gl;e._framebuffer&&(t.deleteFramebuffer(e._framebuffer),e._framebuffer=null),e._depthStencilBuffer&&(t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(t.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null),e._MSAARenderBuffer&&(t.deleteRenderbuffer(e._MSAARenderBuffer),e._MSAARenderBuffer=null)},e.prototype._releaseTexture=function(e){this._releaseFramebufferObjects(e),this._deleteTexture(e._webGLTexture),this.unbindAllTextures();var t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()},e.prototype._deleteTexture=function(e){this._gl.deleteTexture(e)},e.prototype._setProgram=function(e){this._currentProgram!==e&&(this._gl.useProgram(e),this._currentProgram=e)},e.prototype.bindSamplers=function(e){var t=e.getPipelineContext();this._setProgram(t.program);for(var i=e.getSamplers(),n=0;n<i.length;n++){var r=e.getUniform(i[n]);r&&(this._boundUniforms[n]=r)}this._currentEffect=null},e.prototype._activateCurrentTexture=function(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)},e.prototype._bindTextureDirectly=function(e,t,i,n){void 0===i&&(i=!1),void 0===n&&(n=!1);var r=!1,o=t&&t._associatedChannel>-1;return i&&o&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||n?(this._activateCurrentTexture(),t&&t.isMultiview?this._gl.bindTexture(e,t?t._colorTextureArray:null):this._gl.bindTexture(e,t?t._webGLTexture:null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)):i&&(r=!0,this._activateCurrentTexture()),o&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),r},e.prototype._bindTexture=function(e,t){if(void 0!==e){t&&(t._associatedChannel=e),this._activeChannel=e;var i=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(i,t)}},e.prototype.unbindAllTextures=function(){for(var e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))},e.prototype.setTexture=function(e,t,i){void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))},e.prototype._bindSamplerUniformToChannel=function(e,t){var i=this._boundUniforms[e];i&&i._currentState!==t&&(this._gl.uniform1i(i,t),i._currentState=t)},e.prototype._getTextureWrapMode=function(e){switch(e){case u.a.TEXTURE_WRAP_ADDRESSMODE:return this._gl.REPEAT;case u.a.TEXTURE_CLAMP_ADDRESSMODE:return this._gl.CLAMP_TO_EDGE;case u.a.TEXTURE_MIRROR_ADDRESSMODE:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT},e.prototype._setTexture=function(e,t,i,n){if(void 0===i&&(i=!1),void 0===n&&(n=!1),!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video)this._activeChannel=e,t.update();else if(t.delayLoadState===u.a.DELAYLOADSTATE_NOTLOADED)return t.delayLoad(),!1;var r;r=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!i&&r&&(r._associatedChannel=e);var o=!0;this._boundTexturesCache[e]===r&&(i||this._bindSamplerUniformToChannel(r._associatedChannel,e),o=!1),this._activeChannel=e;var a=this._getTextureTarget(r);if(o&&this._bindTextureDirectly(a,r,i),r&&!r.isMultiview){if(r.isCube&&r._cachedCoordinatesMode!==t.coordinatesMode){r._cachedCoordinatesMode=t.coordinatesMode;var s=t.coordinatesMode!==u.a.TEXTURE_CUBIC_MODE&&t.coordinatesMode!==u.a.TEXTURE_SKYBOX_MODE?u.a.TEXTURE_WRAP_ADDRESSMODE:u.a.TEXTURE_CLAMP_ADDRESSMODE;t.wrapU=s,t.wrapV=s}r._cachedWrapU!==t.wrapU&&(r._cachedWrapU=t.wrapU,this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),r)),r._cachedWrapV!==t.wrapV&&(r._cachedWrapV=t.wrapV,this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),r)),r.is3D&&r._cachedWrapR!==t.wrapR&&(r._cachedWrapR=t.wrapR,this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),r)),this._setAnisotropicLevel(a,r,t.anisotropicFilteringLevel)}return!0},e.prototype.setTextureArray=function(e,t,i){if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===i.length||(this._textureUnits=new Int32Array(i.length));for(var n=0;n<i.length;n++){var r=i[n].getInternalTexture();r?(this._textureUnits[n]=e+n,r._associatedChannel=e+n):this._textureUnits[n]=-1}this._gl.uniform1iv(t,this._textureUnits);for(var o=0;o<i.length;o++)this._setTexture(this._textureUnits[o],i[o],!0)}},e.prototype._setAnisotropicLevel=function(e,t,i){var n=this._caps.textureAnisotropicFilterExtension;t.samplingMode!==u.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST&&t.samplingMode!==u.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR&&t.samplingMode!==u.a.TEXTURE_LINEAR_LINEAR&&(i=1),n&&t._cachedAnisotropicFilteringLevel!==i&&(this._setTextureParameterFloat(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(i,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=i)},e.prototype._setTextureParameterFloat=function(e,t,i,n){this._bindTextureDirectly(e,n,!0,!0),this._gl.texParameterf(e,t,i)},e.prototype._setTextureParameterInteger=function(e,t,i,n){n&&this._bindTextureDirectly(e,n,!0,!0),this._gl.texParameteri(e,t,i)},e.prototype.unbindAllAttributes=function(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(var e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e)}else{e=0;for(var t=this._vertexAttribArraysEnabled.length;e<t;e++)e>=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}},e.prototype.releaseEffects=function(){for(var e in this._compiledEffects){var t=this._compiledEffects[e].getPipelineContext();this._deletePipelineContext(t)}this._compiledEffects={}},e.prototype.dispose=function(){this.stopRenderLoop(),this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.releaseEffects(),this.unbindAllAttributes(),this._boundUniforms=[],f.a.IsWindowObjectExist()&&this._renderingCanvas&&(this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored))),this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers=[],this._renderingCanvas=null,this._currentProgram=null,this._boundRenderFunction=null,r.a.ResetCache();for(var e=0,t=this._activeRequests;e<t.length;e++)t[e].abort()},e.prototype.attachContextLostEvent=function(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)},e.prototype.attachContextRestoredEvent=function(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)},e.prototype.getError=function(){return this._gl.getError()},e.prototype._canRenderToFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(u.a.TEXTURETYPE_FLOAT)},e.prototype._canRenderToHalfFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(u.a.TEXTURETYPE_HALF_FLOAT)},e.prototype._canRenderToFramebuffer=function(e){for(var t=this._gl;t.getError()!==t.NO_ERROR;);var i=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);var r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);var o=t.checkFramebufferStatus(t.FRAMEBUFFER);if((i=(i=i&&o===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){t.bindFramebuffer(t.FRAMEBUFFER,null);var a=t.RGBA,s=t.UNSIGNED_BYTE,c=new Uint8Array(4);t.readPixels(0,0,1,1,a,s,c),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(n),t.deleteFramebuffer(r),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i},e.prototype._getWebGLTextureType=function(e){if(1===this._webGLVersion){switch(e){case u.a.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case u.a.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT_OES;case u.a.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case u.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case u.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case u.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case u.a.TEXTURETYPE_BYTE:return this._gl.BYTE;case u.a.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case u.a.TEXTURETYPE_SHORT:return this._gl.SHORT;case u.a.TEXTURETYPE_UNSIGNED_SHORT:return this._gl.UNSIGNED_SHORT;case u.a.TEXTURETYPE_INT:return this._gl.INT;case u.a.TEXTURETYPE_UNSIGNED_INTEGER:return this._gl.UNSIGNED_INT;case u.a.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case u.a.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT;case u.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case u.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case u.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5;case u.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case u.a.TEXTURETYPE_UNSIGNED_INT_24_8:return this._gl.UNSIGNED_INT_24_8;case u.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case u.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case u.a.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE},e.prototype._getInternalFormat=function(e){var t=this._gl.RGBA;switch(e){case u.a.TEXTUREFORMAT_ALPHA:t=this._gl.ALPHA;break;case u.a.TEXTUREFORMAT_LUMINANCE:t=this._gl.LUMINANCE;break;case u.a.TEXTUREFORMAT_LUMINANCE_ALPHA:t=this._gl.LUMINANCE_ALPHA;break;case u.a.TEXTUREFORMAT_RED:t=this._gl.RED;break;case u.a.TEXTUREFORMAT_RG:t=this._gl.RG;break;case u.a.TEXTUREFORMAT_RGB:t=this._gl.RGB;break;case u.a.TEXTUREFORMAT_RGBA:t=this._gl.RGBA}if(this._webGLVersion>1)switch(e){case u.a.TEXTUREFORMAT_RED_INTEGER:t=this._gl.RED_INTEGER;break;case u.a.TEXTUREFORMAT_RG_INTEGER:t=this._gl.RG_INTEGER;break;case u.a.TEXTUREFORMAT_RGB_INTEGER:t=this._gl.RGB_INTEGER;break;case u.a.TEXTUREFORMAT_RGBA_INTEGER:t=this._gl.RGBA_INTEGER}return t},e.prototype._getRGBABufferInternalSizedFormat=function(e,t){if(1===this._webGLVersion){if(void 0!==t)switch(t){case u.a.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case u.a.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case u.a.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA;case u.a.TEXTUREFORMAT_RGB:return this._gl.RGB}return this._gl.RGBA}switch(e){case u.a.TEXTURETYPE_BYTE:switch(t){case u.a.TEXTUREFORMAT_RED:return this._gl.R8_SNORM;case u.a.TEXTUREFORMAT_RG:return this._gl.RG8_SNORM;case u.a.TEXTUREFORMAT_RGB:return this._gl.RGB8_SNORM;case u.a.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8I;case u.a.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8I;case u.a.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8I;case u.a.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case u.a.TEXTURETYPE_UNSIGNED_BYTE:switch(t){case u.a.TEXTUREFORMAT_RED:return this._gl.R8;case u.a.TEXTUREFORMAT_RG:return this._gl.RG8;case u.a.TEXTUREFORMAT_RGB:return this._gl.RGB8;case u.a.TEXTUREFORMAT_RGBA:return this._gl.RGBA8;case u.a.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8UI;case u.a.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8UI;case u.a.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8UI;case u.a.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8UI;case u.a.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case u.a.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case u.a.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case u.a.TEXTURETYPE_SHORT:switch(t){case u.a.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16I;case u.a.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16I;case u.a.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16I;case u.a.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16I}case u.a.TEXTURETYPE_UNSIGNED_SHORT:switch(t){case u.a.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16UI;case u.a.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16UI;case u.a.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16UI;case u.a.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16UI}case u.a.TEXTURETYPE_INT:switch(t){case u.a.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32I;case u.a.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32I;case u.a.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32I;case u.a.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32I}case u.a.TEXTURETYPE_UNSIGNED_INTEGER:switch(t){case u.a.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32UI;case u.a.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32UI;case u.a.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32UI;case u.a.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32UI}case u.a.TEXTURETYPE_FLOAT:switch(t){case u.a.TEXTUREFORMAT_RED:return this._gl.R32F;case u.a.TEXTUREFORMAT_RG:return this._gl.RG32F;case u.a.TEXTUREFORMAT_RGB:return this._gl.RGB32F;case u.a.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA32F}case u.a.TEXTURETYPE_HALF_FLOAT:switch(t){case u.a.TEXTUREFORMAT_RED:return this._gl.R16F;case u.a.TEXTUREFORMAT_RG:return this._gl.RG16F;case u.a.TEXTUREFORMAT_RGB:return this._gl.RGB16F;case u.a.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA16F}case u.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.RGB565;case u.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.R11F_G11F_B10F;case u.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.RGB9_E5;case u.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.RGBA4;case u.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.RGB5_A1;case u.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:switch(t){case u.a.TEXTUREFORMAT_RGBA:return this._gl.RGB10_A2;case u.a.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return this._gl.RGBA8},e.prototype._getRGBAMultiSampleBufferFormat=function(e){return e===u.a.TEXTURETYPE_FLOAT?this._gl.RGBA32F:e===u.a.TEXTURETYPE_HALF_FLOAT?this._gl.RGBA16F:this._gl.RGBA8},e.prototype._loadFile=function(t,i,n,r,o,a){var s=this,c=e._FileToolsLoadFile(t,i,n,r,o,a);return this._activeRequests.push(c),c.onCompleteObservable.add(function(e){s._activeRequests.splice(s._activeRequests.indexOf(e),1)}),c},e._FileToolsLoadFile=function(e,t,i,n,r,a){throw o.a.WarnImport("FileTools")},e.prototype.readPixels=function(e,t,i,n,r){void 0===r&&(r=!0);var o=r?4:3,a=r?this._gl.RGBA:this._gl.RGB,s=new Uint8Array(n*i*o);return this._gl.readPixels(e,t,i,n,a,this._gl.UNSIGNED_BYTE,s),s},Object.defineProperty(e,"IsSupported",{get:function(){return this.isSupported()},enumerable:!1,configurable:!0}),e.isSupported=function(){if(null!==this._HasMajorPerformanceCaveat)return!this._HasMajorPerformanceCaveat;if(null===this._IsSupported)try{var e=v.a.CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=null!=t&&!!window.WebGLRenderingContext}catch(e){this._IsSupported=!1}return this._IsSupported},Object.defineProperty(e,"HasMajorPerformanceCaveat",{get:function(){if(null===this._HasMajorPerformanceCaveat)try{var e=v.a.CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch(e){this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat},enumerable:!1,configurable:!0}),e.CeilingPOT=function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},e.FloorPOT=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)-(e>>1)},e.NearestPOT=function(t){var i=e.CeilingPOT(t),n=e.FloorPOT(t);return i-t>t-n?n:i},e.GetExponentOfTwo=function(t,i,n){var r;switch(void 0===n&&(n=u.a.SCALEMODE_NEAREST),n){case u.a.SCALEMODE_FLOOR:r=e.FloorPOT(t);break;case u.a.SCALEMODE_NEAREST:r=e.NearestPOT(t);break;case u.a.SCALEMODE_CEILING:default:r=e.CeilingPOT(t)}return Math.min(r,i)},e.QueueNewFrame=function(e,t){return f.a.IsWindowObjectExist()?(t||(t=window),t.requestPostAnimationFrame?t.requestPostAnimationFrame(e):t.requestAnimationFrame?t.requestAnimationFrame(e):t.msRequestAnimationFrame?t.msRequestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.mozRequestAnimationFrame?t.mozRequestAnimationFrame(e):t.oRequestAnimationFrame?t.oRequestAnimationFrame(e):window.setTimeout(e,16)):"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e,16)},e.prototype.getHostDocument=function(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:document},e.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]}],e._TextureLoaders=[],e.CollisionsEpsilon=.001,e._IsSupported=null,e._HasMajorPerformanceCaveat=null,e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return n}),i.d(t,"a",function(){return c});var n,r=i(6),o=i(102),a=i(2),s=i(21);!function(e){e[e.Unknown=0]="Unknown",e[e.Url=1]="Url",e[e.Temp=2]="Temp",e[e.Raw=3]="Raw",e[e.Dynamic=4]="Dynamic",e[e.RenderTarget=5]="RenderTarget",e[e.MultiRenderTarget=6]="MultiRenderTarget",e[e.Cube=7]="Cube",e[e.CubeRaw=8]="CubeRaw",e[e.CubePrefiltered=9]="CubePrefiltered",e[e.Raw3D=10]="Raw3D",e[e.Raw2DArray=11]="Raw2DArray",e[e.Depth=12]="Depth",e[e.CubeRawRGBD=13]="CubeRawRGBD"}(n||(n={}));var c=function(){function e(e,t,i){void 0===i&&(i=!1),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.samplingMode=-1,this.generateMipMaps=!1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new r.c,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=n.Unknown,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._MSAARenderBuffer=null,this._attachments=null,this._textureArray=null,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._isDisabled=!1,this._compression=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._comparisonFunction=0,this._sphericalPolynomial=null,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._webGLTexture=null,this._references=1,this._gammaSpace=null,this._engine=e,this._source=t,i||(this._webGLTexture=e._createTexture())}return e.prototype.getEngine=function(){return this._engine},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!1,configurable:!0}),e.prototype.incrementReferences=function(){this._references++},e.prototype.updateSize=function(e,t,i){void 0===i&&(i=1),this.width=e,this.height=t,this.depth=i,this.baseWidth=e,this.baseHeight=t,this.baseDepth=i,this._size=e*t*i},e.prototype._rebuild=function(){var t,i,r=this;switch(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedAnisotropicFilteringLevel=null,this.source){case n.Temp:return;case n.Url:return void(i=this._engine.createTexture(null!==(t=this._originalUrl)&&void 0!==t?t:this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,function(){i._swapAndDie(r),r.isReady=!0},null,this._buffer,void 0,this.format));case n.Raw:return(i=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this),void(this.isReady=!0);case n.Raw3D:return(i=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this),void(this.isReady=!0);case n.Raw2DArray:return(i=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this),void(this.isReady=!0);case n.Dynamic:return(i=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode))._swapAndDie(this),void this._engine.updateDynamicTexture(this,this._engine.getRenderingCanvas(),this.invertY,void 0,void 0,!0);case n.RenderTarget:var s=new o.a;if(s.generateDepthBuffer=this._generateDepthBuffer,s.generateMipMaps=this.generateMipMaps,s.generateStencilBuffer=this._generateStencilBuffer,s.samplingMode=this.samplingMode,s.type=this.type,this.isCube)i=this._engine.createRenderTargetCubeTexture(this.width,s);else{var c={width:this.width,height:this.height,layers:this.is2DArray?this.depth:void 0};i=this._engine.createRenderTargetTexture(c,s)}return i._swapAndDie(this),void(this.isReady=!0);case n.Depth:var l={bilinearFiltering:this.samplingMode!==a.a.TEXTURE_BILINEAR_SAMPLINGMODE,comparisonFunction:this._comparisonFunction,generateStencil:this._generateStencilBuffer,isCube:this.isCube},u={width:this.width,height:this.height,layers:this.is2DArray?this.depth:void 0};return(i=this._engine.createDepthStencilTexture(u,l))._swapAndDie(this),void(this.isReady=!0);case n.Cube:return void(i=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,function(){i._swapAndDie(r),r.isReady=!0},null,this.format,this._extension));case n.CubeRaw:return(i=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this),void(this.isReady=!0);case n.CubeRawRGBD:return i=this._engine.createRawCubeTexture(null,this.width,this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),void e._UpdateRGBDAsync(i,this._bufferViewArrayArray,this._sphericalPolynomial,this._lodGenerationScale,this._lodGenerationOffset).then(function(){i._swapAndDie(r),r.isReady=!0});case n.CubePrefiltered:return void((i=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,function(e){e&&e._swapAndDie(r),r.isReady=!0},null,this.format,this._extension))._sphericalPolynomial=this._sphericalPolynomial)}},e.prototype._swapAndDie=function(e){e._webGLTexture=this._webGLTexture,e._isRGBD=this._isRGBD,this._framebuffer&&(e._framebuffer=this._framebuffer),this._depthStencilBuffer&&(e._depthStencilBuffer=this._depthStencilBuffer),e._depthStencilTexture=this._depthStencilTexture,this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);var t,i=this._engine.getLoadedTexturesCache();-1!==(t=i.indexOf(this))&&i.splice(t,1),-1===(t=i.indexOf(e))&&i.push(e)},e.prototype.dispose=function(){this._webGLTexture&&(this._references--,0===this._references&&(this._engine._releaseTexture(this),this._webGLTexture=null))},e._UpdateRGBDAsync=function(e,t,i,n,r){throw s.a.WarnImport("environmentTextureTools")},e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return n}),i.d(t,"c",function(){return r}),i.d(t,"a",function(){return o});var n=1/2.2,r=2.2,o=.001},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var n=i(1),r=i(0),o=i(3),a=i(6),s=i(22),c=i(21),l=function(){function e(e,t){void 0===t&&(t=null),this.state="",this.metadata=null,this.reservedDataStore=null,this._doNotSerialize=!1,this._isDisposed=!1,this.animations=new Array,this._ranges={},this.onReady=null,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=r.a.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._sceneRootNodesIndex=-1,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new a.c,this._onDisposeObserver=null,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||s.a.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache()}return e.AddNodeConstructor=function(e,t){this._NodeConstructors[e]=t},e.Construct=function(e,t,i,n){var r=this._NodeConstructors[e];return r?r(t,i,n):null},Object.defineProperty(e.prototype,"doNotSerialize",{get:function(){return!!this._doNotSerialize||!!this._parentNode&&this._parentNode.doNotSerialize},set:function(e){this._doNotSerialize=e},enumerable:!1,configurable:!0}),e.prototype.isDisposed=function(){return this._isDisposed},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parentNode},set:function(e){if(this._parentNode!==e){var t=this._parentNode;if(this._parentNode&&void 0!==this._parentNode._children&&null!==this._parentNode._children){var i=this._parentNode._children.indexOf(this);-1!==i&&this._parentNode._children.splice(i,1),e||this._isDisposed||this._addToSceneRootNodes()}this._parentNode=e,this._parentNode&&(void 0!==this._parentNode._children&&null!==this._parentNode._children||(this._parentNode._children=new Array),this._parentNode._children.push(this),t||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}},enumerable:!1,configurable:!0}),e.prototype._addToSceneRootNodes=function(){-1===this._sceneRootNodesIndex&&(this._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))},e.prototype._removeFromSceneRootNodes=function(){if(-1!==this._sceneRootNodesIndex){var e=this._scene.rootNodes,t=e.length-1;e[this._sceneRootNodesIndex]=e[t],e[this._sceneRootNodesIndex]._sceneRootNodesIndex=this._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._sceneRootNodesIndex=-1}},Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"Node"},Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getEngine=function(){return this._scene.getEngine()},e.prototype.addBehavior=function(e,t){var i=this;return void 0===t&&(t=!1),-1!==this._behaviors.indexOf(e)||(e.init(),this._scene.isLoading&&!t?this._scene.onDataLoadedObservable.addOnce(function(){e.attach(i)}):e.attach(this),this._behaviors.push(e)),this},e.prototype.removeBehavior=function(e){var t=this._behaviors.indexOf(e);return-1===t||(this._behaviors[t].detach(),this._behaviors.splice(t,1)),this},Object.defineProperty(e.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),e.prototype.getBehaviorByName=function(e){for(var t=0,i=this._behaviors;t<i.length;t++){var n=i[t];if(n.name===e)return n}return null},e.prototype.getWorldMatrix=function(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix},e.prototype._getWorldMatrixDeterminant=function(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant},Object.defineProperty(e.prototype,"worldMatrixFromCache",{get:function(){return this._worldMatrix},enumerable:!1,configurable:!0}),e.prototype._initCache=function(){this._cache={},this._cache.parent=void 0},e.prototype.updateCache=function(e){!e&&this.isSynchronized()||(this._cache.parent=this.parent,this._updateCache())},e.prototype._getActionManagerForTrigger=function(e,t){return void 0===t&&(t=!0),this.parent?this.parent._getActionManagerForTrigger(e,!1):null},e.prototype._updateCache=function(e){},e.prototype._isSynchronized=function(){return!0},e.prototype._markSyncedWithParent=function(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)},e.prototype.isSynchronizedWithParent=function(){return!this._parentNode||this._parentUpdateId===this._parentNode._childUpdateId&&this._parentNode.isSynchronized()},e.prototype.isSynchronized=function(){return this._cache.parent!=this._parentNode?(this._cache.parent=this._parentNode,!1):!(this._parentNode&&!this.isSynchronizedWithParent())&&this._isSynchronized()},e.prototype.isReady=function(e){return void 0===e&&(e=!1),this._isReady},e.prototype.isEnabled=function(e){return void 0===e&&(e=!0),!1===e?this._isEnabled:!!this._isEnabled&&this._isParentEnabled},e.prototype._syncParentEnabledState=function(){this._isParentEnabled=!this._parentNode||this._parentNode.isEnabled(),this._children&&this._children.forEach(function(e){e._syncParentEnabledState()})},e.prototype.setEnabled=function(e){this._isEnabled=e,this._syncParentEnabledState()},e.prototype.isDescendantOf=function(e){return!!this.parent&&(this.parent===e||this.parent.isDescendantOf(e))},e.prototype._getDescendants=function(e,t,i){if(void 0===t&&(t=!1),this._children)for(var n=0;n<this._children.length;n++){var r=this._children[n];i&&!i(r)||e.push(r),t||r._getDescendants(e,!1,i)}},e.prototype.getDescendants=function(e,t){var i=new Array;return this._getDescendants(i,e,t),i},e.prototype.getChildMeshes=function(e,t){var i=[];return this._getDescendants(i,e,function(e){return(!t||t(e))&&void 0!==e.cullingStrategy}),i},e.prototype.getChildren=function(e,t){return void 0===t&&(t=!0),this.getDescendants(t,e)},e.prototype._setReady=function(e){e!==this._isReady&&(e?(this.onReady&&this.onReady(this),this._isReady=!0):this._isReady=!1)},e.prototype.getAnimationByName=function(e){for(var t=0;t<this.animations.length;t++){var i=this.animations[t];if(i.name===e)return i}return null},e.prototype.createAnimationRange=function(t,i,n){if(!this._ranges[t]){this._ranges[t]=e._AnimationRangeFactory(t,i,n);for(var r=0,o=this.animations.length;r<o;r++)this.animations[r]&&this.animations[r].createRange(t,i,n)}},e.prototype.deleteAnimationRange=function(e,t){void 0===t&&(t=!0);for(var i=0,n=this.animations.length;i<n;i++)this.animations[i]&&this.animations[i].deleteRange(e,t);this._ranges[e]=null},e.prototype.getAnimationRange=function(e){return this._ranges[e]||null},e.prototype.getAnimationRanges=function(){var e,t=[];for(e in this._ranges)t.push(this._ranges[e]);return t},e.prototype.beginAnimation=function(e,t,i,n){var r=this.getAnimationRange(e);return r?this._scene.beginAnimation(this,r.from,r.to,t,i,n):null},e.prototype.serializeAnimationRanges=function(){var e=[];for(var t in this._ranges){var i=this._ranges[t];if(i){var n={};n.name=t,n.from=i.from,n.to=i.to,e.push(n)}}return e},e.prototype.computeWorldMatrix=function(e){return this._worldMatrix||(this._worldMatrix=r.a.Identity()),this._worldMatrix},e.prototype.dispose=function(e,t){if(void 0===t&&(t=!1),this._isDisposed=!0,!e)for(var i=0,n=this.getDescendants(!0);i<n.length;i++)n[i].dispose(e,t);this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear();for(var r=0,o=this._behaviors;r<o.length;r++)o[r].detach();this._behaviors=[]},e.ParseAnimationRanges=function(e,t,i){if(t.ranges)for(var n=0;n<t.ranges.length;n++){var r=t.ranges[n];e.createAnimationRange(r.name,r.from,r.to)}},e.prototype.getHierarchyBoundingVectors=function(e,t){var i,n;if(void 0===e&&(e=!0),void 0===t&&(t=null),this.getScene().incrementRenderId(),this.computeWorldMatrix(!0),this.getBoundingInfo&&this.subMeshes){var o=this.getBoundingInfo();i=o.boundingBox.minimumWorld.clone(),n=o.boundingBox.maximumWorld.clone()}else i=new r.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new r.e(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(e)for(var a=0,s=this.getDescendants(!1);a<s.length;a++){var c=s[a];if(c.computeWorldMatrix(!0),(!t||t(c))&&c.getBoundingInfo&&0!==c.getTotalVertices()){var l=c.getBoundingInfo().boundingBox,u=l.minimumWorld,h=l.maximumWorld;r.e.CheckExtends(u,i,n),r.e.CheckExtends(h,i,n)}}return{min:i,max:n}},e._AnimationRangeFactory=function(e,t,i){throw c.a.WarnImport("AnimationRange")},e._NodeConstructors={},Object(n.c)([Object(o.c)()],e.prototype,"name",void 0),Object(n.c)([Object(o.c)()],e.prototype,"id",void 0),Object(n.c)([Object(o.c)()],e.prototype,"uniqueId",void 0),Object(n.c)([Object(o.c)()],e.prototype,"state",void 0),Object(n.c)([Object(o.c)()],e.prototype,"metadata",void 0),e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return A}),i.d(t,"a",function(){return P});var n=i(1),r=i(3),o=i(33),a=i(20),s=i(0),c=i(9),l=i(4),u=i(105),h=i(42),d=i(25),f=i(76),p=i(87),_=i(15),m=i(10),g=i(11),v=i(19),b=i(5);b.a.IncludesShadersStore.defaultFragmentDeclaration="uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)\nuniform mat4 reflectionMatrix;\n#endif\n#ifndef REFLECTIONMAP_SKYBOX\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif";b.a.IncludesShadersStore.defaultUboDeclaration="layout(std140,column_major) uniform;\nuniform Material\n{\nvec4 diffuseLeftColor;\nvec4 diffuseRightColor;\nvec4 opacityParts;\nvec4 reflectionLeftColor;\nvec4 reflectionRightColor;\nvec4 refractionLeftColor;\nvec4 refractionRightColor;\nvec4 emissiveLeftColor;\nvec4 emissiveRightColor;\nvec2 vDiffuseInfos;\nvec2 vAmbientInfos;\nvec2 vOpacityInfos;\nvec2 vReflectionInfos;\nvec3 vReflectionPosition;\nvec3 vReflectionSize;\nvec2 vEmissiveInfos;\nvec2 vLightmapInfos;\nvec2 vSpecularInfos;\nvec3 vBumpInfos;\nmat4 diffuseMatrix;\nmat4 ambientMatrix;\nmat4 opacityMatrix;\nmat4 reflectionMatrix;\nmat4 emissiveMatrix;\nmat4 lightmapMatrix;\nmat4 specularMatrix;\nmat4 bumpMatrix;\nvec2 vTangentSpaceParams;\nfloat pointSize;\nmat4 refractionMatrix;\nvec4 vRefractionInfos;\nvec4 vSpecularColor;\nvec3 vEmissiveColor;\nfloat visibility;\nvec4 vDiffuseColor;\nvec4 vDetailInfos;\nmat4 detailMatrix;\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};\n",i(160),i(59),i(106),i(107),i(154),i(130),i(161),i(131),i(108),i(109),i(132),i(133),i(115),i(116),i(125),i(110),i(134),i(162),i(135),i(155),i(136);b.a.ShadersStore.defaultPixelShader="#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#define RECIPROCAL_PI2 0.15915494\nuniform vec3 vEyePosition;\nuniform vec3 vAmbientColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\n#if SPECULARDIRECTUV == 1\n#define vSpecularUV vMainUV1\n#elif SPECULARDIRECTUV == 2\n#define vSpecularUV vMainUV2\n#else\nvarying vec2 vSpecularUV;\n#endif\nuniform sampler2D specularSampler;\n#endif\n#ifdef ALPHATEST\nuniform float alphaCutOff;\n#endif\n\n#include<fresnelFunction>\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<alphaCutOff)\ndiscard;\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef DETAIL\nbaseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\n\nvec3 baseAmbientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\nspecularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#else\nfloat glossiness=0.;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\nfloat shadow=1.;\n#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n\nvec4 refractionColor=vec4(0.,0.,0.,1.);\n#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nif (dot(refractionVector,viewDirectionW)<1.0) {\nrefractionColor=textureCube(refractionCubeSampler,refractionVector);\n}\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\nrefractionColor=texture2D(refraction2DSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor.rgb=fromRGBD(refractionColor);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor.rgb=toGammaSpace(refractionColor.rgb);\n#endif\nrefractionColor.rgb*=vRefractionInfos.x;\n#endif\n\nvec4 reflectionColor=vec4(0.,0.,0.,1.);\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);\n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;\nreflectionColor=texture2D(reflection2DSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor.rgb=toGammaSpace(reflectionColor.rgb);\n#endif\nreflectionColor.rgb*=vReflectionInfos.x;\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\nrefractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\nalpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\nalpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<alphaCutOff)\ndiscard;\n#endif\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n\nvec3 emissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\nemissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\ndiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor.rgb;\n#else\ncolor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor.rgb=max(color.rgb,0.);\n#include<logDepthFragment>\n#include<fogFragment>\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);\ncolor=applyImageProcessing(color);\n#endif\n#endif\ncolor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\ngl_FragData[0]=color;\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef PREPASS_VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef PREPASS_IRRADIANCE\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[PREPASS_DEPTHNORMAL_INDEX]=vec4(vViewPos.z,(view*vec4(normalW,0.0)).rgb);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULAR)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=specularMapColor;\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=color;\n#endif\n}\n";b.a.IncludesShadersStore.defaultVertexDeclaration="\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\nuniform mat4 specularMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef REFLECTION\nuniform mat4 reflectionMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n",i(78),i(79),i(163),i(164),i(117),i(137),i(93),i(94),i(100),i(80),i(81),i(165),i(156),i(111),i(157),i(138),b.a.IncludesShadersStore.pointCloudVertex="#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif",i(158);b.a.ShadersStore.defaultVertexShader="#include<__decl__defaultVertex>\n\n#define CUSTOM_VERTEX_BEGIN\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nvarying vec2 vDetailUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nvarying vec2 vSpecularUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));\nvNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\nvPositionW=vec3(worldPos);\n#include<prePassVertex>\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nif (vDetailInfos.x == 0.)\n{\nvDetailUV=vec2(detailMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDetailUV=vec2(detailMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nif (vSpecularInfos.x == 0.)\n{\nvSpecularUV=vec2(specularMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n#include<pointCloudVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";var y=i(2),T=i(67),E=i(92),S={effect:null,subMesh:null},A=function(e){function t(){var t=e.call(this)||this;return t.MAINUV1=!1,t.MAINUV2=!1,t.DIFFUSE=!1,t.DIFFUSEDIRECTUV=0,t.DETAIL=!1,t.DETAILDIRECTUV=0,t.DETAIL_NORMALBLENDMETHOD=0,t.AMBIENT=!1,t.AMBIENTDIRECTUV=0,t.OPACITY=!1,t.OPACITYDIRECTUV=0,t.OPACITYRGB=!1,t.REFLECTION=!1,t.EMISSIVE=!1,t.EMISSIVEDIRECTUV=0,t.SPECULAR=!1,t.SPECULARDIRECTUV=0,t.BUMP=!1,t.BUMPDIRECTUV=0,t.PARALLAX=!1,t.PARALLAXOCCLUSION=!1,t.SPECULAROVERALPHA=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.ALPHAFROMDIFFUSE=!1,t.POINTSIZE=!1,t.FOG=!1,t.SPECULARTERM=!1,t.DIFFUSEFRESNEL=!1,t.OPACITYFRESNEL=!1,t.REFLECTIONFRESNEL=!1,t.REFRACTIONFRESNEL=!1,t.EMISSIVEFRESNEL=!1,t.FRESNEL=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.BONETEXTURE=!1,t.BONES_VELOCITY_ENABLED=!1,t.INSTANCES=!1,t.THIN_INSTANCES=!1,t.GLOSSINESS=!1,t.ROUGHNESS=!1,t.EMISSIVEASILLUMINATION=!1,t.LINKEMISSIVEWITHDIFFUSE=!1,t.REFLECTIONFRESNELFROMSPECULAR=!1,t.LIGHTMAP=!1,t.LIGHTMAPDIRECTUV=0,t.OBJECTSPACE_NORMALMAP=!1,t.USELIGHTMAPASSHADOWMAP=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.LOGARITHMICDEPTH=!1,t.REFRACTION=!1,t.REFRACTIONMAP_3D=!1,t.REFLECTIONOVERALPHA=!1,t.TWOSIDEDLIGHTING=!1,t.SHADOWFLOAT=!1,t.MORPHTARGETS=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_UV=!1,t.NUM_MORPH_INFLUENCERS=0,t.NONUNIFORMSCALING=!1,t.PREMULTIPLYALPHA=!1,t.ALPHATEST_AFTERALLALPHACOMPUTATIONS=!1,t.ALPHABLEND=!0,t.PREPASS=!1,t.PREPASS_IRRADIANCE=!1,t.PREPASS_IRRADIANCE_INDEX=-1,t.PREPASS_ALBEDO=!1,t.PREPASS_ALBEDO_INDEX=-1,t.PREPASS_DEPTHNORMAL=!1,t.PREPASS_DEPTHNORMAL_INDEX=-1,t.PREPASS_POSITION=!1,t.PREPASS_POSITION_INDEX=-1,t.PREPASS_VELOCITY=!1,t.PREPASS_VELOCITY_INDEX=-1,t.PREPASS_REFLECTIVITY=!1,t.PREPASS_REFLECTIVITY_INDEX=-1,t.SCENE_MRT_COUNT=0,t.RGBDLIGHTMAP=!1,t.RGBDREFLECTION=!1,t.RGBDREFRACTION=!1,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.MULTIVIEW=!1,t.IS_REFLECTION_LINEAR=!1,t.IS_REFRACTION_LINEAR=!1,t.EXPOSURE=!1,t.rebuild(),t}return Object(n.d)(t,e),t.prototype.setReflectionMode=function(e){for(var t=0,i=["REFLECTIONMAP_CUBIC","REFLECTIONMAP_EXPLICIT","REFLECTIONMAP_PLANAR","REFLECTIONMAP_PROJECTION","REFLECTIONMAP_PROJECTION","REFLECTIONMAP_SKYBOX","REFLECTIONMAP_SPHERICAL","REFLECTIONMAP_EQUIRECTANGULAR","REFLECTIONMAP_EQUIRECTANGULAR_FIXED","REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"];t<i.length;t++){var n=i[t];this[n]=n===e}},t}(f.a),P=function(e){function t(i,n){var r=e.call(this,i,n)||this;return r._diffuseTexture=null,r._ambientTexture=null,r._opacityTexture=null,r._reflectionTexture=null,r._emissiveTexture=null,r._specularTexture=null,r._bumpTexture=null,r._lightmapTexture=null,r._refractionTexture=null,r.ambientColor=new c.a(0,0,0),r.diffuseColor=new c.a(1,1,1),r.specularColor=new c.a(1,1,1),r.emissiveColor=new c.a(0,0,0),r.specularPower=64,r._useAlphaFromDiffuseTexture=!1,r._useEmissiveAsIllumination=!1,r._linkEmissiveWithDiffuse=!1,r._useSpecularOverAlpha=!1,r._useReflectionOverAlpha=!1,r._disableLighting=!1,r._useObjectSpaceNormalMap=!1,r._useParallax=!1,r._useParallaxOcclusion=!1,r.parallaxScaleBias=.05,r._roughness=0,r.indexOfRefraction=.98,r.invertRefractionY=!0,r.alphaCutOff=.4,r._useLightmapAsShadowmap=!1,r._useReflectionFresnelFromSpecular=!1,r._useGlossinessFromSpecularMapAlpha=!1,r._maxSimultaneousLights=4,r._invertNormalMapX=!1,r._invertNormalMapY=!1,r._twoSidedLighting=!1,r.detailMap=new E.a(r._markAllSubMeshesAsTexturesDirty.bind(r)),r._renderTargets=new o.a(16),r._worldViewProjectionMatrix=s.a.Zero(),r._globalAmbientColor=new c.a(0,0,0),r._rebuildInParallel=!1,r._attachImageProcessingConfiguration(null),r.prePassConfiguration=new u.a,r.getRenderTargetTextures=function(){return r._renderTargets.reset(),t.ReflectionTextureEnabled&&r._reflectionTexture&&r._reflectionTexture.isRenderTarget&&r._renderTargets.push(r._reflectionTexture),t.RefractionTextureEnabled&&r._refractionTexture&&r._refractionTexture.isRenderTarget&&r._renderTargets.push(r._refractionTexture),r._renderTargets},r}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e){var t=this;e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(function(){t._markAllSubMeshesAsImageProcessingDirty()})))},Object.defineProperty(t.prototype,"cameraColorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this._imageProcessingConfiguration.colorGradingTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this._imageProcessingConfiguration.colorCurves},set:function(e){this._imageProcessingConfiguration.colorCurves=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canRenderToMRT",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!!(t.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget)||!!(t.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"StandardMaterial"},Object.defineProperty(t.prototype,"useLogarithmicDepth",{get:function(){return this._useLogarithmicDepth},set:function(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported,this._markAllSubMeshesAsMiscDirty()},enumerable:!1,configurable:!0}),t.prototype.needAlphaBlending=function(){return!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled)},t.prototype.needAlphaTesting=function(){return!!this._forceAlphaTest||this._hasAlphaChannel()&&(null==this._transparencyMode||this._transparencyMode===d.a.MATERIAL_ALPHATEST)},t.prototype._shouldUseAlphaFromDiffuseTexture=function(){return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==d.a.MATERIAL_OPAQUE},t.prototype._hasAlphaChannel=function(){return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha||null!=this._opacityTexture},t.prototype.getAlphaTestTexture=function(){return this._diffuseTexture},t.prototype.isReadyForSubMesh=function(e,i,n){if(void 0===n&&(n=!1),i.effect&&this.isFrozen&&i.effect._wasPreviouslyReady)return!0;i._materialDefines||(i._materialDefines=new A);var r=this.getScene(),o=i._materialDefines;if(this._isReadyForSubMesh(i))return!0;var a=r.getEngine();if(o._needNormals=_.a.PrepareDefinesForLights(r,e,o,!0,this._maxSimultaneousLights,this._disableLighting),_.a.PrepareDefinesForMultiview(r,o),_.a.PrepareDefinesForPrePass(r,o,this.canRenderToMRT),o._areTexturesDirty){if(o._needUVs=!1,o.MAINUV1=!1,o.MAINUV2=!1,r.texturesEnabled){if(this._diffuseTexture&&t.DiffuseTextureEnabled){if(!this._diffuseTexture.isReadyOrNotBlocking())return!1;_.a.PrepareDefinesForMergedUV(this._diffuseTexture,o,"DIFFUSE")}else o.DIFFUSE=!1;if(this._ambientTexture&&t.AmbientTextureEnabled){if(!this._ambientTexture.isReadyOrNotBlocking())return!1;_.a.PrepareDefinesForMergedUV(this._ambientTexture,o,"AMBIENT")}else o.AMBIENT=!1;if(this._opacityTexture&&t.OpacityTextureEnabled){if(!this._opacityTexture.isReadyOrNotBlocking())return!1;_.a.PrepareDefinesForMergedUV(this._opacityTexture,o,"OPACITY"),o.OPACITYRGB=this._opacityTexture.getAlphaFromRGB}else o.OPACITY=!1;if(this._reflectionTexture&&t.ReflectionTextureEnabled){if(!this._reflectionTexture.isReadyOrNotBlocking())return!1;switch(o._needNormals=!0,o.REFLECTION=!0,o.ROUGHNESS=this._roughness>0,o.REFLECTIONOVERALPHA=this._useReflectionOverAlpha,o.INVERTCUBICMAP=this._reflectionTexture.coordinatesMode===m.a.INVCUBIC_MODE,o.REFLECTIONMAP_3D=this._reflectionTexture.isCube,o.RGBDREFLECTION=this._reflectionTexture.isRGBD,this._reflectionTexture.coordinatesMode){case m.a.EXPLICIT_MODE:o.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case m.a.PLANAR_MODE:o.setReflectionMode("REFLECTIONMAP_PLANAR");break;case m.a.PROJECTION_MODE:o.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case m.a.SKYBOX_MODE:o.setReflectionMode("REFLECTIONMAP_SKYBOX");break;case m.a.SPHERICAL_MODE:o.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case m.a.EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case m.a.FIXED_EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case m.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case m.a.CUBIC_MODE:case m.a.INVCUBIC_MODE:default:o.setReflectionMode("REFLECTIONMAP_CUBIC")}o.USE_LOCAL_REFLECTIONMAP_CUBIC=!!this._reflectionTexture.boundingBoxSize}else o.REFLECTION=!1;if(this._emissiveTexture&&t.EmissiveTextureEnabled){if(!this._emissiveTexture.isReadyOrNotBlocking())return!1;_.a.PrepareDefinesForMergedUV(this._emissiveTexture,o,"EMISSIVE")}else o.EMISSIVE=!1;if(this._lightmapTexture&&t.LightmapTextureEnabled){if(!this._lightmapTexture.isReadyOrNotBlocking())return!1;_.a.PrepareDefinesForMergedUV(this._lightmapTexture,o,"LIGHTMAP"),o.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,o.RGBDLIGHTMAP=this._lightmapTexture.isRGBD}else o.LIGHTMAP=!1;if(this._specularTexture&&t.SpecularTextureEnabled){if(!this._specularTexture.isReadyOrNotBlocking())return!1;_.a.PrepareDefinesForMergedUV(this._specularTexture,o,"SPECULAR"),o.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha}else o.SPECULAR=!1;if(r.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&t.BumpTextureEnabled){if(!this._bumpTexture.isReady())return!1;_.a.PrepareDefinesForMergedUV(this._bumpTexture,o,"BUMP"),o.PARALLAX=this._useParallax,o.PARALLAXOCCLUSION=this._useParallaxOcclusion,o.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else o.BUMP=!1;if(this._refractionTexture&&t.RefractionTextureEnabled){if(!this._refractionTexture.isReadyOrNotBlocking())return!1;o._needUVs=!0,o.REFRACTION=!0,o.REFRACTIONMAP_3D=this._refractionTexture.isCube,o.RGBDREFRACTION=this._refractionTexture.isRGBD}else o.REFRACTION=!1;o.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else o.DIFFUSE=!1,o.AMBIENT=!1,o.OPACITY=!1,o.REFLECTION=!1,o.EMISSIVE=!1,o.LIGHTMAP=!1,o.BUMP=!1,o.REFRACTION=!1;o.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),o.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,o.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,o.SPECULAROVERALPHA=this._useSpecularOverAlpha,o.PREMULTIPLYALPHA=this.alphaMode===y.a.ALPHA_PREMULTIPLIED||this.alphaMode===y.a.ALPHA_PREMULTIPLIED_PORTERDUFF,o.ALPHATEST_AFTERALLALPHACOMPUTATIONS=null!==this.transparencyMode,o.ALPHABLEND=null===this.transparencyMode||this.needAlphaBlendingForMesh(e)}if(!this.detailMap.isReadyForSubMesh(o,r))return!1;if(o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o),o.IS_REFLECTION_LINEAR=null!=this.reflectionTexture&&!this.reflectionTexture.gammaSpace,o.IS_REFRACTION_LINEAR=null!=this.refractionTexture&&!this.refractionTexture.gammaSpace}if(o._areFresnelDirty&&(t.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(o.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,o.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,o.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,o.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,o.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,o.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,o._needNormals=!0,o.FRESNEL=!0):o.FRESNEL=!1),_.a.PrepareDefinesForMisc(e,r,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,o),_.a.PrepareDefinesForAttributes(e,o,!0,!0,!0),_.a.PrepareDefinesForFrameBoundValues(r,a,o,n,null,i.getRenderingMesh().hasThinInstances),this.detailMap.prepareDefines(o,r),o.isDirty){var s=o._areLightsDisposed;o.markAsProcessed();var c=new T.a;o.REFLECTION&&c.addFallback(0,"REFLECTION"),o.SPECULAR&&c.addFallback(0,"SPECULAR"),o.BUMP&&c.addFallback(0,"BUMP"),o.PARALLAX&&c.addFallback(1,"PARALLAX"),o.PARALLAXOCCLUSION&&c.addFallback(0,"PARALLAXOCCLUSION"),o.SPECULAROVERALPHA&&c.addFallback(0,"SPECULAROVERALPHA"),o.FOG&&c.addFallback(1,"FOG"),o.POINTSIZE&&c.addFallback(0,"POINTSIZE"),o.LOGARITHMICDEPTH&&c.addFallback(0,"LOGARITHMICDEPTH"),_.a.HandleFallbacksForShadows(o,c,this._maxSimultaneousLights),o.SPECULARTERM&&c.addFallback(0,"SPECULARTERM"),o.DIFFUSEFRESNEL&&c.addFallback(1,"DIFFUSEFRESNEL"),o.OPACITYFRESNEL&&c.addFallback(2,"OPACITYFRESNEL"),o.REFLECTIONFRESNEL&&c.addFallback(3,"REFLECTIONFRESNEL"),o.EMISSIVEFRESNEL&&c.addFallback(4,"EMISSIVEFRESNEL"),o.FRESNEL&&c.addFallback(4,"FRESNEL"),o.MULTIVIEW&&c.addFallback(0,"MULTIVIEW");var d=[l.b.PositionKind];o.NORMAL&&d.push(l.b.NormalKind),o.UV1&&d.push(l.b.UVKind),o.UV2&&d.push(l.b.UV2Kind),o.VERTEXCOLOR&&d.push(l.b.ColorKind),_.a.PrepareAttributesForBones(d,e,o,c),_.a.PrepareAttributesForInstances(d,o),_.a.PrepareAttributesForMorphTargets(d,e,o);var f="default",p=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","diffuseMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vReflectionPosition","vReflectionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureWidth"],g=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler"],v=["Material","Scene"];E.a.AddUniforms(p),E.a.AddSamplers(g),u.a.AddUniforms(p),u.a.AddSamplers(p),h.a&&(h.a.PrepareUniforms(p,o),h.a.PrepareSamplers(g,o)),_.a.PrepareUniformsAndSamplersList({uniformsNames:p,uniformBuffersNames:v,samplers:g,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});var b={};this.customShaderNameResolve&&(f=this.customShaderNameResolve(f,p,v,g,o,d,b));var P=o.toString(),C=i.effect,R=r.getEngine().createEffect(f,{attributes:d,uniformsNames:p,uniformBuffersNames:v,samplers:g,defines:P,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:o.NUM_MORPH_INFLUENCERS},processFinalCode:b.processFinalCode,multiTarget:o.PREPASS},a);if(R)if(this._onEffectCreatedObservable&&(S.effect=R,S.subMesh=i,this._onEffectCreatedObservable.notifyObservers(S)),this.allowShaderHotSwapping&&C&&!R.isReady()){if(R=C,this._rebuildInParallel=!0,o.markAsUnprocessed(),s)return o._areLightsDisposed=!0,!1}else this._rebuildInParallel=!1,r.resetCachedMaterial(),i.setEffect(R,o),this.buildUniformLayout()}return!(!i.effect||!i.effect.isReady()||(o._renderId=r.getRenderId(),i.effect._wasPreviouslyReady=!0,0))},t.prototype.buildUniformLayout=function(){var e=this._uniformBuffer;e.addUniform("diffuseLeftColor",4),e.addUniform("diffuseRightColor",4),e.addUniform("opacityParts",4),e.addUniform("reflectionLeftColor",4),e.addUniform("reflectionRightColor",4),e.addUniform("refractionLeftColor",4),e.addUniform("refractionRightColor",4),e.addUniform("emissiveLeftColor",4),e.addUniform("emissiveRightColor",4),e.addUniform("vDiffuseInfos",2),e.addUniform("vAmbientInfos",2),e.addUniform("vOpacityInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vSpecularInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("diffuseMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("reflectionMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("specularMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("pointSize",1),e.addUniform("refractionMatrix",16),e.addUniform("vRefractionInfos",4),e.addUniform("vSpecularColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("visibility",1),e.addUniform("vDiffuseColor",4),E.a.PrepareUniformBuffer(e),e.create()},t.prototype.unbind=function(){if(this._activeEffect){var t=!1;this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&(this._activeEffect.setTexture("reflection2DSampler",null),t=!0),this._refractionTexture&&this._refractionTexture.isRenderTarget&&(this._activeEffect.setTexture("refraction2DSampler",null),t=!0),t&&this._markAllSubMeshesAsTexturesDirty()}e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,i,n){var r=this.getScene(),o=n._materialDefines;if(o){var s=n.effect;if(s){this._activeEffect=s,o.INSTANCES&&!o.THIN_INSTANCES||this.bindOnlyWorldMatrix(e),this.prePassConfiguration.bindForSubMesh(this._activeEffect,r,i,e,this.isFrozen),o.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var l=this._mustRebind(r,s,i.visibility);_.a.BindBonesParameters(i,s);var u=this._uniformBuffer;if(l){if(u.bindToEffect(s,"Material"),this.bindViewProjection(s),!u.useUbo||!this.isFrozen||!u.isSync){if(t.FresnelEnabled&&o.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(u.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),u.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&u.updateColor4("opacityParts",new c.a(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(u.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),u.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(u.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),u.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(u.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),u.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),r.texturesEnabled){if(this._diffuseTexture&&t.DiffuseTextureEnabled&&(u.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),_.a.BindTextureMatrix(this._diffuseTexture,u,"diffuse")),this._ambientTexture&&t.AmbientTextureEnabled&&(u.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),_.a.BindTextureMatrix(this._ambientTexture,u,"ambient")),this._opacityTexture&&t.OpacityTextureEnabled&&(u.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),_.a.BindTextureMatrix(this._opacityTexture,u,"opacity")),this._hasAlphaChannel()&&s.setFloat("alphaCutOff",this.alphaCutOff),this._reflectionTexture&&t.ReflectionTextureEnabled&&(u.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),u.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){var h=this._reflectionTexture;u.updateVector3("vReflectionPosition",h.boundingBoxPosition),u.updateVector3("vReflectionSize",h.boundingBoxSize)}if(this._emissiveTexture&&t.EmissiveTextureEnabled&&(u.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),_.a.BindTextureMatrix(this._emissiveTexture,u,"emissive")),this._lightmapTexture&&t.LightmapTextureEnabled&&(u.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),_.a.BindTextureMatrix(this._lightmapTexture,u,"lightmap")),this._specularTexture&&t.SpecularTextureEnabled&&(u.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),_.a.BindTextureMatrix(this._specularTexture,u,"specular")),this._bumpTexture&&r.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&(u.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),_.a.BindTextureMatrix(this._bumpTexture,u,"bump"),r._mirroredCameraPosition?u.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):u.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&t.RefractionTextureEnabled){var d=1;this._refractionTexture.isCube||(u.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(d=this._refractionTexture.depth)),u.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,d,this.invertRefractionY?-1:1)}}this.pointsCloud&&u.updateFloat("pointSize",this.pointSize),o.SPECULARTERM&&u.updateColor4("vSpecularColor",this.specularColor,this.specularPower),u.updateColor3("vEmissiveColor",t.EmissiveTextureEnabled?this.emissiveColor:c.a.BlackReadOnly),u.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha)}u.updateFloat("visibility",i.visibility),r.texturesEnabled&&(this._diffuseTexture&&t.DiffuseTextureEnabled&&s.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&t.AmbientTextureEnabled&&s.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&t.OpacityTextureEnabled&&s.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?s.setTexture("reflectionCubeSampler",this._reflectionTexture):s.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&t.EmissiveTextureEnabled&&s.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&t.LightmapTextureEnabled&&s.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&t.SpecularTextureEnabled&&s.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&r.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&s.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&t.RefractionTextureEnabled)&&(d=1,this._refractionTexture.isCube?s.setTexture("refractionCubeSampler",this._refractionTexture):s.setTexture("refraction2DSampler",this._refractionTexture)),this.detailMap.bindForSubMesh(u,r,this.isFrozen),_.a.BindClipPlane(s,r),r.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),_.a.BindEyePosition(s,r),s.setColor3("vAmbientColor",this._globalAmbientColor)}!l&&this.isFrozen||(r.lightsEnabled&&!this._disableLighting&&_.a.BindLights(r,i,s,o,this._maxSimultaneousLights,this._rebuildInParallel),(r.fogEnabled&&i.applyFog&&r.fogMode!==a.a.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture)&&this.bindView(s),_.a.BindFogParameters(r,i,s),o.NUM_MORPH_INFLUENCERS&&_.a.BindMorphTargetParameters(i,s),this.useLogarithmicDepth&&_.a.BindLogDepth(o,s,r),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),u.update(),this._afterBind(i,this._activeEffect)}}},t.prototype.getAnimatables=function(){var e=[];return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&e.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),this.detailMap.getAnimatables(e),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&t.push(this._diffuseTexture),this._ambientTexture&&t.push(this._ambientTexture),this._opacityTexture&&t.push(this._opacityTexture),this._reflectionTexture&&t.push(this._reflectionTexture),this._emissiveTexture&&t.push(this._emissiveTexture),this._specularTexture&&t.push(this._specularTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this._refractionTexture&&t.push(this._refractionTexture),this.detailMap.getActiveTextures(t),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._diffuseTexture===t||this._ambientTexture===t||this._opacityTexture===t||this._reflectionTexture===t||this._emissiveTexture===t||this._specularTexture===t||this._bumpTexture===t||this._lightmapTexture===t||this._refractionTexture===t||this.detailMap.hasTexture(t)},t.prototype.dispose=function(t,i){var n,r,o,a,s,c,l,u,h;i&&(null===(n=this._diffuseTexture)||void 0===n||n.dispose(),null===(r=this._ambientTexture)||void 0===r||r.dispose(),null===(o=this._opacityTexture)||void 0===o||o.dispose(),null===(a=this._reflectionTexture)||void 0===a||a.dispose(),null===(s=this._emissiveTexture)||void 0===s||s.dispose(),null===(c=this._specularTexture)||void 0===c||c.dispose(),null===(l=this._bumpTexture)||void 0===l||l.dispose(),null===(u=this._lightmapTexture)||void 0===u||u.dispose(),null===(h=this._refractionTexture)||void 0===h||h.dispose()),this.detailMap.dispose(i),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t,i)},t.prototype.clone=function(e){var i=this,n=r.a.Clone(function(){return new t(e,i.getScene())},this);return n.name=e,n.id=e,n},t.prototype.serialize=function(){return r.a.Serialize(this)},t.Parse=function(e,i,n){return r.a.Parse(function(){return new t(e.name,i)},e,i,n)},Object.defineProperty(t,"DiffuseTextureEnabled",{get:function(){return v.a.DiffuseTextureEnabled},set:function(e){v.a.DiffuseTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"DetailTextureEnabled",{get:function(){return v.a.DetailTextureEnabled},set:function(e){v.a.DetailTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"AmbientTextureEnabled",{get:function(){return v.a.AmbientTextureEnabled},set:function(e){v.a.AmbientTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"OpacityTextureEnabled",{get:function(){return v.a.OpacityTextureEnabled},set:function(e){v.a.OpacityTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ReflectionTextureEnabled",{get:function(){return v.a.ReflectionTextureEnabled},set:function(e){v.a.ReflectionTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EmissiveTextureEnabled",{get:function(){return v.a.EmissiveTextureEnabled},set:function(e){v.a.EmissiveTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SpecularTextureEnabled",{get:function(){return v.a.SpecularTextureEnabled},set:function(e){v.a.SpecularTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BumpTextureEnabled",{get:function(){return v.a.BumpTextureEnabled},set:function(e){v.a.BumpTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"LightmapTextureEnabled",{get:function(){return v.a.LightmapTextureEnabled},set:function(e){v.a.LightmapTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RefractionTextureEnabled",{get:function(){return v.a.RefractionTextureEnabled},set:function(e){v.a.RefractionTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ColorGradingTextureEnabled",{get:function(){return v.a.ColorGradingTextureEnabled},set:function(e){v.a.ColorGradingTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FresnelEnabled",{get:function(){return v.a.FresnelEnabled},set:function(e){v.a.FresnelEnabled=e},enumerable:!1,configurable:!0}),Object(n.c)([Object(r.m)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"diffuseTexture",void 0),Object(n.c)([Object(r.m)("ambientTexture")],t.prototype,"_ambientTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),Object(n.c)([Object(r.m)("opacityTexture")],t.prototype,"_opacityTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),Object(n.c)([Object(r.m)("reflectionTexture")],t.prototype,"_reflectionTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(n.c)([Object(r.m)("emissiveTexture")],t.prototype,"_emissiveTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(n.c)([Object(r.m)("specularTexture")],t.prototype,"_specularTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularTexture",void 0),Object(n.c)([Object(r.m)("bumpTexture")],t.prototype,"_bumpTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),Object(n.c)([Object(r.m)("lightmapTexture")],t.prototype,"_lightmapTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"lightmapTexture",void 0),Object(n.c)([Object(r.m)("refractionTexture")],t.prototype,"_refractionTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),Object(n.c)([Object(r.e)("ambient")],t.prototype,"ambientColor",void 0),Object(n.c)([Object(r.e)("diffuse")],t.prototype,"diffuseColor",void 0),Object(n.c)([Object(r.e)("specular")],t.prototype,"specularColor",void 0),Object(n.c)([Object(r.e)("emissive")],t.prototype,"emissiveColor",void 0),Object(n.c)([Object(r.c)()],t.prototype,"specularPower",void 0),Object(n.c)([Object(r.c)("useAlphaFromDiffuseTexture")],t.prototype,"_useAlphaFromDiffuseTexture",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"useAlphaFromDiffuseTexture",void 0),Object(n.c)([Object(r.c)("useEmissiveAsIllumination")],t.prototype,"_useEmissiveAsIllumination",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useEmissiveAsIllumination",void 0),Object(n.c)([Object(r.c)("linkEmissiveWithDiffuse")],t.prototype,"_linkEmissiveWithDiffuse",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkEmissiveWithDiffuse",void 0),Object(n.c)([Object(r.c)("useSpecularOverAlpha")],t.prototype,"_useSpecularOverAlpha",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),Object(n.c)([Object(r.c)("useReflectionOverAlpha")],t.prototype,"_useReflectionOverAlpha",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useReflectionOverAlpha",void 0),Object(n.c)([Object(r.c)("disableLighting")],t.prototype,"_disableLighting",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(n.c)([Object(r.c)("useObjectSpaceNormalMap")],t.prototype,"_useObjectSpaceNormalMap",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),Object(n.c)([Object(r.c)("useParallax")],t.prototype,"_useParallax",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),Object(n.c)([Object(r.c)("useParallaxOcclusion")],t.prototype,"_useParallaxOcclusion",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),Object(n.c)([Object(r.c)()],t.prototype,"parallaxScaleBias",void 0),Object(n.c)([Object(r.c)("roughness")],t.prototype,"_roughness",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(n.c)([Object(r.c)()],t.prototype,"indexOfRefraction",void 0),Object(n.c)([Object(r.c)()],t.prototype,"invertRefractionY",void 0),Object(n.c)([Object(r.c)()],t.prototype,"alphaCutOff",void 0),Object(n.c)([Object(r.c)("useLightmapAsShadowmap")],t.prototype,"_useLightmapAsShadowmap",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),Object(n.c)([Object(r.h)("diffuseFresnelParameters")],t.prototype,"_diffuseFresnelParameters",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"diffuseFresnelParameters",void 0),Object(n.c)([Object(r.h)("opacityFresnelParameters")],t.prototype,"_opacityFresnelParameters",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsFresnelAndMiscDirty")],t.prototype,"opacityFresnelParameters",void 0),Object(n.c)([Object(r.h)("reflectionFresnelParameters")],t.prototype,"_reflectionFresnelParameters",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"reflectionFresnelParameters",void 0),Object(n.c)([Object(r.h)("refractionFresnelParameters")],t.prototype,"_refractionFresnelParameters",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"refractionFresnelParameters",void 0),Object(n.c)([Object(r.h)("emissiveFresnelParameters")],t.prototype,"_emissiveFresnelParameters",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"emissiveFresnelParameters",void 0),Object(n.c)([Object(r.c)("useReflectionFresnelFromSpecular")],t.prototype,"_useReflectionFresnelFromSpecular",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"useReflectionFresnelFromSpecular",void 0),Object(n.c)([Object(r.c)("useGlossinessFromSpecularMapAlpha")],t.prototype,"_useGlossinessFromSpecularMapAlpha",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useGlossinessFromSpecularMapAlpha",void 0),Object(n.c)([Object(r.c)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.c)([Object(r.c)("invertNormalMapX")],t.prototype,"_invertNormalMapX",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(n.c)([Object(r.c)("invertNormalMapY")],t.prototype,"_invertNormalMapY",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(n.c)([Object(r.c)("twoSidedLighting")],t.prototype,"_twoSidedLighting",void 0),Object(n.c)([Object(r.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),Object(n.c)([Object(r.c)()],t.prototype,"useLogarithmicDepth",null),t}(p.a);g.a.RegisteredTypes["BABYLON.StandardMaterial"]=P,a.a.DefaultMaterialFactory=function(e){return new P("default material",e)}},function(e,t,i){"use strict";i.d(t,"a",function(){return S});var n=i(1),r=i(12),o=i(6),a=i(0),s=i(13),c=i(4),l=i(16),u=i(46),h=i(54),d=i(43),f=i(2),p=i(147),_=i(21),m=i(101),g=i(9),v=i(28),b=i(23),y=i(11),T=function(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=a.e.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1},E=function(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new T,this._visibility=1,this._skeleton=null,this._layerMask=268435455,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=null,this._currentLODIsUpToDate=!1},S=function(e){function t(i,n){void 0===n&&(n=null);var r=e.call(this,i,n,!1)||this;return r._internalAbstractMeshDataInfo=new E,r.cullingStrategy=t.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,r.onCollideObservable=new o.c,r.onCollisionPositionChangeObservable=new o.c,r.onMaterialChangedObservable=new o.c,r.definedFacingForward=!0,r._occlusionQuery=null,r._renderingGroup=null,r.alphaIndex=Number.MAX_VALUE,r.isVisible=!0,r.isPickable=!0,r.showSubMeshesBoundingBox=!1,r.isBlocker=!1,r.enablePointerMoveEvents=!1,r._renderingGroupId=0,r._material=null,r.outlineColor=g.a.Red(),r.outlineWidth=.02,r.overlayColor=g.a.Red(),r.overlayAlpha=.5,r.useOctreeForRenderingSelection=!0,r.useOctreeForPicking=!0,r.useOctreeForCollisions=!0,r.alwaysSelectAsActiveMesh=!1,r.doNotSyncBoundingInfo=!1,r.actionManager=null,r._meshCollisionData=new p.a,r.ellipsoid=new a.e(.5,1,.5),r.ellipsoidOffset=new a.e(0,0,0),r.edgesWidth=1,r.edgesColor=new g.b(1,0,0,1),r._edgesRenderer=null,r._masterMesh=null,r._boundingInfo=null,r._renderId=0,r._intersectionsInProgress=new Array,r._unIndexed=!1,r._lightSources=new Array,r._waitingData={lods:null,actions:null,freezeWorldMatrix:null},r._bonesTransformMatrices=null,r._transformMatrixTexture=null,r.onRebuildObservable=new o.c,r._onCollisionPositionChange=function(e,t,i){void 0===i&&(i=null),t.subtractToRef(r._meshCollisionData._oldPositionForCollisions,r._meshCollisionData._diffPositionForCollisions),r._meshCollisionData._diffPositionForCollisions.length()>s.a.CollisionsEpsilon&&r.position.addInPlace(r._meshCollisionData._diffPositionForCollisions),i&&r.onCollideObservable.notifyObservers(i),r.onCollisionPositionChangeObservable.notifyObservers(r.position)},r.getScene().addMesh(r),r._resyncLightSources(),r}return Object(n.d)(t,e),Object.defineProperty(t,"BILLBOARDMODE_NONE",{get:function(){return u.a.BILLBOARDMODE_NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_X",{get:function(){return u.a.BILLBOARDMODE_X},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Y",{get:function(){return u.a.BILLBOARDMODE_Y},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Z",{get:function(){return u.a.BILLBOARDMODE_Z},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_ALL",{get:function(){return u.a.BILLBOARDMODE_ALL},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_USE_POSITION",{get:function(){return u.a.BILLBOARDMODE_USE_POSITION},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"facetNb",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetNb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"partitioningSubdivisions",{get:function(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions},set:function(e){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"partitioningBBoxRatio",{get:function(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio},set:function(e){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mustDepthSortFacets",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort},set:function(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"facetDepthSortFrom",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom},set:function(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFacetDataEnabled",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled},enumerable:!1,configurable:!0}),t.prototype._updateNonUniformScalingState=function(t){return!!e.prototype._updateNonUniformScalingState.call(this,t)&&(this._markSubMeshesAsMiscDirty(),!0)},Object.defineProperty(t.prototype,"onCollide",{set:function(e){this._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._meshCollisionData._onCollideObserver),this._meshCollisionData._onCollideObserver=this.onCollideObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCollisionPositionChange",{set:function(e){this._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._meshCollisionData._onCollisionPositionChangeObserver),this._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._internalAbstractMeshDataInfo._visibility},set:function(e){this._internalAbstractMeshDataInfo._visibility!==e&&(this._internalAbstractMeshDataInfo._visibility=e,this._markSubMeshesAsMiscDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._renderingGroupId},set:function(e){this._renderingGroupId=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},set:function(e){this._material!==e&&(this._material&&this._material.meshMap&&(this._material.meshMap[this.uniqueId]=void 0),this._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&this._unBindEffect())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"receiveShadows",{get:function(){return this._internalAbstractMeshDataInfo._receiveShadows},set:function(e){this._internalAbstractMeshDataInfo._receiveShadows!==e&&(this._internalAbstractMeshDataInfo._receiveShadows=e,this._markSubMeshesAsLightDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasVertexAlpha",{get:function(){return this._internalAbstractMeshDataInfo._hasVertexAlpha},set:function(e){this._internalAbstractMeshDataInfo._hasVertexAlpha!==e&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useVertexColors",{get:function(){return this._internalAbstractMeshDataInfo._useVertexColors},set:function(e){this._internalAbstractMeshDataInfo._useVertexColors!==e&&(this._internalAbstractMeshDataInfo._useVertexColors=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"computeBonesUsingShaders",{get:function(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders},set:function(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"numBoneInfluencers",{get:function(){return this._internalAbstractMeshDataInfo._numBoneInfluencers},set:function(e){this._internalAbstractMeshDataInfo._numBoneInfluencers!==e&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applyFog",{get:function(){return this._internalAbstractMeshDataInfo._applyFog},set:function(e){this._internalAbstractMeshDataInfo._applyFog!==e&&(this._internalAbstractMeshDataInfo._applyFog=e,this._markSubMeshesAsMiscDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerMask",{get:function(){return this._internalAbstractMeshDataInfo._layerMask},set:function(e){e!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=e,this._resyncLightSources())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._meshCollisionData._collisionMask},set:function(e){this._meshCollisionData._collisionMask=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collisionResponse",{get:function(){return this._meshCollisionData._collisionResponse},set:function(e){this._meshCollisionData._collisionResponse=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collisionGroup",{get:function(){return this._meshCollisionData._collisionGroup},set:function(e){this._meshCollisionData._collisionGroup=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"surroundingMeshes",{get:function(){return this._meshCollisionData._surroundingMeshes},set:function(e){this._meshCollisionData._surroundingMeshes=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightSources",{get:function(){return this._lightSources},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_positions",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skeleton",{get:function(){return this._internalAbstractMeshDataInfo._skeleton},set:function(e){var t=this._internalAbstractMeshDataInfo._skeleton;t&&t.needInitialSkinMatrix&&t._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=e,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"AbstractMesh"},t.prototype.toString=function(e){var t="Name: "+this.name+", isInstance: "+("InstancedMesh"!==this.getClassName()?"YES":"NO");t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);var i=this._internalAbstractMeshDataInfo._skeleton;return i&&(t+=", skeleton: "+i.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),t},t.prototype._getEffectiveParent=function(){return this._masterMesh&&this.billboardMode!==u.a.BILLBOARDMODE_NONE?this._masterMesh:e.prototype._getEffectiveParent.call(this)},t.prototype._getActionManagerForTrigger=function(e,t){if(void 0===t&&(t=!0),this.actionManager&&(t||this.actionManager.isRecursive)){if(!e)return this.actionManager;if(this.actionManager.hasSpecificTrigger(e))return this.actionManager}return this.parent?this.parent._getActionManagerForTrigger(e,!1):null},t.prototype._rebuild=function(){if(this.onRebuildObservable.notifyObservers(this),this._occlusionQuery&&(this._occlusionQuery=null),this.subMeshes)for(var e=0,t=this.subMeshes;e<t.length;e++)t[e]._rebuild()},t.prototype._resyncLightSources=function(){this._lightSources.length=0;for(var e=0,t=this.getScene().lights;e<t.length;e++){var i=t[e];i.isEnabled()&&i.canAffectMesh(this)&&this._lightSources.push(i)}this._markSubMeshesAsLightDirty()},t.prototype._resyncLightSource=function(e){var t=e.isEnabled()&&e.canAffectMesh(this),i=this._lightSources.indexOf(e),n=!1;if(-1===i){if(!t)return;this._lightSources.push(e)}else{if(t)return;n=!0,this._lightSources.splice(i,1)}this._markSubMeshesAsLightDirty(n)},t.prototype._unBindEffect=function(){for(var e=0,t=this.subMeshes;e<t.length;e++)t[e].setEffect(null)},t.prototype._removeLightSource=function(e,t){var i=this._lightSources.indexOf(e);-1!==i&&(this._lightSources.splice(i,1),this._markSubMeshesAsLightDirty(t))},t.prototype._markSubMeshesAsDirty=function(e){if(this.subMeshes)for(var t=0,i=this.subMeshes;t<i.length;t++){var n=i[t];n._materialDefines&&e(n._materialDefines)}},t.prototype._markSubMeshesAsLightDirty=function(e){void 0===e&&(e=!1),this._markSubMeshesAsDirty(function(t){return t.markAsLightDirty(e)})},t.prototype._markSubMeshesAsAttributesDirty=function(){this._markSubMeshesAsDirty(function(e){return e.markAsAttributesDirty()})},t.prototype._markSubMeshesAsMiscDirty=function(){this._markSubMeshesAsDirty(function(e){return e.markAsMiscDirty()})},Object.defineProperty(t.prototype,"scaling",{get:function(){return this._scaling},set:function(e){this._scaling=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isBlocked",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.getLOD=function(e){return this},t.prototype.getTotalVertices=function(){return 0},t.prototype.getTotalIndices=function(){return 0},t.prototype.getIndices=function(){return null},t.prototype.getVerticesData=function(e){return null},t.prototype.setVerticesData=function(e,t,i,n){return this},t.prototype.updateVerticesData=function(e,t,i,n){return this},t.prototype.setIndices=function(e,t){return this},t.prototype.isVerticesDataPresent=function(e){return!1},t.prototype.getBoundingInfo=function(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfo||this._updateBoundingInfo(),this._boundingInfo)},t.prototype.normalizeToUnitCube=function(t,i,n){return void 0===t&&(t=!0),void 0===i&&(i=!1),e.prototype.normalizeToUnitCube.call(this,t,i,n)},t.prototype.setBoundingInfo=function(e){return this._boundingInfo=e,this},Object.defineProperty(t.prototype,"useBones",{get:function(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(c.b.MatricesIndicesKind)&&this.isVerticesDataPresent(c.b.MatricesWeightsKind)},enumerable:!1,configurable:!0}),t.prototype._preActivate=function(){},t.prototype._preActivateForIntermediateRendering=function(e){},t.prototype._activate=function(e,t){return this._renderId=e,!0},t.prototype._postActivate=function(){},t.prototype._freeze=function(){},t.prototype._unFreeze=function(){},t.prototype.getWorldMatrix=function(){return this._masterMesh&&this.billboardMode===u.a.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():e.prototype.getWorldMatrix.call(this)},t.prototype._getWorldMatrixDeterminant=function(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():e.prototype._getWorldMatrixDeterminant.call(this)},Object.defineProperty(t.prototype,"isAnInstance",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasInstances",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasThinInstances",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.movePOV=function(e,t,i){return this.position.addInPlace(this.calcMovePOV(e,t,i)),this},t.prototype.calcMovePOV=function(e,t,i){var n=new a.a;(this.rotationQuaternion?this.rotationQuaternion:a.b.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(n);var r=a.e.Zero(),o=this.definedFacingForward?-1:1;return a.e.TransformCoordinatesFromFloatsToRef(e*o,t,i*o,n,r),r},t.prototype.rotatePOV=function(e,t,i){return this.rotation.addInPlace(this.calcRotatePOV(e,t,i)),this},t.prototype.calcRotatePOV=function(e,t,i){var n=this.definedFacingForward?1:-1;return new a.e(e*n,t,i*n)},t.prototype.refreshBoundingInfo=function(e){return void 0===e&&(e=!1),this._boundingInfo&&this._boundingInfo.isLocked||this._refreshBoundingInfo(this._getPositionData(e),null),this},t.prototype._refreshBoundingInfo=function(e,t){if(e){var i=Object(m.a)(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new d.a(i.minimum,i.maximum)}if(this.subMeshes)for(var n=0;n<this.subMeshes.length;n++)this.subMeshes[n].refreshBoundingInfo(e);this._updateBoundingInfo()},t.prototype._getPositionData=function(e){var t=this.getVerticesData(c.b.PositionKind);if(t&&e&&this.skeleton){t=r.b.Slice(t),this._generatePointsArray();var i=this.getVerticesData(c.b.MatricesIndicesKind),n=this.getVerticesData(c.b.MatricesWeightsKind);if(n&&i){var o=this.numBoneInfluencers>4,s=o?this.getVerticesData(c.b.MatricesIndicesExtraKind):null,l=o?this.getVerticesData(c.b.MatricesWeightsExtraKind):null;this.skeleton.prepare();for(var u=this.skeleton.getTransformMatrices(this),h=a.c.Vector3[0],d=a.c.Matrix[0],f=a.c.Matrix[1],p=0,_=0;_<t.length;_+=3,p+=4){var m,g;for(d.reset(),m=0;m<4;m++)(g=n[p+m])>0&&(a.a.FromFloat32ArrayToRefScaled(u,Math.floor(16*i[p+m]),g,f),d.addToSelf(f));if(o)for(m=0;m<4;m++)(g=l[p+m])>0&&(a.a.FromFloat32ArrayToRefScaled(u,Math.floor(16*s[p+m]),g,f),d.addToSelf(f));a.e.TransformCoordinatesFromFloatsToRef(t[_],t[_+1],t[_+2],d,h),h.toArray(t,_),this._positions&&this._positions[_/3].copyFrom(h)}}}return t},t.prototype._updateBoundingInfo=function(){var e=this._effectiveMesh;return this._boundingInfo?this._boundingInfo.update(e.worldMatrixFromCache):this._boundingInfo=new d.a(this.absolutePosition,this.absolutePosition,e.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(e.worldMatrixFromCache),this},t.prototype._updateSubMeshesBoundingInfo=function(e){if(!this.subMeshes)return this;for(var t=this.subMeshes.length,i=0;i<t;i++){var n=this.subMeshes[i];(t>1||!n.IsGlobal)&&n.updateBoundingInfo(e)}return this},t.prototype._afterComputeWorldMatrix=function(){this.doNotSyncBoundingInfo||this._updateBoundingInfo()},Object.defineProperty(t.prototype,"_effectiveMesh",{get:function(){return this.skeleton&&this.skeleton.overrideMesh||this},enumerable:!1,configurable:!0}),t.prototype.isInFrustum=function(e){return null!==this._boundingInfo&&this._boundingInfo.isInFrustum(e,this.cullingStrategy)},t.prototype.isCompletelyInFrustum=function(e){return null!==this._boundingInfo&&this._boundingInfo.isCompletelyInFrustum(e)},t.prototype.intersectsMesh=function(e,t,i){if(void 0===t&&(t=!1),!this._boundingInfo||!e._boundingInfo)return!1;if(this._boundingInfo.intersects(e._boundingInfo,t))return!0;if(i)for(var n=0,r=this.getChildMeshes();n<r.length;n++)if(r[n].intersectsMesh(e,t,!0))return!0;return!1},t.prototype.intersectsPoint=function(e){return!!this._boundingInfo&&this._boundingInfo.intersectsPoint(e)},Object.defineProperty(t.prototype,"checkCollisions",{get:function(){return this._meshCollisionData._checkCollisions},set:function(e){this._meshCollisionData._checkCollisions=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collider",{get:function(){return this._meshCollisionData._collider},enumerable:!1,configurable:!0}),t.prototype.moveWithCollisions=function(e){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._meshCollisionData._oldPositionForCollisions);var t=this.getScene().collisionCoordinator;return this._meshCollisionData._collider||(this._meshCollisionData._collider=t.createCollider()),this._meshCollisionData._collider._radius=this.ellipsoid,t.getNewPosition(this._meshCollisionData._oldPositionForCollisions,e,this._meshCollisionData._collider,3,this,this._onCollisionPositionChange,this.uniqueId),this},t.prototype._collideForSubMesh=function(e,t,i){if(this._generatePointsArray(),!this._positions)return this;if(!e._lastColliderWorldVertices||!e._lastColliderTransformMatrix.equals(t)){e._lastColliderTransformMatrix=t.clone(),e._lastColliderWorldVertices=[],e._trianglePlanes=[];for(var n=e.verticesStart,r=e.verticesStart+e.verticesCount,o=n;o<r;o++)e._lastColliderWorldVertices.push(a.e.TransformCoordinates(this._positions[o],t))}return i._collide(e._trianglePlanes,e._lastColliderWorldVertices,this.getIndices(),e.indexStart,e.indexStart+e.indexCount,e.verticesStart,!!e.getMaterial(),this),this},t.prototype._processCollisionsForSubMeshes=function(e,t){for(var i=this._scene.getCollidingSubMeshCandidates(this,e),n=i.length,r=0;r<n;r++){var o=i.data[r];n>1&&!o._checkCollision(e)||this._collideForSubMesh(o,t,e)}return this},t.prototype._checkCollision=function(e){if(!this._boundingInfo||!this._boundingInfo._checkCollision(e))return this;var t=a.c.Matrix[0],i=a.c.Matrix[1];return a.a.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,i),this._processCollisionsForSubMeshes(e,i),this},t.prototype._generatePointsArray=function(){return!1},t.prototype.intersects=function(e,t,i,n,r,o){var s;void 0===n&&(n=!1),void 0===o&&(o=!1);var c=new h.a,l="InstancedLinesMesh"===this.getClassName()||"LinesMesh"===this.getClassName()?this.intersectionThreshold:0,u=this._boundingInfo;if(!this.subMeshes||!u)return c;if(!(o||e.intersectsSphere(u.boundingSphere,l)&&e.intersectsBox(u.boundingBox,l)))return c;if(n)return c.hit=!o,c.pickedMesh=o?null:this,c.distance=o?0:a.e.Distance(e.origin,u.boundingSphere.center),c.subMeshId=0,c;if(!this._generatePointsArray())return c;for(var d=null,p=this._scene.getIntersectingSubMeshCandidates(this,e),_=p.length,m=!1,g=0;g<_;g++){var v=(b=p.data[g]).getMaterial();if(v&&(null===(s=this.getIndices())||void 0===s?void 0:s.length)&&(v.fillMode==f.a.MATERIAL_TriangleStripDrawMode||v.fillMode==f.a.MATERIAL_TriangleFillMode||v.fillMode==f.a.MATERIAL_WireFrameFillMode||v.fillMode==f.a.MATERIAL_PointFillMode)){m=!0;break}}if(!m)return c.hit=!0,c.pickedMesh=this,c.distance=a.e.Distance(e.origin,u.boundingSphere.center),c.subMeshId=-1,c;for(g=0;g<_;g++){var b=p.data[g];if(!(_>1)||b.canIntersects(e)){var y=b.intersects(e,this._positions,this.getIndices(),t,i);if(y&&(t||!d||y.distance<d.distance)&&((d=y).subMeshId=g,t))break}}if(d){var T=null!=r?r:this.skeleton&&this.skeleton.overrideMesh?this.skeleton.overrideMesh.getWorldMatrix():this.getWorldMatrix(),E=a.c.Vector3[0],S=a.c.Vector3[1];a.e.TransformCoordinatesToRef(e.origin,T,E),e.direction.scaleToRef(d.distance,S);var A=a.e.TransformNormal(S,T).addInPlace(E);return c.hit=!0,c.distance=a.e.Distance(E,A),c.pickedPoint=A,c.pickedMesh=this,c.bu=d.bu||0,c.bv=d.bv||0,c.subMeshFaceId=d.faceId,c.faceId=d.faceId+p.data[d.subMeshId].indexStart/(-1!==this.getClassName().indexOf("LinesMesh")?2:3),c.subMeshId=d.subMeshId,c}return c},t.prototype.clone=function(e,t,i){return null},t.prototype.releaseSubMeshes=function(){if(this.subMeshes)for(;this.subMeshes.length;)this.subMeshes[0].dispose();else this.subMeshes=new Array;return this},t.prototype.dispose=function(t,i){var n,r=this;for(void 0===i&&(i=!1),this._scene.useMaterialMeshMap&&this._material&&this._material.meshMap&&(this._material.meshMap[this.uniqueId]=void 0),this.getScene().freeActiveMeshes(),this.getScene().freeRenderingGroups(),void 0!==this.actionManager&&null!==this.actionManager&&(this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),n=0;n<this._intersectionsInProgress.length;n++){var o=this._intersectionsInProgress[n],a=o._intersectionsInProgress.indexOf(this);o._intersectionsInProgress.splice(a,1)}this._intersectionsInProgress=[],this.getScene().lights.forEach(function(e){var t=e.includedOnlyMeshes.indexOf(r);-1!==t&&e.includedOnlyMeshes.splice(t,1),-1!==(t=e.excludedMeshes.indexOf(r))&&e.excludedMeshes.splice(t,1);var i=e.getShadowGenerator();if(i){var n=i.getShadowMap();n&&n.renderList&&-1!==(t=n.renderList.indexOf(r))&&n.renderList.splice(t,1)}}),"InstancedMesh"===this.getClassName()&&"InstancedLinesMesh"===this.getClassName()||this.releaseSubMeshes();var s=this.getScene().getEngine();if(this._occlusionQuery&&(this.isOcclusionQueryInProgress=!1,s.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),s.wipeCaches(),this.getScene().removeMesh(this),i&&this.material&&("MultiMaterial"===this.material.getClassName()?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!t)for(n=0;n<this.getScene().particleSystems.length;n++)this.getScene().particleSystems[n].emitter===this&&(this.getScene().particleSystems[n].dispose(),n--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled&&this.disableFacetData(),this.onAfterWorldMatrixUpdateObservable.clear(),this.onCollideObservable.clear(),this.onCollisionPositionChangeObservable.clear(),this.onRebuildObservable.clear(),e.prototype.dispose.call(this,t,i)},t.prototype.addChild=function(e){return e.setParent(this),this},t.prototype.removeChild=function(e){return e.setParent(null),this},t.prototype._initFacetData=function(){var e=this._internalAbstractMeshDataInfo._facetData;e.facetNormals||(e.facetNormals=new Array),e.facetPositions||(e.facetPositions=new Array),e.facetPartitioning||(e.facetPartitioning=new Array),e.facetNb=this.getIndices().length/3|0,e.partitioningSubdivisions=e.partitioningSubdivisions?e.partitioningSubdivisions:10,e.partitioningBBoxRatio=e.partitioningBBoxRatio?e.partitioningBBoxRatio:1.01;for(var t=0;t<e.facetNb;t++)e.facetNormals[t]=a.e.Zero(),e.facetPositions[t]=a.e.Zero();return e.facetDataEnabled=!0,this},t.prototype.updateFacetData=function(){var e=this._internalAbstractMeshDataInfo._facetData;e.facetDataEnabled||this._initFacetData();var t=this.getVerticesData(c.b.PositionKind),i=this.getIndices(),n=this.getVerticesData(c.b.NormalKind),r=this.getBoundingInfo();if(e.facetDepthSort&&!e.facetDepthSortEnabled){if(e.facetDepthSortEnabled=!0,i instanceof Uint16Array)e.depthSortedIndices=new Uint16Array(i);else if(i instanceof Uint32Array)e.depthSortedIndices=new Uint32Array(i);else{for(var o=!1,s=0;s<i.length;s++)if(i[s]>65535){o=!0;break}e.depthSortedIndices=o?new Uint32Array(i):new Uint16Array(i)}if(e.facetDepthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},!e.facetDepthSortFrom){var u=this.getScene().activeCamera;e.facetDepthSortFrom=u?u.position:a.e.Zero()}e.depthSortedFacets=[];for(var h=0;h<e.facetNb;h++){var d={ind:3*h,sqDistance:0};e.depthSortedFacets.push(d)}e.invertedMatrix=a.a.Identity(),e.facetDepthSortOrigin=a.e.Zero()}e.bbSize.x=r.maximum.x-r.minimum.x>v.a?r.maximum.x-r.minimum.x:v.a,e.bbSize.y=r.maximum.y-r.minimum.y>v.a?r.maximum.y-r.minimum.y:v.a,e.bbSize.z=r.maximum.z-r.minimum.z>v.a?r.maximum.z-r.minimum.z:v.a;var f=e.bbSize.x>e.bbSize.y?e.bbSize.x:e.bbSize.y;if(f=f>e.bbSize.z?f:e.bbSize.z,e.subDiv.max=e.partitioningSubdivisions,e.subDiv.X=Math.floor(e.subDiv.max*e.bbSize.x/f),e.subDiv.Y=Math.floor(e.subDiv.max*e.bbSize.y/f),e.subDiv.Z=Math.floor(e.subDiv.max*e.bbSize.z/f),e.subDiv.X=e.subDiv.X<1?1:e.subDiv.X,e.subDiv.Y=e.subDiv.Y<1?1:e.subDiv.Y,e.subDiv.Z=e.subDiv.Z<1?1:e.subDiv.Z,e.facetParameters.facetNormals=this.getFacetLocalNormals(),e.facetParameters.facetPositions=this.getFacetLocalPositions(),e.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),e.facetParameters.bInfo=r,e.facetParameters.bbSize=e.bbSize,e.facetParameters.subDiv=e.subDiv,e.facetParameters.ratio=this.partitioningBBoxRatio,e.facetParameters.depthSort=e.facetDepthSort,e.facetDepthSort&&e.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(e.invertedMatrix),a.e.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,l.a.ComputeNormals(t,i,n,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);var p=e.depthSortedIndices.length/3|0;for(h=0;h<p;h++){var _=e.depthSortedFacets[h].ind;e.depthSortedIndices[3*h]=i[_],e.depthSortedIndices[3*h+1]=i[_+1],e.depthSortedIndices[3*h+2]=i[_+2]}this.updateIndices(e.depthSortedIndices,void 0,!0)}return this},t.prototype.getFacetLocalNormals=function(){var e=this._internalAbstractMeshDataInfo._facetData;return e.facetNormals||this.updateFacetData(),e.facetNormals},t.prototype.getFacetLocalPositions=function(){var e=this._internalAbstractMeshDataInfo._facetData;return e.facetPositions||this.updateFacetData(),e.facetPositions},t.prototype.getFacetLocalPartitioning=function(){var e=this._internalAbstractMeshDataInfo._facetData;return e.facetPartitioning||this.updateFacetData(),e.facetPartitioning},t.prototype.getFacetPosition=function(e){var t=a.e.Zero();return this.getFacetPositionToRef(e,t),t},t.prototype.getFacetPositionToRef=function(e,t){var i=this.getFacetLocalPositions()[e],n=this.getWorldMatrix();return a.e.TransformCoordinatesToRef(i,n,t),this},t.prototype.getFacetNormal=function(e){var t=a.e.Zero();return this.getFacetNormalToRef(e,t),t},t.prototype.getFacetNormalToRef=function(e,t){var i=this.getFacetLocalNormals()[e];return a.e.TransformNormalToRef(i,this.getWorldMatrix(),t),this},t.prototype.getFacetsAtLocalCoordinates=function(e,t,i){var n=this.getBoundingInfo(),r=this._internalAbstractMeshDataInfo._facetData,o=Math.floor((e-n.minimum.x*r.partitioningBBoxRatio)*r.subDiv.X*r.partitioningBBoxRatio/r.bbSize.x),a=Math.floor((t-n.minimum.y*r.partitioningBBoxRatio)*r.subDiv.Y*r.partitioningBBoxRatio/r.bbSize.y),s=Math.floor((i-n.minimum.z*r.partitioningBBoxRatio)*r.subDiv.Z*r.partitioningBBoxRatio/r.bbSize.z);return o<0||o>r.subDiv.max||a<0||a>r.subDiv.max||s<0||s>r.subDiv.max?null:r.facetPartitioning[o+r.subDiv.max*a+r.subDiv.max*r.subDiv.max*s]},t.prototype.getClosestFacetAtCoordinates=function(e,t,i,n,r,o){void 0===r&&(r=!1),void 0===o&&(o=!0);var s=this.getWorldMatrix(),c=a.c.Matrix[5];s.invertToRef(c);var l=a.c.Vector3[8];a.e.TransformCoordinatesFromFloatsToRef(e,t,i,c,l);var u=this.getClosestFacetAtLocalCoordinates(l.x,l.y,l.z,n,r,o);return n&&a.e.TransformCoordinatesFromFloatsToRef(n.x,n.y,n.z,s,n),u},t.prototype.getClosestFacetAtLocalCoordinates=function(e,t,i,n,r,o){void 0===r&&(r=!1),void 0===o&&(o=!0);var a=null,s=0,c=0,l=0,u=0,h=0,d=0,f=0,p=0,_=this.getFacetLocalPositions(),m=this.getFacetLocalNormals(),g=this.getFacetsAtLocalCoordinates(e,t,i);if(!g)return null;for(var v,b,y,T=Number.MAX_VALUE,E=T,S=0;S<g.length;S++)b=m[v=g[S]],u=(e-(y=_[v]).x)*b.x+(t-y.y)*b.y+(i-y.z)*b.z,(!r||r&&o&&u>=0||r&&!o&&u<=0)&&(u=b.x*y.x+b.y*y.y+b.z*y.z,h=-(b.x*e+b.y*t+b.z*i-u)/(b.x*b.x+b.y*b.y+b.z*b.z),(E=(s=(d=e+b.x*h)-e)*s+(c=(f=t+b.y*h)-t)*c+(l=(p=i+b.z*h)-i)*l)<T&&(T=E,a=v,n&&(n.x=d,n.y=f,n.z=p)));return a},t.prototype.getFacetDataParameters=function(){return this._internalAbstractMeshDataInfo._facetData.facetParameters},t.prototype.disableFacetData=function(){var e=this._internalAbstractMeshDataInfo._facetData;return e.facetDataEnabled&&(e.facetDataEnabled=!1,e.facetPositions=new Array,e.facetNormals=new Array,e.facetPartitioning=new Array,e.facetParameters=null,e.depthSortedIndices=new Uint32Array(0)),this},t.prototype.updateIndices=function(e,t,i){return void 0===i&&(i=!1),this},t.prototype.createNormals=function(e){var t,i=this.getVerticesData(c.b.PositionKind),n=this.getIndices();return t=this.isVerticesDataPresent(c.b.NormalKind)?this.getVerticesData(c.b.NormalKind):[],l.a.ComputeNormals(i,n,t,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(c.b.NormalKind,t,e),this},t.prototype.alignWithNormal=function(e,t){t||(t=b.a.Y);var i=a.c.Vector3[0],n=a.c.Vector3[1];return a.e.CrossToRef(t,e,n),a.e.CrossToRef(e,n,i),this.rotationQuaternion?a.b.RotationQuaternionFromAxisToRef(i,e,n,this.rotationQuaternion):a.e.RotationFromAxisToRef(i,e,n,this.rotation),this},t.prototype._checkOcclusionQuery=function(){return!1},t.prototype.disableEdgesRendering=function(){throw _.a.WarnImport("EdgesRenderer")},t.prototype.enableEdgesRendering=function(e,t,i){throw _.a.WarnImport("EdgesRenderer")},t.prototype.getConnectedParticleSystems=function(){var e=this;return this._scene.particleSystems.filter(function(t){return t.emitter===e})},t.OCCLUSION_TYPE_NONE=0,t.OCCLUSION_TYPE_OPTIMISTIC=1,t.OCCLUSION_TYPE_STRICT=2,t.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0,t.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1,t.CULLINGSTRATEGY_STANDARD=f.a.MESHES_CULLINGSTRATEGY_STANDARD,t.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=f.a.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,t.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=f.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION,t.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=f.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY,t}(u.a);y.a.RegisteredTypes["BABYLON.AbstractMesh"]=S},function(e,t,i){"use strict";i.d(t,"a",function(){return u});var n=i(8),r=i(44),o=i(0),a=i(31),s=i(7),c=i(50),l=i(23);s.a._PhysicsImpostorParser=function(e,t,i){return new u(t,i.physicsImpostor,{mass:i.physicsMass,friction:i.physicsFriction,restitution:i.physicsRestitution},e)};var u=function(){function e(e,t,i,r){var a=this;void 0===i&&(i={mass:0}),this.object=e,this.type=t,this._options=i,this._scene=r,this._pluginData={},this._bodyUpdateRequired=!1,this._onBeforePhysicsStepCallbacks=new Array,this._onAfterPhysicsStepCallbacks=new Array,this._onPhysicsCollideCallbacks=[],this._deltaPosition=o.e.Zero(),this._isDisposed=!1,this.soft=!1,this.segments=0,this._tmpQuat=new o.b,this._tmpQuat2=new o.b,this.beforeStep=function(){a._physicsEngine&&(a.object.translate(a._deltaPosition,-1),a._deltaRotationConjugated&&a.object.rotationQuaternion&&a.object.rotationQuaternion.multiplyToRef(a._deltaRotationConjugated,a.object.rotationQuaternion),a.object.computeWorldMatrix(!1),a.object.parent&&a.object.rotationQuaternion?(a.getParentsRotation(),a._tmpQuat.multiplyToRef(a.object.rotationQuaternion,a._tmpQuat)):a._tmpQuat.copyFrom(a.object.rotationQuaternion||new o.b),a._options.disableBidirectionalTransformation||a.object.rotationQuaternion&&a._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(a,a.object.getAbsolutePosition(),a._tmpQuat),a._onBeforePhysicsStepCallbacks.forEach(function(e){e(a)}))},this.afterStep=function(){a._physicsEngine&&(a._onAfterPhysicsStepCallbacks.forEach(function(e){e(a)}),a._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(a),a.object.parent&&a.object.rotationQuaternion&&(a.getParentsRotation(),a._tmpQuat.conjugateInPlace(),a._tmpQuat.multiplyToRef(a.object.rotationQuaternion,a.object.rotationQuaternion)),a.object.setAbsolutePosition(a.object.position),a._deltaRotation&&a.object.rotationQuaternion&&a.object.rotationQuaternion.multiplyToRef(a._deltaRotation,a.object.rotationQuaternion),a.object.translate(a._deltaPosition,1))},this.onCollideEvent=null,this.onCollide=function(e){if((a._onPhysicsCollideCallbacks.length||a.onCollideEvent)&&a._physicsEngine){var t=a._physicsEngine.getImpostorWithPhysicsBody(e.body);t&&(a.onCollideEvent&&a.onCollideEvent(a,t),a._onPhysicsCollideCallbacks.filter(function(e){return-1!==e.otherImpostors.indexOf(t)}).forEach(function(i){i.callback(a,t,e.point)}))}},this.object?(this.object.parent&&0!==i.mass&&n.a.Warn("A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur."),!this._scene&&e.getScene&&(this._scene=e.getScene()),this._scene&&(this.type>100&&(this.soft=!0),this._physicsEngine=this._scene.getPhysicsEngine(),this._physicsEngine?(this.object.rotationQuaternion||(this.object.rotation?this.object.rotationQuaternion=o.b.RotationYawPitchRoll(this.object.rotation.y,this.object.rotation.x,this.object.rotation.z):this.object.rotationQuaternion=new o.b),this._options.mass=void 0===i.mass?0:i.mass,this._options.friction=void 0===i.friction?.2:i.friction,this._options.restitution=void 0===i.restitution?.2:i.restitution,this.soft&&(this._options.mass=this._options.mass>0?this._options.mass:1,this._options.pressure=void 0===i.pressure?200:i.pressure,this._options.stiffness=void 0===i.stiffness?1:i.stiffness,this._options.velocityIterations=void 0===i.velocityIterations?20:i.velocityIterations,this._options.positionIterations=void 0===i.positionIterations?20:i.positionIterations,this._options.fixedPoints=void 0===i.fixedPoints?0:i.fixedPoints,this._options.margin=void 0===i.margin?0:i.margin,this._options.damping=void 0===i.damping?0:i.damping,this._options.path=void 0===i.path?null:i.path,this._options.shape=void 0===i.shape?null:i.shape),this._joints=[],!this.object.parent||this._options.ignoreParent?this._init():this.object.parent.physicsImpostor&&n.a.Warn("You must affect impostors to children before affecting impostor to parent.")):n.a.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors."))):n.a.Error("No object was provided. A physics object is obligatory")}return Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mass",{get:function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyMass(this):0},set:function(e){this.setMass(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"friction",{get:function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyFriction(this):0},set:function(e){this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyFriction(this,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"restitution",{get:function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this):0},set:function(e){this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pressure",{get:function(){if(!this._physicsEngine)return 0;var e=this._physicsEngine.getPhysicsPlugin();return e.setBodyPressure?e.getBodyPressure(this):0},set:function(e){if(this._physicsEngine){var t=this._physicsEngine.getPhysicsPlugin();t.setBodyPressure&&t.setBodyPressure(this,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stiffness",{get:function(){if(!this._physicsEngine)return 0;var e=this._physicsEngine.getPhysicsPlugin();return e.getBodyStiffness?e.getBodyStiffness(this):0},set:function(e){if(this._physicsEngine){var t=this._physicsEngine.getPhysicsPlugin();t.setBodyStiffness&&t.setBodyStiffness(this,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"velocityIterations",{get:function(){if(!this._physicsEngine)return 0;var e=this._physicsEngine.getPhysicsPlugin();return e.getBodyVelocityIterations?e.getBodyVelocityIterations(this):0},set:function(e){if(this._physicsEngine){var t=this._physicsEngine.getPhysicsPlugin();t.setBodyVelocityIterations&&t.setBodyVelocityIterations(this,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"positionIterations",{get:function(){if(!this._physicsEngine)return 0;var e=this._physicsEngine.getPhysicsPlugin();return e.getBodyPositionIterations?e.getBodyPositionIterations(this):0},set:function(e){if(this._physicsEngine){var t=this._physicsEngine.getPhysicsPlugin();t.setBodyPositionIterations&&t.setBodyPositionIterations(this,e)}},enumerable:!1,configurable:!0}),e.prototype._init=function(){this._physicsEngine&&(this._physicsEngine.removeImpostor(this),this.physicsBody=null,this._parent=this._parent||this._getPhysicsParent(),this._isDisposed||this.parent&&!this._options.ignoreParent||this._physicsEngine.addImpostor(this))},e.prototype._getPhysicsParent=function(){return this.object.parent instanceof a.a?this.object.parent.physicsImpostor:null},e.prototype.isBodyInitRequired=function(){return this._bodyUpdateRequired||!this._physicsBody&&!this._parent},e.prototype.setScalingUpdated=function(){this.forceUpdate()},e.prototype.forceUpdate=function(){this._init(),this.parent&&!this._options.ignoreParent&&this.parent.forceUpdate()},Object.defineProperty(e.prototype,"physicsBody",{get:function(){return this._parent&&!this._options.ignoreParent?this._parent.physicsBody:this._physicsBody},set:function(e){this._physicsBody&&this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this),this._physicsBody=e,this.resetUpdateFlags()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return!this._options.ignoreParent&&this._parent?this._parent:null},set:function(e){this._parent=e},enumerable:!1,configurable:!0}),e.prototype.resetUpdateFlags=function(){this._bodyUpdateRequired=!1},e.prototype.getObjectExtendSize=function(){if(this.object.getBoundingInfo){var t=this.object.rotationQuaternion,i=this.object.scaling.clone();this.object.rotationQuaternion=e.IDENTITY_QUATERNION;var n=this.object.computeWorldMatrix&&this.object.computeWorldMatrix(!0);n&&n.decompose(i,void 0,void 0);var r=this.object.getBoundingInfo().boundingBox.extendSize.scale(2).multiplyInPlace(i);return this.object.rotationQuaternion=t,this.object.computeWorldMatrix&&this.object.computeWorldMatrix(!0),r}return e.DEFAULT_OBJECT_SIZE},e.prototype.getObjectCenter=function(){return this.object.getBoundingInfo?this.object.getBoundingInfo().boundingBox.centerWorld:this.object.position},e.prototype.getParam=function(e){return this._options[e]},e.prototype.setParam=function(e,t){this._options[e]=t,this._bodyUpdateRequired=!0},e.prototype.setMass=function(e){this.getParam("mass")!==e&&this.setParam("mass",e),this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyMass(this,e)},e.prototype.getLinearVelocity=function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this):o.e.Zero()},e.prototype.setLinearVelocity=function(e){this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this,e)},e.prototype.getAngularVelocity=function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this):o.e.Zero()},e.prototype.setAngularVelocity=function(e){this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this,e)},e.prototype.executeNativeFunction=function(e){this._physicsEngine&&e(this._physicsEngine.getPhysicsPlugin().world,this.physicsBody)},e.prototype.registerBeforePhysicsStep=function(e){this._onBeforePhysicsStepCallbacks.push(e)},e.prototype.unregisterBeforePhysicsStep=function(e){var t=this._onBeforePhysicsStepCallbacks.indexOf(e);t>-1?this._onBeforePhysicsStepCallbacks.splice(t,1):n.a.Warn("Function to remove was not found")},e.prototype.registerAfterPhysicsStep=function(e){this._onAfterPhysicsStepCallbacks.push(e)},e.prototype.unregisterAfterPhysicsStep=function(e){var t=this._onAfterPhysicsStepCallbacks.indexOf(e);t>-1?this._onAfterPhysicsStepCallbacks.splice(t,1):n.a.Warn("Function to remove was not found")},e.prototype.registerOnPhysicsCollide=function(e,t){var i=e instanceof Array?e:[e];this._onPhysicsCollideCallbacks.push({callback:t,otherImpostors:i})},e.prototype.unregisterOnPhysicsCollide=function(e,t){var i=e instanceof Array?e:[e],r=-1;this._onPhysicsCollideCallbacks.some(function(e,n){if(e.callback===t&&e.otherImpostors.length===i.length){var o=e.otherImpostors.every(function(e){return i.indexOf(e)>-1});return o&&(r=n),o}return!1})?this._onPhysicsCollideCallbacks.splice(r,1):n.a.Warn("Function to remove was not found")},e.prototype.getParentsRotation=function(){var e=this.object.parent;for(this._tmpQuat.copyFromFloats(0,0,0,1);e;)e.rotationQuaternion?this._tmpQuat2.copyFrom(e.rotationQuaternion):o.b.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,e.rotation.z,this._tmpQuat2),this._tmpQuat.multiplyToRef(this._tmpQuat2,this._tmpQuat),e=e.parent;return this._tmpQuat},e.prototype.applyForce=function(e,t){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().applyForce(this,e,t),this},e.prototype.applyImpulse=function(e,t){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().applyImpulse(this,e,t),this},e.prototype.createJoint=function(e,t,i){var n=new c.e(t,i);return this.addJoint(e,n),this},e.prototype.addJoint=function(e,t){return this._joints.push({otherImpostor:e,joint:t}),this._physicsEngine&&this._physicsEngine.addJoint(this,e,t),this},e.prototype.addAnchor=function(e,t,i,n,r){if(!this._physicsEngine)return this;var o=this._physicsEngine.getPhysicsPlugin();return o.appendAnchor?(this._physicsEngine&&o.appendAnchor(this,e,t,i,n,r),this):this},e.prototype.addHook=function(e,t,i,n){if(!this._physicsEngine)return this;var r=this._physicsEngine.getPhysicsPlugin();return r.appendAnchor?(this._physicsEngine&&r.appendHook(this,e,t,i,n),this):this},e.prototype.sleep=function(){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().sleepBody(this),this},e.prototype.wakeUp=function(){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().wakeUpBody(this),this},e.prototype.clone=function(t){return t?new e(t,this.type,this._options,this._scene):null},e.prototype.dispose=function(){var e=this;this._physicsEngine&&(this._joints.forEach(function(t){e._physicsEngine&&e._physicsEngine.removeJoint(e,t.otherImpostor,t.joint)}),this._physicsEngine.removeImpostor(this),this.parent&&this.parent.forceUpdate(),this._isDisposed=!0)},e.prototype.setDeltaPosition=function(e){this._deltaPosition.copyFrom(e)},e.prototype.setDeltaRotation=function(e){this._deltaRotation||(this._deltaRotation=new o.b),this._deltaRotation.copyFrom(e),this._deltaRotationConjugated=this._deltaRotation.conjugate()},e.prototype.getBoxSizeToRef=function(e){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this,e),this},e.prototype.getRadius=function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getRadius(this):0},e.prototype.syncBoneWithImpostor=function(t,i,n,r,o){var a=e._tmpVecs[0],s=this.object;if(s.rotationQuaternion)if(o){var c=e._tmpQuat;s.rotationQuaternion.multiplyToRef(o,c),t.setRotationQuaternion(c,l.c.WORLD,i)}else t.setRotationQuaternion(s.rotationQuaternion,l.c.WORLD,i);a.x=0,a.y=0,a.z=0,n&&(a.x=n.x,a.y=n.y,a.z=n.z,t.getDirectionToRef(a,i,a),null==r&&(r=n.length()),a.x*=r,a.y*=r,a.z*=r),t.getParent()?(a.addInPlace(s.getAbsolutePosition()),t.setAbsolutePosition(a,i)):(i.setAbsolutePosition(s.getAbsolutePosition()),i.position.x-=a.x,i.position.y-=a.y,i.position.z-=a.z)},e.prototype.syncImpostorWithBone=function(t,i,n,r,o,a){var s=this.object;if(s.rotationQuaternion)if(o){var c=e._tmpQuat;t.getRotationQuaternionToRef(l.c.WORLD,i,c),c.multiplyToRef(o,s.rotationQuaternion)}else t.getRotationQuaternionToRef(l.c.WORLD,i,s.rotationQuaternion);var u=e._tmpVecs[0],h=e._tmpVecs[1];a||((a=e._tmpVecs[2]).x=0,a.y=1,a.z=0),t.getDirectionToRef(a,i,h),t.getAbsolutePositionToRef(i,u),null==r&&n&&(r=n.length()),null!=r&&(u.x+=h.x*r,u.y+=h.y*r,u.z+=h.z*r),s.setAbsolutePosition(u)},e.DEFAULT_OBJECT_SIZE=new o.e(1,1,1),e.IDENTITY_QUATERNION=o.b.Identity(),e._tmpVecs=r.a.BuildArray(3,o.e.Zero),e._tmpQuat=o.b.Identity(),e.NoImpostor=0,e.SphereImpostor=1,e.BoxImpostor=2,e.PlaneImpostor=3,e.MeshImpostor=4,e.CapsuleImpostor=6,e.CylinderImpostor=7,e.ParticleImpostor=8,e.HeightmapImpostor=9,e.ConvexHullImpostor=10,e.CustomImpostor=100,e.RopeImpostor=101,e.ClothImpostor=102,e.SoftbodyImpostor=103,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r}),i.d(t,"b",function(){return o});var n=i(1),r=function(){function e(t){this.length=0,this.data=new Array(t),this._id=e._GlobalId++}return e.prototype.push=function(e){this.data[this.length++]=e,this.length>this.data.length&&(this.data.length*=2)},e.prototype.forEach=function(e){for(var t=0;t<this.length;t++)e(this.data[t])},e.prototype.sort=function(e){this.data.sort(e)},e.prototype.reset=function(){this.length=0},e.prototype.dispose=function(){this.reset(),this.data&&(this.data.length=0,this.data=[])},e.prototype.concat=function(e){if(0!==e.length){this.length+e.length>this.data.length&&(this.data.length=2*(this.length+e.length));for(var t=0;t<e.length;t++)this.data[this.length++]=(e.data||e)[t]}},e.prototype.indexOf=function(e){var t=this.data.indexOf(e);return t>=this.length?-1:t},e.prototype.contains=function(e){return-1!==this.indexOf(e)},e._GlobalId=0,e}(),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._duplicateId=0,t}return Object(n.d)(t,e),t.prototype.push=function(t){e.prototype.push.call(this,t),t.__smartArrayFlags||(t.__smartArrayFlags={}),t.__smartArrayFlags[this._id]=this._duplicateId},t.prototype.pushNoDuplicate=function(e){return!(e.__smartArrayFlags&&e.__smartArrayFlags[this._id]===this._duplicateId||(this.push(e),0))},t.prototype.reset=function(){e.prototype.reset.call(this),this._duplicateId++},t.prototype.concatWithNoDuplicate=function(e){if(0!==e.length){this.length+e.length>this.data.length&&(this.data.length=2*(this.length+e.length));for(var t=0;t<e.length;t++){var i=(e.data||e)[t];this.pushNoDuplicate(i)}}},t}(r)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.EndsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.StartsWith=function(e,t){return!!e&&0===e.indexOf(t)},e.Decode=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",i=0;i<e.byteLength;i++)t+=String.fromCharCode(e[i]);return t},e.EncodeArrayBufferToBase64=function(e){for(var t,i,n,r,o,a,s,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0,h=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);u<h.length;)r=(t=h[u++])>>2,o=(3&t)<<4|(i=u<h.length?h[u++]:Number.NaN)>>4,a=(15&i)<<2|(n=u<h.length?h[u++]:Number.NaN)>>6,s=63&n,isNaN(i)?a=s=64:isNaN(n)&&(s=64),l+=c.charAt(r)+c.charAt(o)+c.charAt(a)+c.charAt(s);return l},e.PadNumber=function(e,t){for(var i=String(e);i.length<t;)i="0"+i;return i},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this.rootNodes=new Array,this.cameras=new Array,this.lights=new Array,this.meshes=new Array,this.skeletons=new Array,this.particleSystems=new Array,this.animations=[],this.animationGroups=new Array,this.multiMaterials=new Array,this.materials=new Array,this.morphTargetManagers=new Array,this.geometries=new Array,this.transformNodes=new Array,this.actionManagers=new Array,this.textures=new Array,this._environmentTexture=null,this.postProcesses=new Array}return e.AddParser=function(e,t){this._BabylonFileParsers[e]=t},e.GetParser=function(e){return this._BabylonFileParsers[e]?this._BabylonFileParsers[e]:null},e.AddIndividualParser=function(e,t){this._IndividualBabylonFileParsers[e]=t},e.GetIndividualParser=function(e){return this._IndividualBabylonFileParsers[e]?this._IndividualBabylonFileParsers[e]:null},e.Parse=function(e,t,i,n){for(var r in this._BabylonFileParsers)this._BabylonFileParsers.hasOwnProperty(r)&&this._BabylonFileParsers[r](e,t,i,n)},Object.defineProperty(e.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(e){this._environmentTexture=e},enumerable:!1,configurable:!0}),e.prototype.getNodes=function(){var e=new Array;return e=(e=(e=(e=e.concat(this.meshes)).concat(this.lights)).concat(this.cameras)).concat(this.transformNodes),this.skeletons.forEach(function(t){return e=e.concat(t.bones)}),e},e._BabylonFileParsers={},e._IndividualBabylonFileParsers={},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return u});var n=i(20),r=i(6),o=i(18),a=i(22),s=i(86),c=i(0),l=i(9),u=function(){function e(e,t){var i=this;void 0===t&&(t=!0),this.originalScene=e,this._pointerCaptures={},this._lastPointerEvents={},this._sharedGizmoLight=null,this._renderCamera=null,this.pickUtilitySceneFirst=!0,this.shouldRender=!0,this.onlyCheckPointerDownEvents=!0,this.processAllEvents=!1,this.onPointerOutObservable=new r.c,this.utilityLayerScene=new n.a(e.getEngine(),{virtual:!0}),this.utilityLayerScene.useRightHandedSystem=e.useRightHandedSystem,this.utilityLayerScene._allowPostProcessClearColor=!1,this.utilityLayerScene.detachControl(),t&&(this._originalPointerObserver=e.onPrePointerObservable.add(function(t,n){if(i.utilityLayerScene.activeCamera&&(i.processAllEvents||t.type===o.a.POINTERMOVE||t.type===o.a.POINTERUP||t.type===o.a.POINTERDOWN||t.type===o.a.POINTERDOUBLETAP)){i.utilityLayerScene.pointerX=e.pointerX,i.utilityLayerScene.pointerY=e.pointerY;var r=t.event;if(e.isPointerCaptured(r.pointerId))i._pointerCaptures[r.pointerId]=!1;else{var a=t.ray?i.utilityLayerScene.pickWithRay(t.ray):i.utilityLayerScene.pick(e.pointerX,e.pointerY);if(!t.ray&&a&&(t.ray=a.ray),i.utilityLayerScene.onPrePointerObservable.notifyObservers(t),i.onlyCheckPointerDownEvents&&t.type!=o.a.POINTERDOWN)return t.skipOnPointerObservable||i.utilityLayerScene.onPointerObservable.notifyObservers(new o.b(t.type,t.event,a),t.type),void(t.type===o.a.POINTERUP&&i._pointerCaptures[r.pointerId]&&(i._pointerCaptures[r.pointerId]=!1));if(i.utilityLayerScene.autoClearDepthAndStencil||i.pickUtilitySceneFirst)a&&a.hit&&(t.skipOnPointerObservable||i.utilityLayerScene.onPointerObservable.notifyObservers(new o.b(t.type,t.event,a),t.type),t.skipOnPointerObservable=!0);else{var s=t.ray?e.pickWithRay(t.ray):e.pick(e.pointerX,e.pointerY),c=t.event;s&&a&&(0===a.distance&&s.pickedMesh?i.mainSceneTrackerPredicate&&i.mainSceneTrackerPredicate(s.pickedMesh)?(i._notifyObservers(t,s,c),t.skipOnPointerObservable=!0):t.type===o.a.POINTERDOWN?i._pointerCaptures[c.pointerId]=!0:i._lastPointerEvents[c.pointerId]&&(i.onPointerOutObservable.notifyObservers(c.pointerId),delete i._lastPointerEvents[c.pointerId]):!i._pointerCaptures[c.pointerId]&&(a.distance<s.distance||0===s.distance)?(i._notifyObservers(t,a,c),t.skipOnPointerObservable||(t.skipOnPointerObservable=a.distance>0)):!i._pointerCaptures[c.pointerId]&&a.distance>s.distance&&(i.mainSceneTrackerPredicate&&i.mainSceneTrackerPredicate(s.pickedMesh)?(i._notifyObservers(t,s,c),t.skipOnPointerObservable=!0):i._lastPointerEvents[c.pointerId]&&(i.onPointerOutObservable.notifyObservers(c.pointerId),delete i._lastPointerEvents[c.pointerId])),t.type===o.a.POINTERUP&&i._pointerCaptures[c.pointerId]&&(i._pointerCaptures[c.pointerId]=!1))}}}}),this._originalPointerObserver&&e.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)),this.utilityLayerScene.autoClear=!1,this._afterRenderObserver=this.originalScene.onAfterCameraRenderObservable.add(function(e){i.shouldRender&&e==i.getRenderCamera()&&i.render()}),this._sceneDisposeObserver=this.originalScene.onDisposeObservable.add(function(){i.dispose()}),this._updateCamera()}return e.prototype.getRenderCamera=function(e){if(this._renderCamera)return this._renderCamera;var t;return t=this.originalScene.activeCameras&&this.originalScene.activeCameras.length>1?this.originalScene.activeCameras[this.originalScene.activeCameras.length-1]:this.originalScene.activeCamera,e&&t&&t.isRigCamera?t.rigParent:t},e.prototype.setRenderCamera=function(e){this._renderCamera=e},e.prototype._getSharedGizmoLight=function(){return this._sharedGizmoLight||(this._sharedGizmoLight=new s.a("shared gizmo light",new c.e(0,1,0),this.utilityLayerScene),this._sharedGizmoLight.intensity=2,this._sharedGizmoLight.groundColor=l.a.Gray()),this._sharedGizmoLight},Object.defineProperty(e,"DefaultUtilityLayer",{get:function(){return null==e._DefaultUtilityLayer&&(e._DefaultUtilityLayer=new e(a.a.LastCreatedScene),e._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(function(){e._DefaultUtilityLayer=null})),e._DefaultUtilityLayer},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DefaultKeepDepthUtilityLayer",{get:function(){return null==e._DefaultKeepDepthUtilityLayer&&(e._DefaultKeepDepthUtilityLayer=new e(a.a.LastCreatedScene),e._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil=!1,e._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(function(){e._DefaultKeepDepthUtilityLayer=null})),e._DefaultKeepDepthUtilityLayer},enumerable:!1,configurable:!0}),e.prototype._notifyObservers=function(e,t,i){e.skipOnPointerObservable||(this.utilityLayerScene.onPointerObservable.notifyObservers(new o.b(e.type,e.event,t),e.type),this._lastPointerEvents[i.pointerId]=!0)},e.prototype.render=function(){if(this._updateCamera(),this.utilityLayerScene.activeCamera){var e=this.utilityLayerScene.activeCamera.getScene(),t=this.utilityLayerScene.activeCamera;t._scene=this.utilityLayerScene,t.leftCamera&&(t.leftCamera._scene=this.utilityLayerScene),t.rightCamera&&(t.rightCamera._scene=this.utilityLayerScene),this.utilityLayerScene.render(!1),t._scene=e,t.leftCamera&&(t.leftCamera._scene=e),t.rightCamera&&(t.rightCamera._scene=e)}},e.prototype.dispose=function(){this.onPointerOutObservable.clear(),this._afterRenderObserver&&this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver),this._sceneDisposeObserver&&this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver),this._originalPointerObserver&&this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver),this.utilityLayerScene.dispose()},e.prototype._updateCamera=function(){this.utilityLayerScene.cameraToUseForPointers=this.getRenderCamera(),this.utilityLayerScene.activeCamera=this.getRenderCamera()},e._DefaultUtilityLayer=null,e._DefaultKeepDepthUtilityLayer=null,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(139),r=function(){function e(){}return e.EnableFor=function(t){t._tags=t._tags||{},t.hasTags=function(){return e.HasTags(t)},t.addTags=function(i){return e.AddTagsTo(t,i)},t.removeTags=function(i){return e.RemoveTagsFrom(t,i)},t.matchesTagsQuery=function(i){return e.MatchesQuery(t,i)}},e.DisableFor=function(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery},e.HasTags=function(e){if(!e._tags)return!1;var t=e._tags;for(var i in t)if(t.hasOwnProperty(i))return!0;return!1},e.GetTags=function(e,t){if(void 0===t&&(t=!0),!e._tags)return null;if(t){var i=[];for(var n in e._tags)e._tags.hasOwnProperty(n)&&!0===e._tags[n]&&i.push(n);return i.join(" ")}return e._tags},e.AddTagsTo=function(t,i){i&&"string"==typeof i&&i.split(" ").forEach(function(i,n,r){e._AddTagTo(t,i)})},e._AddTagTo=function(t,i){""!==(i=i.trim())&&"true"!==i&&"false"!==i&&(i.match(/[\s]/)||i.match(/^([!]|([|]|[&]){2})/)||(e.EnableFor(t),t._tags[i]=!0))},e.RemoveTagsFrom=function(t,i){if(e.HasTags(t)){var n=i.split(" ");for(var r in n)e._RemoveTagFrom(t,n[r])}},e._RemoveTagFrom=function(e,t){delete e._tags[t]},e.MatchesQuery=function(t,i){return void 0===i||(""===i?e.HasTags(t):n.a.Eval(i,function(i){return e.HasTags(t)&&t._tags[i]}))},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.IsWindowObjectExist=function(){return"undefined"!=typeof window},e.IsNavigatorAvailable=function(){return"undefined"!=typeof navigator},e.IsDocumentAvailable=function(){return"undefined"!=typeof document},e.GetDOMTextContent=function(e){for(var t="",i=e.firstChild;i;)3===i.nodeType&&(t+=i.textContent),i=i.nextSibling;return t},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var n=i(44),r=i(0),o=i(54),a=i(114),s=i(20),c=i(24),l=function(){function e(e,t,i){void 0===i&&(i=Number.MAX_VALUE),this.origin=e,this.direction=t,this.length=i}return e.prototype.intersectsBoxMinMax=function(t,i,n){void 0===n&&(n=0);var r,o,a,s,c=e._TmpVector3[0].copyFromFloats(t.x-n,t.y-n,t.z-n),l=e._TmpVector3[1].copyFromFloats(i.x+n,i.y+n,i.z+n),u=0,h=Number.MAX_VALUE;if(Math.abs(this.direction.x)<1e-7){if(this.origin.x<c.x||this.origin.x>l.x)return!1}else if(r=1/this.direction.x,o=(c.x-this.origin.x)*r,(a=(l.x-this.origin.x)*r)==-1/0&&(a=1/0),o>a&&(s=o,o=a,a=s),(u=Math.max(o,u))>(h=Math.min(a,h)))return!1;if(Math.abs(this.direction.y)<1e-7){if(this.origin.y<c.y||this.origin.y>l.y)return!1}else if(r=1/this.direction.y,o=(c.y-this.origin.y)*r,(a=(l.y-this.origin.y)*r)==-1/0&&(a=1/0),o>a&&(s=o,o=a,a=s),(u=Math.max(o,u))>(h=Math.min(a,h)))return!1;if(Math.abs(this.direction.z)<1e-7){if(this.origin.z<c.z||this.origin.z>l.z)return!1}else if(r=1/this.direction.z,o=(c.z-this.origin.z)*r,(a=(l.z-this.origin.z)*r)==-1/0&&(a=1/0),o>a&&(s=o,o=a,a=s),(u=Math.max(o,u))>(h=Math.min(a,h)))return!1;return!0},e.prototype.intersectsBox=function(e,t){return void 0===t&&(t=0),this.intersectsBoxMinMax(e.minimum,e.maximum,t)},e.prototype.intersectsSphere=function(e,t){void 0===t&&(t=0);var i=e.center.x-this.origin.x,n=e.center.y-this.origin.y,r=e.center.z-this.origin.z,o=i*i+n*n+r*r,a=e.radius+t,s=a*a;if(o<=s)return!0;var c=i*this.direction.x+n*this.direction.y+r*this.direction.z;return!(c<0)&&o-c*c<=s},e.prototype.intersectsTriangle=function(t,i,n){var o=e._TmpVector3[0],s=e._TmpVector3[1],c=e._TmpVector3[2],l=e._TmpVector3[3],u=e._TmpVector3[4];i.subtractToRef(t,o),n.subtractToRef(t,s),r.e.CrossToRef(this.direction,s,c);var h=r.e.Dot(o,c);if(0===h)return null;var d=1/h;this.origin.subtractToRef(t,l);var f=r.e.Dot(l,c)*d;if(f<0||f>1)return null;r.e.CrossToRef(l,o,u);var p=r.e.Dot(this.direction,u)*d;if(p<0||f+p>1)return null;var _=r.e.Dot(s,u)*d;return _>this.length?null:new a.a(1-f-p,f,_)},e.prototype.intersectsPlane=function(e){var t,i=r.e.Dot(e.normal,this.direction);if(Math.abs(i)<9.99999997475243e-7)return null;var n=r.e.Dot(e.normal,this.origin);return(t=(-e.d-n)/i)<0?t<-9.99999997475243e-7?null:0:t},e.prototype.intersectsAxis=function(e,t){switch(void 0===t&&(t=0),e){case"y":return(i=(this.origin.y-t)/this.direction.y)>0?null:new r.e(this.origin.x+this.direction.x*-i,t,this.origin.z+this.direction.z*-i);case"x":return(i=(this.origin.x-t)/this.direction.x)>0?null:new r.e(t,this.origin.y+this.direction.y*-i,this.origin.z+this.direction.z*-i);case"z":var i;return(i=(this.origin.z-t)/this.direction.z)>0?null:new r.e(this.origin.x+this.direction.x*-i,this.origin.y+this.direction.y*-i,t);default:return null}},e.prototype.intersectsMesh=function(t,i){var n=r.c.Matrix[0];return t.getWorldMatrix().invertToRef(n),this._tmpRay?e.TransformToRef(this,n,this._tmpRay):this._tmpRay=e.Transform(this,n),t.intersects(this._tmpRay,i)},e.prototype.intersectsMeshes=function(e,t,i){i?i.length=0:i=[];for(var n=0;n<e.length;n++){var r=this.intersectsMesh(e[n],t);r.hit&&i.push(r)}return i.sort(this._comparePickingInfo),i},e.prototype._comparePickingInfo=function(e,t){return e.distance<t.distance?-1:e.distance>t.distance?1:0},e.prototype.intersectionSegment=function(t,i,n){var o=this.origin,a=r.c.Vector3[0],s=r.c.Vector3[1],c=r.c.Vector3[2],l=r.c.Vector3[3];i.subtractToRef(t,a),this.direction.scaleToRef(e.rayl,c),o.addToRef(c,s),t.subtractToRef(o,l);var u,h,d,f,p=r.e.Dot(a,a),_=r.e.Dot(a,c),m=r.e.Dot(c,c),g=r.e.Dot(a,l),v=r.e.Dot(c,l),b=p*m-_*_,y=b,T=b;b<e.smallnum?(h=0,y=1,f=v,T=m):(f=p*v-_*g,(h=_*v-m*g)<0?(h=0,f=v,T=m):h>y&&(h=y,f=v+_,T=m)),f<0?(f=0,-g<0?h=0:-g>p?h=y:(h=-g,y=p)):f>T&&(f=T,-g+_<0?h=0:-g+_>p?h=y:(h=-g+_,y=p)),u=Math.abs(h)<e.smallnum?0:h/y,d=Math.abs(f)<e.smallnum?0:f/T;var E=r.c.Vector3[4];c.scaleToRef(d,E);var S=r.c.Vector3[5];a.scaleToRef(u,S),S.addInPlace(l);var A=r.c.Vector3[6];return S.subtractToRef(E,A),d>0&&d<=this.length&&A.lengthSquared()<n*n?S.length():-1},e.prototype.update=function(e,t,i,n,r,o,a){return this.unprojectRayToRef(e,t,i,n,r,o,a),this},e.Zero=function(){return new e(r.e.Zero(),r.e.Zero())},e.CreateNew=function(t,i,n,r,o,a,s){return e.Zero().update(t,i,n,r,o,a,s)},e.CreateNewFromTo=function(t,i,n){void 0===n&&(n=r.a.IdentityReadOnly);var o=i.subtract(t),a=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z);return o.normalize(),e.Transform(new e(t,o,a),n)},e.Transform=function(t,i){var n=new e(new r.e(0,0,0),new r.e(0,0,0));return e.TransformToRef(t,i,n),n},e.TransformToRef=function(e,t,i){r.e.TransformCoordinatesToRef(e.origin,t,i.origin),r.e.TransformNormalToRef(e.direction,t,i.direction),i.length=e.length;var n=i.direction,o=n.length();if(0!==o&&1!==o){var a=1/o;n.x*=a,n.y*=a,n.z*=a,i.length*=o}},e.prototype.unprojectRayToRef=function(e,t,i,n,o,a,s){var c=r.c.Matrix[0];o.multiplyToRef(a,c),c.multiplyToRef(s,c),c.invert();var l=r.c.Vector3[0];l.x=e/i*2-1,l.y=-(t/n*2-1),l.z=-1;var u=r.c.Vector3[1].copyFromFloats(l.x,l.y,1),h=r.c.Vector3[2],d=r.c.Vector3[3];r.e._UnprojectFromInvertedMatrixToRef(l,c,h),r.e._UnprojectFromInvertedMatrixToRef(u,c,d),this.origin.copyFrom(h),d.subtractToRef(h,this.direction),this.direction.normalize()},e._TmpVector3=n.a.BuildArray(6,r.e.Zero),e.smallnum=1e-8,e.rayl=1e9,e}();s.a.prototype.createPickingRay=function(e,t,i,n,r){void 0===r&&(r=!1);var o=l.Zero();return this.createPickingRayToRef(e,t,i,o,n,r),o},s.a.prototype.createPickingRayToRef=function(e,t,i,n,o,a){void 0===a&&(a=!1);var s=this.getEngine();if(!o){if(!this.activeCamera)return this;o=this.activeCamera}var c=o.viewport.toGlobal(s.getRenderWidth(),s.getRenderHeight());return e=e/s.getHardwareScalingLevel()-c.x,t=t/s.getHardwareScalingLevel()-(s.getRenderHeight()-c.y-c.height),n.update(e,t,c.width,c.height,i||r.a.IdentityReadOnly,a?r.a.IdentityReadOnly:o.getViewMatrix(),o.getProjectionMatrix()),this},s.a.prototype.createPickingRayInCameraSpace=function(e,t,i){var n=l.Zero();return this.createPickingRayInCameraSpaceToRef(e,t,n,i),n},s.a.prototype.createPickingRayInCameraSpaceToRef=function(e,t,i,n){if(!o.a)return this;var a=this.getEngine();if(!n){if(!this.activeCamera)throw new Error("Active camera not set");n=this.activeCamera}var s=n.viewport.toGlobal(a.getRenderWidth(),a.getRenderHeight()),c=r.a.Identity();return e=e/a.getHardwareScalingLevel()-s.x,t=t/a.getHardwareScalingLevel()-(a.getRenderHeight()-s.y-s.height),i.update(e,t,s.width,s.height,c,c,n.getProjectionMatrix()),this},s.a.prototype._internalPickForMesh=function(e,t,i,n,r,o,a,s){var c=t(n),l=i.intersects(c,r,a,o,n,s);return l&&l.hit?!r&&null!=e&&l.distance>=e.distance?null:l:null},s.a.prototype._internalPick=function(e,t,i,n,a){if(!o.a)return null;for(var s=null,c=0;c<this.meshes.length;c++){var l=this.meshes[c];if(t){if(!t(l))continue}else if(!l.isEnabled()||!l.isVisible||!l.isPickable)continue;var u,h=l.skeleton&&l.skeleton.overrideMesh?l.skeleton.overrideMesh.getWorldMatrix():l.getWorldMatrix();if(l.hasThinInstances&&l.thinInstanceEnablePicking){if(u=this._internalPickForMesh(s,e,l,h,!0,!0,a)){if(n)return s;for(var d=r.c.Matrix[1],f=l.thinInstanceGetWorldMatrices(),p=0;p<f.length;p++){f[p].multiplyToRef(h,d);var _=this._internalPickForMesh(s,e,l,d,i,n,a,!0);if(_&&((s=_).thinInstanceIndex=p,i))return s}}}else if((u=this._internalPickForMesh(s,e,l,h,i,n,a))&&(s=u,i))return s}return s||new o.a},s.a.prototype._internalMultiPick=function(e,t,i){if(!o.a)return null;for(var n=new Array,a=0;a<this.meshes.length;a++){var s=this.meshes[a];if(t){if(!t(s))continue}else if(!s.isEnabled()||!s.isVisible||!s.isPickable)continue;var c,l=s.skeleton&&s.skeleton.overrideMesh?s.skeleton.overrideMesh.getWorldMatrix():s.getWorldMatrix();if(s.hasThinInstances&&s.thinInstanceEnablePicking){if(c=this._internalPickForMesh(null,e,s,l,!0,!0,i))for(var u=r.c.Matrix[1],h=s.thinInstanceGetWorldMatrices(),d=0;d<h.length;d++){h[d].multiplyToRef(l,u);var f=this._internalPickForMesh(null,e,s,u,!1,!1,i,!0);f&&(f.thinInstanceIndex=d,n.push(f))}}else(c=this._internalPickForMesh(null,e,s,l,!1,!1,i))&&n.push(c)}return n},s.a.prototype.pickWithBoundingInfo=function(e,t,i,n,a){var s=this;if(!o.a)return null;var c=this._internalPick(function(i){return s._tempPickingRay||(s._tempPickingRay=l.Zero()),s.createPickingRayToRef(e,t,i,s._tempPickingRay,a||null),s._tempPickingRay},i,n,!0);return c&&(c.ray=this.createPickingRay(e,t,r.a.Identity(),a||null)),c},s.a.prototype.pick=function(e,t,i,n,a,s){var c=this;if(!o.a)return null;var u=this._internalPick(function(i){return c._tempPickingRay||(c._tempPickingRay=l.Zero()),c.createPickingRayToRef(e,t,i,c._tempPickingRay,a||null),c._tempPickingRay},i,n,!1,s);return u&&(u.ray=this.createPickingRay(e,t,r.a.Identity(),a||null)),u},s.a.prototype.pickWithRay=function(e,t,i,n){var o=this,a=this._internalPick(function(t){return o._pickWithRayInverseMatrix||(o._pickWithRayInverseMatrix=r.a.Identity()),t.invertToRef(o._pickWithRayInverseMatrix),o._cachedRayForTransform||(o._cachedRayForTransform=l.Zero()),l.TransformToRef(e,o._pickWithRayInverseMatrix,o._cachedRayForTransform),o._cachedRayForTransform},t,i,!1,n);return a&&(a.ray=e),a},s.a.prototype.multiPick=function(e,t,i,n,r){var o=this;return this._internalMultiPick(function(i){return o.createPickingRay(e,t,i,n||null)},i,r)},s.a.prototype.multiPickWithRay=function(e,t,i){var n=this;return this._internalMultiPick(function(t){return n._pickWithRayInverseMatrix||(n._pickWithRayInverseMatrix=r.a.Identity()),t.invertToRef(n._pickWithRayInverseMatrix),n._cachedRayForTransform||(n._cachedRayForTransform=l.Zero()),l.TransformToRef(e,n._pickWithRayInverseMatrix,n._cachedRayForTransform),n._cachedRayForTransform},t,i)},c.a.prototype.getForwardRay=function(e,t,i){return void 0===e&&(e=100),this.getForwardRayToRef(new l(r.e.Zero(),r.e.Zero(),e),e,t,i)},c.a.prototype.getForwardRayToRef=function(e,t,i,n){return void 0===t&&(t=100),i||(i=this.getWorldMatrix()),e.length=t,n?e.origin.copyFrom(n):e.origin.copyFrom(this.position),r.c.Vector3[2].set(0,0,this._scene.useRightHandedSystem?-1:1),r.e.TransformNormalToRef(r.c.Vector3[2],i,r.c.Vector3[3]),r.e.NormalizeToRef(r.c.Vector3[3],e.direction),e}},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var n=i(0),r=i(7),o=i(16),a=i(98),s=i(4);o.a.CreateLineSystem=function(e){for(var t=[],i=[],n=e.lines,r=e.colors,a=[],s=0,c=0;c<n.length;c++)for(var l=n[c],u=0;u<l.length;u++){if(i.push(l[u].x,l[u].y,l[u].z),r){var h=r[c];a.push(h[u].r,h[u].g,h[u].b,h[u].a)}u>0&&(t.push(s-1),t.push(s)),s++}var d=new o.a;return d.indices=t,d.positions=i,r&&(d.colors=a),d},o.a.CreateDashedLines=function(e){var t,i,r=e.dashSize||3,a=e.gapSize||1,s=e.dashNb||200,c=e.points,l=new Array,u=new Array,h=n.e.Zero(),d=0,f=0,p=0,_=0,m=0;for(m=0;m<c.length-1;m++)c[m+1].subtractToRef(c[m],h),d+=h.length();for(i=r*(t=d/s)/(r+a),m=0;m<c.length-1;m++){c[m+1].subtractToRef(c[m],h),f=Math.floor(h.length()/t),h.normalize();for(var g=0;g<f;g++)p=t*g,l.push(c[m].x+p*h.x,c[m].y+p*h.y,c[m].z+p*h.z),l.push(c[m].x+(p+i)*h.x,c[m].y+(p+i)*h.y,c[m].z+(p+i)*h.z),u.push(_,_+1),_+=2}var v=new o.a;return v.positions=l,v.indices=u,v},r.a.CreateLines=function(e,t,i,n,r){void 0===i&&(i=null),void 0===n&&(n=!1),void 0===r&&(r=null);var o={points:t,updatable:n,instance:r};return c.CreateLines(e,o,i)},r.a.CreateDashedLines=function(e,t,i,n,r,o,a,s){void 0===o&&(o=null);var l={points:t,dashSize:i,gapSize:n,dashNb:r,updatable:a,instance:s};return c.CreateDashedLines(e,l,o)};var c=function(){function e(){}return e.CreateLineSystem=function(e,t,i){var n=t.instance,r=t.lines,c=t.colors;if(n){var l,u,h=n.getVerticesData(s.b.PositionKind);c&&(l=n.getVerticesData(s.b.ColorKind));for(var d=0,f=0,p=0;p<r.length;p++)for(var _=r[p],m=0;m<_.length;m++)h[d]=_[m].x,h[d+1]=_[m].y,h[d+2]=_[m].z,c&&l&&(u=c[p],l[f]=u[m].r,l[f+1]=u[m].g,l[f+2]=u[m].b,l[f+3]=u[m].a,f+=4),d+=3;return n.updateVerticesData(s.b.PositionKind,h,!1,!1),c&&l&&n.updateVerticesData(s.b.ColorKind,l,!1,!1),n}var g=!!c,v=new a.b(e,i,null,void 0,void 0,g,t.useVertexAlpha);return o.a.CreateLineSystem(t).applyToMesh(v,t.updatable),v},e.CreateLines=function(t,i,n){void 0===n&&(n=null);var r=i.colors?[i.colors]:null;return e.CreateLineSystem(t,{lines:[i.points],updatable:i.updatable,instance:i.instance,colors:r,useVertexAlpha:i.useVertexAlpha},n)},e.CreateDashedLines=function(e,t,i){void 0===i&&(i=null);var s=t.points,c=t.instance,l=t.gapSize||1,u=t.dashSize||3;if(c)return c.updateMeshPositions(function(e){var t,i,r=n.e.Zero(),o=e.length/6,a=0,l=0,u=0,h=0,d=0,f=0;for(d=0;d<s.length-1;d++)s[d+1].subtractToRef(s[d],r),a+=r.length();t=a/o;var p=c._creationDataStorage.dashSize;for(i=p*t/(p+c._creationDataStorage.gapSize),d=0;d<s.length-1;d++)for(s[d+1].subtractToRef(s[d],r),l=Math.floor(r.length()/t),r.normalize(),f=0;f<l&&h<e.length;)u=t*f,e[h]=s[d].x+u*r.x,e[h+1]=s[d].y+u*r.y,e[h+2]=s[d].z+u*r.z,e[h+3]=s[d].x+(u+i)*r.x,e[h+4]=s[d].y+(u+i)*r.y,e[h+5]=s[d].z+(u+i)*r.z,h+=6,f++;for(;h<e.length;)e[h]=s[d].x,e[h+1]=s[d].y,e[h+2]=s[d].z,h+=3},!1),c;var h=new a.b(e,i,null,void 0,void 0,void 0,t.useVertexAlpha);return o.a.CreateDashedLines(t).applyToMesh(h,t.updatable),h._creationDataStorage=new r.b,h._creationDataStorage.dashSize=u,h._creationDataStorage.gapSize=l,h},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var n=i(34),r=i(8),o=function(e,t){return e?e.getClassName&&"Mesh"===e.getClassName()?null:e.getClassName&&"SubMesh"===e.getClassName()?e.clone(t):e.clone?e.clone():null:null},a=function(){function e(){}return e.DeepCopy=function(e,t,i,a){for(var s=0,c=function(e){var t=[];do{Object.getOwnPropertyNames(e).forEach(function(e){-1===t.indexOf(e)&&t.push(e)})}while(e=Object.getPrototypeOf(e));return t}(e);s<c.length;s++){var l=c[s];if(("_"!==l[0]||a&&-1!==a.indexOf(l))&&!(n.a.EndsWith(l,"Observable")||i&&-1!==i.indexOf(l))){var u=e[l],h=typeof u;if("function"!==h)try{if("object"===h)if(u instanceof Array){if(t[l]=[],u.length>0)if("object"==typeof u[0])for(var d=0;d<u.length;d++){var f=o(u[d],t);-1===t[l].indexOf(f)&&t[l].push(f)}else t[l]=u.slice(0)}else t[l]=o(u,t);else t[l]=u}catch(e){r.a.Warn(e.message)}}}},e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return u}),i.d(t,"a",function(){return h});var n=i(1),r=i(3),o=i(6),a=i(12),s=i(9),c=i(76),l=i(121),u=function(e){function t(){var t=e.call(this)||this;return t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.EXPOSURE=!1,t.rebuild(),t}return Object(n.d)(t,e),t}(c.a),h=function(){function e(){this.colorCurves=new l.a,this._colorCurvesEnabled=!1,this._colorGradingEnabled=!1,this._colorGradingWithGreenDepth=!0,this._colorGradingBGR=!0,this._exposure=1,this._toneMappingEnabled=!1,this._toneMappingType=e.TONEMAPPING_STANDARD,this._contrast=1,this.vignetteStretch=0,this.vignetteCentreX=0,this.vignetteCentreY=0,this.vignetteWeight=1.5,this.vignetteColor=new s.b(0,0,0,0),this.vignetteCameraFov=.5,this._vignetteBlendMode=e.VIGNETTEMODE_MULTIPLY,this._vignetteEnabled=!1,this._applyByPostProcess=!1,this._isEnabled=!0,this.onUpdateParameters=new o.c}return Object.defineProperty(e.prototype,"colorCurvesEnabled",{get:function(){return this._colorCurvesEnabled},set:function(e){this._colorCurvesEnabled!==e&&(this._colorCurvesEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingTexture",{get:function(){return this._colorGradingTexture},set:function(e){this._colorGradingTexture!==e&&(this._colorGradingTexture=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingEnabled",{get:function(){return this._colorGradingEnabled},set:function(e){this._colorGradingEnabled!==e&&(this._colorGradingEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingWithGreenDepth",{get:function(){return this._colorGradingWithGreenDepth},set:function(e){this._colorGradingWithGreenDepth!==e&&(this._colorGradingWithGreenDepth=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingBGR",{get:function(){return this._colorGradingBGR},set:function(e){this._colorGradingBGR!==e&&(this._colorGradingBGR=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"exposure",{get:function(){return this._exposure},set:function(e){this._exposure!==e&&(this._exposure=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toneMappingEnabled",{get:function(){return this._toneMappingEnabled},set:function(e){this._toneMappingEnabled!==e&&(this._toneMappingEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toneMappingType",{get:function(){return this._toneMappingType},set:function(e){this._toneMappingType!==e&&(this._toneMappingType=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contrast",{get:function(){return this._contrast},set:function(e){this._contrast!==e&&(this._contrast=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignetteBlendMode",{get:function(){return this._vignetteBlendMode},set:function(e){this._vignetteBlendMode!==e&&(this._vignetteBlendMode=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignetteEnabled",{get:function(){return this._vignetteEnabled},set:function(e){this._vignetteEnabled!==e&&(this._vignetteEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"applyByPostProcess",{get:function(){return this._applyByPostProcess},set:function(e){this._applyByPostProcess!==e&&(this._applyByPostProcess=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),e.prototype._updateParameters=function(){this.onUpdateParameters.notifyObservers(this)},e.prototype.getClassName=function(){return"ImageProcessingConfiguration"},e.PrepareUniforms=function(e,t){t.EXPOSURE&&e.push("exposureLinear"),t.CONTRAST&&e.push("contrast"),t.COLORGRADING&&e.push("colorTransformSettings"),t.VIGNETTE&&(e.push("vInverseScreenSize"),e.push("vignetteSettings1"),e.push("vignetteSettings2")),t.COLORCURVES&&l.a.PrepareUniforms(e)},e.PrepareSamplers=function(e,t){t.COLORGRADING&&e.push("txColorTransform")},e.prototype.prepareDefines=function(t,i){if(void 0===i&&(i=!1),i!==this.applyByPostProcess||!this._isEnabled)return t.VIGNETTE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.EXPOSURE=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.IMAGEPROCESSING=!1,void(t.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled);switch(t.VIGNETTE=this.vignetteEnabled,t.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===e._VIGNETTEMODE_MULTIPLY,t.VIGNETTEBLENDMODEOPAQUE=!t.VIGNETTEBLENDMODEMULTIPLY,t.TONEMAPPING=this.toneMappingEnabled,this._toneMappingType){case e.TONEMAPPING_ACES:t.TONEMAPPING_ACES=!0;break;default:t.TONEMAPPING_ACES=!1}t.CONTRAST=1!==this.contrast,t.EXPOSURE=1!==this.exposure,t.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,t.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,t.COLORGRADING?t.COLORGRADING3D=this.colorGradingTexture.is3D:t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,t.SAMPLER3DBGRMAP=this.colorGradingBGR,t.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,t.IMAGEPROCESSING=t.VIGNETTE||t.TONEMAPPING||t.CONTRAST||t.EXPOSURE||t.COLORCURVES||t.COLORGRADING},e.prototype.isReady=function(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()},e.prototype.bind=function(e,t){if(this._colorCurvesEnabled&&this.colorCurves&&l.a.Bind(this.colorCurves,e),this._vignetteEnabled){var i=1/e.getEngine().getRenderWidth(),n=1/e.getEngine().getRenderHeight();e.setFloat2("vInverseScreenSize",i,n);var r=null!=t?t:n/i,o=Math.tan(.5*this.vignetteCameraFov),s=o*r,c=Math.sqrt(s*o);s=a.b.Mix(s,c,this.vignetteStretch),o=a.b.Mix(o,c,this.vignetteStretch),e.setFloat4("vignetteSettings1",s,o,-s*this.vignetteCentreX,-o*this.vignetteCentreY);var u=-2*this.vignetteWeight;e.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,u)}if(e.setFloat("exposureLinear",this.exposure),e.setFloat("contrast",this.contrast),this.colorGradingTexture){e.setTexture("txColorTransform",this.colorGradingTexture);var h=this.colorGradingTexture.getSize().height;e.setFloat4("colorTransformSettings",(h-1)/h,.5/h,h,this.colorGradingTexture.level)}},e.prototype.clone=function(){return r.a.Clone(function(){return new e},this)},e.prototype.serialize=function(){return r.a.Serialize(this)},e.Parse=function(t){return r.a.Parse(function(){return new e},t,null,null)},Object.defineProperty(e,"VIGNETTEMODE_MULTIPLY",{get:function(){return this._VIGNETTEMODE_MULTIPLY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"VIGNETTEMODE_OPAQUE",{get:function(){return this._VIGNETTEMODE_OPAQUE},enumerable:!1,configurable:!0}),e.TONEMAPPING_STANDARD=0,e.TONEMAPPING_ACES=1,e._VIGNETTEMODE_MULTIPLY=0,e._VIGNETTEMODE_OPAQUE=1,Object(n.c)([Object(r.g)()],e.prototype,"colorCurves",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_colorCurvesEnabled",void 0),Object(n.c)([Object(r.m)("colorGradingTexture")],e.prototype,"_colorGradingTexture",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_colorGradingEnabled",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_colorGradingWithGreenDepth",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_colorGradingBGR",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_exposure",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_toneMappingEnabled",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_toneMappingType",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_contrast",void 0),Object(n.c)([Object(r.c)()],e.prototype,"vignetteStretch",void 0),Object(n.c)([Object(r.c)()],e.prototype,"vignetteCentreX",void 0),Object(n.c)([Object(r.c)()],e.prototype,"vignetteCentreY",void 0),Object(n.c)([Object(r.c)()],e.prototype,"vignetteWeight",void 0),Object(n.c)([Object(r.f)()],e.prototype,"vignetteColor",void 0),Object(n.c)([Object(r.c)()],e.prototype,"vignetteCameraFov",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_vignetteBlendMode",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_vignetteEnabled",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_applyByPostProcess",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_isEnabled",void 0),e}();r.a._ImageProcessingConfigurationParser=h.Parse},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var n=i(44),r=i(0),o=i(2),a=i(103),s=i(113),c={min:0,max:0},l={min:0,max:0},u=function(e,t,i){var n=r.e.Dot(t.centerWorld,e),o=Math.abs(r.e.Dot(t.directions[0],e))*t.extendSize.x+Math.abs(r.e.Dot(t.directions[1],e))*t.extendSize.y+Math.abs(r.e.Dot(t.directions[2],e))*t.extendSize.z;i.min=n-o,i.max=n+o},h=function(e,t,i){return u(e,t,c),u(e,i,l),!(c.min>l.max||l.min>c.max)},d=function(){function e(e,t,i){this._isLocked=!1,this.boundingBox=new a.a(e,t,i),this.boundingSphere=new s.a(e,t,i)}return e.prototype.reConstruct=function(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)},Object.defineProperty(e.prototype,"minimum",{get:function(){return this.boundingBox.minimum},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this.boundingBox.maximum},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLocked",{get:function(){return this._isLocked},set:function(e){this._isLocked=e},enumerable:!1,configurable:!0}),e.prototype.update=function(e){this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))},e.prototype.centerOn=function(t,i){var n=e.TmpVector3[0].copyFrom(t).subtractInPlace(i),r=e.TmpVector3[1].copyFrom(t).addInPlace(i);return this.boundingBox.reConstruct(n,r,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(n,r,this.boundingBox.getWorldMatrix()),this},e.prototype.scale=function(e){return this.boundingBox.scale(e),this.boundingSphere.scale(e),this},e.prototype.isInFrustum=function(e,t){return void 0===t&&(t=o.a.MESHES_CULLINGSTRATEGY_STANDARD),!(t!==o.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION&&t!==o.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY||!this.boundingSphere.isCenterInFrustum(e))||!!this.boundingSphere.isInFrustum(e)&&(!(t!==o.a.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY&&t!==o.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY)||this.boundingBox.isInFrustum(e))},Object.defineProperty(e.prototype,"diagonalLength",{get:function(){var t=this.boundingBox;return t.maximumWorld.subtractToRef(t.minimumWorld,e.TmpVector3[0]).length()},enumerable:!1,configurable:!0}),e.prototype.isCompletelyInFrustum=function(e){return this.boundingBox.isCompletelyInFrustum(e)},e.prototype._checkCollision=function(e){return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)},e.prototype.intersectsPoint=function(e){return!!this.boundingSphere.centerWorld&&!!this.boundingSphere.intersectsPoint(e)&&!!this.boundingBox.intersectsPoint(e)},e.prototype.intersects=function(e,t){if(!s.a.Intersects(this.boundingSphere,e.boundingSphere))return!1;if(!a.a.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;var i=this.boundingBox,n=e.boundingBox;return!!(h(i.directions[0],i,n)&&h(i.directions[1],i,n)&&h(i.directions[2],i,n)&&h(n.directions[0],i,n)&&h(n.directions[1],i,n)&&h(n.directions[2],i,n)&&h(r.e.Cross(i.directions[0],n.directions[0]),i,n)&&h(r.e.Cross(i.directions[0],n.directions[1]),i,n)&&h(r.e.Cross(i.directions[0],n.directions[2]),i,n)&&h(r.e.Cross(i.directions[1],n.directions[0]),i,n)&&h(r.e.Cross(i.directions[1],n.directions[1]),i,n)&&h(r.e.Cross(i.directions[1],n.directions[2]),i,n)&&h(r.e.Cross(i.directions[2],n.directions[0]),i,n)&&h(r.e.Cross(i.directions[2],n.directions[1]),i,n)&&h(r.e.Cross(i.directions[2],n.directions[2]),i,n))},e.TmpVector3=n.a.BuildArray(2,r.e.Zero),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.BuildArray=function(e,t){for(var i=[],n=0;n<e;++n)i.push(t());return i},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var n=i(0),r=i(7),o=i(16);o.a.CreateSphere=function(e){for(var t=e.segments||32,i=e.diameterX||e.diameter||1,r=e.diameterY||e.diameter||1,a=e.diameterZ||e.diameter||1,s=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,c=e.slice&&e.slice<=0?1:e.slice||1,l=0===e.sideOrientation?0:e.sideOrientation||o.a.DEFAULTSIDE,u=!!e.dedupTopBottomIndices,h=new n.e(i/2,r/2,a/2),d=2+t,f=2*d,p=[],_=[],m=[],g=[],v=0;v<=d;v++){for(var b=v/d,y=b*Math.PI*c,T=0;T<=f;T++){var E=T/f,S=E*Math.PI*2*s,A=n.a.RotationZ(-y),P=n.a.RotationY(S),C=n.e.TransformCoordinates(n.e.Up(),A),R=n.e.TransformCoordinates(C,P),x=R.multiply(h),O=R.divide(h).normalize();_.push(x.x,x.y,x.z),m.push(O.x,O.y,O.z),g.push(E,b)}if(v>0)for(var M=_.length/3,I=M-2*(f+1);I+f+2<M;I++)u?(v>1&&(p.push(I),p.push(I+1),p.push(I+f+1)),(v<d||c<1)&&(p.push(I+f+1),p.push(I+1),p.push(I+f+2))):(p.push(I),p.push(I+1),p.push(I+f+1),p.push(I+f+1),p.push(I+1),p.push(I+f+2))}o.a._ComputeSides(l,_,p,m,g,e.frontUVs,e.backUVs);var D=new o.a;return D.indices=p,D.positions=_,D.normals=m,D.uvs=g,D},r.a.CreateSphere=function(e,t,i,n,r,o){var s={segments:t,diameterX:i,diameterY:i,diameterZ:i,sideOrientation:o,updatable:r};return a.CreateSphere(e,s,n)};var a=function(){function e(){}return e.CreateSphere=function(e,t,i){void 0===i&&(i=null);var n=new r.a(e,i);return t.sideOrientation=r.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,o.a.CreateSphere(t).applyToMesh(n,t.updatable),n},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var n=i(1),r=i(3),o=i(6),a=i(0),s=i(29),c=i(23),l=function(e){function t(i,n,r){void 0===n&&(n=null),void 0===r&&(r=!0);var s=e.call(this,i,n)||this;return s._forward=new a.e(0,0,1),s._forwardInverted=new a.e(0,0,-1),s._up=new a.e(0,1,0),s._right=new a.e(1,0,0),s._rightInverted=new a.e(-1,0,0),s._position=a.e.Zero(),s._rotation=a.e.Zero(),s._rotationQuaternion=null,s._scaling=a.e.One(),s._isDirty=!1,s._transformToBoneReferal=null,s._isAbsoluteSynced=!1,s._billboardMode=t.BILLBOARDMODE_NONE,s._preserveParentRotationForBillboard=!1,s.scalingDeterminant=1,s._infiniteDistance=!1,s.ignoreNonUniformScaling=!1,s.reIntegrateRotationIntoRotationQuaternion=!1,s._poseMatrix=null,s._localMatrix=a.a.Zero(),s._usePivotMatrix=!1,s._absolutePosition=a.e.Zero(),s._absoluteScaling=a.e.Zero(),s._absoluteRotationQuaternion=a.b.Identity(),s._pivotMatrix=a.a.Identity(),s._postMultiplyPivotMatrix=!1,s._isWorldMatrixFrozen=!1,s._indexInSceneTransformNodesArray=-1,s.onAfterWorldMatrixUpdateObservable=new o.c,s._nonUniformScaling=!1,r&&s.getScene().addTransformNode(s),s}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"billboardMode",{get:function(){return this._billboardMode},set:function(e){this._billboardMode!==e&&(this._billboardMode=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"preserveParentRotationForBillboard",{get:function(){return this._preserveParentRotationForBillboard},set:function(e){e!==this._preserveParentRotationForBillboard&&(this._preserveParentRotationForBillboard=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"infiniteDistance",{get:function(){return this._infiniteDistance},set:function(e){this._infiniteDistance!==e&&(this._infiniteDistance=e)},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"TransformNode"},Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation=e,this._rotationQuaternion=null,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this._scaling},set:function(e){this._scaling=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._rotationQuaternion},set:function(e){this._rotationQuaternion=e,e&&this._rotation.setAll(0),this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forward",{get:function(){return a.e.Normalize(a.e.TransformNormal(this.getScene().useRightHandedSystem?this._forwardInverted:this._forward,this.getWorldMatrix()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"up",{get:function(){return a.e.Normalize(a.e.TransformNormal(this._up,this.getWorldMatrix()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return a.e.Normalize(a.e.TransformNormal(this.getScene().useRightHandedSystem?this._rightInverted:this._right,this.getWorldMatrix()))},enumerable:!1,configurable:!0}),t.prototype.updatePoseMatrix=function(e){return this._poseMatrix?(this._poseMatrix.copyFrom(e),this):(this._poseMatrix=e.clone(),this)},t.prototype.getPoseMatrix=function(){return this._poseMatrix||(this._poseMatrix=a.a.Identity()),this._poseMatrix},t.prototype._isSynchronized=function(){var e=this._cache;return!(this.billboardMode!==e.billboardMode||this.billboardMode!==t.BILLBOARDMODE_NONE||e.pivotMatrixUpdated||this.infiniteDistance||this.position._isDirty||this.scaling._isDirty||this._rotationQuaternion&&this._rotationQuaternion._isDirty||this.rotation._isDirty)},t.prototype._initCache=function(){e.prototype._initCache.call(this);var t=this._cache;t.localMatrixUpdated=!1,t.billboardMode=-1,t.infiniteDistance=!1},t.prototype.markAsDirty=function(e){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this},Object.defineProperty(t.prototype,"absolutePosition",{get:function(){return this._absolutePosition},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"absoluteScaling",{get:function(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"absoluteRotationQuaternion",{get:function(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion},enumerable:!1,configurable:!0}),t.prototype.setPreTransformMatrix=function(e){return this.setPivotMatrix(e,!1)},t.prototype.setPivotMatrix=function(e,t){return void 0===t&&(t=!0),this._pivotMatrix.copyFrom(e),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=a.a.Invert(this._pivotMatrix)),this},t.prototype.getPivotMatrix=function(){return this._pivotMatrix},t.prototype.instantiateHierarchy=function(e,t,i){void 0===e&&(e=null);var n=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0);n&&i&&i(this,n);for(var r=0,o=this.getChildTransformNodes(!0);r<o.length;r++)o[r].instantiateHierarchy(n,t,i);return n},t.prototype.freezeWorldMatrix=function(e){return void 0===e&&(e=null),e?this._worldMatrix=e:(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this},t.prototype.unfreezeWorldMatrix=function(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this},Object.defineProperty(t.prototype,"isWorldMatrixFrozen",{get:function(){return this._isWorldMatrixFrozen},enumerable:!1,configurable:!0}),t.prototype.getAbsolutePosition=function(){return this.computeWorldMatrix(),this._absolutePosition},t.prototype.setAbsolutePosition=function(e){if(!e)return this;var t,i,n;if(void 0===e.x){if(arguments.length<3)return this;t=arguments[0],i=arguments[1],n=arguments[2]}else t=e.x,i=e.y,n=e.z;if(this.parent){var r=a.c.Matrix[0];this.parent.getWorldMatrix().invertToRef(r),a.e.TransformCoordinatesFromFloatsToRef(t,i,n,r,this.position)}else this.position.x=t,this.position.y=i,this.position.z=n;return this._absolutePosition.copyFrom(e),this},t.prototype.setPositionWithLocalVector=function(e){return this.computeWorldMatrix(),this.position=a.e.TransformNormal(e,this._localMatrix),this},t.prototype.getPositionExpressedInLocalSpace=function(){this.computeWorldMatrix();var e=a.c.Matrix[0];return this._localMatrix.invertToRef(e),a.e.TransformNormal(this.position,e)},t.prototype.locallyTranslate=function(e){return this.computeWorldMatrix(!0),this.position=a.e.TransformCoordinates(e,this._localMatrix),this},t.prototype.lookAt=function(e,i,n,r,o){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=c.c.LOCAL);var s=t._lookAtVectorCache,l=o===c.c.LOCAL?this.position:this.getAbsolutePosition();if(e.subtractToRef(l,s),this.setDirection(s,i,n,r),o===c.c.WORLD&&this.parent)if(this.rotationQuaternion){var u=a.c.Matrix[0];this.rotationQuaternion.toRotationMatrix(u);var h=a.c.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(h),h.invert(),u.multiplyToRef(h,u),this.rotationQuaternion.fromRotationMatrix(u)}else{var d=a.c.Quaternion[0];a.b.FromEulerVectorToRef(this.rotation,d),u=a.c.Matrix[0],d.toRotationMatrix(u),h=a.c.Matrix[1],this.parent.getWorldMatrix().getRotationMatrixToRef(h),h.invert(),u.multiplyToRef(h,u),d.fromRotationMatrix(u),d.toEulerAnglesToRef(this.rotation)}return this},t.prototype.getDirection=function(e){var t=a.e.Zero();return this.getDirectionToRef(e,t),t},t.prototype.getDirectionToRef=function(e,t){return a.e.TransformNormalToRef(e,this.getWorldMatrix(),t),this},t.prototype.setDirection=function(e,t,i,n){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0);var r=-Math.atan2(e.z,e.x)+Math.PI/2,o=Math.sqrt(e.x*e.x+e.z*e.z),s=-Math.atan2(e.y,o);return this.rotationQuaternion?a.b.RotationYawPitchRollToRef(r+t,s+i,n,this.rotationQuaternion):(this.rotation.x=s+i,this.rotation.y=r+t,this.rotation.z=n),this},t.prototype.setPivotPoint=function(e,t){void 0===t&&(t=c.c.LOCAL),0==this.getScene().getRenderId()&&this.computeWorldMatrix(!0);var i=this.getWorldMatrix();if(t==c.c.WORLD){var n=a.c.Matrix[0];i.invertToRef(n),e=a.e.TransformCoordinates(e,n)}return this.setPivotMatrix(a.a.Translation(-e.x,-e.y,-e.z),!0)},t.prototype.getPivotPoint=function(){var e=a.e.Zero();return this.getPivotPointToRef(e),e},t.prototype.getPivotPointToRef=function(e){return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this},t.prototype.getAbsolutePivotPoint=function(){var e=a.e.Zero();return this.getAbsolutePivotPointToRef(e),e},t.prototype.getAbsolutePivotPointToRef=function(e){return this.getPivotPointToRef(e),a.e.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this},t.prototype.setParent=function(e){if(!e&&!this.parent)return this;var t=a.c.Quaternion[0],i=a.c.Vector3[0],n=a.c.Vector3[1];if(e){var r=a.c.Matrix[0],o=a.c.Matrix[1];this.computeWorldMatrix(!0),e.computeWorldMatrix(!0),e.getWorldMatrix().invertToRef(o),this.getWorldMatrix().multiplyToRef(o,r),r.decompose(n,t,i)}else this.computeWorldMatrix(!0),this.getWorldMatrix().decompose(n,t,i);return this.rotationQuaternion?this.rotationQuaternion.copyFrom(t):t.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(n),this.position.copyFrom(i),this.parent=e,this},Object.defineProperty(t.prototype,"nonUniformScaling",{get:function(){return this._nonUniformScaling},enumerable:!1,configurable:!0}),t.prototype._updateNonUniformScalingState=function(e){return this._nonUniformScaling!==e&&(this._nonUniformScaling=e,!0)},t.prototype.attachToBone=function(e,t){return this._transformToBoneReferal=t,this.parent=e,e.getSkeleton().prepare(),e.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this},t.prototype.detachFromBone=function(){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,this.parent=null,this):this},t.prototype.rotate=function(e,i,n){var r;if(e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0)),n&&n!==c.c.LOCAL){if(this.parent){var o=a.c.Matrix[0];this.parent.getWorldMatrix().invertToRef(o),e=a.e.TransformNormal(e,o)}(r=a.b.RotationAxisToRef(e,i,t._rotationAxisCache)).multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}else r=a.b.RotationAxisToRef(e,i,t._rotationAxisCache),this.rotationQuaternion.multiplyToRef(r,this.rotationQuaternion);return this},t.prototype.rotateAround=function(e,t,i){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=a.b.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));var n=a.c.Vector3[0],r=a.c.Vector3[1],o=a.c.Vector3[2],s=a.c.Quaternion[0],c=a.c.Matrix[0],l=a.c.Matrix[1],u=a.c.Matrix[2],h=a.c.Matrix[3];return e.subtractToRef(this.position,n),a.a.TranslationToRef(n.x,n.y,n.z,c),a.a.TranslationToRef(-n.x,-n.y,-n.z,l),a.a.RotationAxisToRef(t,i,u),l.multiplyToRef(u,h),h.multiplyToRef(c,h),h.decompose(r,s,o),this.position.addInPlace(o),s.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this},t.prototype.translate=function(e,t,i){var n=e.scale(t);if(i&&i!==c.c.LOCAL)this.setAbsolutePosition(this.getAbsolutePosition().add(n));else{var r=this.getPositionExpressedInLocalSpace().add(n);this.setPositionWithLocalVector(r)}return this},t.prototype.addRotation=function(e,t,i){var n;this.rotationQuaternion?n=this.rotationQuaternion:(n=a.c.Quaternion[1],a.b.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,n));var r=a.c.Quaternion[0];return a.b.RotationYawPitchRollToRef(t,e,i,r),n.multiplyInPlace(r),this.rotationQuaternion||n.toEulerAnglesToRef(this.rotation),this},t.prototype._getEffectiveParent=function(){return this.parent},t.prototype.computeWorldMatrix=function(e){if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;var i=this.getScene().getRenderId();if(!this._isDirty&&!e&&this.isSynchronized())return this._currentRenderId=i,this._worldMatrix;var n=this.getScene().activeCamera,r=0!=(this._billboardMode&t.BILLBOARDMODE_USE_POSITION),o=this._billboardMode!==t.BILLBOARDMODE_NONE&&!this.preserveParentRotationForBillboard;o&&n&&r&&(this.lookAt(n.position),(this.billboardMode&t.BILLBOARDMODE_X)!==t.BILLBOARDMODE_X&&(this.rotation.x=0),(this.billboardMode&t.BILLBOARDMODE_Y)!==t.BILLBOARDMODE_Y&&(this.rotation.y=0),(this.billboardMode&t.BILLBOARDMODE_Z)!==t.BILLBOARDMODE_Z&&(this.rotation.z=0)),this._updateCache();var s=this._cache;s.pivotMatrixUpdated=!1,s.billboardMode=this.billboardMode,s.infiniteDistance=this.infiniteDistance,this._currentRenderId=i,this._childUpdateId++,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;var c,l=this._getEffectiveParent(),u=t._TmpScaling,h=this._position;if(this._infiniteDistance&&!this.parent&&n){var d=n.getWorldMatrix(),f=new a.e(d.m[12],d.m[13],d.m[14]);(h=t._TmpTranslation).copyFromFloats(this._position.x+f.x,this._position.y+f.y,this._position.z+f.z)}if(u.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant),this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,c=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(a.b.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(c=t._TmpRotation,a.b.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,c)),this._usePivotMatrix){var p=a.c.Matrix[1];a.a.ScalingToRef(u.x,u.y,u.z,p);var _=a.c.Matrix[0];c.toRotationMatrix(_),this._pivotMatrix.multiplyToRef(p,a.c.Matrix[4]),a.c.Matrix[4].multiplyToRef(_,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(h.x,h.y,h.z)}else a.a.ComposeToRef(u,c,h,this._localMatrix);if(l&&l.getWorldMatrix){if(e&&l.computeWorldMatrix(),o){this._transformToBoneReferal?l.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),a.c.Matrix[7]):a.c.Matrix[7].copyFrom(l.getWorldMatrix());var m=a.c.Vector3[5],g=a.c.Vector3[6];a.c.Matrix[7].decompose(g,void 0,m),a.a.ScalingToRef(g.x,g.y,g.z,a.c.Matrix[7]),a.c.Matrix[7].setTranslation(m),this._localMatrix.multiplyToRef(a.c.Matrix[7],this._worldMatrix)}else this._transformToBoneReferal?(this._localMatrix.multiplyToRef(l.getWorldMatrix(),a.c.Matrix[6]),a.c.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)):this._localMatrix.multiplyToRef(l.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(o&&n&&this.billboardMode&&!r){var v=a.c.Vector3[0];if(this._worldMatrix.getTranslationToRef(v),a.c.Matrix[1].copyFrom(n.getViewMatrix()),a.c.Matrix[1].setTranslationFromFloats(0,0,0),a.c.Matrix[1].invertToRef(a.c.Matrix[0]),(this.billboardMode&t.BILLBOARDMODE_ALL)!==t.BILLBOARDMODE_ALL){a.c.Matrix[0].decompose(void 0,a.c.Quaternion[0],void 0);var b=a.c.Vector3[1];a.c.Quaternion[0].toEulerAnglesToRef(b),(this.billboardMode&t.BILLBOARDMODE_X)!==t.BILLBOARDMODE_X&&(b.x=0),(this.billboardMode&t.BILLBOARDMODE_Y)!==t.BILLBOARDMODE_Y&&(b.y=0),(this.billboardMode&t.BILLBOARDMODE_Z)!==t.BILLBOARDMODE_Z&&(b.z=0),a.a.RotationYawPitchRollToRef(b.y,b.x,b.z,a.c.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(a.c.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(a.c.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):l&&l._nonUniformScaling?this._updateNonUniformScalingState(l._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=a.a.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix},t.prototype.resetLocalMatrix=function(e){if(void 0===e&&(e=!0),this.computeWorldMatrix(),e)for(var t=this.getChildren(),i=0;i<t.length;++i){var n=t[i];if(n){n.computeWorldMatrix();var r=a.c.Matrix[0];n._localMatrix.multiplyToRef(this._localMatrix,r);var o=a.c.Quaternion[0];r.decompose(n.scaling,o,n.position),n.rotationQuaternion?n.rotationQuaternion=o:o.toEulerAnglesToRef(n.rotation)}}this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=a.b.Identity()),this._worldMatrix=a.a.Identity()},t.prototype._afterComputeWorldMatrix=function(){},t.prototype.registerAfterWorldMatrixUpdate=function(e){return this.onAfterWorldMatrixUpdateObservable.add(e),this},t.prototype.unregisterAfterWorldMatrixUpdate=function(e){return this.onAfterWorldMatrixUpdateObservable.removeCallback(e),this},t.prototype.getPositionInCameraSpace=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),a.e.TransformCoordinates(this.getAbsolutePosition(),e.getViewMatrix())},t.prototype.getDistanceToCamera=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),this.getAbsolutePosition().subtract(e.globalPosition).length()},t.prototype.clone=function(e,i,n){var o=this,a=r.a.Clone(function(){return new t(e,o.getScene())},this);if(a.name=e,a.id=e,i&&(a.parent=i),!n)for(var s=this.getDescendants(!0),c=0;c<s.length;c++){var l=s[c];l.clone&&l.clone(e+"."+l.name,a)}return a},t.prototype.serialize=function(e){var t=r.a.Serialize(this,e);return t.type=this.getClassName(),this.parent&&(t.parentId=this.parent.id),t.localMatrix=this.getPivotMatrix().asArray(),t.isEnabled=this.isEnabled(),this.parent&&(t.parentId=this.parent.id),t},t.Parse=function(e,i,n){var o=r.a.Parse(function(){return new t(e.name,i)},e,i,n);return e.localMatrix?o.setPreTransformMatrix(a.a.FromArray(e.localMatrix)):e.pivotMatrix&&o.setPivotMatrix(a.a.FromArray(e.pivotMatrix)),o.setEnabled(e.isEnabled),e.parentId&&(o._waitingParentId=e.parentId),o},t.prototype.getChildTransformNodes=function(e,i){var n=[];return this._getDescendants(n,e,function(e){return(!i||i(e))&&e instanceof t}),n},t.prototype.dispose=function(t,i){if(void 0===i&&(i=!1),this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this.onAfterWorldMatrixUpdateObservable.clear(),t)for(var n=0,r=this.getChildTransformNodes(!0);n<r.length;n++){var o=r[n];o.parent=null,o.computeWorldMatrix(!0)}e.prototype.dispose.call(this,t,i)},t.prototype.normalizeToUnitCube=function(e,t,i){void 0===e&&(e=!0),void 0===t&&(t=!1);var n=null,r=null;t&&(this.rotationQuaternion?(r=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(n=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));var o=this.getHierarchyBoundingVectors(e,i),a=o.max.subtract(o.min),s=Math.max(a.x,a.y,a.z);if(0===s)return this;var c=1/s;return this.scaling.scaleInPlace(c),t&&(this.rotationQuaternion&&r?this.rotationQuaternion.copyFrom(r):this.rotation&&n&&this.rotation.copyFrom(n)),this},t.prototype._syncAbsoluteScalingAndRotation=function(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)},t.BILLBOARDMODE_NONE=0,t.BILLBOARDMODE_X=1,t.BILLBOARDMODE_Y=2,t.BILLBOARDMODE_Z=4,t.BILLBOARDMODE_ALL=7,t.BILLBOARDMODE_USE_POSITION=128,t._TmpRotation=a.b.Zero(),t._TmpScaling=a.e.Zero(),t._TmpTranslation=a.e.Zero(),t._lookAtVectorCache=new a.e(0,0,0),t._rotationAxisCache=new a.b,Object(n.c)([Object(r.o)("position")],t.prototype,"_position",void 0),Object(n.c)([Object(r.o)("rotation")],t.prototype,"_rotation",void 0),Object(n.c)([Object(r.l)("rotationQuaternion")],t.prototype,"_rotationQuaternion",void 0),Object(n.c)([Object(r.o)("scaling")],t.prototype,"_scaling",void 0),Object(n.c)([Object(r.c)("billboardMode")],t.prototype,"_billboardMode",void 0),Object(n.c)([Object(r.c)()],t.prototype,"scalingDeterminant",void 0),Object(n.c)([Object(r.c)("infiniteDistance")],t.prototype,"_infiniteDistance",void 0),Object(n.c)([Object(r.c)()],t.prototype,"ignoreNonUniformScaling",void 0),Object(n.c)([Object(r.c)()],t.prototype,"reIntegrateRotationIntoRotationQuaternion",void 0),t}(s.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(e,t,i,n,r,o){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=n,this.sourceEvent=r,this.additionalData=o}return e.CreateNew=function(t,i,n){var r=t.getScene();return new e(t,r.pointerX,r.pointerY,r.meshUnderPointer||t,i,n)},e.CreateNewFromSprite=function(t,i,n,r){return new e(t,i.pointerX,i.pointerY,i.meshUnderPointer,n,r)},e.CreateNewFromScene=function(t,i){return new e(null,t.pointerX,t.pointerY,t.meshUnderPointer,i)},e.CreateNewFromPrimitive=function(t,i,n,r){return new e(t,i.x,i.y,null,n,r)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return u});var n=i(1),r=i(3),o=i(0),a=i(9),s=i(29),c=i(85),l=i(11),u=function(e){function t(i,n){var r=e.call(this,i,n)||this;return r.diffuse=new a.a(1,1,1),r.specular=new a.a(1,1,1),r.falloffType=t.FALLOFF_DEFAULT,r.intensity=1,r._range=Number.MAX_VALUE,r._inverseSquaredRange=0,r._photometricScale=1,r._intensityMode=t.INTENSITYMODE_AUTOMATIC,r._radius=1e-5,r.renderPriority=0,r._shadowEnabled=!0,r._excludeWithLayerMask=0,r._includeOnlyWithLayerMask=0,r._lightmapMode=0,r._excludedMeshesIds=new Array,r._includedOnlyMeshesIds=new Array,r._isLight=!0,r.getScene().addLight(r),r._uniformBuffer=new c.a(r.getScene().getEngine()),r._buildUniformLayout(),r.includedOnlyMeshes=new Array,r.excludedMeshes=new Array,r._resyncMeshes(),r}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"range",{get:function(){return this._range},set:function(e){this._range=e,this._inverseSquaredRange=1/(this.range*this.range)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intensityMode",{get:function(){return this._intensityMode},set:function(e){this._intensityMode=e,this._computePhotometricScale()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this._radius},set:function(e){this._radius=e,this._computePhotometricScale()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowEnabled",{get:function(){return this._shadowEnabled},set:function(e){this._shadowEnabled!==e&&(this._shadowEnabled=e,this._markMeshesAsLightDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"includedOnlyMeshes",{get:function(){return this._includedOnlyMeshes},set:function(e){this._includedOnlyMeshes=e,this._hookArrayForIncludedOnly(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"excludedMeshes",{get:function(){return this._excludedMeshes},set:function(e){this._excludedMeshes=e,this._hookArrayForExcluded(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"excludeWithLayerMask",{get:function(){return this._excludeWithLayerMask},set:function(e){this._excludeWithLayerMask=e,this._resyncMeshes()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"includeOnlyWithLayerMask",{get:function(){return this._includeOnlyWithLayerMask},set:function(e){this._includeOnlyWithLayerMask=e,this._resyncMeshes()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightmapMode",{get:function(){return this._lightmapMode},set:function(e){this._lightmapMode!==e&&(this._lightmapMode=e,this._markMeshesAsLightDirty())},enumerable:!1,configurable:!0}),t.prototype.transferTexturesToEffect=function(e,t){return this},t.prototype._bindLight=function(e,t,i,n,r){void 0===r&&(r=!1);var o=e.toString(),s=!1;if(!r||!this._uniformBuffer._alreadyBound){if(this._uniformBuffer.bindToEffect(i,"Light"+o),this._renderId!==t.getRenderId()||!this._uniformBuffer.useUbo){this._renderId=t.getRenderId();var c=this.getScaledIntensity();this.transferToEffect(i,o),this.diffuse.scaleToRef(c,a.c.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",a.c.Color3[0],this.range,o),n&&(this.specular.scaleToRef(c,a.c.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",a.c.Color3[1],this.radius,o)),s=!0}if(this.transferTexturesToEffect(i,o),t.shadowsEnabled&&this.shadowEnabled){var l=this.getShadowGenerator();l&&(l.bindShadowLight(o,i),s=!0)}s&&this._uniformBuffer.update()}},t.prototype.getClassName=function(){return"Light"},t.prototype.toString=function(e){var t="Name: "+this.name;if(t+=", type: "+["Point","Directional","Spot","Hemispheric"][this.getTypeID()],this.animations)for(var i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);return t},t.prototype._syncParentEnabledState=function(){e.prototype._syncParentEnabledState.call(this),this.isDisposed()||this._resyncMeshes()},t.prototype.setEnabled=function(t){e.prototype.setEnabled.call(this,t),this._resyncMeshes()},t.prototype.getShadowGenerator=function(){return this._shadowGenerator},t.prototype.getAbsolutePosition=function(){return o.e.Zero()},t.prototype.canAffectMesh=function(e){return!(e&&(this.includedOnlyMeshes&&this.includedOnlyMeshes.length>0&&-1===this.includedOnlyMeshes.indexOf(e)||this.excludedMeshes&&this.excludedMeshes.length>0&&-1!==this.excludedMeshes.indexOf(e)||0!==this.includeOnlyWithLayerMask&&0==(this.includeOnlyWithLayerMask&e.layerMask)||0!==this.excludeWithLayerMask&&this.excludeWithLayerMask&e.layerMask))},t.CompareLightsPriority=function(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority},t.prototype.dispose=function(t,i){void 0===i&&(i=!1),this._shadowGenerator&&(this._shadowGenerator.dispose(),this._shadowGenerator=null),this.getScene().stopAnimation(this);for(var n=0,r=this.getScene().meshes;n<r.length;n++)r[n]._removeLightSource(this,!0);this._uniformBuffer.dispose(),this.getScene().removeLight(this),e.prototype.dispose.call(this,t,i)},t.prototype.getTypeID=function(){return 0},t.prototype.getScaledIntensity=function(){return this._photometricScale*this.intensity},t.prototype.clone=function(e,i){void 0===i&&(i=null);var n=t.GetConstructorFromName(this.getTypeID(),e,this.getScene());if(!n)return null;var o=r.a.Clone(n,this);return i&&(o.parent=i),o.setEnabled(this.isEnabled()),o},t.prototype.serialize=function(){var e=r.a.Serialize(this);return e.type=this.getTypeID(),this.parent&&(e.parentId=this.parent.id),this.excludedMeshes.length>0&&(e.excludedMeshesIds=[],this.excludedMeshes.forEach(function(t){e.excludedMeshesIds.push(t.id)})),this.includedOnlyMeshes.length>0&&(e.includedOnlyMeshesIds=[],this.includedOnlyMeshes.forEach(function(t){e.includedOnlyMeshesIds.push(t.id)})),r.a.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e},t.GetConstructorFromName=function(e,t,i){return s.a.Construct("Light_Type_"+e,t,i)||null},t.Parse=function(e,i){var n=t.GetConstructorFromName(e.type,e.name,i);if(!n)return null;var o=r.a.Parse(n,e,i);if(e.excludedMeshesIds&&(o._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(o._includedOnlyMeshesIds=e.includedOnlyMeshesIds),e.parentId&&(o._waitingParentId=e.parentId),void 0!==e.falloffType&&(o.falloffType=e.falloffType),void 0!==e.lightmapMode&&(o.lightmapMode=e.lightmapMode),e.animations){for(var a=0;a<e.animations.length;a++){var c=e.animations[a],u=l.a.GetClass("BABYLON.Animation");u&&o.animations.push(u.Parse(c))}s.a.ParseAnimationRanges(o,e,i)}return e.autoAnimate&&i.beginAnimation(o,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),o},t.prototype._hookArrayForExcluded=function(e){var t=this,i=e.push;e.push=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var o=i.apply(e,n),a=0,s=n;a<s.length;a++){s[a]._resyncLightSource(t)}return o};var n=e.splice;e.splice=function(i,r){for(var o=n.apply(e,[i,r]),a=0,s=o;a<s.length;a++)s[a]._resyncLightSource(t);return o};for(var r=0,o=e;r<o.length;r++)o[r]._resyncLightSource(this)},t.prototype._hookArrayForIncludedOnly=function(e){var t=this,i=e.push;e.push=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=i.apply(e,n);return t._resyncMeshes(),o};var n=e.splice;e.splice=function(i,r){var o=n.apply(e,[i,r]);return t._resyncMeshes(),o},this._resyncMeshes()},t.prototype._resyncMeshes=function(){for(var e=0,t=this.getScene().meshes;e<t.length;e++)t[e]._resyncLightSource(this)},t.prototype._markMeshesAsLightDirty=function(){for(var e=0,t=this.getScene().meshes;e<t.length;e++){var i=t[e];-1!==i.lightSources.indexOf(this)&&i._markSubMeshesAsLightDirty()}},t.prototype._computePhotometricScale=function(){this._photometricScale=this._getPhotometricScale(),this.getScene().resetCachedMaterial()},t.prototype._getPhotometricScale=function(){var e=0,i=this.getTypeID(),n=this.intensityMode;switch(n===t.INTENSITYMODE_AUTOMATIC&&(n=i===t.LIGHTTYPEID_DIRECTIONALLIGHT?t.INTENSITYMODE_ILLUMINANCE:t.INTENSITYMODE_LUMINOUSINTENSITY),i){case t.LIGHTTYPEID_POINTLIGHT:case t.LIGHTTYPEID_SPOTLIGHT:switch(n){case t.INTENSITYMODE_LUMINOUSPOWER:e=1/(4*Math.PI);break;case t.INTENSITYMODE_LUMINOUSINTENSITY:e=1;break;case t.INTENSITYMODE_LUMINANCE:e=this.radius*this.radius}break;case t.LIGHTTYPEID_DIRECTIONALLIGHT:switch(n){case t.INTENSITYMODE_ILLUMINANCE:e=1;break;case t.INTENSITYMODE_LUMINANCE:var r=this.radius;r=Math.max(r,.001),e=2*Math.PI*(1-Math.cos(r))}break;case t.LIGHTTYPEID_HEMISPHERICLIGHT:e=1}return e},t.prototype._reorderLightsInScene=function(){var e=this.getScene();0!=this._renderPriority&&(e.requireLightSorting=!0),this.getScene().sortLightsByPriority()},t.FALLOFF_DEFAULT=0,t.FALLOFF_PHYSICAL=1,t.FALLOFF_GLTF=2,t.FALLOFF_STANDARD=3,t.LIGHTMAP_DEFAULT=0,t.LIGHTMAP_SPECULAR=1,t.LIGHTMAP_SHADOWSONLY=2,t.INTENSITYMODE_AUTOMATIC=0,t.INTENSITYMODE_LUMINOUSPOWER=1,t.INTENSITYMODE_LUMINOUSINTENSITY=2,t.INTENSITYMODE_ILLUMINANCE=3,t.INTENSITYMODE_LUMINANCE=4,t.LIGHTTYPEID_POINTLIGHT=0,t.LIGHTTYPEID_DIRECTIONALLIGHT=1,t.LIGHTTYPEID_SPOTLIGHT=2,t.LIGHTTYPEID_HEMISPHERICLIGHT=3,Object(n.c)([Object(r.e)()],t.prototype,"diffuse",void 0),Object(n.c)([Object(r.e)()],t.prototype,"specular",void 0),Object(n.c)([Object(r.c)()],t.prototype,"falloffType",void 0),Object(n.c)([Object(r.c)()],t.prototype,"intensity",void 0),Object(n.c)([Object(r.c)()],t.prototype,"range",null),Object(n.c)([Object(r.c)()],t.prototype,"intensityMode",null),Object(n.c)([Object(r.c)()],t.prototype,"radius",null),Object(n.c)([Object(r.c)()],t.prototype,"_renderPriority",void 0),Object(n.c)([Object(r.b)("_reorderLightsInScene")],t.prototype,"renderPriority",void 0),Object(n.c)([Object(r.c)("shadowEnabled")],t.prototype,"_shadowEnabled",void 0),Object(n.c)([Object(r.c)("excludeWithLayerMask")],t.prototype,"_excludeWithLayerMask",void 0),Object(n.c)([Object(r.c)("includeOnlyWithLayerMask")],t.prototype,"_includeOnlyWithLayerMask",void 0),Object(n.c)([Object(r.c)("lightmapMode")],t.prototype,"_lightmapMode",void 0),t}(s.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this._xhr="undefined"!=typeof _native&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}return e.prototype._injectCustomRequestHeaders=function(){for(var t in e.CustomRequestHeaders){var i=e.CustomRequestHeaders[t];i&&this._xhr.setRequestHeader(t,i)}},Object.defineProperty(e.prototype,"onprogress",{get:function(){return this._xhr.onprogress},set:function(e){this._xhr.onprogress=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._xhr.readyState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._xhr.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statusText",{get:function(){return this._xhr.statusText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"response",{get:function(){return this._xhr.response},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseURL",{get:function(){return this._xhr.responseURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseText",{get:function(){return this._xhr.responseText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseType",{get:function(){return this._xhr.responseType},set:function(e){this._xhr.responseType=e},enumerable:!1,configurable:!0}),e.prototype.addEventListener=function(e,t,i){this._xhr.addEventListener(e,t,i)},e.prototype.removeEventListener=function(e,t,i){this._xhr.removeEventListener(e,t,i)},e.prototype.abort=function(){this._xhr.abort()},e.prototype.send=function(t){e.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(t)},e.prototype.open=function(t,i){for(var n=0,r=e.CustomRequestModifiers;n<r.length;n++)(0,r[n])(this._xhr,i);return i=(i=i.replace("file:http:","http:")).replace("file:https:","https:"),this._xhr.open(t,i,!0)},e.prototype.setRequestHeader=function(e,t){this._xhr.setRequestHeader(e,t)},e.prototype.getResponseHeader=function(e){return this._xhr.getResponseHeader(e)},e.CustomRequestHeaders={},e.CustomRequestModifiers=new Array,e}()},function(e,t,i){"use strict";i.d(t,"e",function(){return r}),i.d(t,"a",function(){return o}),i.d(t,"d",function(){return a}),i.d(t,"c",function(){return s}),i.d(t,"b",function(){return c});var n=i(1),r=function(){function e(e,t){this.type=e,this.jointData=t,t.nativeParams=t.nativeParams||{}}return Object.defineProperty(e.prototype,"physicsJoint",{get:function(){return this._physicsJoint},set:function(e){this._physicsJoint,this._physicsJoint=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"physicsPlugin",{set:function(e){this._physicsPlugin=e},enumerable:!1,configurable:!0}),e.prototype.executeNativeFunction=function(e){e(this._physicsPlugin.world,this._physicsJoint)},e.DistanceJoint=0,e.HingeJoint=1,e.BallAndSocketJoint=2,e.WheelJoint=3,e.SliderJoint=4,e.PrismaticJoint=5,e.UniversalJoint=6,e.Hinge2Joint=e.WheelJoint,e.PointToPointJoint=8,e.SpringJoint=9,e.LockJoint=10,e}(),o=function(e){function t(t){return e.call(this,r.DistanceJoint,t)||this}return Object(n.d)(t,e),t.prototype.updateDistance=function(e,t){this._physicsPlugin.updateDistanceJoint(this,e,t)},t}(r),a=function(e){function t(t,i){return e.call(this,t,i)||this}return Object(n.d)(t,e),t.prototype.setMotor=function(e,t){this._physicsPlugin.setMotor(this,e||0,t)},t.prototype.setLimit=function(e,t){this._physicsPlugin.setLimit(this,e,t)},t}(r),s=function(e){function t(t){return e.call(this,r.HingeJoint,t)||this}return Object(n.d)(t,e),t.prototype.setMotor=function(e,t){this._physicsPlugin.setMotor(this,e||0,t)},t.prototype.setLimit=function(e,t){this._physicsPlugin.setLimit(this,e,t)},t}(a),c=function(e){function t(t){return e.call(this,r.Hinge2Joint,t)||this}return Object(n.d)(t,e),t.prototype.setMotor=function(e,t,i){void 0===i&&(i=0),this._physicsPlugin.setMotor(this,e||0,t,i)},t.prototype.setLimit=function(e,t,i){void 0===i&&(i=0),this._physicsPlugin.setLimit(this,e,t,i)},t}(a)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var n=i(0),r=i(7),o=i(36),a=i(18),s=function(){function e(e){var t=this;void 0===e&&(e=o.a.DefaultUtilityLayer),this.gizmoLayer=e,this._attachedMesh=null,this._attachedNode=null,this._scaleRatio=1,this._isHovered=!1,this._customMeshSet=!1,this._updateGizmoRotationToMatchAttachedMesh=!0,this.updateGizmoPositionToMatchAttachedMesh=!0,this.updateScale=!0,this._interactionsEnabled=!0,this._tempQuaternion=new n.b(0,0,0,1),this._tempVector=new n.e,this._tempVector2=new n.e,this._tempMatrix1=new n.a,this._tempMatrix2=new n.a,this._rightHandtoLeftHandMatrix=n.a.RotationY(Math.PI),this._rootMesh=new r.a("gizmoRootNode",e.utilityLayerScene),this._rootMesh.rotationQuaternion=n.b.Identity(),this._beforeRenderObserver=this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(function(){t._update()})}return Object.defineProperty(e.prototype,"scaleRatio",{get:function(){return this._scaleRatio},set:function(e){this._scaleRatio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHovered",{get:function(){return this._isHovered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attachedMesh",{get:function(){return this._attachedMesh},set:function(e){this._attachedMesh=e,e&&(this._attachedNode=e),this._rootMesh.setEnabled(!!e),this._attachedNodeChanged(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attachedNode",{get:function(){return this._attachedNode},set:function(e){this._attachedNode=e,this._attachedMesh=null,this._rootMesh.setEnabled(!!e),this._attachedNodeChanged(e)},enumerable:!1,configurable:!0}),e.prototype.setCustomMesh=function(e){if(e.getScene()!=this.gizmoLayer.utilityLayerScene)throw"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";this._rootMesh.getChildMeshes().forEach(function(e){e.dispose()}),e.parent=this._rootMesh,this._customMeshSet=!0},Object.defineProperty(e.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this._updateGizmoRotationToMatchAttachedMesh},set:function(e){this._updateGizmoRotationToMatchAttachedMesh=e},enumerable:!1,configurable:!0}),e.prototype._attachedNodeChanged=function(e){},e.prototype._update=function(){if(this.attachedNode){var e=this.attachedNode;if(this.attachedMesh&&(e=this.attachedMesh._effectiveMesh||this.attachedNode),this.updateGizmoPositionToMatchAttachedMesh){var t=e.getWorldMatrix().getRow(3),i=t?t.toVector3():new n.e(0,0,0);this._rootMesh.position.copyFrom(i)}if(this.updateGizmoRotationToMatchAttachedMesh?e.getWorldMatrix().decompose(void 0,this._rootMesh.rotationQuaternion):this._rootMesh.rotationQuaternion.set(0,0,0,1),this.updateScale){var r=this.gizmoLayer.utilityLayerScene.activeCamera,o=r.globalPosition;r.devicePosition&&(o=r.devicePosition),this._rootMesh.position.subtractToRef(o,this._tempVector);var a=this._tempVector.length()*this.scaleRatio;this._rootMesh.scaling.set(a,a,a),e._getWorldMatrixDeterminant()<0&&(this._rootMesh.scaling.y*=-1)}else this._rootMesh.scaling.setAll(this.scaleRatio)}},e.prototype._matrixChanged=function(){if(this._attachedNode)if(this._attachedNode._isCamera){var e,t,i=this._attachedNode;if(i.parent){var n=this._tempMatrix2;i.parent._worldMatrix.invertToRef(n),this._attachedNode._worldMatrix.multiplyToRef(n,this._tempMatrix1),e=this._tempMatrix1}else e=this._attachedNode._worldMatrix;if(i.getScene().useRightHandedSystem?(this._rightHandtoLeftHandMatrix.multiplyToRef(e,this._tempMatrix2),t=this._tempMatrix2):t=e,t.decompose(this._tempVector2,this._tempQuaternion,this._tempVector),"FreeCamera"===this._attachedNode.getClassName()||"FlyCamera"===this._attachedNode.getClassName()||"ArcFollowCamera"===this._attachedNode.getClassName()||"TargetCamera"===this._attachedNode.getClassName()||"TouchCamera"===this._attachedNode.getClassName()||"UniversalCamera"===this._attachedNode.getClassName()){var r=this._attachedNode;r.rotation=this._tempQuaternion.toEulerAngles(),r.rotationQuaternion&&r.rotationQuaternion.copyFrom(this._tempQuaternion)}i.position.copyFrom(this._tempVector)}else if(this._attachedNode._isMesh||"AbstractMesh"===this._attachedNode.getClassName()||"TransformNode"===this._attachedNode.getClassName()||"InstancedMesh"===this._attachedNode.getClassName()){var o=this._attachedNode;if(o.parent){n=this._tempMatrix1;var a=this._tempMatrix2;o.parent.getWorldMatrix().invertToRef(n),this._attachedNode.getWorldMatrix().multiplyToRef(n,a),a.decompose(o.scaling,this._tempQuaternion,o.position)}else this._attachedNode._worldMatrix.decompose(o.scaling,this._tempQuaternion,o.position);o.billboardMode||(o.rotationQuaternion?o.rotationQuaternion.copyFrom(this._tempQuaternion):o.rotation=this._tempQuaternion.toEulerAngles())}else if("Bone"===this._attachedNode.getClassName()){var s=this._attachedNode,c=s.getParent();if(c){var l=this._tempMatrix1,u=this._tempMatrix2;c.getWorldMatrix().invertToRef(l),s.getWorldMatrix().multiplyToRef(l,u),s.getLocalMatrix().copyFrom(u)}else s.getLocalMatrix().copyFrom(s.getWorldMatrix());s.markAsDirty()}},e.GizmoAxisPointerObserver=function(e,t){var i=!1;return e.utilityLayerScene.onPointerObservable.add(function(e){var n,r;if(e.pickInfo){if(e.type===a.a.POINTERMOVE){if(i)return;t.forEach(function(t){var i,n;if(t.colliderMeshes&&t.gizmoMeshes){var r=-1!=(null===(i=t.colliderMeshes)||void 0===i?void 0:i.indexOf(null===(n=null==e?void 0:e.pickInfo)||void 0===n?void 0:n.pickedMesh))||t.active?t.hoverMaterial:t.material;t.gizmoMeshes.forEach(function(e){e.material=r,e.color&&(e.color=r.diffuseColor)})}})}e.type===a.a.POINTERDOWN&&t.has(null===(n=e.pickInfo.pickedMesh)||void 0===n?void 0:n.parent)&&(i=!0,t.get(null===(r=e.pickInfo.pickedMesh)||void 0===r?void 0:r.parent).active=!0,t.forEach(function(t){var i,n,r=-1!=(null===(i=t.colliderMeshes)||void 0===i?void 0:i.indexOf(null===(n=null==e?void 0:e.pickInfo)||void 0===n?void 0:n.pickedMesh))||t.active?t.hoverMaterial:t.disableMaterial;t.gizmoMeshes.forEach(function(e){e.material=r,e.color&&(e.color=r.diffuseColor)})})),e.type===a.a.POINTERUP&&t.forEach(function(e){e.active=!1,i=!1,e.gizmoMeshes.forEach(function(t){t.material=e.material,t.color&&(t.color=e.material.diffuseColor)})})}})},e.prototype.dispose=function(){this._rootMesh.dispose(),this._beforeRenderObserver&&this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return h});var n=i(1),r=i(3),o=i(6),a=i(0),s=i(22),c=i(2),l=i(120),u=(i(56),i(77)),h=function(e){function t(i){var n=e.call(this,null)||this;return n.metadata=null,n.reservedDataStore=null,n._hasAlpha=!1,n.getAlphaFromRGB=!1,n.level=1,n.coordinatesIndex=0,n._coordinatesMode=c.a.TEXTURE_EXPLICIT_MODE,n.wrapR=c.a.TEXTURE_WRAP_ADDRESSMODE,n.anisotropicFilteringLevel=t.DEFAULT_ANISOTROPIC_FILTERING_LEVEL,n._isCube=!1,n._gammaSpace=!0,n.invertZ=!1,n.lodLevelInAlpha=!1,n.isRenderTarget=!1,n._prefiltered=!1,n.animations=new Array,n.onDisposeObservable=new o.c,n._onDisposeObserver=null,n._scene=null,n._texture=null,n._uid=null,i?t._isScene(i)?n._scene=i:n._engine=i:n._scene=s.a.LastCreatedScene,n._scene&&(n.uniqueId=n._scene.getUniqueId(),n._scene.addTexture(n),n._engine=n._scene.getEngine()),n._uid=null,n}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"hasAlpha",{get:function(){return this._hasAlpha},set:function(e){this._hasAlpha!==e&&(this._hasAlpha=e,this._scene&&this._scene.markAllMaterialsAsDirty(c.a.MATERIAL_TextureDirtyFlag|c.a.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"coordinatesMode",{get:function(){return this._coordinatesMode},set:function(e){this._coordinatesMode!==e&&(this._coordinatesMode=e,this._scene&&this._scene.markAllMaterialsAsDirty(c.a.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapU",{get:function(){return this._wrapU},set:function(e){this._wrapU=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapV",{get:function(){return this._wrapV},set:function(e){this._wrapV=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCube",{get:function(){return this._texture?this._texture.isCube:this._isCube},set:function(e){this._texture?this._texture.isCube=e:this._isCube=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"is3D",{get:function(){return!!this._texture&&this._texture.is3D},set:function(e){this._texture&&(this._texture.is3D=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"is2DArray",{get:function(){return!!this._texture&&this._texture.is2DArray},set:function(e){this._texture&&(this._texture.is2DArray=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gammaSpace",{get:function(){return this._texture?(null===this._texture._gammaSpace&&(this._texture._gammaSpace=this._gammaSpace),this._texture._gammaSpace):this._gammaSpace},set:function(e){if(this._texture){if(this._texture._gammaSpace===e)return;this._texture._gammaSpace=e}else{if(this._gammaSpace===e)return;this._gammaSpace=e}this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRGBD",{get:function(){return null!=this._texture&&this._texture._isRGBD},set:function(e){this._texture&&(this._texture._isRGBD=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noMipmap",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lodGenerationOffset",{get:function(){return this._texture?this._texture._lodGenerationOffset:0},set:function(e){this._texture&&(this._texture._lodGenerationOffset=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lodGenerationScale",{get:function(){return this._texture?this._texture._lodGenerationScale:0},set:function(e){this._texture&&(this._texture._lodGenerationScale=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linearSpecularLOD",{get:function(){return!!this._texture&&this._texture._linearSpecularLOD},set:function(e){this._texture&&(this._texture._linearSpecularLOD=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"irradianceTexture",{get:function(){return this._texture?this._texture._irradianceTexture:null},set:function(e){this._texture&&(this._texture._irradianceTexture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uid",{get:function(){return this._uid||(this._uid=l.a.RandomId()),this._uid},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.name},t.prototype.getClassName=function(){return"BaseTexture"},Object.defineProperty(t.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isBlocking",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.getScene=function(){return this._scene},t.prototype._getEngine=function(){return this._engine},t.prototype.checkTransformsAreIdentical=function(e){return null!==e},t.prototype.getTextureMatrix=function(){return a.a.IdentityReadOnly},t.prototype.getReflectionTextureMatrix=function(){return a.a.IdentityReadOnly},t.prototype.isReadyOrNotBlocking=function(){return!this.isBlocking||this.isReady()},t.prototype.scale=function(e){},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype._getFromCache=function(e,t,i,n){var r=this._getEngine();if(!r)return null;for(var o=r.getLoadedTexturesCache(),a=0;a<o.length;a++){var s=o[a];if(!(void 0!==n&&n!==s.invertY||s.url!==e||s.generateMipMaps!==!t||i&&i!==s.samplingMode))return s.incrementReferences(),s}return null},t.prototype._rebuild=function(){},t.prototype.clone=function(){return null},Object.defineProperty(t.prototype,"textureType",{get:function(){return this._texture&&void 0!==this._texture.type?this._texture.type:c.a.TEXTURETYPE_UNSIGNED_INT},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textureFormat",{get:function(){return this._texture&&void 0!==this._texture.format?this._texture.format:c.a.TEXTUREFORMAT_RGBA},enumerable:!1,configurable:!0}),t.prototype._markAllSubMeshesAsTexturesDirty=function(){var e=this.getScene();e&&e.markAllMaterialsAsDirty(c.a.MATERIAL_TextureDirtyFlag)},t.prototype.readPixels=function(e,t,i){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=null),!this._texture)return null;var n=this.getSize(),r=n.width,o=n.height,a=this._getEngine();if(!a)return null;0!=t&&(r/=Math.pow(2,t),o/=Math.pow(2,t),r=Math.round(r),o=Math.round(o));try{return this._texture.isCube?a._readTexturePixels(this._texture,r,o,e,t,i):a._readTexturePixels(this._texture,r,o,-1,t,i)}catch(e){return null}},Object.defineProperty(t.prototype,"_lodTextureHigh",{get:function(){return this._texture?this._texture._lodTextureHigh:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_lodTextureMid",{get:function(){return this._texture?this._texture._lodTextureMid:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_lodTextureLow",{get:function(){return this._texture?this._texture._lodTextureLow:null},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){if(this._scene){this._scene.stopAnimation&&this._scene.stopAnimation(this),this._scene._removePendingData(this);var t=this._scene.textures.indexOf(this);t>=0&&this._scene.textures.splice(t,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),e.prototype.dispose.call(this)},t.prototype.serialize=function(){if(!this.name)return null;var e=r.a.Serialize(this);return r.a.AppendSerializedAnimations(this,e),e},t.WhenAllReady=function(e,t){var i=e.length;if(0!==i)for(var n=0;n<e.length;n++){var r=e[n];if(r.isReady())0==--i&&t();else{var o=r.onLoadObservable;o&&o.addOnce(function(){0==--i&&t()})}}else t()},t._isScene=function(e){return"Scene"===e.getClassName()},t.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,Object(n.c)([Object(r.c)()],t.prototype,"uniqueId",void 0),Object(n.c)([Object(r.c)()],t.prototype,"name",void 0),Object(n.c)([Object(r.c)()],t.prototype,"metadata",void 0),Object(n.c)([Object(r.c)("hasAlpha")],t.prototype,"_hasAlpha",void 0),Object(n.c)([Object(r.c)()],t.prototype,"getAlphaFromRGB",void 0),Object(n.c)([Object(r.c)()],t.prototype,"level",void 0),Object(n.c)([Object(r.c)()],t.prototype,"coordinatesIndex",void 0),Object(n.c)([Object(r.c)("coordinatesMode")],t.prototype,"_coordinatesMode",void 0),Object(n.c)([Object(r.c)()],t.prototype,"wrapU",null),Object(n.c)([Object(r.c)()],t.prototype,"wrapV",null),Object(n.c)([Object(r.c)()],t.prototype,"wrapR",void 0),Object(n.c)([Object(r.c)()],t.prototype,"anisotropicFilteringLevel",void 0),Object(n.c)([Object(r.c)()],t.prototype,"isCube",null),Object(n.c)([Object(r.c)()],t.prototype,"is3D",null),Object(n.c)([Object(r.c)()],t.prototype,"is2DArray",null),Object(n.c)([Object(r.c)()],t.prototype,"gammaSpace",null),Object(n.c)([Object(r.c)()],t.prototype,"invertZ",void 0),Object(n.c)([Object(r.c)()],t.prototype,"lodLevelInAlpha",void 0),Object(n.c)([Object(r.c)()],t.prototype,"lodGenerationOffset",null),Object(n.c)([Object(r.c)()],t.prototype,"lodGenerationScale",null),Object(n.c)([Object(r.c)()],t.prototype,"linearSpecularLOD",null),Object(n.c)([Object(r.m)()],t.prototype,"irradianceTexture",null),Object(n.c)([Object(r.c)()],t.prototype,"isRenderTarget",void 0),t}(function(){function e(e){this._wrapU=c.a.TEXTURE_WRAP_ADDRESSMODE,this._wrapV=c.a.TEXTURE_WRAP_ADDRESSMODE,this.wrapR=c.a.TEXTURE_WRAP_ADDRESSMODE,this.anisotropicFilteringLevel=4,this.delayLoadState=c.a.DELAYLOADSTATE_NONE,this._texture=null,this._engine=null,this._cachedSize=u.a.Zero(),this._cachedBaseSize=u.a.Zero(),this._texture=e,this._texture&&(this._engine=this._texture.getEngine())}return Object.defineProperty(e.prototype,"wrapU",{get:function(){return this._wrapU},set:function(e){this._wrapU=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapV",{get:function(){return this._wrapV},set:function(e){this._wrapV=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinatesMode",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCube",{get:function(){return!!this._texture&&this._texture.isCube},set:function(e){this._texture&&(this._texture.isCube=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"is3D",{get:function(){return!!this._texture&&this._texture.is3D},set:function(e){this._texture&&(this._texture.is3D=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"is2DArray",{get:function(){return!!this._texture&&this._texture.is2DArray},set:function(e){this._texture&&(this._texture.is2DArray=e)},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"ThinTexture"},e.prototype.isReady=function(){return this.delayLoadState===c.a.DELAYLOADSTATE_NOTLOADED?(this.delayLoad(),!1):!!this._texture&&this._texture.isReady},e.prototype.delayLoad=function(){},e.prototype.getInternalTexture=function(){return this._texture},e.prototype.getSize=function(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize},e.prototype.getBaseSize=function(){return this.isReady()&&this._texture?this._texture._size?(this._cachedBaseSize.width=this._texture._size,this._cachedBaseSize.height=this._texture._size,this._cachedBaseSize):(this._cachedBaseSize.width=this._texture.baseWidth,this._cachedBaseSize.height=this._texture.baseHeight,this._cachedBaseSize):(this._cachedBaseSize.width=0,this._cachedBaseSize.height=0,this._cachedBaseSize)},e.prototype.updateSamplingMode=function(e){this._texture&&this._engine&&this._engine.updateTextureSamplingMode(e,this._texture)},e.prototype.releaseInternalTexture=function(){this._texture&&(this._texture.dispose(),this._texture=null)},e.prototype.dispose=function(){this._texture&&(this.releaseInternalTexture(),this._engine=null)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var n=i(0),r=i(9),o=i(7),a=i(16),s=i(20),c=i(23);a.a.CreateCylinder=function(e){var t=e.height||2,i=0===e.diameterTop?0:e.diameterTop||e.diameter||1,s=0===e.diameterBottom?0:e.diameterBottom||e.diameter||1;i=i||1e-5,s=s||1e-5;var l,u=e.tessellation||24,h=e.subdivisions||1,d=!!e.hasRings,f=!!e.enclose,p=0===e.cap?0:e.cap||o.a.CAP_ALL,_=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,m=0===e.sideOrientation?0:e.sideOrientation||a.a.DEFAULTSIDE,g=e.faceUV||new Array(3),v=e.faceColors,b=2+(1+(1!==_&&f?2:0))*(d?h:1);for(l=0;l<b;l++)v&&void 0===v[l]&&(v[l]=new r.b(1,1,1,1));for(l=0;l<b;l++)g&&void 0===g[l]&&(g[l]=new n.f(0,0,1,1));var y,T,E,S,A,P,C=new Array,R=new Array,x=new Array,O=new Array,M=new Array,I=2*Math.PI*_/u,D=(s-i)/2/t,N=n.e.Zero(),L=n.e.Zero(),w=n.e.Zero(),F=n.e.Zero(),B=n.e.Zero(),U=c.a.Y,V=1,k=1,G=0,z=0;for(S=0;S<=h;S++)for(E=((T=S/h)*(i-s)+s)/2,V=d&&0!==S&&S!==h?2:1,P=0;P<V;P++){for(d&&(k+=P),f&&(k+=2*P),A=0;A<=u;A++)y=A*I,N.x=Math.cos(-y)*E,N.y=-t/2+T*t,N.z=Math.sin(-y)*E,0===i&&S===h?(L.x=x[x.length-3*(u+1)],L.y=x[x.length-3*(u+1)+1],L.z=x[x.length-3*(u+1)+2]):(L.x=N.x,L.z=N.z,L.y=Math.sqrt(L.x*L.x+L.z*L.z)*D,L.normalize()),0===A&&(w.copyFrom(N),F.copyFrom(L)),R.push(N.x,N.y,N.z),x.push(L.x,L.y,L.z),z=d?G!==k?g[k].y:g[k].w:g[k].y+(g[k].w-g[k].y)*T,O.push(g[k].x+(g[k].z-g[k].x)*A/u,z),v&&M.push(v[k].r,v[k].g,v[k].b,v[k].a);1!==_&&f&&(R.push(N.x,N.y,N.z),R.push(0,N.y,0),R.push(0,N.y,0),R.push(w.x,w.y,w.z),n.e.CrossToRef(U,L,B),B.normalize(),x.push(B.x,B.y,B.z,B.x,B.y,B.z),n.e.CrossToRef(F,U,B),B.normalize(),x.push(B.x,B.y,B.z,B.x,B.y,B.z),z=d?G!==k?g[k+1].y:g[k+1].w:g[k+1].y+(g[k+1].w-g[k+1].y)*T,O.push(g[k+1].x,z),O.push(g[k+1].z,z),z=d?G!==k?g[k+2].y:g[k+2].w:g[k+2].y+(g[k+2].w-g[k+2].y)*T,O.push(g[k+2].x,z),O.push(g[k+2].z,z),v&&(M.push(v[k+1].r,v[k+1].g,v[k+1].b,v[k+1].a),M.push(v[k+1].r,v[k+1].g,v[k+1].b,v[k+1].a),M.push(v[k+2].r,v[k+2].g,v[k+2].b,v[k+2].a),M.push(v[k+2].r,v[k+2].g,v[k+2].b,v[k+2].a))),G!==k&&(G=k)}var j=1!==_&&f?u+4:u;for(S=0,k=0;k<h;k++){var W=0,H=0,X=0,Y=0;for(A=0;A<u;A++)W=S*(j+1)+A,H=(S+1)*(j+1)+A,X=S*(j+1)+(A+1),Y=(S+1)*(j+1)+(A+1),C.push(W,H,X),C.push(Y,X,H);1!==_&&f&&(C.push(W+2,H+2,X+2),C.push(Y+2,X+2,H+2),C.push(W+4,H+4,X+4),C.push(Y+4,X+4,H+4)),S=d?S+2:S+1}var K=function(e){var r=e?i/2:s/2;if(0!==r){var o,a,c,l=e?g[b-1]:g[0],h=null;v&&(h=e?v[b-1]:v[0]);var d=R.length/3,f=e?t/2:-t/2,p=new n.e(0,f,0);R.push(p.x,p.y,p.z),x.push(0,e?1:-1,0),O.push(l.x+.5*(l.z-l.x),l.y+.5*(l.w-l.y)),h&&M.push(h.r,h.g,h.b,h.a);var m=new n.d(.5,.5);for(c=0;c<=u;c++){o=2*Math.PI*c*_/u;var y=Math.cos(-o),T=Math.sin(-o);a=new n.e(y*r,f,T*r);var E=new n.d(y*m.x+.5,T*m.y+.5);R.push(a.x,a.y,a.z),x.push(0,e?1:-1,0),O.push(l.x+(l.z-l.x)*E.x,l.y+(l.w-l.y)*E.y),h&&M.push(h.r,h.g,h.b,h.a)}for(c=0;c<u;c++)e?(C.push(d),C.push(d+(c+2)),C.push(d+(c+1))):(C.push(d),C.push(d+(c+1)),C.push(d+(c+2)))}};p!==o.a.CAP_START&&p!==o.a.CAP_ALL||K(!1),p!==o.a.CAP_END&&p!==o.a.CAP_ALL||K(!0),a.a._ComputeSides(m,R,C,x,O,e.frontUVs,e.backUVs);var Q=new a.a;return Q.indices=C,Q.positions=R,Q.normals=x,Q.uvs=O,v&&(Q.colors=M),Q},o.a.CreateCylinder=function(e,t,i,n,r,a,c,u,h){void 0!==c&&c instanceof s.a||(void 0!==c&&(h=u||o.a.DEFAULTSIDE,u=c),c=a,a=1);var d={height:t,diameterTop:i,diameterBottom:n,tessellation:r,subdivisions:a,sideOrientation:h,updatable:u};return l.CreateCylinder(e,d,c)};var l=function(){function e(){}return e.CreateCylinder=function(e,t,i){var n=new o.a(e,i);return t.sideOrientation=o.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,a.a.CreateCylinder(t).applyToMesh(n,t.updatable),n},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(0),r=i(4),o=function(){function e(){this._pickingUnavailable=!1,this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.originMesh=null,this.ray=null}return e.prototype.getNormal=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=!0),!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(r.b.NormalKind))return null;var i,o=this.pickedMesh.getIndices();if(!o)return null;if(t){var a=this.pickedMesh.getVerticesData(r.b.NormalKind),s=n.e.FromArray(a,3*o[3*this.faceId]),c=n.e.FromArray(a,3*o[3*this.faceId+1]),l=n.e.FromArray(a,3*o[3*this.faceId+2]);s=s.scale(this.bu),c=c.scale(this.bv),l=l.scale(1-this.bu-this.bv),i=new n.e(s.x+c.x+l.x,s.y+c.y+l.y,s.z+c.z+l.z)}else{var u=this.pickedMesh.getVerticesData(r.b.PositionKind),h=n.e.FromArray(u,3*o[3*this.faceId]),d=n.e.FromArray(u,3*o[3*this.faceId+1]),f=n.e.FromArray(u,3*o[3*this.faceId+2]),p=h.subtract(d),_=f.subtract(d);i=n.e.Cross(p,_)}if(e){var m=this.pickedMesh.getWorldMatrix();this.pickedMesh.nonUniformScaling&&(n.c.Matrix[0].copyFrom(m),(m=n.c.Matrix[0]).setTranslationFromFloats(0,0,0),m.invert(),m.transposeToRef(n.c.Matrix[1]),m=n.c.Matrix[1]),i=n.e.TransformNormal(i,m)}return i.normalize(),i},e.prototype.getTextureCoordinates=function(){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(r.b.UVKind))return null;var e=this.pickedMesh.getIndices();if(!e)return null;var t=this.pickedMesh.getVerticesData(r.b.UVKind);if(!t)return null;var i=n.d.FromArray(t,2*e[3*this.faceId]),o=n.d.FromArray(t,2*e[3*this.faceId+1]),a=n.d.FromArray(t,2*e[3*this.faceId+2]);return i=i.scale(this.bu),o=o.scale(this.bv),a=a.scale(1-this.bu-this.bv),new n.d(i.x+o.x+a.x,i.y+o.y+a.y)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(57),r=function(){function e(){this._startMonitoringTime=0,this._min=0,this._max=0,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}return Object.defineProperty(e.prototype,"min",{get:function(){return this._min},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"average",{get:function(){return this._average},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecAverage",{get:function(){return this._lastSecAverage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this._current},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this._totalAccumulated},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._totalValueCount},enumerable:!1,configurable:!0}),e.prototype.fetchNewFrame=function(){this._totalValueCount++,this._current=0,this._lastSecValueCount++},e.prototype.addCount=function(t,i){e.Enabled&&(this._current+=t,i&&this._fetchResult())},e.prototype.beginMonitoring=function(){e.Enabled&&(this._startMonitoringTime=n.a.Now)},e.prototype.endMonitoring=function(t){if(void 0===t&&(t=!0),e.Enabled){t&&this.fetchNewFrame();var i=n.a.Now;this._current=i-this._startMonitoringTime,t&&this._fetchResult()}},e.prototype._fetchResult=function(){this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current),this._average=this._totalAccumulated/this._totalValueCount;var e=n.a.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)},e.Enabled=!0,e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return f}),i.d(t,"d",function(){return p}),i.d(t,"c",function(){return _}),i.d(t,"a",function(){return m});var n=i(1),r=i(49),o=i(38),a=i(6),s=i(83),c=i(140),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.d)(t,e),t._setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t}(Error),u=i(34),h=i(26),d=i(128),f=function(e){function t(i,n){var o=e.call(this,i)||this;return o.name="LoadFileError",l._setPrototypeOf(o,t.prototype),n instanceof r.a?o.request=n:o.file=n,o}return Object(n.d)(t,e),t}(l),p=function(e){function t(i,n){var r=e.call(this,i)||this;return r.request=n,r.name="RequestFileError",l._setPrototypeOf(r,t.prototype),r}return Object(n.d)(t,e),t}(l),_=function(e){function t(i,n){var r=e.call(this,i)||this;return r.file=n,r.name="ReadFileError",l._setPrototypeOf(r,t.prototype),r}return Object(n.d)(t,e),t}(l),m=function(){function e(){}return e._CleanUrl=function(e){return e.replace(/#/gm,"%23")},e.SetCorsBehavior=function(t,i){if((!t||0!==t.indexOf("data:"))&&e.CorsBehavior)if("string"==typeof e.CorsBehavior||this.CorsBehavior instanceof String)i.crossOrigin=e.CorsBehavior;else{var n=e.CorsBehavior(t);n&&(i.crossOrigin=n)}},e.LoadImage=function(t,i,n,r,o){var a;void 0===o&&(o="");var c=!1;if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)?"undefined"!=typeof Blob?(a=URL.createObjectURL(new Blob([t],{type:o})),c=!0):a="data:"+o+";base64,"+u.a.EncodeArrayBufferToBase64(t):t instanceof Blob?(a=URL.createObjectURL(t),c=!0):(a=e._CleanUrl(t),a=e.PreprocessUrl(t)),"undefined"==typeof Image)return e.LoadFile(a,function(e){createImageBitmap(new Blob([e],{type:o})).then(function(e){i(e),c&&URL.revokeObjectURL(a)}).catch(function(e){n&&n("Error while trying to load image: "+t,e)})},void 0,r||void 0,!0,function(e,i){n&&n("Error while trying to load image: "+t,i)}),null;var l=new Image;e.SetCorsBehavior(a,l);var h=function(){l.removeEventListener("load",h),l.removeEventListener("error",d),i(l),c&&l.src&&URL.revokeObjectURL(l.src)},d=function(e){if(l.removeEventListener("load",h),l.removeEventListener("error",d),n){var i=t.toString();n("Error while trying to load image: "+(i.length<32?i:i.slice(0,32)+"..."),e)}c&&l.src&&URL.revokeObjectURL(l.src)};l.addEventListener("load",h),l.addEventListener("error",d);var f=function(){l.src=a};if("data:"!==a.substr(0,5)&&r&&r.enableTexturesOffline)r.open(function(){r&&r.loadImage(a,l)},f);else{if(-1!==a.indexOf("file:")){var p=decodeURIComponent(a.substring(5).toLowerCase());if(s.a.FilesToLoad[p]){try{var _;try{_=URL.createObjectURL(s.a.FilesToLoad[p])}catch(e){_=URL.createObjectURL(s.a.FilesToLoad[p])}l.src=_,c=!0}catch(e){l.src=""}return l}}f()}return l},e.ReadFile=function(e,t,i,n,r){var o=new FileReader,s={onCompleteObservable:new a.c,abort:function(){return o.abort()}};return o.onloadend=function(e){return s.onCompleteObservable.notifyObservers(s)},r&&(o.onerror=function(t){r(new _("Unable to read "+e.name,e))}),o.onload=function(e){t(e.target.result)},i&&(o.onprogress=i),n?o.readAsArrayBuffer(e):o.readAsText(e),s},e.LoadFile=function(t,i,n,r,o,a){if(-1!==t.indexOf("file:")){var c=decodeURIComponent(t.substring(5).toLowerCase());0===c.indexOf("./")&&(c=c.substring(2));var l=s.a.FilesToLoad[c];if(l)return e.ReadFile(l,i,n,o,a?function(e){return a(void 0,new f(e.message,e.file))}:void 0)}return e.RequestFile(t,function(e,t){i(e,t?t.responseURL:void 0)},n,r,o,a?function(e){a(e.request,new f(e.message,e.request))}:void 0)},e.RequestFile=function(t,i,n,s,c,l,u){t=e._CleanUrl(t),t=e.PreprocessUrl(t);var h=e.BaseUrl+t,d=!1,f={onCompleteObservable:new a.c,abort:function(){return d=!0}},_=function(){var t=new r.a,a=null;f.abort=function(){d=!0,t.readyState!==(XMLHttpRequest.DONE||4)&&t.abort(),null!==a&&(clearTimeout(a),a=null)};var s=function(_){t.open("GET",h),u&&u(t),c&&(t.responseType="arraybuffer"),n&&t.addEventListener("progress",n);var m=function(){t.removeEventListener("loadend",m),f.onCompleteObservable.notifyObservers(f),f.onCompleteObservable.clear()};t.addEventListener("loadend",m);var g=function(){if(!d&&t.readyState===(XMLHttpRequest.DONE||4)){if(t.removeEventListener("readystatechange",g),t.status>=200&&t.status<300||0===t.status&&(!o.a.IsWindowObjectExist()||e.IsFileURL()))return void i(c?t.response:t.responseText,t);var n=e.DefaultRetryStrategy;if(n){var u=n(h,t,_);if(-1!==u)return t.removeEventListener("loadend",m),t=new r.a,void(a=setTimeout(function(){return s(_+1)},u))}var f=new p("Error status: "+t.status+" "+t.statusText+" - Unable to load "+h,t);l&&l(f)}};t.addEventListener("readystatechange",g),t.send()};s(0)};if(s&&s.enableSceneOffline){var m=function(e){e&&e.status>400?l&&l(e):_()};s.open(function(){s&&s.loadFile(e.BaseUrl+t,function(e){d||i(e),f.onCompleteObservable.notifyObservers(f)},n?function(e){d||n(e)}:void 0,m,c)},m)}else _();return f},e.IsFileURL=function(){return"undefined"!=typeof location&&"file:"===location.protocol},e.DefaultRetryStrategy=c.a.ExponentialBackoff(),e.BaseUrl="",e.CorsBehavior="anonymous",e.PreprocessUrl=function(e){return e},e}();h.a._FileToolsLoadImage=m.LoadImage.bind(m),h.a._FileToolsLoadFile=m.LoadFile.bind(m),d.a._FileToolsLoadFile=m.LoadFile.bind(m)},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(38),r=function(){function e(){}return Object.defineProperty(e,"Now",{get:function(){return n.a.IsWindowObjectExist()&&window.performance&&window.performance.now?window.performance.now():Date.now()},enumerable:!1,configurable:!0}),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}return e.prototype.toGlobal=function(t,i){return new e(this.x*t,this.y*i,this.width*t,this.height*i)},e.prototype.toGlobalToRef=function(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e}()},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.helperFunctions="const float PI=3.1415926535897932384626433832795;\nconst float HALF_MIN=5.96046448e-08;\nconst float LinearEncodePowerApprox=2.2;\nconst float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;\nconst vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);\nconst float Epsilon=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\n#define absEps(x) abs(x)+Epsilon\n#define maxEps(x) max(x,Epsilon)\n#define saturateEps(x) clamp(x,Epsilon,1.0)\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\n\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\nfloat toLinearSpace(float color)\n{\nreturn pow(color,LinearEncodePowerApprox);\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec4 toLinearSpace(vec4 color)\n{\nreturn vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(GammaEncodePowerApprox));\n}\nvec4 toGammaSpace(vec4 color)\n{\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n}\nfloat toGammaSpace(float color)\n{\nreturn pow(color,GammaEncodePowerApprox);\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat pow5(float value) {\nfloat sq=value*value;\nreturn sq*sq*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,LuminanceEncodeApprox),0.,1.);\n}\n\nfloat getRand(vec2 seed) {\nreturn fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);\n}\nfloat dither(vec2 seed,float varianceAmount) {\nfloat rand=getRand(seed);\nfloat dither=mix(-varianceAmount/255.0,varianceAmount/255.0,rand);\nreturn dither;\n}\n\nconst float rgbdMaxRange=255.0;\nvec4 toRGBD(vec3 color) {\nfloat maxRGB=maxEps(max(color.r,max(color.g,color.b)));\nfloat D=max(rgbdMaxRange/maxRGB,1.);\nD=clamp(floor(D)/255.0,0.,1.);\n\nvec3 rgb=color.rgb*D;\n\nrgb=toGammaSpace(rgb);\nreturn vec4(rgb,D);\n}\nvec3 fromRGBD(vec4 rgbd) {\n\nrgbd.rgb=toLinearSpace(rgbd.rgb);\n\nreturn rgbd.rgb/rgbd.a;\n}\n"},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(0),r=function(){function e(){}return e._RemoveAndStorePivotPoint=function(t){t&&0===e._PivotCached&&(t.getPivotPointToRef(e._OldPivotPoint),e._PivotPostMultiplyPivotMatrix=t._postMultiplyPivotMatrix,e._OldPivotPoint.equalsToFloats(0,0,0)||(t.setPivotMatrix(n.a.IdentityReadOnly),e._OldPivotPoint.subtractToRef(t.getPivotPoint(),e._PivotTranslation),e._PivotTmpVector.copyFromFloats(1,1,1),e._PivotTmpVector.subtractInPlace(t.scaling),e._PivotTmpVector.multiplyInPlace(e._PivotTranslation),t.position.addInPlace(e._PivotTmpVector))),e._PivotCached++},e._RestorePivotPoint=function(t){t&&!e._OldPivotPoint.equalsToFloats(0,0,0)&&1===e._PivotCached&&(t.setPivotPoint(e._OldPivotPoint),t._postMultiplyPivotMatrix=e._PivotPostMultiplyPivotMatrix,e._PivotTmpVector.copyFromFloats(1,1,1),e._PivotTmpVector.subtractInPlace(t.scaling),e._PivotTmpVector.multiplyInPlace(e._PivotTranslation),t.position.subtractInPlace(e._PivotTmpVector)),this._PivotCached--},e._PivotCached=0,e._OldPivotPoint=new n.e,e._PivotTranslation=new n.e,e._PivotTmpVector=new n.e,e._PivotPostMultiplyPivotMatrix=!1,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var n=i(4),r=i(114),o=i(43),a=i(2),s=i(101),c=function(){function e(e,t,i,n,r,o,a,s,c){void 0===s&&(s=!0),void 0===c&&(c=!0),this.materialIndex=e,this.verticesStart=t,this.verticesCount=i,this.indexStart=n,this.indexCount=r,this._materialDefines=null,this._materialEffect=null,this._effectOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=o,this._renderingMesh=a||o,c&&o.subMeshes.push(this),this._trianglePlanes=[],this._id=o.subMeshes.length-1,s&&(this.refreshBoundingInfo(),o.computeWorldMatrix(!0))}return Object.defineProperty(e.prototype,"materialDefines",{get:function(){return this._materialDefines},set:function(e){this._materialDefines=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"effect",{get:function(){var e;return null!==(e=this._effectOverride)&&void 0!==e?e:this._materialEffect},enumerable:!1,configurable:!0}),e.prototype.setEffect=function(e,t){void 0===t&&(t=null),this._materialEffect!==e?(this._materialDefines=t,this._materialEffect=e):e||(this._materialDefines=null)},e.AddToMesh=function(t,i,n,r,o,a,s,c){return void 0===c&&(c=!0),new e(t,i,n,r,o,a,s,c)},Object.defineProperty(e.prototype,"IsGlobal",{get:function(){return 0===this.verticesStart&&this.verticesCount===this._mesh.getTotalVertices()},enumerable:!1,configurable:!0}),e.prototype.getBoundingInfo=function(){return this.IsGlobal?this._mesh.getBoundingInfo():this._boundingInfo},e.prototype.setBoundingInfo=function(e){return this._boundingInfo=e,this},e.prototype.getMesh=function(){return this._mesh},e.prototype.getRenderingMesh=function(){return this._renderingMesh},e.prototype.getReplacementMesh=function(){return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null},e.prototype.getEffectiveMesh=function(){return(this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null)||this._renderingMesh},e.prototype.getMaterial=function(){var e=this._renderingMesh.material;if(null==e)return this._mesh.getScene().defaultMaterial;if(this._IsMultiMaterial(e)){var t=e.getSubMaterial(this.materialIndex);return this._currentMaterial!==t&&(this._currentMaterial=t,this._materialDefines=null),t}return e},e.prototype._IsMultiMaterial=function(e){return void 0!==e.getSubMaterial},e.prototype.refreshBoundingInfo=function(e){if(void 0===e&&(e=null),this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(n.b.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;var t,i=this._renderingMesh.getIndices();if(0===this.indexStart&&this.indexCount===i.length){var r=this._renderingMesh.getBoundingInfo();t={minimum:r.minimum.clone(),maximum:r.maximum.clone()}}else t=Object(s.b)(e,i,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(t.minimum,t.maximum):this._boundingInfo=new o.a(t.minimum,t.maximum),this},e.prototype._checkCollision=function(e){return this.getBoundingInfo()._checkCollision(e)},e.prototype.updateBoundingInfo=function(e){var t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this},e.prototype.isInFrustum=function(e){var t=this.getBoundingInfo();return!!t&&t.isInFrustum(e,this._mesh.cullingStrategy)},e.prototype.isCompletelyInFrustum=function(e){var t=this.getBoundingInfo();return!!t&&t.isCompletelyInFrustum(e)},e.prototype.render=function(e){return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this},e.prototype._getLinesIndexBuffer=function(e,t){if(!this._linesIndexBuffer){for(var i=[],n=this.indexStart;n<this.indexStart+this.indexCount;n+=3)i.push(e[n],e[n+1],e[n+1],e[n+2],e[n+2],e[n]);this._linesIndexBuffer=t.createIndexBuffer(i),this._linesIndexCount=i.length}return this._linesIndexBuffer},e.prototype.canIntersects=function(e){var t=this.getBoundingInfo();return!!t&&e.intersectsBox(t.boundingBox)},e.prototype.intersects=function(e,t,i,n,r){var o=this.getMaterial();if(!o)return null;var s=3,c=!1;switch(o.fillMode){case a.a.MATERIAL_PointListDrawMode:case a.a.MATERIAL_LineListDrawMode:case a.a.MATERIAL_LineLoopDrawMode:case a.a.MATERIAL_LineStripDrawMode:case a.a.MATERIAL_TriangleFanDrawMode:return null;case a.a.MATERIAL_TriangleStripDrawMode:s=1,c=!0}return"InstancedLinesMesh"===this._mesh.getClassName()||"LinesMesh"===this._mesh.getClassName()?i.length?this._intersectLines(e,t,i,this._mesh.intersectionThreshold,n):this._intersectUnIndexedLines(e,t,i,this._mesh.intersectionThreshold,n):!i.length&&this._mesh._unIndexed?this._intersectUnIndexedTriangles(e,t,i,n,r):this._intersectTriangles(e,t,i,s,c,n,r)},e.prototype._intersectLines=function(e,t,i,n,o){for(var a=null,s=this.indexStart;s<this.indexStart+this.indexCount;s+=2){var c=t[i[s]],l=t[i[s+1]],u=e.intersectionSegment(c,l,n);if(!(u<0)&&(o||!a||u<a.distance)&&((a=new r.a(null,null,u)).faceId=s/2,o))break}return a},e.prototype._intersectUnIndexedLines=function(e,t,i,n,o){for(var a=null,s=this.verticesStart;s<this.verticesStart+this.verticesCount;s+=2){var c=t[s],l=t[s+1],u=e.intersectionSegment(c,l,n);if(!(u<0)&&(o||!a||u<a.distance)&&((a=new r.a(null,null,u)).faceId=s/2,o))break}return a},e.prototype._intersectTriangles=function(e,t,i,n,r,o,a){for(var s=null,c=-1,l=this.indexStart;l<this.indexStart+this.indexCount;l+=n){c++;var u=i[l],h=i[l+1],d=i[l+2];if(r&&4294967295===d)l+=2;else{var f=t[u],p=t[h],_=t[d];if(!a||a(f,p,_,e)){var m=e.intersectsTriangle(f,p,_);if(m){if(m.distance<0)continue;if((o||!s||m.distance<s.distance)&&((s=m).faceId=c,o))break}}}}return s},e.prototype._intersectUnIndexedTriangles=function(e,t,i,n,r){for(var o=null,a=this.verticesStart;a<this.verticesStart+this.verticesCount;a+=3){var s=t[a],c=t[a+1],l=t[a+2];if(!r||r(s,c,l,e)){var u=e.intersectsTriangle(s,c,l);if(u){if(u.distance<0)continue;if((n||!o||u.distance<o.distance)&&((o=u).faceId=a/3,n))break}}}return o},e.prototype._rebuild=function(){this._linesIndexBuffer&&(this._linesIndexBuffer=null)},e.prototype.clone=function(t,i){var n=new e(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,t,i,!1);if(!this.IsGlobal){var r=this.getBoundingInfo();if(!r)return n;n._boundingInfo=new o.a(r.minimum,r.maximum)}return n},e.prototype.dispose=function(){this._linesIndexBuffer&&(this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer),this._linesIndexBuffer=null);var e=this._mesh.subMeshes.indexOf(this);this._mesh.subMeshes.splice(e,1)},e.prototype.getClassName=function(){return"SubMesh"},e.CreateFromIndices=function(t,i,n,r,o){for(var a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=(o||r).getIndices(),l=i;l<i+n;l++){var u=c[l];u<a&&(a=u),u>s&&(s=u)}return new e(t,a,s-a+1,i,n,r,o)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var n=i(1),r=i(8),o=i(10),a=i(2),s=(i(126),i(70)),c=function(e){function t(t,i,n,r,c,l,u){void 0===n&&(n=null),void 0===c&&(c=a.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===l&&(l=a.a.TEXTUREFORMAT_RGBA);var h=e.call(this,null,n,!r,u,c,void 0,void 0,void 0,void 0,l)||this;h.name=t,h.wrapU=o.a.CLAMP_ADDRESSMODE,h.wrapV=o.a.CLAMP_ADDRESSMODE,h._generateMipMaps=r;var d=h._getEngine();if(!d)return h;i.getContext?(h._canvas=i,h._texture=d.createDynamicTexture(i.width,i.height,r,c)):(h._canvas=s.a.CreateCanvas(1,1),i.width||0===i.width?h._texture=d.createDynamicTexture(i.width,i.height,r,c):h._texture=d.createDynamicTexture(i,i,r,c));var f=h.getSize();return h._canvas.width=f.width,h._canvas.height=f.height,h._context=h._canvas.getContext("2d"),h}return Object(n.d)(t,e),t.prototype.getClassName=function(){return"DynamicTexture"},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype._recreate=function(e){this._canvas.width=e.width,this._canvas.height=e.height,this.releaseInternalTexture(),this._texture=this._getEngine().createDynamicTexture(e.width,e.height,this._generateMipMaps,this.samplingMode)},t.prototype.scale=function(e){var t=this.getSize();t.width*=e,t.height*=e,this._recreate(t)},t.prototype.scaleTo=function(e,t){var i=this.getSize();i.width=e,i.height=t,this._recreate(i)},t.prototype.getContext=function(){return this._context},t.prototype.clear=function(){var e=this.getSize();this._context.fillRect(0,0,e.width,e.height)},t.prototype.update=function(e,t){void 0===t&&(t=!1),this._getEngine().updateDynamicTexture(this._texture,this._canvas,void 0===e||e,t,this._format||void 0)},t.prototype.drawText=function(e,t,i,n,r,o,a,s){void 0===s&&(s=!0);var c=this.getSize();if(o&&(this._context.fillStyle=o,this._context.fillRect(0,0,c.width,c.height)),this._context.font=n,null==t){var l=this._context.measureText(e);t=(c.width-l.width)/2}if(null==i){var u=parseInt(n.replace(/\D/g,""));i=c.height/2+u/3.65}this._context.fillStyle=r||"",this._context.fillText(e,t,i),s&&this.update(a)},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var i=this.getSize(),n=new t(this.name,i,e,this._generateMipMaps);return n.hasAlpha=this.hasAlpha,n.level=this.level,n.wrapU=this.wrapU,n.wrapV=this.wrapV,n},t.prototype.serialize=function(){var t=this.getScene();t&&!t.isReady()&&r.a.Warn("The scene must be ready before serializing the dynamic texture");var i=e.prototype.serialize.call(this);return this._IsCanvasElement(this._canvas)&&(i.base64String=this._canvas.toDataURL()),i.invertY=this._invertY,i.samplingMode=this.samplingMode,i},t.prototype._IsCanvasElement=function(e){return void 0!==e.toDataURL},t.prototype._rebuild=function(){this.update()},t}(o.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var n=i(0),r=i(9),o=i(7),a=i(16);a.a.CreateBox=function(e){var t,i=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23],o=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],s=[],c=e.width||e.size||1,l=e.height||e.size||1,u=e.depth||e.size||1,h=e.wrap||!1,d=void 0===e.topBaseAt?1:e.topBaseAt,f=void 0===e.bottomBaseAt?0:e.bottomBaseAt,p=[2,0,3,1][d=(d+4)%4],_=[2,0,1,3][f=(f+4)%4],m=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(h){i=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],m=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];for(var g=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],v=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]],b=[17,18,19,16],y=[22,23,20,21];p>0;)g.unshift(g.pop()),b.unshift(b.pop()),p--;for(;_>0;)v.unshift(v.pop()),y.unshift(y.pop()),_--;g=g.flat(),v=v.flat(),m=m.concat(g).concat(v),i.push(b[0],b[2],b[3],b[0],b[1],b[2]),i.push(y[0],y[2],y[3],y[0],y[1],y[2])}var T=[c/2,l/2,u/2];t=m.reduce(function(e,t,i){return e.concat(t*T[i%3])},[]);for(var E=0===e.sideOrientation?0:e.sideOrientation||a.a.DEFAULTSIDE,S=e.faceUV||new Array(6),A=e.faceColors,P=[],C=0;C<6;C++)void 0===S[C]&&(S[C]=new n.f(0,0,1,1)),A&&void 0===A[C]&&(A[C]=new r.b(1,1,1,1));for(var R=0;R<6;R++)if(s.push(S[R].z,S[R].w),s.push(S[R].x,S[R].w),s.push(S[R].x,S[R].y),s.push(S[R].z,S[R].y),A)for(var x=0;x<4;x++)P.push(A[R].r,A[R].g,A[R].b,A[R].a);a.a._ComputeSides(E,t,i,o,s,e.frontUVs,e.backUVs);var O=new a.a;if(O.indices=i,O.positions=t,O.normals=o,O.uvs=s,A){var M=E===a.a.DOUBLESIDE?P.concat(P):P;O.colors=M}return O},o.a.CreateBox=function(e,t,i,n,r){void 0===i&&(i=null);var o={size:t,sideOrientation:r,updatable:n};return s.CreateBox(e,o,i)};var s=function(){function e(){}return e.CreateBox=function(e,t,i){void 0===i&&(i=null);var n=new o.a(e,i);return t.sideOrientation=o.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,a.a.CreateBox(t).applyToMesh(n,t.updatable),n},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(0),r=function(){function e(e,t,i,r){this.normal=new n.e(e,t,i),this.d=r}return e.prototype.asArray=function(){return[this.normal.x,this.normal.y,this.normal.z,this.d]},e.prototype.clone=function(){return new e(this.normal.x,this.normal.y,this.normal.z,this.d)},e.prototype.getClassName=function(){return"Plane"},e.prototype.getHashCode=function(){var e=this.normal.getHashCode();return 397*e^(0|this.d)},e.prototype.normalize=function(){var e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z),t=0;return 0!==e&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this},e.prototype.transform=function(t){var i=e._TmpMatrix;t.invertToRef(i);var n=i.m,r=this.normal.x,o=this.normal.y,a=this.normal.z,s=this.d;return new e(r*n[0]+o*n[1]+a*n[2]+s*n[3],r*n[4]+o*n[5]+a*n[6]+s*n[7],r*n[8]+o*n[9]+a*n[10]+s*n[11],r*n[12]+o*n[13]+a*n[14]+s*n[15])},e.prototype.dotCoordinate=function(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d},e.prototype.copyFromPoints=function(e,t,i){var n,r=t.x-e.x,o=t.y-e.y,a=t.z-e.z,s=i.x-e.x,c=i.y-e.y,l=i.z-e.z,u=o*l-a*c,h=a*s-r*l,d=r*c-o*s,f=Math.sqrt(u*u+h*h+d*d);return n=0!==f?1/f:0,this.normal.x=u*n,this.normal.y=h*n,this.normal.z=d*n,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this},e.prototype.isFrontFacingTo=function(e,t){return n.e.Dot(this.normal,e)<=t},e.prototype.signedDistanceTo=function(e){return n.e.Dot(e,this.normal)+this.d},e.FromArray=function(t){return new e(t[0],t[1],t[2],t[3])},e.FromPoints=function(t,i,n){var r=new e(0,0,0,0);return r.copyFromPoints(t,i,n),r},e.FromPositionAndNormal=function(t,i){var n=new e(0,0,0,0);return i.normalize(),n.normal=i,n.d=-(i.x*t.x+i.y*t.y+i.z*t.z),n},e.SignedDistanceToPlaneFromPositionAndNormal=function(e,t,i){var r=-(t.x*e.x+t.y*e.y+t.z*e.z);return n.e.Dot(i,t)+r},e._TmpMatrix=n.a.Identity(),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return u});var n=i(7),r=i(20),o=i(6),a=i(0),s=i(18),c=i(39),l=i(60),u=(i(84),function(){function e(e){this._useAlternatePickedPointAboveMaxDragAngleDragSpeed=-1.1,this.maxDragAngle=0,this._useAlternatePickedPointAboveMaxDragAngle=!1,this.currentDraggingPointerID=-1,this.dragging=!1,this.dragDeltaRatio=.2,this.updateDragPlane=!0,this._debugMode=!1,this._moving=!1,this.onDragObservable=new o.c,this.onDragStartObservable=new o.c,this.onDragEndObservable=new o.c,this.moveAttached=!0,this.enabled=!0,this.startAndReleaseDragOnPointerEvents=!0,this.detachCameraControls=!0,this.useObjectOrientationForDragging=!0,this.validateDrag=function(e){return!0},this._tmpVector=new a.e(0,0,0),this._alternatePickedPoint=new a.e(0,0,0),this._worldDragAxis=new a.e(0,0,0),this._targetPosition=new a.e(0,0,0),this._attachedToElement=!1,this._startDragRay=new c.a(new a.e,new a.e),this._lastPointerRay={},this._dragDelta=new a.e,this._pointA=new a.e(0,0,0),this._pointC=new a.e(0,0,0),this._localAxis=new a.e(0,0,0),this._lookAt=new a.e(0,0,0),this._options=e||{};var t=0;if(this._options.dragAxis&&t++,this._options.dragPlaneNormal&&t++,t>1)throw"Multiple drag modes specified in dragBehavior options. Only one expected"}return Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return"PointerDrag"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t,i){var o=this;this._scene=t.getScene(),this.attachedNode=t,e._planeScene||(this._debugMode?e._planeScene=this._scene:(e._planeScene=new r.a(this._scene.getEngine(),{virtual:!0}),e._planeScene.detachControl(),this._scene.onDisposeObservable.addOnce(function(){e._planeScene.dispose(),e._planeScene=null}))),this._dragPlane=n.a.CreatePlane("pointerDragPlane",this._debugMode?1:1e4,e._planeScene,!1,n.a.DOUBLESIDE),this.lastDragPosition=new a.e(0,0,0);var u=i||function(e){return o.attachedNode==e||e.isDescendantOf(o.attachedNode)};this._pointerObserver=this._scene.onPointerObservable.add(function(t,i){if(o.enabled)if(t.type==s.a.POINTERDOWN)o.startAndReleaseDragOnPointerEvents&&!o.dragging&&t.pickInfo&&t.pickInfo.hit&&t.pickInfo.pickedMesh&&t.pickInfo.pickedPoint&&t.pickInfo.ray&&u(t.pickInfo.pickedMesh)&&o._startDrag(t.event.pointerId,t.pickInfo.ray,t.pickInfo.pickedPoint);else if(t.type==s.a.POINTERUP)o.startAndReleaseDragOnPointerEvents&&o.currentDraggingPointerID==t.event.pointerId&&o.releaseDrag();else if(t.type==s.a.POINTERMOVE){var n=t.event.pointerId;if(o.currentDraggingPointerID===e._AnyMouseID&&n!==e._AnyMouseID){var r=t.event;("mouse"===r.pointerType||!o._scene.getEngine().hostInformation.isMobile&&r instanceof MouseEvent)&&(o._lastPointerRay[o.currentDraggingPointerID]&&(o._lastPointerRay[n]=o._lastPointerRay[o.currentDraggingPointerID],delete o._lastPointerRay[o.currentDraggingPointerID]),o.currentDraggingPointerID=n)}o._lastPointerRay[n]||(o._lastPointerRay[n]=new c.a(new a.e,new a.e)),t.pickInfo&&t.pickInfo.ray&&(o._lastPointerRay[n].origin.copyFrom(t.pickInfo.ray.origin),o._lastPointerRay[n].direction.copyFrom(t.pickInfo.ray.direction),o.currentDraggingPointerID==n&&o.dragging&&o._moveDrag(t.pickInfo.ray))}}),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add(function(){o._moving&&o.moveAttached&&(l.a._RemoveAndStorePivotPoint(o.attachedNode),o._targetPosition.subtractToRef(o.attachedNode.absolutePosition,o._tmpVector),o._tmpVector.scaleInPlace(o.dragDeltaRatio),o.attachedNode.getAbsolutePosition().addToRef(o._tmpVector,o._tmpVector),o.validateDrag(o._tmpVector)&&o.attachedNode.setAbsolutePosition(o._tmpVector),l.a._RestorePivotPoint(o.attachedNode))})},e.prototype.releaseDrag=function(){if(this.dragging&&(this.dragging=!1,this.onDragEndObservable.notifyObservers({dragPlanePoint:this.lastDragPosition,pointerId:this.currentDraggingPointerID})),this.currentDraggingPointerID=-1,this._moving=!1,this.detachCameraControls&&this._attachedToElement&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera){if("ArcRotateCamera"===this._scene.activeCamera.getClassName()){var e=this._scene.activeCamera;e.attachControl(!e.inputs||e.inputs.noPreventDefault,e._useCtrlForPanning,e._panningMouseButton)}else this._scene.activeCamera.attachControl(!this._scene.activeCamera.inputs||this._scene.activeCamera.inputs.noPreventDefault);this._attachedToElement=!1}},e.prototype.startDrag=function(t,i,n){void 0===t&&(t=e._AnyMouseID),this._startDrag(t,i,n);var r=this._lastPointerRay[t];t===e._AnyMouseID&&(r=this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]),r&&this._moveDrag(r)},e.prototype._startDrag=function(e,t,i){if(this._scene.activeCamera&&!this.dragging&&this.attachedNode){l.a._RemoveAndStorePivotPoint(this.attachedNode),t?(this._startDragRay.direction.copyFrom(t.direction),this._startDragRay.origin.copyFrom(t.origin)):(this._startDragRay.origin.copyFrom(this._scene.activeCamera.position),this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector),this._tmpVector.subtractToRef(this._scene.activeCamera.position,this._startDragRay.direction)),this._updateDragPlanePosition(this._startDragRay,i||this._tmpVector);var n=this._pickWithRayOnDragPlane(this._startDragRay);n&&(this.dragging=!0,this.currentDraggingPointerID=e,this.lastDragPosition.copyFrom(n),this.onDragStartObservable.notifyObservers({dragPlanePoint:n,pointerId:this.currentDraggingPointerID}),this._targetPosition.copyFrom(this.attachedNode.absolutePosition),this.detachCameraControls&&this._scene.activeCamera&&this._scene.activeCamera.inputs&&!this._scene.activeCamera.leftCamera&&(this._scene.activeCamera.inputs.attachedToElement?(this._scene.activeCamera.detachControl(),this._attachedToElement=!0):this._attachedToElement=!1)),l.a._RestorePivotPoint(this.attachedNode)}},e.prototype._moveDrag=function(e){this._moving=!0;var t=this._pickWithRayOnDragPlane(e);if(t){this.updateDragPlane&&this._updateDragPlanePosition(e,t);var i=0;this._options.dragAxis?(this.useObjectOrientationForDragging?a.e.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._worldDragAxis):this._worldDragAxis.copyFrom(this._options.dragAxis),t.subtractToRef(this.lastDragPosition,this._tmpVector),i=a.e.Dot(this._tmpVector,this._worldDragAxis),this._worldDragAxis.scaleToRef(i,this._dragDelta)):(i=this._dragDelta.length(),t.subtractToRef(this.lastDragPosition,this._dragDelta)),this._targetPosition.addInPlace(this._dragDelta),this.onDragObservable.notifyObservers({dragDistance:i,delta:this._dragDelta,dragPlanePoint:t,dragPlaneNormal:this._dragPlane.forward,pointerId:this.currentDraggingPointerID}),this.lastDragPosition.copyFrom(t)}},e.prototype._pickWithRayOnDragPlane=function(t){var i=this;if(!t)return null;var n=Math.acos(a.e.Dot(this._dragPlane.forward,t.direction));if(n>Math.PI/2&&(n=Math.PI-n),this.maxDragAngle>0&&n>this.maxDragAngle){if(this._useAlternatePickedPointAboveMaxDragAngle){this._tmpVector.copyFrom(t.direction),this.attachedNode.absolutePosition.subtractToRef(t.origin,this._alternatePickedPoint),this._alternatePickedPoint.normalize(),this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed*a.e.Dot(this._alternatePickedPoint,this._tmpVector)),this._tmpVector.addInPlace(this._alternatePickedPoint);var r=a.e.Dot(this._dragPlane.forward,this._tmpVector);return this._dragPlane.forward.scaleToRef(-r,this._alternatePickedPoint),this._alternatePickedPoint.addInPlace(this._tmpVector),this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition),this._alternatePickedPoint}return null}var o=e._planeScene.pickWithRay(t,function(e){return e==i._dragPlane});return o&&o.hit&&o.pickedMesh&&o.pickedPoint?o.pickedPoint:null},e.prototype._updateDragPlanePosition=function(e,t){this._pointA.copyFrom(t),this._options.dragAxis?(this.useObjectOrientationForDragging?a.e.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragAxis),e.origin.subtractToRef(this._pointA,this._pointC),this._pointC.normalize(),Math.abs(a.e.Dot(this._localAxis,this._pointC))>.999?Math.abs(a.e.Dot(a.e.UpReadOnly,this._pointC))>.999?this._lookAt.copyFrom(a.e.Right()):this._lookAt.copyFrom(a.e.UpReadOnly):(a.e.CrossToRef(this._localAxis,this._pointC,this._lookAt),a.e.CrossToRef(this._localAxis,this._lookAt,this._lookAt),this._lookAt.normalize()),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._lookAt,this._lookAt),this._dragPlane.lookAt(this._lookAt)):this._options.dragPlaneNormal?(this.useObjectOrientationForDragging?a.e.TransformCoordinatesToRef(this._options.dragPlaneNormal,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragPlaneNormal),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._localAxis,this._lookAt),this._dragPlane.lookAt(this._lookAt)):(this._dragPlane.position.copyFrom(this._pointA),this._dragPlane.lookAt(e.origin)),this._dragPlane.position.copyFrom(this.attachedNode.absolutePosition),this._dragPlane.computeWorldMatrix(!0)},e.prototype.detach=function(){this._pointerObserver&&this._scene.onPointerObservable.remove(this._pointerObserver),this._beforeRenderObserver&&this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver),this.releaseDrag()},e._AnyMouseID=-2,e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return r}),i.d(t,"b",function(){return o}),i.d(t,"c",function(){return a});var n=i(1),r=function(){function e(){}return e.KEYDOWN=1,e.KEYUP=2,e}(),o=function(e,t){this.type=e,this.event=t},a=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.type=t,n.event=i,n.skipOnPointerObservable=!1,n}return Object(n.d)(t,e),t}(o)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this._defines={},this._currentRank=32,this._maxRank=-1,this._mesh=null}return e.prototype.unBindMesh=function(){this._mesh=null},e.prototype.addFallback=function(e,t){this._defines[e]||(e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)},e.prototype.addCPUSkinningFallback=function(e,t){this._mesh=t,e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e)},Object.defineProperty(e.prototype,"hasMoreFallbacks",{get:function(){return this._currentRank<=this._maxRank},enumerable:!1,configurable:!0}),e.prototype.reduce=function(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;for(var i=this._mesh.getScene(),n=0;n<i.meshes.length;n++){var r=i.meshes[n];if(r.material){if(r.computeBonesUsingShaders&&0!==r.numBoneInfluencers)if(r.material.getEffect()===t)r.computeBonesUsingShaders=!1;else if(r.subMeshes)for(var o=0,a=r.subMeshes;o<a.length;o++)if(a[o].effect===t){r.computeBonesUsingShaders=!1;break}}else!this._mesh.material&&r.computeBonesUsingShaders&&r.numBoneInfluencers>0&&(r.computeBonesUsingShaders=!1)}}else{var s=this._defines[this._currentRank];if(s)for(n=0;n<s.length;n++)e=e.replace("#define "+s[n],"");this._currentRank++}return e},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var n=i(1),r=i(25),o=i(37),a=i(11),s=function(e){function t(t,i){var n=e.call(this,t,i,!0)||this;return i.multiMaterials.push(n),n.subMaterials=new Array,n._storeEffectOnSubMeshes=!0,n}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"subMaterials",{get:function(){return this._subMaterials},set:function(e){this._subMaterials=e,this._hookArray(e)},enumerable:!1,configurable:!0}),t.prototype.getChildren=function(){return this.subMaterials},t.prototype._hookArray=function(e){var t=this,i=e.push;e.push=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=i.apply(e,n);return t._markAllSubMeshesAsTexturesDirty(),o};var n=e.splice;e.splice=function(i,r){var o=n.apply(e,[i,r]);return t._markAllSubMeshesAsTexturesDirty(),o}},t.prototype.getSubMaterial=function(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]},t.prototype.getActiveTextures=function(){var t;return(t=e.prototype.getActiveTextures.call(this)).concat.apply(t,this.subMaterials.map(function(e){return e?e.getActiveTextures():[]}))},t.prototype.hasTexture=function(t){var i;if(e.prototype.hasTexture.call(this,t))return!0;for(var n=0;n<this.subMaterials.length;n++)if(null===(i=this.subMaterials[n])||void 0===i?void 0:i.hasTexture(t))return!0;return!1},t.prototype.getClassName=function(){return"MultiMaterial"},t.prototype.isReadyForSubMesh=function(e,t,i){for(var n=0;n<this.subMaterials.length;n++){var r=this.subMaterials[n];if(r){if(r._storeEffectOnSubMeshes){if(!r.isReadyForSubMesh(e,t,i))return!1;continue}if(!r.isReady(e))return!1}}return!0},t.prototype.clone=function(e,i){for(var n=new t(e,this.getScene()),r=0;r<this.subMaterials.length;r++){var o,a=this.subMaterials[r];o=i&&a?a.clone(e+"-"+a.name):this.subMaterials[r],n.subMaterials.push(o)}return n},t.prototype.serialize=function(){var e={};e.name=this.name,e.id=this.id,o.a&&(e.tags=o.a.GetTags(this)),e.materials=[];for(var t=0;t<this.subMaterials.length;t++){var i=this.subMaterials[t];i?e.materials.push(i.id):e.materials.push(null)}return e},t.prototype.dispose=function(t,i,n){var r=this.getScene();if(r){if(n)for(var o=0;o<this.subMaterials.length;o++){var a=this.subMaterials[o];a&&a.dispose(t,i)}(o=r.multiMaterials.indexOf(this))>=0&&r.multiMaterials.splice(o,1),e.prototype.dispose.call(this,t,i)}},t.ParseMultiMaterial=function(e,i){var n=new t(e.name,i);n.id=e.id,o.a&&o.a.AddTagsTo(n,e.tags);for(var r=0;r<e.materials.length;r++){var a=e.materials[r];a?n.subMaterials.push(i.getLastMaterialByID(a)):n.subMaterials.push(null)}return n},t}(r.a);a.a.RegisteredTypes["BABYLON.MultiMaterial"]=s},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(2),r=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return e._ForceFullSceneLoadingForIncremental},set:function(t){e._ForceFullSceneLoadingForIncremental=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return e._ShowLoadingScreen},set:function(t){e._ShowLoadingScreen=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return e._loggingLevel},set:function(t){e._loggingLevel=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return e._CleanBoneMatrixWeights},set:function(t){e._CleanBoneMatrixWeights=t},enumerable:!1,configurable:!0}),e._ForceFullSceneLoadingForIncremental=!1,e._ShowLoadingScreen=!0,e._CleanBoneMatrixWeights=!1,e._loggingLevel=n.a.SCENELOADER_NO_LOGGING,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.CreateCanvas=function(e,t){if("undefined"==typeof document)return new OffscreenCanvas(e,t);var i=document.createElement("canvas");return i.width=e,i.height=t,i},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return p});var n=i(0),r=i(9),o=i(16),a=i(4),s=i(61),c=i(69),l=i(43),u=i(2),h=i(12),d=i(37),f=i(101),p=function(){function e(e,t,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=null),this.delayLoadState=u.a.DELAYLOADSTATE_NONE,this._totalVertices=0,this._isDisposed=!1,this._indexBufferIsUpdatable=!1,this._positionsCache=[],this.useBoundingInfoFromGeometry=!1,this.id=e,this.uniqueId=t.getUniqueId(),this._engine=t.getEngine(),this._meshes=[],this._scene=t,this._vertexBuffers={},this._indices=[],this._updatable=n,i?this.setAllVerticesData(i,n):(this._totalVertices=0,this._indices=[]),this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),r&&(this.applyToMesh(r),r.computeWorldMatrix(!0))}return Object.defineProperty(e.prototype,"boundingBias",{get:function(){return this._boundingBias},set:function(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)},enumerable:!1,configurable:!0}),e.CreateGeometryForMesh=function(t){var i=new e(e.RandomId(),t.getScene());return i.applyToMesh(t),i},Object.defineProperty(e.prototype,"meshes",{get:function(){return this._meshes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extend",{get:function(){return this._extend},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getEngine=function(){return this._engine},e.prototype.isReady=function(){return this.delayLoadState===u.a.DELAYLOADSTATE_LOADED||this.delayLoadState===u.a.DELAYLOADSTATE_NONE},Object.defineProperty(e.prototype,"doNotSerialize",{get:function(){for(var e=0;e<this._meshes.length;e++)if(!this._meshes[e].doNotSerialize)return!1;return!0},enumerable:!1,configurable:!0}),e.prototype._rebuild=function(){for(var e in this._vertexArrayObjects&&(this._vertexArrayObjects={}),0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices)),this._vertexBuffers)this._vertexBuffers[e]._rebuild()},e.prototype.setAllVerticesData=function(e,t){e.applyToGeometry(this,t),this.notifyUpdate()},e.prototype.setVerticesData=function(e,t,i,n){void 0===i&&(i=!1),i&&Array.isArray(t)&&(t=new Float32Array(t));var r=new a.b(this._engine,t,e,i,0===this._meshes.length,n);this.setVerticesBuffer(r)},e.prototype.removeVerticesData=function(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e])},e.prototype.setVerticesBuffer=function(e,t){void 0===t&&(t=null);var i=e.getKind();if(this._vertexBuffers[i]&&this._vertexBuffers[i].dispose(),this._vertexBuffers[i]=e,i===a.b.PositionKind){var n=e.getData();null!=t?this._totalVertices=t:null!=n&&(this._totalVertices=n.length/(e.byteStride/4)),this._updateExtend(n),this._resetPointsArrayCache();for(var r=this._meshes,o=r.length,s=0;s<o;s++){var c=r[s];c._boundingInfo=new l.a(this._extend.minimum,this._extend.maximum),c._createGlobalSubMesh(!1),c.computeWorldMatrix(!0)}}this.notifyUpdate(i),this._vertexArrayObjects&&(this._disposeVertexArrayObjects(),this._vertexArrayObjects={})},e.prototype.updateVerticesDataDirectly=function(e,t,i,n){void 0===n&&(n=!1);var r=this.getVertexBuffer(e);r&&(r.updateDirectly(t,i,n),this.notifyUpdate(e))},e.prototype.updateVerticesData=function(e,t,i){void 0===i&&(i=!1);var n=this.getVertexBuffer(e);n&&(n.update(t),e===a.b.PositionKind&&this._updateBoundingInfo(i,t),this.notifyUpdate(e))},e.prototype._updateBoundingInfo=function(e,t){if(e&&this._updateExtend(t),this._resetPointsArrayCache(),e)for(var i=0,n=this._meshes;i<n.length;i++){var r=n[i];r._boundingInfo?r._boundingInfo.reConstruct(this._extend.minimum,this._extend.maximum):r._boundingInfo=new l.a(this._extend.minimum,this._extend.maximum);for(var o=0,a=r.subMeshes;o<a.length;o++)a[o].refreshBoundingInfo()}},e.prototype._bind=function(e,t){if(e){void 0===t&&(t=this._indexBuffer);var i=this.getVertexBuffers();i&&(t==this._indexBuffer&&this._vertexArrayObjects?(this._vertexArrayObjects[e.key]||(this._vertexArrayObjects[e.key]=this._engine.recordVertexArrayObject(i,t,e)),this._engine.bindVertexArrayObject(this._vertexArrayObjects[e.key],t)):this._engine.bindBuffers(i,t,e))}},e.prototype.getTotalVertices=function(){return this.isReady()?this._totalVertices:0},e.prototype.getVerticesData=function(e,t,i){var n=this.getVertexBuffer(e);if(!n)return null;var r=n.getData();if(!r)return null;var o=n.getSize()*a.b.GetTypeByteLength(n.type),s=this._totalVertices*n.getSize();if(n.type!==a.b.FLOAT||n.byteStride!==o){var c=[];return n.forEach(s,function(e){return c.push(e)}),c}if(!(r instanceof Array||r instanceof Float32Array)||0!==n.byteOffset||r.length!==s){if(r instanceof Array){var l=n.byteOffset/4;return h.b.Slice(r,l,l+s)}if(r instanceof ArrayBuffer)return new Float32Array(r,n.byteOffset,s);if(l=r.byteOffset+n.byteOffset,i||t&&1!==this._meshes.length){var u=new Float32Array(s),d=new Float32Array(r.buffer,l,s);return u.set(d),u}var f=l%4;return f&&(l=Math.max(0,l-f)),new Float32Array(r.buffer,l,s)}return i||t&&1!==this._meshes.length?h.b.Slice(r):r},e.prototype.isVertexBufferUpdatable=function(e){var t=this._vertexBuffers[e];return!!t&&t.isUpdatable()},e.prototype.getVertexBuffer=function(e){return this.isReady()?this._vertexBuffers[e]:null},e.prototype.getVertexBuffers=function(){return this.isReady()?this._vertexBuffers:null},e.prototype.isVerticesDataPresent=function(e){return this._vertexBuffers?void 0!==this._vertexBuffers[e]:!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)},e.prototype.getVerticesDataKinds=function(){var e,t=[];if(!this._vertexBuffers&&this._delayInfo)for(e in this._delayInfo)t.push(e);else for(e in this._vertexBuffers)t.push(e);return t},e.prototype.updateIndices=function(e,t,i){if(void 0===i&&(i=!1),this._indexBuffer)if(this._indexBufferIsUpdatable){var n=e.length!==this._indices.length;if(i||(this._indices=e.slice()),this._engine.updateDynamicIndexBuffer(this._indexBuffer,e,t),n)for(var r=0,o=this._meshes;r<o.length;r++)o[r]._createGlobalSubMesh(!0)}else this.setIndices(e,null,!0)},e.prototype.setIndices=function(e,t,i){void 0===t&&(t=null),void 0===i&&(i=!1),this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._disposeVertexArrayObjects(),this._indices=e,this._indexBufferIsUpdatable=i,0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i)),null!=t&&(this._totalVertices=t);for(var n=0,r=this._meshes;n<r.length;n++)r[n]._createGlobalSubMesh(!0);this.notifyUpdate()},e.prototype.getTotalIndices=function(){return this.isReady()?this._indices.length:0},e.prototype.getIndices=function(e,t){if(!this.isReady())return null;var i=this._indices;if(t||e&&1!==this._meshes.length){for(var n=i.length,r=[],o=0;o<n;o++)r.push(i[o]);return r}return i},e.prototype.getIndexBuffer=function(){return this.isReady()?this._indexBuffer:null},e.prototype._releaseVertexArrayObject=function(e){void 0===e&&(e=null),e&&this._vertexArrayObjects&&this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])},e.prototype.releaseForMesh=function(e,t){var i=this._meshes,n=i.indexOf(e);-1!==n&&(i.splice(n,1),e._geometry=null,0===i.length&&t&&this.dispose())},e.prototype.applyToMesh=function(e){if(e._geometry!==this){var t=e._geometry;t&&t.releaseForMesh(e);var i=this._meshes;e._geometry=this,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):e._boundingInfo=this._boundingInfo}},e.prototype._updateExtend=function(e){void 0===e&&(e=null),this.useBoundingInfoFromGeometry&&this._boundingInfo?this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()}:(e||(e=this.getVerticesData(a.b.PositionKind)),this._extend=Object(f.a)(e,0,this._totalVertices,this.boundingBias,3))},e.prototype._applyToMesh=function(e){var t=this._meshes.length;for(var i in this._vertexBuffers){1===t&&this._vertexBuffers[i].create();var n=this._vertexBuffers[i].getBuffer();n&&(n.references=t),i===a.b.PositionKind&&(this._extend||this._updateExtend(),e._boundingInfo=new l.a(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(!1),e._updateBoundingInfo())}1===t&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices)),this._indexBuffer&&(this._indexBuffer.references=t),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()},e.prototype.notifyUpdate=function(e){this.onGeometryUpdated&&this.onGeometryUpdated(this,e);for(var t=0,i=this._meshes;t<i.length;t++)i[t]._markSubMeshesAsAttributesDirty()},e.prototype.load=function(e,t){this.delayLoadState!==u.a.DELAYLOADSTATE_LOADING&&(this.isReady()?t&&t():(this.delayLoadState=u.a.DELAYLOADSTATE_LOADING,this._queueLoad(e,t)))},e.prototype._queueLoad=function(e,t){var i=this;this.delayLoadingFile&&(e._addPendingData(this),e._loadFile(this.delayLoadingFile,function(n){if(i._delayLoadingFunction){i._delayLoadingFunction(JSON.parse(n),i),i.delayLoadState=u.a.DELAYLOADSTATE_LOADED,i._delayInfo=[],e._removePendingData(i);for(var r=i._meshes,o=r.length,a=0;a<o;a++)i._applyToMesh(r[a]);t&&t()}},void 0,!0))},e.prototype.toLeftHanded=function(){var e=this.getIndices(!1);if(null!=e&&e.length>0){for(var t=0;t<e.length;t+=3){var i=e[t+0];e[t+0]=e[t+2],e[t+2]=i}this.setIndices(e)}var n=this.getVerticesData(a.b.PositionKind,!1);if(null!=n&&n.length>0){for(t=0;t<n.length;t+=3)n[t+2]=-n[t+2];this.setVerticesData(a.b.PositionKind,n,!1)}var r=this.getVerticesData(a.b.NormalKind,!1);if(null!=r&&r.length>0){for(t=0;t<r.length;t+=3)r[t+2]=-r[t+2];this.setVerticesData(a.b.NormalKind,r,!1)}},e.prototype._resetPointsArrayCache=function(){this._positions=null},e.prototype._generatePointsArray=function(){if(this._positions)return!0;var e=this.getVerticesData(a.b.PositionKind);if(!e||0===e.length)return!1;for(var t=3*this._positionsCache.length,i=this._positionsCache.length;t<e.length;t+=3,++i)this._positionsCache[i]=n.e.FromArray(e,t);for(t=0,i=0;t<e.length;t+=3,++i)this._positionsCache[i].set(e[0+t],e[1+t],e[2+t]);return this._positionsCache.length=e.length/3,this._positions=this._positionsCache,!0},e.prototype.isDisposed=function(){return this._isDisposed},e.prototype._disposeVertexArrayObjects=function(){if(this._vertexArrayObjects){for(var e in this._vertexArrayObjects)this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e]);this._vertexArrayObjects={}}},e.prototype.dispose=function(){var e,t=this._meshes,i=t.length;for(e=0;e<i;e++)this.releaseForMesh(t[e]);for(var n in this._meshes=[],this._disposeVertexArrayObjects(),this._vertexBuffers)this._vertexBuffers[n].dispose();this._vertexBuffers={},this._totalVertices=0,this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null,this._indices=[],this.delayLoadState=u.a.DELAYLOADSTATE_NONE,this.delayLoadingFile=null,this._delayLoadingFunction=null,this._delayInfo=[],this._boundingInfo=null,this._scene.removeGeometry(this),this._isDisposed=!0},e.prototype.copy=function(t){var i=new o.a;i.indices=[];var n=this.getIndices();if(n)for(var r=0;r<n.length;r++)i.indices.push(n[r]);var a,s=!1,c=!1;for(a in this._vertexBuffers){var u=this.getVerticesData(a);if(u&&(u instanceof Float32Array?i.set(new Float32Array(u),a):i.set(u.slice(0),a),!c)){var h=this.getVertexBuffer(a);h&&(c=!(s=h.isUpdatable()))}}var d=new e(t,this._scene,i,s);for(a in d.delayLoadState=this.delayLoadState,d.delayLoadingFile=this.delayLoadingFile,d._delayLoadingFunction=this._delayLoadingFunction,this._delayInfo)d._delayInfo=d._delayInfo||[],d._delayInfo.push(a);return d._boundingInfo=new l.a(this._extend.minimum,this._extend.maximum),d},e.prototype.serialize=function(){var e={};return e.id=this.id,e.updatable=this._updatable,d.a&&d.a.HasTags(this)&&(e.tags=d.a.GetTags(this)),e},e.prototype.toNumberArray=function(e){return Array.isArray(e)?e:Array.prototype.slice.call(e)},e.prototype.serializeVerticeData=function(){var e=this.serialize();return this.isVerticesDataPresent(a.b.PositionKind)&&(e.positions=this.toNumberArray(this.getVerticesData(a.b.PositionKind)),this.isVertexBufferUpdatable(a.b.PositionKind)&&(e.positions._updatable=!0)),this.isVerticesDataPresent(a.b.NormalKind)&&(e.normals=this.toNumberArray(this.getVerticesData(a.b.NormalKind)),this.isVertexBufferUpdatable(a.b.NormalKind)&&(e.normals._updatable=!0)),this.isVerticesDataPresent(a.b.TangentKind)&&(e.tangets=this.toNumberArray(this.getVerticesData(a.b.TangentKind)),this.isVertexBufferUpdatable(a.b.TangentKind)&&(e.tangets._updatable=!0)),this.isVerticesDataPresent(a.b.UVKind)&&(e.uvs=this.toNumberArray(this.getVerticesData(a.b.UVKind)),this.isVertexBufferUpdatable(a.b.UVKind)&&(e.uvs._updatable=!0)),this.isVerticesDataPresent(a.b.UV2Kind)&&(e.uv2s=this.toNumberArray(this.getVerticesData(a.b.UV2Kind)),this.isVertexBufferUpdatable(a.b.UV2Kind)&&(e.uv2s._updatable=!0)),this.isVerticesDataPresent(a.b.UV3Kind)&&(e.uv3s=this.toNumberArray(this.getVerticesData(a.b.UV3Kind)),this.isVertexBufferUpdatable(a.b.UV3Kind)&&(e.uv3s._updatable=!0)),this.isVerticesDataPresent(a.b.UV4Kind)&&(e.uv4s=this.toNumberArray(this.getVerticesData(a.b.UV4Kind)),this.isVertexBufferUpdatable(a.b.UV4Kind)&&(e.uv4s._updatable=!0)),this.isVerticesDataPresent(a.b.UV5Kind)&&(e.uv5s=this.toNumberArray(this.getVerticesData(a.b.UV5Kind)),this.isVertexBufferUpdatable(a.b.UV5Kind)&&(e.uv5s._updatable=!0)),this.isVerticesDataPresent(a.b.UV6Kind)&&(e.uv6s=this.toNumberArray(this.getVerticesData(a.b.UV6Kind)),this.isVertexBufferUpdatable(a.b.UV6Kind)&&(e.uv6s._updatable=!0)),this.isVerticesDataPresent(a.b.ColorKind)&&(e.colors=this.toNumberArray(this.getVerticesData(a.b.ColorKind)),this.isVertexBufferUpdatable(a.b.ColorKind)&&(e.colors._updatable=!0)),this.isVerticesDataPresent(a.b.MatricesIndicesKind)&&(e.matricesIndices=this.toNumberArray(this.getVerticesData(a.b.MatricesIndicesKind)),e.matricesIndices._isExpanded=!0,this.isVertexBufferUpdatable(a.b.MatricesIndicesKind)&&(e.matricesIndices._updatable=!0)),this.isVerticesDataPresent(a.b.MatricesWeightsKind)&&(e.matricesWeights=this.toNumberArray(this.getVerticesData(a.b.MatricesWeightsKind)),this.isVertexBufferUpdatable(a.b.MatricesWeightsKind)&&(e.matricesWeights._updatable=!0)),e.indices=this.toNumberArray(this.getIndices()),e},e.ExtractFromMesh=function(e,t){var i=e._geometry;return i?i.copy(t):null},e.RandomId=function(){return h.b.RandomId()},e._ImportGeometry=function(t,i){var n=i.getScene(),o=t.geometryId;if(o){var c=n.getGeometryByID(o);c&&c.applyToMesh(i)}else if(t instanceof ArrayBuffer){var l=i._binaryInfo;if(l.positionsAttrDesc&&l.positionsAttrDesc.count>0){var u=new Float32Array(t,l.positionsAttrDesc.offset,l.positionsAttrDesc.count);i.setVerticesData(a.b.PositionKind,u,!1)}if(l.normalsAttrDesc&&l.normalsAttrDesc.count>0){var h=new Float32Array(t,l.normalsAttrDesc.offset,l.normalsAttrDesc.count);i.setVerticesData(a.b.NormalKind,h,!1)}if(l.tangetsAttrDesc&&l.tangetsAttrDesc.count>0){var d=new Float32Array(t,l.tangetsAttrDesc.offset,l.tangetsAttrDesc.count);i.setVerticesData(a.b.TangentKind,d,!1)}if(l.uvsAttrDesc&&l.uvsAttrDesc.count>0){var f=new Float32Array(t,l.uvsAttrDesc.offset,l.uvsAttrDesc.count);i.setVerticesData(a.b.UVKind,f,!1)}if(l.uvs2AttrDesc&&l.uvs2AttrDesc.count>0){var p=new Float32Array(t,l.uvs2AttrDesc.offset,l.uvs2AttrDesc.count);i.setVerticesData(a.b.UV2Kind,p,!1)}if(l.uvs3AttrDesc&&l.uvs3AttrDesc.count>0){var _=new Float32Array(t,l.uvs3AttrDesc.offset,l.uvs3AttrDesc.count);i.setVerticesData(a.b.UV3Kind,_,!1)}if(l.uvs4AttrDesc&&l.uvs4AttrDesc.count>0){var m=new Float32Array(t,l.uvs4AttrDesc.offset,l.uvs4AttrDesc.count);i.setVerticesData(a.b.UV4Kind,m,!1)}if(l.uvs5AttrDesc&&l.uvs5AttrDesc.count>0){var g=new Float32Array(t,l.uvs5AttrDesc.offset,l.uvs5AttrDesc.count);i.setVerticesData(a.b.UV5Kind,g,!1)}if(l.uvs6AttrDesc&&l.uvs6AttrDesc.count>0){var v=new Float32Array(t,l.uvs6AttrDesc.offset,l.uvs6AttrDesc.count);i.setVerticesData(a.b.UV6Kind,v,!1)}if(l.colorsAttrDesc&&l.colorsAttrDesc.count>0){var b=new Float32Array(t,l.colorsAttrDesc.offset,l.colorsAttrDesc.count);i.setVerticesData(a.b.ColorKind,b,!1,l.colorsAttrDesc.stride)}if(l.matricesIndicesAttrDesc&&l.matricesIndicesAttrDesc.count>0){for(var y=new Int32Array(t,l.matricesIndicesAttrDesc.offset,l.matricesIndicesAttrDesc.count),T=[],E=0;E<y.length;E++){var S=y[E];T.push(255&S),T.push((65280&S)>>8),T.push((16711680&S)>>16),T.push(S>>24&255)}i.setVerticesData(a.b.MatricesIndicesKind,T,!1)}if(l.matricesIndicesExtraAttrDesc&&l.matricesIndicesExtraAttrDesc.count>0){for(y=new Int32Array(t,l.matricesIndicesExtraAttrDesc.offset,l.matricesIndicesExtraAttrDesc.count),T=[],E=0;E<y.length;E++)S=y[E],T.push(255&S),T.push((65280&S)>>8),T.push((16711680&S)>>16),T.push(S>>24&255);i.setVerticesData(a.b.MatricesIndicesExtraKind,T,!1)}if(l.matricesWeightsAttrDesc&&l.matricesWeightsAttrDesc.count>0){var A=new Float32Array(t,l.matricesWeightsAttrDesc.offset,l.matricesWeightsAttrDesc.count);i.setVerticesData(a.b.MatricesWeightsKind,A,!1)}if(l.indicesAttrDesc&&l.indicesAttrDesc.count>0){var P=new Int32Array(t,l.indicesAttrDesc.offset,l.indicesAttrDesc.count);i.setIndices(P,null)}if(l.subMeshesAttrDesc&&l.subMeshesAttrDesc.count>0){var C=new Int32Array(t,l.subMeshesAttrDesc.offset,5*l.subMeshesAttrDesc.count);for(i.subMeshes=[],E=0;E<l.subMeshesAttrDesc.count;E++){var R=C[5*E+0],x=C[5*E+1],O=C[5*E+2],M=C[5*E+3],I=C[5*E+4];s.a.AddToMesh(R,x,O,M,I,i)}}}else if(t.positions&&t.normals&&t.indices){if(i.setVerticesData(a.b.PositionKind,t.positions,t.positions._updatable),i.setVerticesData(a.b.NormalKind,t.normals,t.normals._updatable),t.tangents&&i.setVerticesData(a.b.TangentKind,t.tangents,t.tangents._updatable),t.uvs&&i.setVerticesData(a.b.UVKind,t.uvs,t.uvs._updatable),t.uvs2&&i.setVerticesData(a.b.UV2Kind,t.uvs2,t.uvs2._updatable),t.uvs3&&i.setVerticesData(a.b.UV3Kind,t.uvs3,t.uvs3._updatable),t.uvs4&&i.setVerticesData(a.b.UV4Kind,t.uvs4,t.uvs4._updatable),t.uvs5&&i.setVerticesData(a.b.UV5Kind,t.uvs5,t.uvs5._updatable),t.uvs6&&i.setVerticesData(a.b.UV6Kind,t.uvs6,t.uvs6._updatable),t.colors&&i.setVerticesData(a.b.ColorKind,r.b.CheckColors4(t.colors,t.positions.length/3),t.colors._updatable),t.matricesIndices)if(t.matricesIndices._isExpanded)delete t.matricesIndices._isExpanded,i.setVerticesData(a.b.MatricesIndicesKind,t.matricesIndices,t.matricesIndices._updatable);else{for(T=[],E=0;E<t.matricesIndices.length;E++){var D=t.matricesIndices[E];T.push(255&D),T.push((65280&D)>>8),T.push((16711680&D)>>16),T.push(D>>24&255)}i.setVerticesData(a.b.MatricesIndicesKind,T,t.matricesIndices._updatable)}if(t.matricesIndicesExtra)if(t.matricesIndicesExtra._isExpanded)delete t.matricesIndices._isExpanded,i.setVerticesData(a.b.MatricesIndicesExtraKind,t.matricesIndicesExtra,t.matricesIndicesExtra._updatable);else{for(T=[],E=0;E<t.matricesIndicesExtra.length;E++)D=t.matricesIndicesExtra[E],T.push(255&D),T.push((65280&D)>>8),T.push((16711680&D)>>16),T.push(D>>24&255);i.setVerticesData(a.b.MatricesIndicesExtraKind,T,t.matricesIndicesExtra._updatable)}t.matricesWeights&&(e._CleanMatricesWeights(t,i),i.setVerticesData(a.b.MatricesWeightsKind,t.matricesWeights,t.matricesWeights._updatable)),t.matricesWeightsExtra&&i.setVerticesData(a.b.MatricesWeightsExtraKind,t.matricesWeightsExtra,t.matricesWeights._updatable),i.setIndices(t.indices,null)}if(t.subMeshes){i.subMeshes=[];for(var N=0;N<t.subMeshes.length;N++){var L=t.subMeshes[N];s.a.AddToMesh(L.materialIndex,L.verticesStart,L.verticesCount,L.indexStart,L.indexCount,i)}}i._shouldGenerateFlatShading&&(i.convertToFlatShadedMesh(),i._shouldGenerateFlatShading=!1),i.computeWorldMatrix(!0),n.onMeshImportedObservable.notifyObservers(i)},e._CleanMatricesWeights=function(e,t){if(c.a.CleanBoneMatrixWeights){var i=0;if(e.skeletonId>-1){var n=t.getScene().getLastSkeletonByID(e.skeletonId);if(n){i=n.bones.length;for(var r=t.getVerticesData(a.b.MatricesIndicesKind),o=t.getVerticesData(a.b.MatricesIndicesExtraKind),s=e.matricesWeights,l=e.matricesWeightsExtra,u=e.numBoneInfluencer,h=s.length,d=0;d<h;d+=4){for(var f=0,p=-1,_=0;_<4;_++)f+=m=s[d+_],m<.001&&p<0&&(p=_);if(l)for(_=0;_<4;_++){var m;f+=m=l[d+_],m<.001&&p<0&&(p=_+4)}if((p<0||p>u-1)&&(p=u-1),f>.001){var g=1/f;for(_=0;_<4;_++)s[d+_]*=g;if(l)for(_=0;_<4;_++)l[d+_]*=g}else p>=4?(l[d+p-4]=1-f,o[d+p-4]=i):(s[d+p]=1-f,r[d+p]=i)}t.setVerticesData(a.b.MatricesIndicesKind,r),e.matricesWeightsExtra&&t.setVerticesData(a.b.MatricesIndicesExtraKind,o)}}}},e.Parse=function(t,i,r){if(i.getGeometryByID(t.id))return null;var s=new e(t.id,i,void 0,t.updatable);return d.a&&d.a.AddTagsTo(s,t.tags),t.delayLoadingFile?(s.delayLoadState=u.a.DELAYLOADSTATE_NOTLOADED,s.delayLoadingFile=r+t.delayLoadingFile,s._boundingInfo=new l.a(n.e.FromArray(t.boundingBoxMinimum),n.e.FromArray(t.boundingBoxMaximum)),s._delayInfo=[],t.hasUVs&&s._delayInfo.push(a.b.UVKind),t.hasUVs2&&s._delayInfo.push(a.b.UV2Kind),t.hasUVs3&&s._delayInfo.push(a.b.UV3Kind),t.hasUVs4&&s._delayInfo.push(a.b.UV4Kind),t.hasUVs5&&s._delayInfo.push(a.b.UV5Kind),t.hasUVs6&&s._delayInfo.push(a.b.UV6Kind),t.hasColors&&s._delayInfo.push(a.b.ColorKind),t.hasMatricesIndices&&s._delayInfo.push(a.b.MatricesIndicesKind),t.hasMatricesWeights&&s._delayInfo.push(a.b.MatricesWeightsKind),s._delayLoadingFunction=o.a.ImportVertexData):o.a.ImportVertexData(t,s),i.pushGeometry(s,!0),s},e}()},function(e,t,i){"use strict";i.d(t,"e",function(){return n}),i.d(t,"c",function(){return s}),i.d(t,"a",function(){return c}),i.d(t,"b",function(){return l}),i.d(t,"f",function(){return u}),i.d(t,"g",function(){return h}),i.d(t,"d",function(){return d});var n,r=i(14),o=i(0),a=i(28);!function(e){e[e.CW=0]="CW",e[e.CCW=1]="CCW"}(n||(n={}));var s=function(){function e(){}return e.Interpolate=function(e,t,i,n,r){for(var o=1-3*n+3*t,a=3*n-6*t,s=3*t,c=e,l=0;l<5;l++){var u=c*c;c-=1/(3*o*u+2*a*c+s)*(o*(u*c)+a*u+s*c-e),c=Math.min(1,Math.max(0,c))}return 3*Math.pow(1-c,2)*c*i+3*(1-c)*Math.pow(c,2)*r+Math.pow(c,3)},e}(),c=function(){function e(e){this._radians=e,this._radians<0&&(this._radians+=2*Math.PI)}return e.prototype.degrees=function(){return 180*this._radians/Math.PI},e.prototype.radians=function(){return this._radians},e.BetweenTwoPoints=function(t,i){var n=i.subtract(t);return new e(Math.atan2(n.y,n.x))},e.FromRadians=function(t){return new e(t)},e.FromDegrees=function(t){return new e(t*Math.PI/180)},e}(),l=function(e,t,i){this.startPoint=e,this.midPoint=t,this.endPoint=i;var r=Math.pow(t.x,2)+Math.pow(t.y,2),a=(Math.pow(e.x,2)+Math.pow(e.y,2)-r)/2,s=(r-Math.pow(i.x,2)-Math.pow(i.y,2))/2,l=(e.x-t.x)*(t.y-i.y)-(t.x-i.x)*(e.y-t.y);this.centerPoint=new o.d((a*(t.y-i.y)-s*(e.y-t.y))/l,((e.x-t.x)*s-(t.x-i.x)*a)/l),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=c.BetweenTwoPoints(this.centerPoint,this.startPoint);var u=this.startAngle.degrees(),h=c.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),d=c.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();h-u>180&&(h-=360),h-u<-180&&(h+=360),d-h>180&&(d-=360),d-h<-180&&(d+=360),this.orientation=h-u<0?n.CW:n.CCW,this.angle=c.FromDegrees(this.orientation===n.CW?u-d:d-u)},u=function(){function e(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new o.d(e,t))}return e.prototype.addLineTo=function(e,t){if(this.closed)return this;var i=new o.d(e,t),n=this._points[this._points.length-1];return this._points.push(i),this._length+=i.subtract(n).length(),this},e.prototype.addArcTo=function(e,t,i,r,a){if(void 0===a&&(a=36),this.closed)return this;var s=this._points[this._points.length-1],c=new o.d(e,t),u=new o.d(i,r),h=new l(s,c,u),d=h.angle.radians()/a;h.orientation===n.CW&&(d*=-1);for(var f=h.startAngle.radians()+d,p=0;p<a;p++){var _=Math.cos(f)*h.radius+h.centerPoint.x,m=Math.sin(f)*h.radius+h.centerPoint.y;this.addLineTo(_,m),f+=d}return this},e.prototype.close=function(){return this.closed=!0,this},e.prototype.length=function(){var e=this._length;if(this.closed){var t=this._points[this._points.length-1];e+=this._points[0].subtract(t).length()}return e},e.prototype.getPoints=function(){return this._points},e.prototype.getPointAtLengthPosition=function(e){if(e<0||e>1)return o.d.Zero();for(var t=e*this.length(),i=0,n=0;n<this._points.length;n++){var r=(n+1)%this._points.length,a=this._points[n],s=this._points[r].subtract(a),c=s.length()+i;if(t>=i&&t<=c){var l=s.normalize(),u=t-i;return new o.d(a.x+l.x*u,a.y+l.y*u)}i=c}return o.d.Zero()},e.StartingAt=function(t,i){return new e(t,i)},e}(),h=function(){function e(e,t,i,n){void 0===t&&(t=null),void 0===n&&(n=!1),this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:o.e.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:o.a.Identity()};for(var r=0;r<e.length;r++)this._curve[r]=e[r].clone();this._raw=i||!1,this._alignTangentsWithPath=n,this._compute(t,n)}return e.prototype.getCurve=function(){return this._curve},e.prototype.getPoints=function(){return this._curve},e.prototype.length=function(){return this._distances[this._distances.length-1]},e.prototype.getTangents=function(){return this._tangents},e.prototype.getNormals=function(){return this._normals},e.prototype.getBinormals=function(){return this._binormals},e.prototype.getDistances=function(){return this._distances},e.prototype.getPointAt=function(e){return this._updatePointAtData(e).point},e.prototype.getTangentAt=function(e,t){return void 0===t&&(t=!1),this._updatePointAtData(e,t),t?o.e.TransformCoordinates(o.e.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]},e.prototype.getNormalAt=function(e,t){return void 0===t&&(t=!1),this._updatePointAtData(e,t),t?o.e.TransformCoordinates(o.e.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]},e.prototype.getBinormalAt=function(e,t){return void 0===t&&(t=!1),this._updatePointAtData(e,t),t?o.e.TransformCoordinates(o.e.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]},e.prototype.getDistanceAt=function(e){return this.length()*e},e.prototype.getPreviousPointIndexAt=function(e){return this._updatePointAtData(e),this._pointAtData.previousPointArrayIndex},e.prototype.getSubPositionAt=function(e){return this._updatePointAtData(e),this._pointAtData.subPosition},e.prototype.getClosestPositionTo=function(e){for(var t=Number.MAX_VALUE,i=0,n=0;n<this._curve.length-1;n++){var r=this._curve[n+0],a=this._curve[n+1].subtract(r).normalize(),s=this._distances[n+1]-this._distances[n+0],c=Math.min(Math.max(o.e.Dot(a,e.subtract(r).normalize()),0)*o.e.Distance(r,e)/s,1),l=o.e.Distance(r.add(a.scale(c*s)),e);l<t&&(t=l,i=(this._distances[n+0]+s*c)/this.length())}return i},e.prototype.slice=function(t,i){if(void 0===t&&(t=0),void 0===i&&(i=1),t<0&&(t=1- -1*t%1),i<0&&(i=1- -1*i%1),t>i){var n=t;t=i,i=n}var r=this.getCurve(),o=this.getPointAt(t),a=this.getPreviousPointIndexAt(t),s=this.getPointAt(i),c=this.getPreviousPointIndexAt(i)+1,l=[];return 0!==t&&(a++,l.push(o)),l.push.apply(l,r.slice(a,c)),1===i&&1!==t||l.push(s),new e(l,this.getNormalAt(t),this._raw,this._alignTangentsWithPath)},e.prototype.update=function(e,t,i){void 0===t&&(t=null),void 0===i&&(i=!1);for(var n=0;n<e.length;n++)this._curve[n].x=e[n].x,this._curve[n].y=e[n].y,this._curve[n].z=e[n].z;return this._compute(t,i),this},e.prototype._compute=function(e,t){void 0===t&&(t=!1);var i=this._curve.length;if(!(i<2)){this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[i-1]=this._curve[i-1].subtract(this._curve[i-2]),this._raw||this._tangents[i-1].normalize();var n,r,a,s,c,l=this._tangents[0],u=this._normalVector(l,e);this._normals[0]=u,this._raw||this._normals[0].normalize(),this._binormals[0]=o.e.Cross(l,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(var h=1;h<i;h++)n=this._getLastNonNullVector(h),h<i-1&&(r=this._getFirstNonNullVector(h),this._tangents[h]=t?r:n.add(r),this._tangents[h].normalize()),this._distances[h]=this._distances[h-1]+this._curve[h].subtract(this._curve[h-1]).length(),a=this._tangents[h],c=this._binormals[h-1],this._normals[h]=o.e.Cross(c,a),this._raw||(0===this._normals[h].length()?(s=this._normals[h-1],this._normals[h]=s.clone()):this._normals[h].normalize()),this._binormals[h]=o.e.Cross(a,this._normals[h]),this._raw||this._binormals[h].normalize();this._pointAtData.id=NaN}},e.prototype._getFirstNonNullVector=function(e){for(var t=1,i=this._curve[e+t].subtract(this._curve[e]);0===i.length()&&e+t+1<this._curve.length;)t++,i=this._curve[e+t].subtract(this._curve[e]);return i},e.prototype._getLastNonNullVector=function(e){for(var t=1,i=this._curve[e].subtract(this._curve[e-t]);0===i.length()&&e>t+1;)t++,i=this._curve[e].subtract(this._curve[e-t]);return i},e.prototype._normalVector=function(e,t){var i,n,s=e.length();return 0===s&&(s=1),null==t?(n=r.a.WithinEpsilon(Math.abs(e.y)/s,1,a.a)?r.a.WithinEpsilon(Math.abs(e.x)/s,1,a.a)?r.a.WithinEpsilon(Math.abs(e.z)/s,1,a.a)?o.e.Zero():new o.e(0,0,1):new o.e(1,0,0):new o.e(0,-1,0),i=o.e.Cross(e,n)):(i=o.e.Cross(e,t),o.e.CrossToRef(i,e,i)),i.normalize(),i},e.prototype._updatePointAtData=function(e,t){if(void 0===t&&(t=!1),this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;var i=this.getPoints();if(e<=0)return this._setPointAtData(0,0,i[0],0,t);if(e>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,t);for(var n,r=i[0],a=0,s=e*this.length(),c=1;c<i.length;c++){n=i[c];var l=o.e.Distance(r,n);if((a+=l)===s)return this._setPointAtData(e,1,n,c,t);if(a>s){var u=(a-s)/l,h=r.subtract(n),d=n.add(h.scaleInPlace(u));return this._setPointAtData(e,1-u,d,c-1,t)}r=n}return this._pointAtData},e.prototype._setPointAtData=function(e,t,i,n,r){return this._pointAtData.point=i,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=n,this._pointAtData.interpolateReady=r,r&&this._updateInterpolationMatrix(),this._pointAtData},e.prototype._updateInterpolationMatrix=function(){this._pointAtData.interpolationMatrix=o.a.Identity();var e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){var t=e+1,i=this._tangents[e].clone(),n=this._normals[e].clone(),r=this._binormals[e].clone(),a=this._tangents[t].clone(),s=this._normals[t].clone(),c=this._binormals[t].clone(),l=o.b.RotationQuaternionFromAxis(n,r,i),u=o.b.RotationQuaternionFromAxis(s,c,a);o.b.Slerp(l,u,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}},e}(),d=function(){function e(e){this._length=0,this._points=e,this._length=this._computeLength(e)}return e.CreateQuadraticBezier=function(t,i,n,r){r=r>2?r:3;for(var a=new Array,s=function(e,t,i,n){return(1-e)*(1-e)*t+2*e*(1-e)*i+e*e*n},c=0;c<=r;c++)a.push(new o.e(s(c/r,t.x,i.x,n.x),s(c/r,t.y,i.y,n.y),s(c/r,t.z,i.z,n.z)));return new e(a)},e.CreateCubicBezier=function(t,i,n,r,a){a=a>3?a:4;for(var s=new Array,c=function(e,t,i,n,r){return(1-e)*(1-e)*(1-e)*t+3*e*(1-e)*(1-e)*i+3*e*e*(1-e)*n+e*e*e*r},l=0;l<=a;l++)s.push(new o.e(c(l/a,t.x,i.x,n.x,r.x),c(l/a,t.y,i.y,n.y,r.y),c(l/a,t.z,i.z,n.z,r.z)));return new e(s)},e.CreateHermiteSpline=function(t,i,n,r,a){for(var s=new Array,c=1/a,l=0;l<=a;l++)s.push(o.e.Hermite(t,i,n,r,l*c));return new e(s)},e.CreateCatmullRomSpline=function(t,i,n){var r=new Array,a=1/i,s=0;if(n){for(var c=t.length,l=0;l<c;l++){s=0;for(var u=0;u<i;u++)r.push(o.e.CatmullRom(t[l%c],t[(l+1)%c],t[(l+2)%c],t[(l+3)%c],s)),s+=a}r.push(r[0])}else{var h=new Array;for(h.push(t[0].clone()),Array.prototype.push.apply(h,t),h.push(t[t.length-1].clone()),l=0;l<h.length-3;l++)for(s=0,u=0;u<i;u++)r.push(o.e.CatmullRom(h[l],h[l+1],h[l+2],h[l+3],s)),s+=a;l--,r.push(o.e.CatmullRom(h[l],h[l+1],h[l+2],h[l+3],s))}return new e(r)},e.prototype.getPoints=function(){return this._points},e.prototype.length=function(){return this._length},e.prototype.continue=function(t){for(var i=this._points[this._points.length-1],n=this._points.slice(),r=t.getPoints(),o=1;o<r.length;o++)n.push(r[o].subtract(r[0]).add(i));return new e(n)},e.prototype._computeLength=function(e){for(var t=0,i=1;i<e.length;i++)t+=e[i].subtract(e[i-1]).length();return t},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return m});var n=i(1),r=i(3),o=i(0),a=i(4),s=i(10),c=i(15),l=i(25),u=i(11),h=i(9),d=i(67),f=i(49),p=i(13),_={effect:null,subMesh:null},m=function(e){function t(t,i,r,a){void 0===a&&(a={});var s=e.call(this,t,i)||this;return s._textures={},s._textureArrays={},s._floats={},s._ints={},s._floatsArrays={},s._colors3={},s._colors3Arrays={},s._colors4={},s._colors4Arrays={},s._vectors2={},s._vectors3={},s._vectors4={},s._matrices={},s._matrixArrays={},s._matrices3x3={},s._matrices2x2={},s._vectors2Arrays={},s._vectors3Arrays={},s._vectors4Arrays={},s._cachedWorldViewMatrix=new o.a,s._cachedWorldViewProjectionMatrix=new o.a,s._multiview=!1,s._shaderPath=r,s._options=Object(n.a)({needAlphaBlending:!1,needAlphaTesting:!1,attributes:["position","normal","uv"],uniforms:["worldViewProjection"],uniformBuffers:[],samplers:[],defines:[]},a),s}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"shaderPath",{get:function(){return this._shaderPath},set:function(e){this._shaderPath=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"ShaderMaterial"},t.prototype.needAlphaBlending=function(){return this.alpha<1||this._options.needAlphaBlending},t.prototype.needAlphaTesting=function(){return this._options.needAlphaTesting},t.prototype._checkUniform=function(e){-1===this._options.uniforms.indexOf(e)&&this._options.uniforms.push(e)},t.prototype.setTexture=function(e,t){return-1===this._options.samplers.indexOf(e)&&this._options.samplers.push(e),this._textures[e]=t,this},t.prototype.setTextureArray=function(e,t){return-1===this._options.samplers.indexOf(e)&&this._options.samplers.push(e),this._checkUniform(e),this._textureArrays[e]=t,this},t.prototype.setFloat=function(e,t){return this._checkUniform(e),this._floats[e]=t,this},t.prototype.setInt=function(e,t){return this._checkUniform(e),this._ints[e]=t,this},t.prototype.setFloats=function(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this},t.prototype.setColor3=function(e,t){return this._checkUniform(e),this._colors3[e]=t,this},t.prototype.setColor3Array=function(e,t){return this._checkUniform(e),this._colors3Arrays[e]=t.reduce(function(e,t){return t.toArray(e,e.length),e},[]),this},t.prototype.setColor4=function(e,t){return this._checkUniform(e),this._colors4[e]=t,this},t.prototype.setColor4Array=function(e,t){return this._checkUniform(e),this._colors4Arrays[e]=t.reduce(function(e,t){return t.toArray(e,e.length),e},[]),this},t.prototype.setVector2=function(e,t){return this._checkUniform(e),this._vectors2[e]=t,this},t.prototype.setVector3=function(e,t){return this._checkUniform(e),this._vectors3[e]=t,this},t.prototype.setVector4=function(e,t){return this._checkUniform(e),this._vectors4[e]=t,this},t.prototype.setMatrix=function(e,t){return this._checkUniform(e),this._matrices[e]=t,this},t.prototype.setMatrices=function(e,t){this._checkUniform(e);for(var i=new Float32Array(16*t.length),n=0;n<t.length;n++)t[n].copyToArray(i,16*n);return this._matrixArrays[e]=i,this},t.prototype.setMatrix3x3=function(e,t){return this._checkUniform(e),this._matrices3x3[e]=t,this},t.prototype.setMatrix2x2=function(e,t){return this._checkUniform(e),this._matrices2x2[e]=t,this},t.prototype.setArray2=function(e,t){return this._checkUniform(e),this._vectors2Arrays[e]=t,this},t.prototype.setArray3=function(e,t){return this._checkUniform(e),this._vectors3Arrays[e]=t,this},t.prototype.setArray4=function(e,t){return this._checkUniform(e),this._vectors4Arrays[e]=t,this},t.prototype._checkCache=function(e,t){return!e||!this._effect||-1!==this._effect.defines.indexOf("#define INSTANCES")===t},t.prototype.isReadyForSubMesh=function(e,t,i){return this.isReady(e,i)},t.prototype.isReady=function(e,t){var i,n;if(this._effect&&this.isFrozen&&this._effect._wasPreviouslyReady)return!0;var r=this.getScene(),o=r.getEngine();if(!this.checkReadyOnEveryCall&&this._renderId===r.getRenderId()&&this._checkCache(e,t))return!0;var s=[],l=[],u=new d.a;o.getCaps().multiview&&r.activeCamera&&r.activeCamera.outputRenderTarget&&r.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,s.push("#define MULTIVIEW"),-1!==this._options.uniforms.indexOf("viewProjection")&&-1===this._options.uniforms.push("viewProjectionR")&&this._options.uniforms.push("viewProjectionR"));for(var h=0;h<this._options.defines.length;h++)s.push(this._options.defines[h]);for(h=0;h<this._options.attributes.length;h++)l.push(this._options.attributes[h]);e&&e.isVerticesDataPresent(a.b.ColorKind)&&(l.push(a.b.ColorKind),s.push("#define VERTEXCOLOR")),t&&(s.push("#define INSTANCES"),c.a.PushAttributesForInstances(l),(null==e?void 0:e.hasThinInstances)&&s.push("#define THIN_INSTANCES"));var f=0;if(e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton){l.push(a.b.MatricesIndicesKind),l.push(a.b.MatricesWeightsKind),e.numBoneInfluencers>4&&(l.push(a.b.MatricesIndicesExtraKind),l.push(a.b.MatricesWeightsExtraKind));var p=e.skeleton;f=e.numBoneInfluencers,s.push("#define NUM_BONE_INFLUENCERS "+f),u.addCPUSkinningFallback(0,e),p.isUsingTextureForMatrices?(s.push("#define BONETEXTURE"),-1===this._options.uniforms.indexOf("boneTextureWidth")&&this._options.uniforms.push("boneTextureWidth"),-1===this._options.samplers.indexOf("boneSampler")&&this._options.samplers.push("boneSampler")):(s.push("#define BonesPerMesh "+(p.bones.length+1)),-1===this._options.uniforms.indexOf("mBones")&&this._options.uniforms.push("mBones"))}else s.push("#define NUM_BONE_INFLUENCERS 0");for(var m in this._textures)if(!this._textures[m].isReady())return!1;e&&this._shouldTurnAlphaTestOn(e)&&s.push("#define ALPHATEST");var g=this._shaderPath,v=this._options.uniforms,b=this._options.uniformBuffers,y=this._options.samplers;this.customShaderNameResolve&&(v=v.slice(),b=b.slice(),y=y.slice(),g=this.customShaderNameResolve(g,v,b,y,s,l));var T=this._effect,E=s.join("\n");return this._cachedDefines!==E&&(this._cachedDefines=E,this._effect=o.createEffect(g,{attributes:l,uniformsNames:v,uniformBuffersNames:b,samplers:y,defines:E,fallbacks:u,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:f}},o),this._onEffectCreatedObservable&&(_.effect=this._effect,this._onEffectCreatedObservable.notifyObservers(_))),null!==(n=!(null===(i=this._effect)||void 0===i?void 0:i.isReady()))&&void 0!==n&&!n&&(T!==this._effect&&r.resetCachedMaterial(),this._renderId=r.getRenderId(),this._effect._wasPreviouslyReady=!0,!0)},t.prototype.bindOnlyWorldMatrix=function(e,t){var i=this.getScene(),n=null!=t?t:this._effect;n&&(-1!==this._options.uniforms.indexOf("world")&&n.setMatrix("world",e),-1!==this._options.uniforms.indexOf("worldView")&&(e.multiplyToRef(i.getViewMatrix(),this._cachedWorldViewMatrix),n.setMatrix("worldView",this._cachedWorldViewMatrix)),-1!==this._options.uniforms.indexOf("worldViewProjection")&&(e.multiplyToRef(i.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),n.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)))},t.prototype.bindForSubMesh=function(e,t,i){this.bind(e,t,i._effectOverride)},t.prototype.bind=function(e,t,i){this.bindOnlyWorldMatrix(e,i);var n=null!=i?i:this._effect;if(n&&this.getScene().getCachedMaterial()!==this){var r;for(r in-1!==this._options.uniforms.indexOf("view")&&n.setMatrix("view",this.getScene().getViewMatrix()),-1!==this._options.uniforms.indexOf("projection")&&n.setMatrix("projection",this.getScene().getProjectionMatrix()),-1!==this._options.uniforms.indexOf("viewProjection")&&(n.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._multiview&&n.setMatrix("viewProjectionR",this.getScene()._transformMatrixR)),this.getScene().activeCamera&&-1!==this._options.uniforms.indexOf("cameraPosition")&&n.setVector3("cameraPosition",this.getScene().activeCamera.globalPosition),c.a.BindBonesParameters(t,n),this._textures)n.setTexture(r,this._textures[r]);for(r in this._textureArrays)n.setTextureArray(r,this._textureArrays[r]);for(r in this._ints)n.setInt(r,this._ints[r]);for(r in this._floats)n.setFloat(r,this._floats[r]);for(r in this._floatsArrays)n.setArray(r,this._floatsArrays[r]);for(r in this._colors3)n.setColor3(r,this._colors3[r]);for(r in this._colors3Arrays)n.setArray3(r,this._colors3Arrays[r]);for(r in this._colors4){var o=this._colors4[r];n.setFloat4(r,o.r,o.g,o.b,o.a)}for(r in this._colors4Arrays)n.setArray4(r,this._colors4Arrays[r]);for(r in this._vectors2)n.setVector2(r,this._vectors2[r]);for(r in this._vectors3)n.setVector3(r,this._vectors3[r]);for(r in this._vectors4)n.setVector4(r,this._vectors4[r]);for(r in this._matrices)n.setMatrix(r,this._matrices[r]);for(r in this._matrixArrays)n.setMatrices(r,this._matrixArrays[r]);for(r in this._matrices3x3)n.setMatrix3x3(r,this._matrices3x3[r]);for(r in this._matrices2x2)n.setMatrix2x2(r,this._matrices2x2[r]);for(r in this._vectors2Arrays)n.setArray2(r,this._vectors2Arrays[r]);for(r in this._vectors3Arrays)n.setArray3(r,this._vectors3Arrays[r]);for(r in this._vectors4Arrays)n.setArray4(r,this._vectors4Arrays[r])}var a=this._effect;this._effect=n,this._afterBind(t),this._effect=a},t.prototype._afterBind=function(t){e.prototype._afterBind.call(this,t),this.getScene()._cachedEffect=this._effect},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);for(var i in this._textures)t.push(this._textures[i]);for(var i in this._textureArrays)for(var n=this._textureArrays[i],r=0;r<n.length;r++)t.push(n[r]);return t},t.prototype.hasTexture=function(t){if(e.prototype.hasTexture.call(this,t))return!0;for(var i in this._textures)if(this._textures[i]===t)return!0;for(var i in this._textureArrays)for(var n=this._textureArrays[i],r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},t.prototype.clone=function(e){var i=this,o=r.a.Clone(function(){return new t(e,i.getScene(),i._shaderPath,i._options)},this);for(var a in o.name=e,o.id=e,"object"==typeof o._shaderPath&&(o._shaderPath=Object(n.a)({},o._shaderPath)),this._options=Object(n.a)({},this._options),Object.keys(this._options).forEach(function(e){var t=i._options[e];Array.isArray(t)&&(i._options[e]=t.slice(0))}),this._textures)o.setTexture(a,this._textures[a]);for(var a in this._floats)o.setFloat(a,this._floats[a]);for(var a in this._floatsArrays)o.setFloats(a,this._floatsArrays[a]);for(var a in this._colors3)o.setColor3(a,this._colors3[a]);for(var a in this._colors4)o.setColor4(a,this._colors4[a]);for(var a in this._vectors2)o.setVector2(a,this._vectors2[a]);for(var a in this._vectors3)o.setVector3(a,this._vectors3[a]);for(var a in this._vectors4)o.setVector4(a,this._vectors4[a]);for(var a in this._matrices)o.setMatrix(a,this._matrices[a]);for(var a in this._matrices3x3)o.setMatrix3x3(a,this._matrices3x3[a]);for(var a in this._matrices2x2)o.setMatrix2x2(a,this._matrices2x2[a]);return o},t.prototype.dispose=function(t,i,n){if(i){var r;for(r in this._textures)this._textures[r].dispose();for(r in this._textureArrays)for(var o=this._textureArrays[r],a=0;a<o.length;a++)o[a].dispose()}this._textures={},e.prototype.dispose.call(this,t,i,n)},t.prototype.serialize=function(){var e,t=r.a.Serialize(this);for(e in t.customType="BABYLON.ShaderMaterial",t.options=this._options,t.shaderPath=this._shaderPath,t.textures={},this._textures)t.textures[e]=this._textures[e].serialize();for(e in t.textureArrays={},this._textureArrays){t.textureArrays[e]=[];for(var i=this._textureArrays[e],n=0;n<i.length;n++)t.textureArrays[e].push(i[n].serialize())}for(e in t.floats={},this._floats)t.floats[e]=this._floats[e];for(e in t.FloatArrays={},this._floatsArrays)t.FloatArrays[e]=this._floatsArrays[e];for(e in t.colors3={},this._colors3)t.colors3[e]=this._colors3[e].asArray();for(e in t.colors3Arrays={},this._colors3Arrays)t.colors3Arrays[e]=this._colors3Arrays[e];for(e in t.colors4={},this._colors4)t.colors4[e]=this._colors4[e].asArray();for(e in t.colors4Arrays={},this._colors4Arrays)t.colors4Arrays[e]=this._colors4Arrays[e];for(e in t.vectors2={},this._vectors2)t.vectors2[e]=this._vectors2[e].asArray();for(e in t.vectors3={},this._vectors3)t.vectors3[e]=this._vectors3[e].asArray();for(e in t.vectors4={},this._vectors4)t.vectors4[e]=this._vectors4[e].asArray();for(e in t.matrices={},this._matrices)t.matrices[e]=this._matrices[e].asArray();for(e in t.matrixArray={},this._matrixArrays)t.matrixArray[e]=this._matrixArrays[e];for(e in t.matrices3x3={},this._matrices3x3)t.matrices3x3[e]=this._matrices3x3[e];for(e in t.matrices2x2={},this._matrices2x2)t.matrices2x2[e]=this._matrices2x2[e];for(e in t.vectors2Arrays={},this._vectors2Arrays)t.vectors2Arrays[e]=this._vectors2Arrays[e];for(e in t.vectors3Arrays={},this._vectors3Arrays)t.vectors3Arrays[e]=this._vectors3Arrays[e];for(e in t.vectors4Arrays={},this._vectors4Arrays)t.vectors4Arrays[e]=this._vectors4Arrays[e];return t},t.Parse=function(e,i,n){var a,c=r.a.Parse(function(){return new t(e.name,i,e.shaderPath,e.options)},e,i,n);for(a in e.textures)c.setTexture(a,s.a.Parse(e.textures[a],i,n));for(a in e.textureArrays){for(var l=e.textureArrays[a],u=new Array,d=0;d<l.length;d++)u.push(s.a.Parse(l[d],i,n));c.setTextureArray(a,u)}for(a in e.floats)c.setFloat(a,e.floats[a]);for(a in e.floatsArrays)c.setFloats(a,e.floatsArrays[a]);for(a in e.colors3)c.setColor3(a,h.a.FromArray(e.colors3[a]));for(a in e.colors3Arrays){var f=e.colors3Arrays[a].reduce(function(e,t,i){return i%3==0?e.push([t]):e[e.length-1].push(t),e},[]).map(function(e){return h.a.FromArray(e)});c.setColor3Array(a,f)}for(a in e.colors4)c.setColor4(a,h.b.FromArray(e.colors4[a]));for(a in e.colors4Arrays)f=e.colors4Arrays[a].reduce(function(e,t,i){return i%4==0?e.push([t]):e[e.length-1].push(t),e},[]).map(function(e){return h.b.FromArray(e)}),c.setColor4Array(a,f);for(a in e.vectors2)c.setVector2(a,o.d.FromArray(e.vectors2[a]));for(a in e.vectors3)c.setVector3(a,o.e.FromArray(e.vectors3[a]));for(a in e.vectors4)c.setVector4(a,o.f.FromArray(e.vectors4[a]));for(a in e.matrices)c.setMatrix(a,o.a.FromArray(e.matrices[a]));for(a in e.matrixArray)c._matrixArrays[a]=new Float32Array(e.matrixArray[a]);for(a in e.matrices3x3)c.setMatrix3x3(a,e.matrices3x3[a]);for(a in e.matrices2x2)c.setMatrix2x2(a,e.matrices2x2[a]);for(a in e.vectors2Arrays)c.setArray2(a,e.vectors2Arrays[a]);for(a in e.vectors3Arrays)c.setArray3(a,e.vectors3Arrays[a]);for(a in e.vectors4Arrays)c.setArray4(a,e.vectors4Arrays[a]);return c},t.ParseFromFileAsync=function(e,t,i,n){var r=this;return void 0===n&&(n=""),new Promise(function(o,a){var s=new f.a;s.addEventListener("readystatechange",function(){if(4==s.readyState)if(200==s.status){var t=JSON.parse(s.responseText),c=r.Parse(t,i||p.a.LastCreatedScene,n);e&&(c.name=e),o(c)}else a("Unable to load the ShaderMaterial")}),s.open("GET",t),s.send()})},t.CreateFromSnippetAsync=function(e,t,i){var n=this;return void 0===i&&(i=""),new Promise(function(r,o){var a=new f.a;a.addEventListener("readystatechange",function(){if(4==a.readyState)if(200==a.status){var s=JSON.parse(JSON.parse(a.responseText).jsonPayload),c=JSON.parse(s.shaderMaterial),l=n.Parse(c,t||p.a.LastCreatedScene,i);l.snippetId=e,r(l)}else o("Unable to load the snippet "+e)}),a.open("GET",n.SnippetUrl+"/"+e.replace(/#/g,"/")),a.send()})},t.SnippetUrl="https://snippet.babylonjs.com",t}(l.a);u.a.RegisteredTypes["BABYLON.ShaderMaterial"]=m},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.SetMatrixPrecision=function(t){if(e.MatrixTrackPrecisionChange=!1,t&&!e.MatrixUse64Bits&&e.MatrixTrackedMatrices)for(var i=0;i<e.MatrixTrackedMatrices.length;++i){var n=e.MatrixTrackedMatrices[i],r=n._m;n._m=new Array(16);for(var o=0;o<16;++o)n._m[o]=r[o]}e.MatrixUse64Bits=t,e.MatrixCurrentType=e.MatrixUse64Bits?Array:Float32Array,e.MatrixTrackedMatrices=null},e.MatrixUse64Bits=!1,e.MatrixTrackPrecisionChange=!0,e.MatrixCurrentType=Float32Array,e.MatrixTrackedMatrices=[],e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return p});var n=i(1),r=i(6),o=i(0),a=i(46),s=i(7),c=i(53),l=i(65),u=i(51),h=i(36),d=i(30),f=i(9),p=function(e){function t(i,n,a,c,u){var p;void 0===n&&(n=f.a.Gray()),void 0===a&&(a=h.a.DefaultUtilityLayer),void 0===c&&(c=null),void 0===u&&(u=1);var _=e.call(this,a)||this;_._pointerObserver=null,_.snapDistance=0,_.onSnapObservable=new r.c,_._isEnabled=!0,_._parent=null,_._dragging=!1,_._parent=c,_._coloredMaterial=new d.a("",a.utilityLayerScene),_._coloredMaterial.diffuseColor=n,_._coloredMaterial.specularColor=n.subtract(new f.a(.1,.1,.1)),_._hoverMaterial=new d.a("",a.utilityLayerScene),_._hoverMaterial.diffuseColor=f.a.Yellow(),_._disableMaterial=new d.a("",a.utilityLayerScene),_._disableMaterial.diffuseColor=f.a.Gray(),_._disableMaterial.alpha=.4;var m=t._CreateArrow(a.utilityLayerScene,_._coloredMaterial,u),g=t._CreateArrow(a.utilityLayerScene,_._coloredMaterial,u+4,!0);_._gizmoMesh=new s.a("",a.utilityLayerScene),_._gizmoMesh.addChild(m),_._gizmoMesh.addChild(g),_._gizmoMesh.lookAt(_._rootMesh.position.add(i)),_._gizmoMesh.scaling.scaleInPlace(1/3),_._gizmoMesh.parent=_._rootMesh;var v=0,b=new o.e,y={snapDistance:0};_.dragBehavior=new l.a({dragAxis:i}),_.dragBehavior.moveAttached=!1,_._rootMesh.addBehavior(_.dragBehavior),_.dragBehavior.onDragObservable.add(function(e){if(_.attachedNode){if(0==_.snapDistance)_.attachedNode.position&&_.attachedNode.position.addInPlaceFromFloats(e.delta.x,e.delta.y,e.delta.z),_.attachedNode.getWorldMatrix().addTranslationFromFloats(e.delta.x,e.delta.y,e.delta.z),_.attachedNode.updateCache();else if(v+=e.dragDistance,Math.abs(v)>_.snapDistance){var t=Math.floor(Math.abs(v)/_.snapDistance);v%=_.snapDistance,e.delta.normalizeToRef(b),b.scaleInPlace(_.snapDistance*t),_.attachedNode.getWorldMatrix().addTranslationFromFloats(b.x,b.y,b.z),_.attachedNode.updateCache(),y.snapDistance=_.snapDistance*t,_.onSnapObservable.notifyObservers(y)}_._matrixChanged()}}),_.dragBehavior.onDragStartObservable.add(function(){_._dragging=!0}),_.dragBehavior.onDragEndObservable.add(function(){_._dragging=!1});var T=a._getSharedGizmoLight();T.includedOnlyMeshes=T.includedOnlyMeshes.concat(_._rootMesh.getChildMeshes(!1));var E={gizmoMeshes:m.getChildMeshes(),colliderMeshes:g.getChildMeshes(),material:_._coloredMaterial,hoverMaterial:_._hoverMaterial,disableMaterial:_._disableMaterial,active:!1};return null===(p=_._parent)||void 0===p||p.addToAxisCache(g,E),_._pointerObserver=a.utilityLayerScene.onPointerObservable.add(function(e){var t;if(!_._customMeshSet&&(_._isHovered=!(-1==E.colliderMeshes.indexOf(null===(t=null==e?void 0:e.pickInfo)||void 0===t?void 0:t.pickedMesh)),!_._parent)){var i=_._isHovered||_._dragging?_._hoverMaterial:_._coloredMaterial;E.gizmoMeshes.forEach(function(e){e.material=i,e.color&&(e.color=i.diffuseColor)})}}),_}return Object(n.d)(t,e),t._CreateArrow=function(e,t,i,n){void 0===i&&(i=1),void 0===n&&(n=!1);var r=new a.a("arrow",e),o=c.a.CreateCylinder("cylinder",{diameterTop:0,height:.075,diameterBottom:.0375*(1+(i-1)/4),tessellation:96},e),s=c.a.CreateCylinder("cylinder",{diameterTop:.005*i,height:.275,diameterBottom:.005*i,tessellation:96},e);return o.parent=r,o.material=t,o.rotation.x=Math.PI/2,o.position.z+=.3,s.parent=r,s.material=t,s.position.z+=.1375,s.rotation.x=Math.PI/2,n&&(s.visibility=0,o.visibility=0),r},t._CreateArrowInstance=function(e,t){for(var i=new a.a("arrow",e),n=0,r=t.getChildMeshes();n<r.length;n++){var o=r[n];o.createInstance(o.name).parent=i}return i},t.prototype._attachedNodeChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh,this.attachedNode=this._parent.attachedNode):(this.attachedMesh=null,this.attachedNode=null)},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose(),[this._coloredMaterial,this._hoverMaterial,this._disableMaterial].forEach(function(e){e&&e.dispose()}),e.prototype.dispose.call(this)},t}(u.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this._isDirty=!0,this._areLightsDirty=!0,this._areLightsDisposed=!1,this._areAttributesDirty=!0,this._areTexturesDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._normals=!1,this._uvs=!1,this._needNormals=!1,this._needUVs=!1}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isDirty},enumerable:!1,configurable:!0}),e.prototype.markAsProcessed=function(){this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirty=!1,this._areLightsDisposed=!1,this._areMiscDirty=!1,this._arePrePassDirty=!1,this._areImageProcessingDirty=!1},e.prototype.markAsUnprocessed=function(){this._isDirty=!0},e.prototype.markAllAsDirty=function(){this._areTexturesDirty=!0,this._areAttributesDirty=!0,this._areLightsDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._areImageProcessingDirty=!0,this._isDirty=!0},e.prototype.markAsImageProcessingDirty=function(){this._areImageProcessingDirty=!0,this._isDirty=!0},e.prototype.markAsLightDirty=function(e){void 0===e&&(e=!1),this._areLightsDirty=!0,this._areLightsDisposed=this._areLightsDisposed||e,this._isDirty=!0},e.prototype.markAsAttributesDirty=function(){this._areAttributesDirty=!0,this._isDirty=!0},e.prototype.markAsTexturesDirty=function(){this._areTexturesDirty=!0,this._isDirty=!0},e.prototype.markAsFresnelDirty=function(){this._areFresnelDirty=!0,this._isDirty=!0},e.prototype.markAsMiscDirty=function(){this._areMiscDirty=!0,this._isDirty=!0},e.prototype.markAsPrePassDirty=function(){this._arePrePassDirty=!0,this._isDirty=!0},e.prototype.rebuild=function(){this._keys=[];for(var e=0,t=Object.keys(this);e<t.length;e++){var i=t[e];"_"!==i[0]&&this._keys.push(i)}},e.prototype.isEqual=function(e){if(this._keys.length!==e._keys.length)return!1;for(var t=0;t<this._keys.length;t++){var i=this._keys[t];if(this[i]!==e[i])return!1}return!0},e.prototype.cloneTo=function(e){this._keys.length!==e._keys.length&&(e._keys=this._keys.slice(0));for(var t=0;t<this._keys.length;t++){var i=this._keys[t];e[i]=this[i]}},e.prototype.reset=function(){for(var e=0;e<this._keys.length;e++){var t=this._keys[e];switch(typeof this[t]){case"number":this[t]=0;break;case"string":this[t]="";break;default:this[t]=!1}}},e.prototype.toString=function(){for(var e="",t=0;t<this._keys.length;t++){var i=this._keys[t],n=this[i];switch(typeof n){case"number":case"string":e+="#define "+i+" "+n+"\n";break;default:n&&(e+="#define "+i+"\n")}}return e},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(e,t){this.width=e,this.height=t}return e.prototype.toString=function(){return"{W: "+this.width+", H: "+this.height+"}"},e.prototype.getClassName=function(){return"Size"},e.prototype.getHashCode=function(){var e=0|this.width;return 397*e^(0|this.height)},e.prototype.copyFrom=function(e){this.width=e.width,this.height=e.height},e.prototype.copyFromFloats=function(e,t){return this.width=e,this.height=t,this},e.prototype.set=function(e,t){return this.copyFromFloats(e,t)},e.prototype.multiplyByFloats=function(t,i){return new e(this.width*t,this.height*i)},e.prototype.clone=function(){return new e(this.width,this.height)},e.prototype.equals=function(e){return!!e&&this.width===e.width&&this.height===e.height},Object.defineProperty(e.prototype,"surface",{get:function(){return this.width*this.height},enumerable:!1,configurable:!0}),e.Zero=function(){return new e(0,0)},e.prototype.add=function(t){return new e(this.width+t.width,this.height+t.height)},e.prototype.subtract=function(t){return new e(this.width-t.width,this.height-t.height)},e.Lerp=function(t,i,n){return new e(t.width+(i.width-t.width)*n,t.height+(i.height-t.height)*n)},e}()},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.bonesDeclaration="#if NUM_BONE_INFLUENCERS>0\n#ifdef BONETEXTURE\nuniform sampler2D boneSampler;\nuniform float boneTextureWidth;\n#else\nuniform mat4 mBones[BonesPerMesh];\n#ifdef BONES_VELOCITY_ENABLED\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#endif\nattribute vec4 matricesIndices;\nattribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;\nattribute vec4 matricesWeightsExtra;\n#endif\n#ifdef BONETEXTURE\n#define inline\nmat4 readMatrixFromRawSampler(sampler2D smp,float index)\n{\nfloat offset=index*4.0;\nfloat dx=1.0/boneTextureWidth;\nvec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));\nvec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));\nvec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));\nvec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));\nreturn mat4(m0,m1,m2,m3);\n}\n#endif\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.instancesDeclaration="#ifdef INSTANCES\nattribute vec4 world0;\nattribute vec4 world1;\nattribute vec4 world2;\nattribute vec4 world3;\n#ifdef THIN_INSTANCES\nuniform mat4 world;\n#endif\n#else\nuniform mat4 world;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.instancesVertex="#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#ifdef THIN_INSTANCES\nfinalWorld=world*finalWorld;\n#endif\n#else\nmat4 finalWorld=world;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.bonesVertex="#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];\n#endif\n#else\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\n#endif\nfinalWorld=finalWorld*influence;\n#endif"},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var n=i(0),r=i(7),o=i(4),a=i(16),s=i(43);a.a.CreateRibbon=function(e){var t=e.pathArray,i=e.closeArray||!1,n=e.closePath||!1,r=e.invertUV||!1,s=Math.floor(t[0].length/2),c=e.offset||s;c=c>s?s:Math.floor(c);var l,u,h,d,f=0===e.sideOrientation?0:e.sideOrientation||a.a.DEFAULTSIDE,p=e.uvs,_=e.colors,m=[],g=[],v=[],b=[],y=[],T=[],E=[],S=[],A=[],P=[];if(t.length<2){var C=[],R=[];for(h=0;h<t[0].length-c;h++)C.push(t[0][h]),R.push(t[0][h+c]);t=[C,R]}var x,O,M,I,D,N=0,L=n?1:0;for(l=t[0].length,u=0;u<t.length;u++){for(E[u]=0,y[u]=[0],l=l<(O=(x=t[u]).length)?l:O,d=0;d<O;)m.push(x[d].x,x[d].y,x[d].z),d>0&&(M=x[d].subtract(x[d-1]).length()+E[u],y[u].push(M),E[u]=M),d++;n&&(d--,m.push(x[0].x,x[0].y,x[0].z),M=x[d].subtract(x[0]).length()+E[u],y[u].push(M),E[u]=M),A[u]=O+L,P[u]=N,N+=O+L}var w,F,B=null,U=null;for(h=0;h<l+L;h++){for(S[h]=0,T[h]=[0],u=0;u<t.length-1;u++)I=t[u],D=t[u+1],h===l?(B=I[0],U=D[0]):(B=I[h],U=D[h]),M=U.subtract(B).length()+S[h],T[h].push(M),S[h]=M;i&&U&&B&&(I=t[u],D=t[0],h===l&&(U=D[0]),M=U.subtract(B).length()+S[h],S[h]=M)}if(p)for(u=0;u<p.length;u++)b.push(p[u].x,p[u].y);else for(u=0;u<t.length;u++)for(h=0;h<l+L;h++)w=0!=E[u]?y[u][h]/E[u]:0,F=0!=S[h]?T[h][u]/S[h]:0,r?b.push(F,w):b.push(w,F);for(var V=0,k=A[u=0]-1,G=A[u+1]-1,z=k<G?k:G,j=P[1]-P[0],W=i?A.length:A.length-1;V<=z&&u<W;)g.push(V,V+j,V+1),g.push(V+j+1,V+1,V+j),(V+=1)===z&&(++u==A.length-1?(j=P[0]-P[u],k=A[u]-1,G=A[0]-1):(j=P[u+1]-P[u],k=A[u]-1,G=A[u+1]-1),V=P[u],z=k<G?k+V:G+V);if(a.a.ComputeNormals(m,g,v),n){var H=0,X=0;for(u=0;u<t.length;u++)H=3*P[u],X=u+1<t.length?3*(P[u+1]-1):v.length-3,v[H]=.5*(v[H]+v[X]),v[H+1]=.5*(v[H+1]+v[X+1]),v[H+2]=.5*(v[H+2]+v[X+2]),v[X]=v[H],v[X+1]=v[H+1],v[X+2]=v[H+2]}a.a._ComputeSides(f,m,g,v,b,e.frontUVs,e.backUVs);var Y=null;if(_){Y=new Float32Array(4*_.length);for(var K=0;K<_.length;K++)Y[4*K]=_[K].r,Y[4*K+1]=_[K].g,Y[4*K+2]=_[K].b,Y[4*K+3]=_[K].a}var Q=new a.a,q=new Float32Array(m),Z=new Float32Array(v),J=new Float32Array(b);return Q.indices=g,Q.positions=q,Q.normals=Z,Q.uvs=J,Y&&Q.set(Y,o.b.ColorKind),n&&(Q._idx=P),Q},r.a.CreateRibbon=function(e,t,i,n,r,o,a,s,l){return void 0===i&&(i=!1),void 0===a&&(a=!1),c.CreateRibbon(e,{pathArray:t,closeArray:i,closePath:n,offset:r,updatable:a,sideOrientation:s,instance:l},o)};var c=function(){function e(){}return e.CreateRibbon=function(e,t,i){void 0===i&&(i=null);var c=t.pathArray,l=t.closeArray,u=t.closePath,h=r.a._GetDefaultSideOrientation(t.sideOrientation),d=t.instance,f=t.updatable;if(d){var p=n.c.Vector3[0].setAll(Number.MAX_VALUE),_=n.c.Vector3[1].setAll(-Number.MAX_VALUE),m=d.getVerticesData(o.b.PositionKind);if(function(e){for(var t=c[0].length,i=d,n=0,o=i._originalBuilderSideOrientation===r.a.DOUBLESIDE?2:1,a=1;a<=o;++a)for(var s=0;s<c.length;++s){var l=c[s],u=l.length;t=t<u?t:u;for(var h=0;h<t;++h){var f=l[h];e[n]=f.x,e[n+1]=f.y,e[n+2]=f.z,p.minimizeInPlaceFromFloats(f.x,f.y,f.z),_.maximizeInPlaceFromFloats(f.x,f.y,f.z),n+=3}i._creationDataStorage&&i._creationDataStorage.closePath&&(f=l[0],e[n]=f.x,e[n+1]=f.y,e[n+2]=f.z,n+=3)}}(m),d._boundingInfo?d._boundingInfo.reConstruct(p,_,d._worldMatrix):d._boundingInfo=new s.a(p,_,d._worldMatrix),d.updateVerticesData(o.b.PositionKind,m,!1,!1),t.colors){for(var g=d.getVerticesData(o.b.ColorKind),v=0,b=0;v<t.colors.length;v++,b+=4){var y=t.colors[v];g[b]=y.r,g[b+1]=y.g,g[b+2]=y.b,g[b+3]=y.a}d.updateVerticesData(o.b.ColorKind,g,!1,!1)}if(t.uvs){for(var T=d.getVerticesData(o.b.UVKind),E=0;E<t.uvs.length;E++)T[2*E]=t.uvs[E].x,T[2*E+1]=t.uvs[E].y;d.updateVerticesData(o.b.UVKind,T,!1,!1)}if(!d.areNormalsFrozen||d.isFacetDataEnabled){var S=d.getIndices(),A=d.getVerticesData(o.b.NormalKind),P=d.isFacetDataEnabled?d.getFacetDataParameters():null;if(a.a.ComputeNormals(m,S,A,P),d._creationDataStorage&&d._creationDataStorage.closePath)for(var C=0,R=0,x=0;x<c.length;x++)C=3*d._creationDataStorage.idx[x],R=x+1<c.length?3*(d._creationDataStorage.idx[x+1]-1):A.length-3,A[C]=.5*(A[C]+A[R]),A[C+1]=.5*(A[C+1]+A[R+1]),A[C+2]=.5*(A[C+2]+A[R+2]),A[R]=A[C],A[R+1]=A[C+1],A[R+2]=A[C+2];d.areNormalsFrozen||d.updateVerticesData(o.b.NormalKind,A,!1,!1)}return d}var O=new r.a(e,i);O._originalBuilderSideOrientation=h,O._creationDataStorage=new r.b;var M=a.a.CreateRibbon(t);return u&&(O._creationDataStorage.idx=M._idx),O._creationDataStorage.closePath=u,O._creationDataStorage.closeArray=l,M.applyToMesh(O,f),O},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.FilesToLoad={},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(7),r=i(16);r.a.CreatePlane=function(e){var t=[],i=[],n=[],o=[],a=e.width||e.size||1,s=e.height||e.size||1,c=0===e.sideOrientation?0:e.sideOrientation||r.a.DEFAULTSIDE,l=a/2,u=s/2;i.push(-l,-u,0),n.push(0,0,-1),o.push(0,0),i.push(l,-u,0),n.push(0,0,-1),o.push(1,0),i.push(l,u,0),n.push(0,0,-1),o.push(1,1),i.push(-l,u,0),n.push(0,0,-1),o.push(0,1),t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),r.a._ComputeSides(c,i,t,n,o,e.frontUVs,e.backUVs);var h=new r.a;return h.indices=t,h.positions=i,h.normals=n,h.uvs=o,h},n.a.CreatePlane=function(e,t,i,n,r){var a={size:t,width:t,height:t,sideOrientation:r,updatable:n};return o.CreatePlane(e,a,i)};var o=function(){function e(){}return e.CreatePlane=function(e,t,i){void 0===i&&(i=null);var o=new n.a(e,i);return t.sideOrientation=n.a._GetDefaultSideOrientation(t.sideOrientation),o._originalBuilderSideOrientation=t.sideOrientation,r.a.CreatePlane(t).applyToMesh(o,t.updatable),t.sourcePlane&&(o.translate(t.sourcePlane.normal,-t.sourcePlane.d),o.setDirection(t.sourcePlane.normal.scale(-1))),o},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(8),r=(i(153),function(){function e(e,t,i){this._alreadyBound=!1,this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers,this._dynamic=i,this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformLocationPointer=0,this._needSync=!1,this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform)}return Object.defineProperty(e.prototype,"useUbo",{get:function(){return!this._noUBO},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSync",{get:function(){return!this._needSync},enumerable:!1,configurable:!0}),e.prototype.isDynamic=function(){return void 0!==this._dynamic},e.prototype.getData=function(){return this._bufferData},e.prototype.getBuffer=function(){return this._buffer},e.prototype._fillAlignment=function(e){var t;if(t=e<=2?e:4,this._uniformLocationPointer%t!=0){var i=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;for(var n=this._uniformLocationPointer-i,r=0;r<n;r++)this._data.push(0)}},e.prototype.addUniform=function(e,t){if(!this._noUBO&&void 0===this._uniformLocations[e]){var i;if(t instanceof Array)t=(i=t).length;else{t=t,i=[];for(var n=0;n<t;n++)i.push(0)}for(this._fillAlignment(t),this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t,n=0;n<t;n++)this._data.push(i[n]);this._needSync=!0}},e.prototype.addMatrix=function(e,t){this.addUniform(e,Array.prototype.slice.call(t.toArray()))},e.prototype.addFloat2=function(e,t,i){var n=[t,i];this.addUniform(e,n)},e.prototype.addFloat3=function(e,t,i,n){var r=[t,i,n];this.addUniform(e,r)},e.prototype.addColor3=function(e,t){var i=new Array;t.toArray(i),this.addUniform(e,i)},e.prototype.addColor4=function(e,t,i){var n=new Array;t.toArray(n),n.push(i),this.addUniform(e,n)},e.prototype.addVector3=function(e,t){var i=new Array;t.toArray(i),this.addUniform(e,i)},e.prototype.addMatrix3x3=function(e){this.addUniform(e,12)},e.prototype.addMatrix2x2=function(e){this.addUniform(e,8)},e.prototype.create=function(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)},e.prototype._rebuild=function(){!this._noUBO&&this._bufferData&&(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData):this._buffer=this._engine.createUniformBuffer(this._bufferData))},e.prototype.update=function(){this._buffer?(this._dynamic||this._needSync)&&(this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1):this.create()},e.prototype.updateUniform=function(e,t,i){var r=this._uniformLocations[e];if(void 0===r){if(this._buffer)return void n.a.Error("Cannot add an uniform after UBO has been created.");this.addUniform(e,i),r=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(a=0;a<i;a++)this._bufferData[r+a]=t[a];else{for(var o=!1,a=0;a<i;a++)16!==i&&this._bufferData[r+a]===t[a]||(o=!0,this._bufferData[r+a]=t[a]);this._needSync=this._needSync||o}},e.prototype._cacheMatrix=function(e,t){var i=this._valueCache[e],n=t.updateFlag;return(void 0===i||i!==n)&&(this._valueCache[e]=n,!0)},e.prototype._updateMatrix3x3ForUniform=function(t,i){for(var n=0;n<3;n++)e._tempBuffer[4*n]=i[3*n],e._tempBuffer[4*n+1]=i[3*n+1],e._tempBuffer[4*n+2]=i[3*n+2],e._tempBuffer[4*n+3]=0;this.updateUniform(t,e._tempBuffer,12)},e.prototype._updateMatrix3x3ForEffect=function(e,t){this._currentEffect.setMatrix3x3(e,t)},e.prototype._updateMatrix2x2ForEffect=function(e,t){this._currentEffect.setMatrix2x2(e,t)},e.prototype._updateMatrix2x2ForUniform=function(t,i){for(var n=0;n<2;n++)e._tempBuffer[4*n]=i[2*n],e._tempBuffer[4*n+1]=i[2*n+1],e._tempBuffer[4*n+2]=0,e._tempBuffer[4*n+3]=0;this.updateUniform(t,e._tempBuffer,8)},e.prototype._updateFloatForEffect=function(e,t){this._currentEffect.setFloat(e,t)},e.prototype._updateFloatForUniform=function(t,i){e._tempBuffer[0]=i,this.updateUniform(t,e._tempBuffer,1)},e.prototype._updateFloat2ForEffect=function(e,t,i,n){void 0===n&&(n=""),this._currentEffect.setFloat2(e+n,t,i)},e.prototype._updateFloat2ForUniform=function(t,i,n){e._tempBuffer[0]=i,e._tempBuffer[1]=n,this.updateUniform(t,e._tempBuffer,2)},e.prototype._updateFloat3ForEffect=function(e,t,i,n,r){void 0===r&&(r=""),this._currentEffect.setFloat3(e+r,t,i,n)},e.prototype._updateFloat3ForUniform=function(t,i,n,r){e._tempBuffer[0]=i,e._tempBuffer[1]=n,e._tempBuffer[2]=r,this.updateUniform(t,e._tempBuffer,3)},e.prototype._updateFloat4ForEffect=function(e,t,i,n,r,o){void 0===o&&(o=""),this._currentEffect.setFloat4(e+o,t,i,n,r)},e.prototype._updateFloat4ForUniform=function(t,i,n,r,o){e._tempBuffer[0]=i,e._tempBuffer[1]=n,e._tempBuffer[2]=r,e._tempBuffer[3]=o,this.updateUniform(t,e._tempBuffer,4)},e.prototype._updateMatrixForEffect=function(e,t){this._currentEffect.setMatrix(e,t)},e.prototype._updateMatrixForUniform=function(e,t){this._cacheMatrix(e,t)&&this.updateUniform(e,t.toArray(),16)},e.prototype._updateVector3ForEffect=function(e,t){this._currentEffect.setVector3(e,t)},e.prototype._updateVector3ForUniform=function(t,i){i.toArray(e._tempBuffer),this.updateUniform(t,e._tempBuffer,3)},e.prototype._updateVector4ForEffect=function(e,t){this._currentEffect.setVector4(e,t)},e.prototype._updateVector4ForUniform=function(t,i){i.toArray(e._tempBuffer),this.updateUniform(t,e._tempBuffer,4)},e.prototype._updateColor3ForEffect=function(e,t,i){void 0===i&&(i=""),this._currentEffect.setColor3(e+i,t)},e.prototype._updateColor3ForUniform=function(t,i){i.toArray(e._tempBuffer),this.updateUniform(t,e._tempBuffer,3)},e.prototype._updateColor4ForEffect=function(e,t,i,n){void 0===n&&(n=""),this._currentEffect.setColor4(e+n,t,i)},e.prototype._updateColor4ForUniform=function(t,i,n){i.toArray(e._tempBuffer),e._tempBuffer[3]=n,this.updateUniform(t,e._tempBuffer,4)},e.prototype.setTexture=function(e,t){this._currentEffect.setTexture(e,t)},e.prototype.updateUniformDirectly=function(e,t){this.updateUniform(e,t,t.length),this.update()},e.prototype.bindToEffect=function(e,t){this._currentEffect=e,!this._noUBO&&this._buffer&&(this._alreadyBound=!0,e.bindUniformBuffer(this._buffer,t))},e.prototype.dispose=function(){if(!this._noUBO){var e=this._engine._uniformBuffers,t=e.indexOf(this);-1!==t&&(e[t]=e[e.length-1],e.pop()),this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}},e._MAX_UNIFORM_SIZE=256,e._tempBuffer=new Float32Array(e._MAX_UNIFORM_SIZE),e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var n=i(1),r=i(3),o=i(0),a=i(9),s=i(29),c=i(48);s.a.AddNodeConstructor("Light_Type_3",function(e,t){return function(){return new l(e,o.e.Zero(),t)}});var l=function(e){function t(t,i,n){var r=e.call(this,t,n)||this;return r.groundColor=new a.a(0,0,0),r.direction=i||o.e.Up(),r}return Object(n.d)(t,e),t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.getClassName=function(){return"HemisphericLight"},t.prototype.setDirectionToTarget=function(e){return this.direction=o.e.Normalize(e.subtract(o.e.Zero())),this.direction},t.prototype.getShadowGenerator=function(){return null},t.prototype.transferToEffect=function(e,t){var i=o.e.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",i.x,i.y,i.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this},t.prototype.transferToNodeMaterialEffect=function(e,t){var i=o.e.Normalize(this.direction);return e.setFloat3(t,i.x,i.y,i.z),this},t.prototype.computeWorldMatrix=function(){return this._worldMatrix||(this._worldMatrix=o.a.Identity()),this._worldMatrix},t.prototype.getTypeID=function(){return c.a.LIGHTTYPEID_HEMISPHERICLIGHT},t.prototype.prepareLightSpecificDefines=function(e,t){e["HEMILIGHT"+t]=!0},Object(n.c)([Object(r.e)()],t.prototype,"groundColor",void 0),Object(n.c)([Object(r.o)()],t.prototype,"direction",void 0),t}(c.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(1),r=i(0),o=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._normalMatrix=new r.a,n._storeEffectOnSubMeshes=!0,n}return Object(n.d)(t,e),t.prototype.getEffect=function(){return this._activeEffect},t.prototype.isReady=function(e,t){return!!e&&(!e.subMeshes||0===e.subMeshes.length||this.isReadyForSubMesh(e,e.subMeshes[0],t))},t.prototype._isReadyForSubMesh=function(e){var t=e._materialDefines;return!(this.checkReadyOnEveryCall||!e.effect||!t||t._renderId!==this.getScene().getRenderId())},t.prototype.bindOnlyWorldMatrix=function(e){this._activeEffect.setMatrix("world",e)},t.prototype.bindOnlyNormalMatrix=function(e){this._activeEffect.setMatrix("normalMatrix",e)},t.prototype.bind=function(e,t){t&&this.bindForSubMesh(e,t,t.subMeshes[0])},t.prototype._afterBind=function(t,i){void 0===i&&(i=null),e.prototype._afterBind.call(this,t),this.getScene()._cachedEffect=i},t.prototype._mustRebind=function(e,t,i){return void 0===i&&(i=1),e.isCachedMaterialInvalid(this,t,i)},t}(i(25).a)},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(1),r=function(e){function t(t){var i=e.call(this)||this;return i._buffer=t,i}return Object(n.d)(t,e),Object.defineProperty(t.prototype,"underlyingResource",{get:function(){return this._buffer},enumerable:!1,configurable:!0}),t}(i(89).a)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this.references=0,this.capacity=0,this.is32Bits=!1}return Object.defineProperty(e.prototype,"underlyingResource",{get:function(){return null},enumerable:!1,configurable:!0}),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(64),r=function(){function e(){}return e.GetPlanes=function(t){for(var i=[],r=0;r<6;r++)i.push(new n.a(0,0,0,0));return e.GetPlanesToRef(t,i),i},e.GetNearPlaneToRef=function(e,t){var i=e.m;t.normal.x=i[3]+i[2],t.normal.y=i[7]+i[6],t.normal.z=i[11]+i[10],t.d=i[15]+i[14],t.normalize()},e.GetFarPlaneToRef=function(e,t){var i=e.m;t.normal.x=i[3]-i[2],t.normal.y=i[7]-i[6],t.normal.z=i[11]-i[10],t.d=i[15]-i[14],t.normalize()},e.GetLeftPlaneToRef=function(e,t){var i=e.m;t.normal.x=i[3]+i[0],t.normal.y=i[7]+i[4],t.normal.z=i[11]+i[8],t.d=i[15]+i[12],t.normalize()},e.GetRightPlaneToRef=function(e,t){var i=e.m;t.normal.x=i[3]-i[0],t.normal.y=i[7]-i[4],t.normal.z=i[11]-i[8],t.d=i[15]-i[12],t.normalize()},e.GetTopPlaneToRef=function(e,t){var i=e.m;t.normal.x=i[3]-i[1],t.normal.y=i[7]-i[5],t.normal.z=i[11]-i[9],t.d=i[15]-i[13],t.normalize()},e.GetBottomPlaneToRef=function(e,t){var i=e.m;t.normal.x=i[3]+i[1],t.normal.y=i[7]+i[5],t.normal.z=i[11]+i[9],t.d=i[15]+i[13],t.normalize()},e.GetPlanesToRef=function(t,i){e.GetNearPlaneToRef(t,i[0]),e.GetFarPlaneToRef(t,i[1]),e.GetLeftPlaneToRef(t,i[2]),e.GetRightPlaneToRef(t,i[3]),e.GetTopPlaneToRef(t,i[4]),e.GetBottomPlaneToRef(t,i[5])},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(2),r=function(){function e(){this.hoverCursor="",this.actions=new Array,this.isRecursive=!1}return Object.defineProperty(e,"HasTriggers",{get:function(){for(var t in e.Triggers)if(e.Triggers.hasOwnProperty(t))return!0;return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e,"HasPickTriggers",{get:function(){for(var t in e.Triggers)if(e.Triggers.hasOwnProperty(t)){var i=parseInt(t);if(i>=n.a.ACTION_OnPickTrigger&&i<=n.a.ACTION_OnPickUpTrigger)return!0}return!1},enumerable:!1,configurable:!0}),e.HasSpecificTrigger=function(t){for(var i in e.Triggers)if(e.Triggers.hasOwnProperty(i)&&parseInt(i)===t)return!0;return!1},e.Triggers={},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var n=i(1),r=i(25),o=i(3),a=i(19),s=i(15),c=function(){function e(e){this._texture=null,this.diffuseBlendLevel=1,this.roughnessBlendLevel=1,this.bumpLevel=1,this._normalBlendMethod=r.a.MATERIAL_NORMALBLENDMETHOD_WHITEOUT,this._isEnabled=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t){var i=t.getEngine();return!(e._areTexturesDirty&&t.texturesEnabled&&i.getCaps().standardDerivatives&&this._texture&&a.a.DetailTextureEnabled&&!this._texture.isReady())},e.prototype.prepareDefines=function(e,t){if(this._isEnabled){e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod;var i=t.getEngine();e._areTexturesDirty&&(i.getCaps().standardDerivatives&&this._texture&&a.a.DetailTextureEnabled&&this._isEnabled?(s.a.PrepareDefinesForMergedUV(this._texture,e,"DETAIL"),e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod):e.DETAIL=!1)}else e.DETAIL=!1},e.prototype.bindForSubMesh=function(e,t,i){this._isEnabled&&(e.useUbo&&i&&e.isSync||this._texture&&a.a.DetailTextureEnabled&&(e.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),s.a.BindTextureMatrix(this._texture,e,"detail")),t.texturesEnabled&&this._texture&&a.a.DetailTextureEnabled&&e.setTexture("detailSampler",this._texture))},e.prototype.hasTexture=function(e){return this._texture===e},e.prototype.getActiveTextures=function(e){this._texture&&e.push(this._texture)},e.prototype.getAnimatables=function(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)},e.prototype.dispose=function(e){var t;e&&(null===(t=this._texture)||void 0===t||t.dispose())},e.prototype.getClassName=function(){return"DetailMap"},e.AddUniforms=function(e){e.push("vDetailInfos")},e.AddSamplers=function(e){e.push("detailSampler")},e.PrepareUniformBuffer=function(e){e.addUniform("vDetailInfos",4),e.addUniform("detailMatrix",16)},e.prototype.copyTo=function(e){o.a.Clone(function(){return e},this)},e.prototype.serialize=function(){return o.a.Serialize(this)},e.prototype.parse=function(e,t,i){var n=this;o.a.Parse(function(){return n},e,t,i)},Object(n.c)([Object(o.m)("detailTexture"),Object(o.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),Object(n.c)([Object(o.c)()],e.prototype,"diffuseBlendLevel",void 0),Object(n.c)([Object(o.c)()],e.prototype,"roughnessBlendLevel",void 0),Object(n.c)([Object(o.c)()],e.prototype,"bumpLevel",void 0),Object(n.c)([Object(o.c)(),Object(o.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"normalBlendMethod",void 0),Object(n.c)([Object(o.c)(),Object(o.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),e}()},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.morphTargetsVertexGlobalDeclaration="#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.morphTargetsVertexDeclaration="#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#ifdef MORPHTARGETS_UV\nattribute vec2 uv_{X};\n#endif\n#endif"},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var n=i(25),r=i(4),o=i(2),a=function(){function e(e){this._vertexBuffers={},this._scene=e}return e.prototype._prepareBuffers=function(){if(!this._vertexBuffers[r.b.PositionKind]){var e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[r.b.PositionKind]=new r.b(this._scene.getEngine(),e,r.b.PositionKind,!1,!1,2),this._buildIndexBuffer()}},e.prototype._buildIndexBuffer=function(){var e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)},e.prototype._rebuild=function(){var e=this._vertexBuffers[r.b.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())},e.prototype._prepareFrame=function(e,t){void 0===e&&(e=null),void 0===t&&(t=null);var i=this._scene.activeCamera;return!(!i||!(t=t||i._postProcesses.filter(function(e){return null!=e}))||0===t.length||!this._scene.postProcessesEnabled||(t[0].activate(i,e,null!=t),0))},e.prototype.directRender=function(e,t,i,r,o,a){void 0===t&&(t=null),void 0===i&&(i=!1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=!1);for(var s=this._scene.getEngine(),c=0;c<e.length;c++){c<e.length-1?e[c+1].activate(this._scene.activeCamera,t):t?s.bindFramebuffer(t,r,void 0,void 0,i,o):a||s.restoreDefaultFramebuffer();var l=e[c],u=l.apply();u&&(l.onBeforeRenderObservable.notifyObservers(u),this._prepareBuffers(),s.bindBuffers(this._vertexBuffers,this._indexBuffer,u),s.drawElementsType(n.a.TriangleFillMode,0,6),l.onAfterRenderObservable.notifyObservers(u))}s.setDepthBuffer(!0),s.setDepthWrite(!0)},e.prototype._finalizeFrame=function(e,t,i,r,a){void 0===a&&(a=!1);var s=this._scene.activeCamera;if(s&&0!==(r=r||s._postProcesses.filter(function(e){return null!=e})).length&&this._scene.postProcessesEnabled){for(var c=this._scene.getEngine(),l=0,u=r.length;l<u;l++){var h=r[l];if(l<u-1?h._outputTexture=r[l+1].activate(s,t):t?(c.bindFramebuffer(t,i,void 0,void 0,a),h._outputTexture=t):(c.restoreDefaultFramebuffer(),h._outputTexture=null),e)break;var d=h.apply();d&&(h.onBeforeRenderObservable.notifyObservers(d),this._prepareBuffers(),c.bindBuffers(this._vertexBuffers,this._indexBuffer,d),c.drawElementsType(n.a.TriangleFillMode,0,6),h.onAfterRenderObservable.notifyObservers(d))}c.setDepthBuffer(!0),c.setDepthWrite(!0),c.setAlphaMode(o.a.ALPHA_DISABLE)}},e.prototype.dispose=function(){var e=this._vertexBuffers[r.b.PositionKind];e&&(e.dispose(),this._vertexBuffers[r.b.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r}),i.d(t,"b",function(){return o});var n=i(148),r=function(){},o=function(){function e(t){this._useSceneAutoClearSetup=!1,this._renderingGroups=new Array,this._autoClearDepthStencil={},this._customOpaqueSortCompareFn={},this._customAlphaTestSortCompareFn={},this._customTransparentSortCompareFn={},this._renderingGroupInfo=new r,this._scene=t;for(var i=e.MIN_RENDERINGGROUPS;i<e.MAX_RENDERINGGROUPS;i++)this._autoClearDepthStencil[i]={autoClear:!0,depth:!0,stencil:!0}}return e.prototype._clearDepthStencilBuffer=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0),this._depthStencilBufferAlreadyCleaned||(this._scene.getEngine().clear(null,!1,e,t),this._depthStencilBufferAlreadyCleaned=!0)},e.prototype.render=function(t,i,n,r){var o=this._renderingGroupInfo;if(o.scene=this._scene,o.camera=this._scene.activeCamera,this._scene.spriteManagers&&r)for(var a=0;a<this._scene.spriteManagers.length;a++){var s=this._scene.spriteManagers[a];this.dispatchSprites(s)}for(a=e.MIN_RENDERINGGROUPS;a<e.MAX_RENDERINGGROUPS;a++){this._depthStencilBufferAlreadyCleaned=a===e.MIN_RENDERINGGROUPS;var c=this._renderingGroups[a];if(c){var l=Math.pow(2,a);if(o.renderingGroupId=a,this._scene.onBeforeRenderingGroupObservable.notifyObservers(o,l),e.AUTOCLEAR){var u=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(a):this._autoClearDepthStencil[a];u&&u.autoClear&&this._clearDepthStencilBuffer(u.depth,u.stencil)}for(var h=0,d=this._scene._beforeRenderingGroupDrawStage;h<d.length;h++)d[h].action(a);c.render(t,r,n,i);for(var f=0,p=this._scene._afterRenderingGroupDrawStage;f<p.length;f++)p[f].action(a);this._scene.onAfterRenderingGroupObservable.notifyObservers(o,l)}}},e.prototype.reset=function(){for(var t=e.MIN_RENDERINGGROUPS;t<e.MAX_RENDERINGGROUPS;t++){var i=this._renderingGroups[t];i&&i.prepare()}},e.prototype.dispose=function(){this.freeRenderingGroups(),this._renderingGroups.length=0,this._renderingGroupInfo=null},e.prototype.freeRenderingGroups=function(){for(var t=e.MIN_RENDERINGGROUPS;t<e.MAX_RENDERINGGROUPS;t++){var i=this._renderingGroups[t];i&&i.dispose()}},e.prototype._prepareRenderingGroup=function(e){void 0===this._renderingGroups[e]&&(this._renderingGroups[e]=new n.a(e,this._scene,this._customOpaqueSortCompareFn[e],this._customAlphaTestSortCompareFn[e],this._customTransparentSortCompareFn[e]))},e.prototype.dispatchSprites=function(e){var t=e.renderingGroupId||0;this._prepareRenderingGroup(t),this._renderingGroups[t].dispatchSprites(e)},e.prototype.dispatchParticles=function(e){var t=e.renderingGroupId||0;this._prepareRenderingGroup(t),this._renderingGroups[t].dispatchParticles(e)},e.prototype.dispatch=function(e,t,i){void 0===t&&(t=e.getMesh());var n=t.renderingGroupId||0;this._prepareRenderingGroup(n),this._renderingGroups[n].dispatch(e,t,i)},e.prototype.setRenderingOrder=function(e,t,i,n){if(void 0===t&&(t=null),void 0===i&&(i=null),void 0===n&&(n=null),this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=i,this._customTransparentSortCompareFn[e]=n,this._renderingGroups[e]){var r=this._renderingGroups[e];r.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],r.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],r.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}},e.prototype.setRenderingAutoClearDepthStencil=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!0),this._autoClearDepthStencil[e]={autoClear:t,depth:i,stencil:n}},e.prototype.getAutoClearDepthStencilSetup=function(e){return this._autoClearDepthStencil[e]},e.MAX_RENDERINGGROUPS=4,e.MIN_RENDERINGGROUPS=0,e.AUTOCLEAR=!0,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var n=i(0),r=i(7),o=i(82),a=i(72);r.a.ExtrudeShape=function(e,t,i,n,o,a,c,l,u,h){void 0===c&&(c=null);var d={shape:t,path:i,scale:n,rotation:o,cap:0===a?0:a||r.a.NO_CAP,sideOrientation:u,instance:h,updatable:l};return s.ExtrudeShape(e,d,c)},r.a.ExtrudeShapeCustom=function(e,t,i,n,o,a,c,l,u,h,d,f){var p={shape:t,path:i,scaleFunction:n,rotationFunction:o,ribbonCloseArray:a,ribbonClosePath:c,cap:0===l?0:l||r.a.NO_CAP,sideOrientation:d,instance:f,updatable:h};return s.ExtrudeShapeCustom(e,p,u)};var s=function(){function e(){}return e.ExtrudeShape=function(t,i,n){void 0===n&&(n=null);var o=i.path,a=i.shape,s=i.scale||1,c=i.rotation||0,l=0===i.cap?0:i.cap||r.a.NO_CAP,u=i.updatable,h=r.a._GetDefaultSideOrientation(i.sideOrientation),d=i.instance||null,f=i.invertUV||!1;return e._ExtrudeShapeGeneric(t,a,o,s,c,null,null,!1,!1,l,!1,n,!!u,h,d,f,i.frontUVs||null,i.backUVs||null)},e.ExtrudeShapeCustom=function(t,i,n){void 0===n&&(n=null);var o=i.path,a=i.shape,s=i.scaleFunction||function(){return 1},c=i.rotationFunction||function(){return 0},l=i.ribbonCloseArray||!1,u=i.ribbonClosePath||!1,h=0===i.cap?0:i.cap||r.a.NO_CAP,d=i.updatable,f=r.a._GetDefaultSideOrientation(i.sideOrientation),p=i.instance,_=i.invertUV||!1;return e._ExtrudeShapeGeneric(t,a,o,null,null,s,c,l,u,h,!0,n,!!d,f,p||null,_,i.frontUVs||null,i.backUVs||null)},e._ExtrudeShapeGeneric=function(e,t,i,s,c,l,u,h,d,f,p,_,m,g,v,b,y,T){var E,S,A=function(e,t,i,o,a,s,c,l,u,h){for(var d=i.getTangents(),f=i.getNormals(),p=i.getBinormals(),_=i.getDistances(),m=0,g=h&&l?l:function(){return null!==s?s:0},v=h&&c?c:function(){return null!==a?a:1},b=u===r.a.NO_CAP||u===r.a.CAP_END?0:2,y=n.c.Matrix[0],T=0;T<t.length;T++){for(var E=new Array,S=g(T,_[T]),A=v(T,_[T]),P=0;P<e.length;P++){n.a.RotationAxisToRef(d[T],m,y);var C=d[T].scale(e[P].z).add(f[T].scale(e[P].x)).add(p[T].scale(e[P].y)),R=E[P]?E[P]:n.e.Zero();n.e.TransformCoordinatesToRef(C,y,R),R.scaleInPlace(A).addInPlace(t[T]),E[P]=R}o[b]=E,m+=S,b++}var x=function(e){var t,i=Array(),r=n.e.Zero();for(t=0;t<e.length;t++)r.addInPlace(e[t]);for(r.scaleInPlace(1/e.length),t=0;t<e.length;t++)i.push(r);return i};switch(u){case r.a.NO_CAP:break;case r.a.CAP_START:o[0]=x(o[2]),o[1]=o[2];break;case r.a.CAP_END:o[b]=o[b-1],o[b+1]=x(o[b-1]);break;case r.a.CAP_ALL:o[0]=x(o[2]),o[1]=o[2],o[b]=o[b-1],o[b+1]=x(o[b-1])}return o};if(v){var P=v._creationDataStorage;return E=P.path3D.update(i),S=A(t,i,P.path3D,P.pathArray,s,c,l,u,P.cap,p),r.a.CreateRibbon("",S,!1,!1,0,_||void 0,!1,0,v)}S=A(t,i,E=new a.g(i),new Array,s,c,l,u,f=f<0||f>3?0:f,p);var C=o.a.CreateRibbon(e,{pathArray:S,closeArray:h,closePath:d,updatable:m,sideOrientation:g,invertUV:b,frontUVs:y||void 0,backUVs:T||void 0},_);return C._creationDataStorage.pathArray=S,C._creationDataStorage.path3D=E,C._creationDataStorage.cap=f,C},e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return h}),i.d(t,"a",function(){return d});var n=i(1),r=i(9),o=i(4),a=i(7),s=i(151),c=i(25),l=i(73),u=i(15),h=(i(166),i(167),function(e){function t(t,i,n,a,s,c,u){void 0===i&&(i=null),void 0===n&&(n=null),void 0===a&&(a=null);var h=e.call(this,t,i,n,a,s)||this;h.useVertexColor=c,h.useVertexAlpha=u,h.color=new r.a(1,1,1),h.alpha=1,a&&(h.color=a.color.clone(),h.alpha=a.alpha,h.useVertexColor=a.useVertexColor,h.useVertexAlpha=a.useVertexAlpha),h.intersectionThreshold=.1;var d={attributes:[o.b.PositionKind,"world0","world1","world2","world3"],uniforms:["vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","world","viewProjection"],needAlphaBlending:!0,defines:[]};return!1===u&&(d.needAlphaBlending=!1),c?(d.defines.push("#define VERTEXCOLOR"),d.attributes.push(o.b.ColorKind)):(d.uniforms.push("color"),h.color4=new r.b),h._colorShader=new l.a("colorShader",h.getScene(),"color",d),h}return Object(n.d)(t,e),t.prototype._addClipPlaneDefine=function(e){var t="#define "+e;-1===this._colorShader.options.defines.indexOf(t)&&this._colorShader.options.defines.push(t)},t.prototype._removeClipPlaneDefine=function(e){var t="#define "+e,i=this._colorShader.options.defines.indexOf(t);-1!==i&&this._colorShader.options.defines.splice(i,1)},t.prototype.isReady=function(){var t=this.getScene();return t.clipPlane?this._addClipPlaneDefine("CLIPPLANE"):this._removeClipPlaneDefine("CLIPPLANE"),t.clipPlane2?this._addClipPlaneDefine("CLIPPLANE2"):this._removeClipPlaneDefine("CLIPPLANE2"),t.clipPlane3?this._addClipPlaneDefine("CLIPPLANE3"):this._removeClipPlaneDefine("CLIPPLANE3"),t.clipPlane4?this._addClipPlaneDefine("CLIPPLANE4"):this._removeClipPlaneDefine("CLIPPLANE4"),t.clipPlane5?this._addClipPlaneDefine("CLIPPLANE5"):this._removeClipPlaneDefine("CLIPPLANE5"),t.clipPlane6?this._addClipPlaneDefine("CLIPPLANE6"):this._removeClipPlaneDefine("CLIPPLANE6"),!!this._colorShader.isReady(this)&&e.prototype.isReady.call(this)},t.prototype.getClassName=function(){return"LinesMesh"},Object.defineProperty(t.prototype,"material",{get:function(){return this._colorShader},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checkCollisions",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype._bind=function(e,t,i){if(!this._geometry)return this;var n=this._colorShader.getEffect(),r=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(this._geometry._bind(n,r),!this.useVertexColor){var o=this.color,a=o.r,s=o.g,c=o.b;this.color4.set(a,s,c,this.alpha),this._colorShader.setColor4("color",this.color4)}return u.a.BindClipPlane(n,this.getScene()),this},t.prototype._draw=function(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;var n=this.getScene().getEngine();return this._unIndexed?n.drawArraysType(c.a.LineListDrawMode,e.verticesStart,e.verticesCount,i):n.drawElementsType(c.a.LineListDrawMode,e.indexStart,e.indexCount,i),this},t.prototype.dispose=function(t){this._colorShader.dispose(!1,!1,!0),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e,i,n){return void 0===i&&(i=null),new t(e,this.getScene(),i,this,n)},t.prototype.createInstance=function(e){return new d(e,this)},t}(a.a)),d=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.intersectionThreshold=i.intersectionThreshold,n}return Object(n.d)(t,e),t.prototype.getClassName=function(){return"InstancedLinesMesh"},t}(s.a)},function(e,t,i){"use strict";i.r(t),i.d(t,"AxesViewer",function(){return c}),i.d(t,"BoneAxesViewer",function(){return h}),i.d(t,"DebugLayerTab",function(){return n}),i.d(t,"DebugLayer",function(){return m}),i.d(t,"PhysicsViewer",function(){return A}),i.d(t,"RayHelper",function(){return C}),i.d(t,"SkeletonViewer",function(){return N});var n,r=i(0),o=i(30),a=i(75),s=i(9),c=function(){function e(t,i,n,c,l,u){if(void 0===i&&(i=1),void 0===n&&(n=2),this._scaleLinesFactor=4,this._instanced=!1,this.scene=null,this.scaleLines=1,this.scaleLines=i,!c){var h=new o.a("",t);h.disableLighting=!0,h.emissiveColor=s.a.Red().scale(.5),c=a.a._CreateArrow(t,h)}if(!l){var d=new o.a("",t);d.disableLighting=!0,d.emissiveColor=s.a.Green().scale(.5),l=a.a._CreateArrow(t,d)}if(!u){var f=new o.a("",t);f.disableLighting=!0,f.emissiveColor=s.a.Blue().scale(.5),u=a.a._CreateArrow(t,f)}this._xAxis=c,this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis=l,this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis=u,this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),null!=n&&(e._SetRenderingGroupId(this._xAxis,n),e._SetRenderingGroupId(this._yAxis,n),e._SetRenderingGroupId(this._zAxis,n)),this.scene=t,this.update(new r.e,r.e.Right(),r.e.Up(),r.e.Forward())}return Object.defineProperty(e.prototype,"xAxis",{get:function(){return this._xAxis},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yAxis",{get:function(){return this._yAxis},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zAxis",{get:function(){return this._zAxis},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t,i,n){this._xAxis.position.copyFrom(e),this._xAxis.setDirection(t),this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis.position.copyFrom(e),this._yAxis.setDirection(i),this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis.position.copyFrom(e),this._zAxis.setDirection(n),this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor)},e.prototype.createInstance=function(){var t=a.a._CreateArrowInstance(this.scene,this._xAxis),i=a.a._CreateArrowInstance(this.scene,this._yAxis),n=a.a._CreateArrowInstance(this.scene,this._zAxis),r=new e(this.scene,this.scaleLines,null,t,i,n);return r._instanced=!0,r},e.prototype.dispose=function(){this._xAxis&&this._xAxis.dispose(!1,!this._instanced),this._yAxis&&this._yAxis.dispose(!1,!this._instanced),this._zAxis&&this._zAxis.dispose(!1,!this._instanced),this.scene=null},e._SetRenderingGroupId=function(e,t){e.getChildMeshes().forEach(function(e){e.renderingGroupId=t})},e}(),l=i(1),u=i(23),h=function(e){function t(t,i,n,o){void 0===o&&(o=1);var a=e.call(this,t,o)||this;return a.pos=r.e.Zero(),a.xaxis=r.e.Zero(),a.yaxis=r.e.Zero(),a.zaxis=r.e.Zero(),a.mesh=n,a.bone=i,a}return Object(l.d)(t,e),t.prototype.update=function(){if(this.mesh&&this.bone){var t=this.bone;t._markAsDirtyAndCompose(),t.getAbsolutePositionToRef(this.mesh,this.pos),t.getDirectionToRef(u.a.X,this.mesh,this.xaxis),t.getDirectionToRef(u.a.Y,this.mesh,this.yaxis),t.getDirectionToRef(u.a.Z,this.mesh,this.zaxis),e.prototype.update.call(this,this.pos,this.xaxis,this.yaxis,this.zaxis)}},t.prototype.dispose=function(){this.mesh&&(this.mesh=null,this.bone=null,e.prototype.dispose.call(this))},t}(c),d=i(12),f=i(6),p=i(20),_=i(13);Object.defineProperty(p.a.prototype,"debugLayer",{get:function(){return this._debugLayer||(this._debugLayer=new m(this)),this._debugLayer},enumerable:!0,configurable:!0}),function(e){e[e.Properties=0]="Properties",e[e.Debug=1]="Debug",e[e.Statistics=2]="Statistics",e[e.Tools=3]="Tools",e[e.Settings=4]="Settings"}(n||(n={}));var m=function(){function e(e){var t=this;this.BJSINSPECTOR=this._getGlobalInspector(),this._scene=e,this._scene.onDisposeObservable.add(function(){t._scene._debugLayer&&t._scene._debugLayer.hide()})}return Object.defineProperty(e.prototype,"onPropertyChangedObservable",{get:function(){return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector?this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable:(this._onPropertyChangedObservable||(this._onPropertyChangedObservable=new f.c),this._onPropertyChangedObservable)},enumerable:!1,configurable:!0}),e.prototype._createInspector=function(e){if(!this.isVisible()){if(this._onPropertyChangedObservable){for(var t=0,i=this._onPropertyChangedObservable.observers;t<i.length;t++){var n=i[t];this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(n)}this._onPropertyChangedObservable.clear(),this._onPropertyChangedObservable=void 0}var r=Object(l.a)({overlay:!1,showExplorer:!0,showInspector:!0,embedMode:!1,handleResize:!0,enablePopup:!0},e);this.BJSINSPECTOR=this.BJSINSPECTOR||this._getGlobalInspector(),this.BJSINSPECTOR.Inspector.Show(this._scene,r)}},e.prototype.select=function(e,t){this.BJSINSPECTOR&&(t&&("[object String]"==Object.prototype.toString.call(t)?this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(t):this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(t)),this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(e))},e.prototype._getGlobalInspector=function(){return"undefined"!=typeof INSPECTOR?INSPECTOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.Inspector?BABYLON:void 0},e.prototype.isVisible=function(){return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.IsVisible},e.prototype.hide=function(){this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.Hide()},e.prototype.setAsActiveScene=function(){this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector._SetNewScene(this._scene)},e.prototype.show=function(t){var i=this;return new Promise(function(n,r){if(void 0===i.BJSINSPECTOR){var o=t&&t.inspectorURL?t.inspectorURL:e.InspectorURL;d.b.LoadScript(o,function(){i._createInspector(t),n(i)})}else i._createInspector(t),n(i)})},e.InspectorURL="https://unpkg.com/babylonjs-inspector@"+_.a.Version+"/babylon.inspector.bundle.js",e}(),g=i(7),v=i(63),b=i(45),y=i(22),T=i(32),E=i(36),S=i(53),A=function(){function e(e){this._impostors=[],this._meshes=[],this._numMeshes=0,this._debugMeshMeshes=new Array,this._scene=e||y.a.LastCreatedScene;var t=this._scene.getPhysicsEngine();t&&(this._physicsEnginePlugin=t.getPhysicsPlugin()),this._utilityLayer=new E.a(this._scene,!1),this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!0}return e.prototype._updateDebugMeshes=function(){for(var e=this._physicsEnginePlugin,t=0;t<this._numMeshes;t++){var i=this._impostors[t];if(i)if(i.isDisposed)this.hideImpostor(this._impostors[t--]);else{if(i.type===T.a.MeshImpostor)continue;var n=this._meshes[t];n&&e&&e.syncMeshWithImpostor(n,i)}}},e.prototype.showImpostor=function(e,t){if(!this._scene)return null;for(var i=0;i<this._numMeshes;i++)if(this._impostors[i]==e)return null;var n=this._getDebugMesh(e,t);return n&&(this._impostors[this._numMeshes]=e,this._meshes[this._numMeshes]=n,0===this._numMeshes&&(this._renderFunction=this._updateDebugMeshes.bind(this),this._scene.registerBeforeRender(this._renderFunction)),this._numMeshes++),n},e.prototype.hideImpostor=function(e){if(e&&this._scene&&this._utilityLayer){for(var t=!1,i=this._utilityLayer.utilityLayerScene,n=0;n<this._numMeshes;n++)if(this._impostors[n]==e){var r=this._meshes[n];if(!r)continue;i.removeMesh(r),r.dispose();var o=this._debugMeshMeshes.indexOf(r);o>-1&&this._debugMeshMeshes.splice(o,1),this._numMeshes--,this._numMeshes>0?(this._meshes[n]=this._meshes[this._numMeshes],this._impostors[n]=this._impostors[this._numMeshes],this._meshes[this._numMeshes]=null,this._impostors[this._numMeshes]=null):(this._meshes[0]=null,this._impostors[0]=null),t=!0;break}t&&0===this._numMeshes&&this._scene.unregisterBeforeRender(this._renderFunction)}},e.prototype._getDebugMaterial=function(e){return this._debugMaterial||(this._debugMaterial=new o.a("",e),this._debugMaterial.wireframe=!0,this._debugMaterial.emissiveColor=s.a.White(),this._debugMaterial.disableLighting=!0),this._debugMaterial},e.prototype._getDebugBoxMesh=function(e){return this._debugBoxMesh||(this._debugBoxMesh=v.a.CreateBox("physicsBodyBoxViewMesh",{size:1},e),this._debugBoxMesh.rotationQuaternion=r.b.Identity(),this._debugBoxMesh.material=this._getDebugMaterial(e),this._debugBoxMesh.setEnabled(!1)),this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugSphereMesh=function(e){return this._debugSphereMesh||(this._debugSphereMesh=b.a.CreateSphere("physicsBodySphereViewMesh",{diameter:1},e),this._debugSphereMesh.rotationQuaternion=r.b.Identity(),this._debugSphereMesh.material=this._getDebugMaterial(e),this._debugSphereMesh.setEnabled(!1)),this._debugSphereMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugCylinderMesh=function(e){return this._debugCylinderMesh||(this._debugCylinderMesh=S.a.CreateCylinder("physicsBodyCylinderViewMesh",{diameterTop:1,diameterBottom:1,height:1},e),this._debugCylinderMesh.rotationQuaternion=r.b.Identity(),this._debugCylinderMesh.material=this._getDebugMaterial(e),this._debugCylinderMesh.setEnabled(!1)),this._debugCylinderMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugMeshMesh=function(e,t){var i=new g.a(e.name,t,null,e);return i.position=r.e.Zero(),i.setParent(e),i.material=this._getDebugMaterial(t),this._debugMeshMeshes.push(i),i},e.prototype._getDebugMesh=function(e,t){var i=this;if(!this._utilityLayer)return null;if(t&&t.parent&&t.parent.physicsImpostor)return null;var n=null,r=this._utilityLayer.utilityLayerScene;switch(e.type){case T.a.BoxImpostor:n=this._getDebugBoxMesh(r),e.getBoxSizeToRef(n.scaling);break;case T.a.SphereImpostor:n=this._getDebugSphereMesh(r);var o=e.getRadius();n.scaling.x=2*o,n.scaling.y=2*o,n.scaling.z=2*o;break;case T.a.MeshImpostor:t&&(n=this._getDebugMeshMesh(t,r));break;case T.a.NoImpostor:t&&t.getChildMeshes().filter(function(e){return e.physicsImpostor?1:0}).forEach(function(e){i._getDebugBoxMesh(r).parent=e});break;case T.a.CylinderImpostor:n=this._getDebugCylinderMesh(r);var a=e.object.getBoundingInfo();n.scaling.x=a.boundingBox.maximum.x-a.boundingBox.minimum.x,n.scaling.y=a.boundingBox.maximum.y-a.boundingBox.minimum.y,n.scaling.z=a.boundingBox.maximum.z-a.boundingBox.minimum.z}return n},e.prototype.dispose=function(){for(var e=this._numMeshes,t=0;t<e;t++)this.hideImpostor(this._impostors[0]);this._debugBoxMesh&&this._debugBoxMesh.dispose(),this._debugSphereMesh&&this._debugSphereMesh.dispose(),this._debugCylinderMesh&&this._debugCylinderMesh.dispose(),this._debugMaterial&&this._debugMaterial.dispose(),this._impostors.length=0,this._scene=null,this._physicsEnginePlugin=null,this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null)},e}(),P=i(40),C=function(){function e(e){this.ray=e}return e.CreateAndShow=function(t,i,n){var r=new e(t);return r.show(i,n),r},e.prototype.show=function(e,t){if(!this._renderFunction&&this.ray){var i=this.ray;this._renderFunction=this._render.bind(this),this._scene=e,this._renderPoints=[i.origin,i.origin.add(i.direction.scale(i.length))],this._renderLine=g.a.CreateLines("ray",this._renderPoints,e,!0),this._renderLine.isPickable=!1,this._renderFunction&&this._scene.registerBeforeRender(this._renderFunction)}t&&this._renderLine&&this._renderLine.color.copyFrom(t)},e.prototype.hide=function(){this._renderFunction&&this._scene&&(this._scene.unregisterBeforeRender(this._renderFunction),this._scene=null,this._renderFunction=null,this._renderLine&&(this._renderLine.dispose(),this._renderLine=null),this._renderPoints=[])},e.prototype._render=function(){var e=this.ray;if(e){var t=this._renderPoints[1],i=Math.min(e.length,1e6);t.copyFrom(e.direction),t.scaleInPlace(i),t.addInPlace(e.origin),this._renderPoints[0].copyFrom(e.origin),g.a.CreateLines("ray",this._renderPoints,this._scene,!0,this._renderLine)}},e.prototype.attachToMesh=function(e,t,i,n){var o=this;this._attachedToMesh=e;var a=this.ray;a&&(a.direction||(a.direction=r.e.Zero()),a.origin||(a.origin=r.e.Zero()),n&&(a.length=n),i||(i=r.e.Zero()),t||(t=new r.e(0,0,-1)),this._scene||(this._scene=e.getScene()),this._meshSpaceDirection?(this._meshSpaceDirection.copyFrom(t),this._meshSpaceOrigin.copyFrom(i)):(this._meshSpaceDirection=t.clone(),this._meshSpaceOrigin=i.clone()),this._onAfterRenderObserver||(this._onAfterRenderObserver=this._scene.onBeforeRenderObservable.add(function(){return o._updateToMesh()}),this._onAfterStepObserver=this._scene.onAfterStepObservable.add(function(){return o._updateToMesh()})),this._attachedToMesh.computeWorldMatrix(!0),this._updateToMesh())},e.prototype.detachFromMesh=function(){this._attachedToMesh&&this._scene&&(this._onAfterRenderObserver&&(this._scene.onBeforeRenderObservable.remove(this._onAfterRenderObserver),this._scene.onAfterStepObservable.remove(this._onAfterStepObserver)),this._attachedToMesh=null,this._onAfterRenderObserver=null,this._onAfterStepObserver=null,this._scene=null)},e.prototype._updateToMesh=function(){var e=this.ray;this._attachedToMesh&&e&&(this._attachedToMesh._isDisposed?this.detachFromMesh():(this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection,e.direction),r.e.TransformCoordinatesToRef(this._meshSpaceOrigin,this._attachedToMesh.getWorldMatrix(),e.origin)))},e.prototype.dispose=function(){this.hide(),this.detachFromMesh(),this.ray=null},e}(),R=i(25),x=i(73),O=i(62),M=i(4),I=i(5),D=i(97),N=function(){function e(t,i,n,r,o,a){var c,l,u,h,d,f,p,_,m,g,v,b,y,T;void 0===r&&(r=!0),void 0===o&&(o=3),void 0===a&&(a={}),this.skeleton=t,this.mesh=i,this.autoUpdateBonesMatrices=r,this.renderingGroupId=o,this.options=a,this.color=s.a.White(),this._debugLines=new Array,this._localAxes=null,this._isEnabled=!1,this._obs=null,this._scene=n,this._ready=!1,a.pauseAnimations=null===(c=a.pauseAnimations)||void 0===c||c,a.returnToRest=null!==(l=a.returnToRest)&&void 0!==l&&l,a.displayMode=null!==(u=a.displayMode)&&void 0!==u?u:e.DISPLAY_LINES,a.displayOptions=null!==(h=a.displayOptions)&&void 0!==h?h:{},a.displayOptions.midStep=null!==(d=a.displayOptions.midStep)&&void 0!==d?d:.235,a.displayOptions.midStepFactor=null!==(f=a.displayOptions.midStepFactor)&&void 0!==f?f:.155,a.displayOptions.sphereBaseSize=null!==(p=a.displayOptions.sphereBaseSize)&&void 0!==p?p:.15,a.displayOptions.sphereScaleUnit=null!==(_=a.displayOptions.sphereScaleUnit)&&void 0!==_?_:2,a.displayOptions.sphereFactor=null!==(m=a.displayOptions.sphereFactor)&&void 0!==m?m:.865,a.displayOptions.spurFollowsChild=null!==(g=a.displayOptions.spurFollowsChild)&&void 0!==g&&g,a.displayOptions.showLocalAxes=null!==(v=a.displayOptions.showLocalAxes)&&void 0!==v&&v,a.displayOptions.localAxesSize=null!==(b=a.displayOptions.localAxesSize)&&void 0!==b?b:.075,a.computeBonesUsingShaders=null===(y=a.computeBonesUsingShaders)||void 0===y||y,a.useAllBones=null===(T=a.useAllBones)||void 0===T||T;var S=i.getVerticesData(M.b.MatricesIndicesKind),A=i.getVerticesData(M.b.MatricesWeightsKind);if(this._boneIndices=new Set,!a.useAllBones&&S&&A)for(var P=0;P<S.length;++P){var C=S[P];0!==A[P]&&this._boneIndices.add(C)}this._utilityLayer=new E.a(this._scene,!1),this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!0;var R=this.options.displayMode||0;R>e.DISPLAY_SPHERE_AND_SPURS&&(R=e.DISPLAY_LINES),this.displayMode=R,this.update(),this._bindObs()}return e.CreateBoneWeightShader=function(e,t){var i,n,r,o,a,c,l=e.skeleton,u=null!==(i=e.colorBase)&&void 0!==i?i:s.a.Black(),h=null!==(n=e.colorZero)&&void 0!==n?n:s.a.Blue(),d=null!==(r=e.colorQuarter)&&void 0!==r?r:s.a.Green(),f=null!==(o=e.colorHalf)&&void 0!==o?o:s.a.Yellow(),p=null!==(a=e.colorFull)&&void 0!==a?a:s.a.Red(),_=null!==(c=e.targetBoneIndex)&&void 0!==c?c:0;I.a.ShadersStore["boneWeights:"+l.name+"VertexShader"]="precision highp float;\n\n        attribute vec3 position;\n        attribute vec2 uv;\n\n        uniform mat4 view;\n        uniform mat4 projection;\n        uniform mat4 worldViewProjection;\n\n        #include<bonesDeclaration>\n        #if NUM_BONE_INFLUENCERS == 0\n            attribute vec4 matricesIndices;\n            attribute vec4 matricesWeights;\n        #endif\n\n        #include<instancesDeclaration>\n\n        varying vec3 vColor;\n\n        uniform vec3 colorBase;\n        uniform vec3 colorZero;\n        uniform vec3 colorQuarter;\n        uniform vec3 colorHalf;\n        uniform vec3 colorFull;\n\n        uniform float targetBoneIndex;\n\n        void main() {\n            vec3 positionUpdated = position;\n\n            #include<instancesVertex>\n            #include<bonesVertex>\n\n            vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\n\n            vec3 color = colorBase;\n            float totalWeight = 0.;\n            if(matricesIndices[0] == targetBoneIndex && matricesWeights[0] > 0.){\n                totalWeight += matricesWeights[0];\n            }\n            if(matricesIndices[1] == targetBoneIndex && matricesWeights[1] > 0.){\n                totalWeight += matricesWeights[1];\n            }\n            if(matricesIndices[2] == targetBoneIndex && matricesWeights[2] > 0.){\n                totalWeight += matricesWeights[2];\n            }\n            if(matricesIndices[3] == targetBoneIndex && matricesWeights[3] > 0.){\n                totalWeight += matricesWeights[3];\n            }\n\n            color = mix(color, colorZero, smoothstep(0., 0.25, totalWeight));\n            color = mix(color, colorQuarter, smoothstep(0.25, 0.5, totalWeight));\n            color = mix(color, colorHalf, smoothstep(0.5, 0.75, totalWeight));\n            color = mix(color, colorFull, smoothstep(0.75, 1.0, totalWeight));\n            vColor = color;\n\n        gl_Position = projection * view * worldPos;\n        }",I.a.ShadersStore["boneWeights:"+l.name+"FragmentShader"]="\n            precision highp float;\n            varying vec3 vPosition;\n\n            varying vec3 vColor;\n\n            void main() {\n                vec4 color = vec4(vColor, 1.0);\n                gl_FragColor = color;\n            }\n        ";var m=new x.a("boneWeight:"+l.name,t,{vertex:"boneWeights:"+l.name,fragment:"boneWeights:"+l.name},{attributes:["position","normal","matricesIndices","matricesWeights"],uniforms:["world","worldView","worldViewProjection","view","projection","viewProjection","colorBase","colorZero","colorQuarter","colorHalf","colorFull","targetBoneIndex"]});return m.setColor3("colorBase",u),m.setColor3("colorZero",h),m.setColor3("colorQuarter",d),m.setColor3("colorHalf",f),m.setColor3("colorFull",p),m.setFloat("targetBoneIndex",_),m.getClassName=function(){return"BoneWeightShader"},m.transparencyMode=R.a.MATERIAL_OPAQUE,m},e.CreateSkeletonMapShader=function(t,i){var n,r=t.skeleton,o=null!==(n=t.colorMap)&&void 0!==n?n:[{color:new s.a(1,.38,.18),location:0},{color:new s.a(.59,.18,1),location:.2},{color:new s.a(.59,1,.18),location:.4},{color:new s.a(1,.87,.17),location:.6},{color:new s.a(1,.17,.42),location:.8},{color:new s.a(.17,.68,1),location:1}],a=r.bones.length+1,c=e._CreateBoneMapColorBuffer(a,o,i),l=new x.a("boneWeights:"+r.name,i,{vertexSource:"precision highp float;\n\n            attribute vec3 position;\n            attribute vec2 uv;\n\n            uniform mat4 view;\n            uniform mat4 projection;\n            uniform mat4 worldViewProjection;\n            uniform float colorMap["+4*r.bones.length+"];\n\n            #include<bonesDeclaration>\n            #if NUM_BONE_INFLUENCERS == 0\n                attribute vec4 matricesIndices;\n                attribute vec4 matricesWeights;\n            #endif\n            #include<instancesDeclaration>\n\n            varying vec3 vColor;\n\n            void main() {\n                vec3 positionUpdated = position;\n\n                #include<instancesVertex>\n                #include<bonesVertex>\n\n                vec3 color = vec3(0.);\n                bool first = true;\n\n                for (int i = 0; i < 4; i++) {\n                    int boneIdx = int(matricesIndices[i]);\n                    float boneWgt = matricesWeights[i];\n\n                    vec3 c = vec3(colorMap[boneIdx * 4 + 0], colorMap[boneIdx * 4 + 1], colorMap[boneIdx * 4 + 2]);\n\n                    if (boneWgt > 0.) {\n                        if (first) {\n                            first = false;\n                            color = c;\n                        } else {\n                            color = mix(color, c, boneWgt);\n                        }\n                    }\n                }\n\n                vColor = color;\n\n                vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\n\n                gl_Position = projection * view * worldPos;\n            }",fragmentSource:"\n            precision highp float;\n            varying vec3 vColor;\n\n            void main() {\n                vec4 color = vec4( vColor, 1.0 );\n                gl_FragColor = color;\n            }\n            "},{attributes:["position","normal","matricesIndices","matricesWeights"],uniforms:["world","worldView","worldViewProjection","view","projection","viewProjection","colorMap"]});return l.setFloats("colorMap",c),l.getClassName=function(){return"SkeletonMapShader"},l.transparencyMode=R.a.MATERIAL_OPAQUE,l},e._CreateBoneMapColorBuffer=function(e,t,i){var n=new O.a("temp",{width:e,height:1},i,!1),r=n.getContext(),o=r.createLinearGradient(0,0,e,0);t.forEach(function(e){o.addColorStop(e.location,e.color.toHexString())}),r.fillStyle=o,r.fillRect(0,0,e,1),n.update();for(var a=[],s=r.getImageData(0,0,e,1).data,c=0;c<s.length;c++)a.push(s[c]*(1/255));return n.dispose(),a},Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"utilityLayer",{get:function(){return this._utilityLayer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return this._ready},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ready",{set:function(e){this._ready=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"debugMesh",{get:function(){return this._debugMesh},set:function(e){this._debugMesh=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayMode",{get:function(){return this.options.displayMode||e.DISPLAY_LINES},set:function(t){t>e.DISPLAY_SPHERE_AND_SPURS&&(t=e.DISPLAY_LINES),this.options.displayMode=t},enumerable:!1,configurable:!0}),e.prototype._bindObs=function(){var t=this;switch(this.displayMode){case e.DISPLAY_LINES:this._obs=this.scene.onBeforeRenderObservable.add(function(){t._displayLinesUpdate()})}},e.prototype.update=function(){switch(this.displayMode){case e.DISPLAY_LINES:this._displayLinesUpdate();break;case e.DISPLAY_SPHERES:this._buildSpheresAndSpurs(!0);break;case e.DISPLAY_SPHERE_AND_SPURS:this._buildSpheresAndSpurs(!1)}this._buildLocalAxes()},Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this.isEnabled!==e&&(this._isEnabled=e,this.debugMesh&&this.debugMesh.setEnabled(e),e&&!this._obs?this._bindObs():!e&&this._obs&&(this.scene.onBeforeRenderObservable.remove(this._obs),this._obs=null))},enumerable:!1,configurable:!0}),e.prototype._getBonePosition=function(e,t,i,n,o,a){void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=r.c.Matrix[0],c=t.getParent();if(s.copyFrom(t.getLocalMatrix()),0!==n||0!==o||0!==a){var l=r.c.Matrix[1];r.a.IdentityToRef(l),l.setTranslationFromFloats(n,o,a),l.multiplyToRef(s,s)}c&&s.multiplyToRef(c.getAbsoluteTransform(),s),s.multiplyToRef(i,s),e.x=s.m[12],e.y=s.m[13],e.z=s.m[14]},e.prototype._getLinesForBonesWithLength=function(e,t){for(var i=e.length,n=this.mesh._effectiveMesh.position,o=0,a=0;a<i;a++){var s=e[a],c=this._debugLines[o];-1!==s._index&&(this._boneIndices.has(s.getIndex())||this.options.useAllBones)&&(c||(c=[r.e.Zero(),r.e.Zero()],this._debugLines[o]=c),this._getBonePosition(c[0],s,t),this._getBonePosition(c[1],s,t,0,s.length,0),c[0].subtractInPlace(n),c[1].subtractInPlace(n),o++)}},e.prototype._getLinesForBonesNoLength=function(e){for(var t=e.length,i=0,n=this.mesh._effectiveMesh,o=n.position,a=t-1;a>=0;a--){var s=e[a],c=s.getParent();if(c&&(this._boneIndices.has(s.getIndex())||this.options.useAllBones)){var l=this._debugLines[i];l||(l=[r.e.Zero(),r.e.Zero()],this._debugLines[i]=l),s.getAbsolutePositionToRef(n,l[0]),c.getAbsolutePositionToRef(n,l[1]),l[0].subtractInPlace(o),l[1].subtractInPlace(o),i++}}},e.prototype._revert=function(e){this.options.pauseAnimations&&(this.scene.animationsEnabled=e,this.utilityLayer.utilityLayerScene.animationsEnabled=e)},e.prototype._getAbsoluteBindPoseToRef=function(e,t){null!==e&&-1!==e._index?(this._getAbsoluteBindPoseToRef(e.getParent(),t),e.getBindPose().multiplyToRef(t,t)):t.copyFrom(r.a.Identity())},e.prototype._buildSpheresAndSpurs=function(e){var t,i;void 0===e&&(e=!0),this._debugMesh&&(this._debugMesh.dispose(),this._debugMesh=null,this.ready=!1),this._ready=!1;var n=null===(t=this.utilityLayer)||void 0===t?void 0:t.utilityLayerScene,o=this.skeleton.bones,a=[],s=[],c=this.scene.animationsEnabled;try{this.options.pauseAnimations&&(this.scene.animationsEnabled=!1,n.animationsEnabled=!1),this.options.returnToRest&&this.skeleton.returnToRest(),this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteTransforms();for(var l=Number.NEGATIVE_INFINITY,u=this.options.displayOptions||{},h=function(t){var i=o[t];if(-1===i._index||!d._boneIndices.has(i.getIndex())&&!d.options.useAllBones)return"continue";var c=new r.a;d._getAbsoluteBindPoseToRef(i,c);var h=new r.e;c.decompose(void 0,void 0,h),i.children.forEach(function(t,o){var a=new r.a;t.getBindPose().multiplyToRef(c,a);var d=new r.e;a.decompose(void 0,void 0,d);var f=r.e.Distance(h,d);if(f>l&&(l=f),!e){for(var p=d.clone().subtract(h.clone()),_=p.length(),m=p.normalize().scale(_),v=u.midStep||.165,b=u.midStepFactor||.215,y=m.scale(v),T=D.a.ExtrudeShapeCustom("skeletonViewer",{shape:[new r.e(1,-1,0),new r.e(1,1,0),new r.e(-1,1,0),new r.e(-1,-1,0),new r.e(1,-1,0)],path:[r.e.Zero(),y,m],scaleFunction:function(e){switch(e){case 0:case 2:return 0;case 1:return _*b}return 0},sideOrientation:g.a.DEFAULTSIDE,updatable:!1},n),E=T.getTotalVertices(),S=[],A=[],P=0;P<E;P++)S.push(1,0,0,0),u.spurFollowsChild&&P>9?A.push(t.getIndex(),0,0,0):A.push(i.getIndex(),0,0,0);T.position=h.clone(),T.setVerticesData(M.b.MatricesWeightsKind,S,!1),T.setVerticesData(M.b.MatricesIndicesKind,A,!1),T.convertToFlatShadedMesh(),s.push(T)}});for(var f=u.sphereBaseSize||.2,p=b.a.CreateSphere("skeletonViewer",{segments:6,diameter:f,updatable:!0},n),_=p.getTotalVertices(),m=[],v=[],y=0;y<_;y++)m.push(1,0,0,0),v.push(i.getIndex(),0,0,0);p.setVerticesData(M.b.MatricesWeightsKind,m,!1),p.setVerticesData(M.b.MatricesIndicesKind,v,!1),p.position=h.clone(),a.push([p,i])},d=this,f=0;f<o.length;f++)h(f);var p=u.sphereScaleUnit||2,_=u.sphereFactor||.85,m=[];for(f=0;f<a.length;f++){for(var v=a[f],y=v[0],T=v[1],E=1/(p/l),S=0,A=T;A.getParent()&&-1!==A.getParent().getIndex();)S++,A=A.getParent();y.scaling.scaleInPlace(E*Math.pow(_,S)),m.push(y)}this.debugMesh=g.a.MergeMeshes(m.concat(s),!0,!0),this.debugMesh&&(this.debugMesh.renderingGroupId=this.renderingGroupId,this.debugMesh.skeleton=this.skeleton,this.debugMesh.parent=this.mesh,this.debugMesh.computeBonesUsingShaders=null===(i=this.options.computeBonesUsingShaders)||void 0===i||i,this.debugMesh.alwaysSelectAsActiveMesh=!0),this.utilityLayer._getSharedGizmoLight().intensity=.7,this._revert(c),this.ready=!0}catch(e){console.error(e),this._revert(c),this.dispose()}},e.prototype._buildLocalAxes=function(){var e;this._localAxes&&this._localAxes.dispose(),this._localAxes=null;var t=this.options.displayOptions||{};if(t.showLocalAxes){var i=this._utilityLayer.utilityLayerScene,n=t.localAxesSize||.075,o=[],a=[],c=new s.b(1,0,0,1),l=new s.b(0,1,0,1),u=new s.b(0,0,1,1),h=[],d=[];for(var f in this.skeleton.bones){var p=this.skeleton.bones[f];if(-1!==p._index&&(this._boneIndices.has(p.getIndex())||this.options.useAllBones)){var _=new r.a,m=new r.e;this._getAbsoluteBindPoseToRef(p,_),_.decompose(void 0,void 0,m);var g=p.getBindPose().getRotationMatrix(),v=r.e.TransformCoordinates(new r.e(0+n,0,0),g),b=r.e.TransformCoordinates(new r.e(0,0+n,0),g),y=r.e.TransformCoordinates(new r.e(0,0,0+n),g),T=[[m,m.add(v)],[m,m.add(b)],[m,m.add(y)]],E=[[c,c],[l,l],[u,u]];o.push.apply(o,T),a.push.apply(a,E);for(var S=0;S<6;S++)h.push(1,0,0,0),d.push(p.getIndex(),0,0,0)}}this._localAxes=P.a.CreateLineSystem("localAxes",{lines:o,colors:a,updatable:!0},i),this._localAxes.setVerticesData(M.b.MatricesWeightsKind,h,!1),this._localAxes.setVerticesData(M.b.MatricesIndicesKind,d,!1),this._localAxes.skeleton=this.skeleton,this._localAxes.renderingGroupId=this.renderingGroupId,this._localAxes.parent=this.mesh,this._localAxes.computeBonesUsingShaders=null===(e=this.options.computeBonesUsingShaders)||void 0===e||e}},e.prototype._displayLinesUpdate=function(){if(this._utilityLayer){this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteTransforms();var e=this.mesh._effectiveMesh;void 0===this.skeleton.bones[0].length?this._getLinesForBonesNoLength(this.skeleton.bones):this._getLinesForBonesWithLength(this.skeleton.bones,e.getWorldMatrix());var t=this._utilityLayer.utilityLayerScene;t&&(this._debugMesh?P.a.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:this._debugMesh},t):(this._debugMesh=P.a.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:null},t),this._debugMesh.renderingGroupId=this.renderingGroupId),this._debugMesh.position.copyFrom(this.mesh.position),this._debugMesh.color=this.color)}},e.prototype.changeDisplayMode=function(e){var t=!!this.isEnabled;this.displayMode!==e&&(this.isEnabled=!1,this._debugMesh&&(this._debugMesh.dispose(),this._debugMesh=null,this.ready=!1),this.displayMode=e,this.update(),this._bindObs(),this.isEnabled=t)},e.prototype.changeDisplayOptions=function(e,t){var i=!!this.isEnabled;this.options.displayOptions[e]=t,this.isEnabled=!1,this._debugMesh&&(this._debugMesh.dispose(),this._debugMesh=null,this.ready=!1),this.update(),this._bindObs(),this.isEnabled=i},e.prototype.dispose=function(){this.isEnabled=!1,this._debugMesh&&(this._debugMesh.dispose(),this._debugMesh=null),this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null),this.ready=!1},e.DISPLAY_LINES=0,e.DISPLAY_SPHERES=1,e.DISPLAY_SPHERE_AND_SPURS=2,e}()},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.morphTargetsVertex="#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];\n#endif\n#endif"},function(e,t,i){"use strict";i.d(t,"b",function(){return r}),i.d(t,"a",function(){return o});var n=i(0);function r(e,t,i,r,o){void 0===o&&(o=null);for(var a=new n.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new n.e(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=i;c<i+r;c++){var l=3*t[c],u=e[l],h=e[l+1],d=e[l+2];a.minimizeInPlaceFromFloats(u,h,d),s.maximizeInPlaceFromFloats(u,h,d)}return o&&(a.x-=a.x*o.x+o.y,a.y-=a.y*o.x+o.y,a.z-=a.z*o.x+o.y,s.x+=s.x*o.x+o.y,s.y+=s.y*o.x+o.y,s.z+=s.z*o.x+o.y),{minimum:a,maximum:s}}function o(e,t,i,r,o){void 0===r&&(r=null);var a=new n.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new n.e(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);o||(o=3);for(var c=t,l=t*o;c<t+i;c++,l+=o){var u=e[l],h=e[l+1],d=e[l+2];a.minimizeInPlaceFromFloats(u,h,d),s.maximizeInPlaceFromFloats(u,h,d)}return r&&(a.x-=a.x*r.x+r.y,a.y-=a.y*r.x+r.y,a.z-=a.z*r.x+r.y,s.x+=s.x*r.x+r.y,s.y+=s.y*r.x+r.y,s.z+=s.z*r.x+r.y),{minimum:a,maximum:s}}},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){}},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var n=i(44),r=i(0),o=i(28),a=function(){function e(e,t,i){this.vectors=n.a.BuildArray(8,r.e.Zero),this.center=r.e.Zero(),this.centerWorld=r.e.Zero(),this.extendSize=r.e.Zero(),this.extendSizeWorld=r.e.Zero(),this.directions=n.a.BuildArray(3,r.e.Zero),this.vectorsWorld=n.a.BuildArray(8,r.e.Zero),this.minimumWorld=r.e.Zero(),this.maximumWorld=r.e.Zero(),this.minimum=r.e.Zero(),this.maximum=r.e.Zero(),this.reConstruct(e,t,i)}return e.prototype.reConstruct=function(e,t,i){var n=e.x,o=e.y,a=e.z,s=t.x,c=t.y,l=t.z,u=this.vectors;this.minimum.copyFromFloats(n,o,a),this.maximum.copyFromFloats(s,c,l),u[0].copyFromFloats(n,o,a),u[1].copyFromFloats(s,c,l),u[2].copyFromFloats(s,o,a),u[3].copyFromFloats(n,c,a),u[4].copyFromFloats(n,o,l),u[5].copyFromFloats(s,c,a),u[6].copyFromFloats(n,c,l),u[7].copyFromFloats(s,o,l),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=i||r.a.IdentityReadOnly,this._update(this._worldMatrix)},e.prototype.scale=function(t){var i=e.TmpVector3,n=this.maximum.subtractToRef(this.minimum,i[0]),r=n.length();n.normalizeFromLength(r);var o=r*t,a=n.scaleInPlace(.5*o),s=this.center.subtractToRef(a,i[1]),c=this.center.addToRef(a,i[2]);return this.reConstruct(s,c,this._worldMatrix),this},e.prototype.getWorldMatrix=function(){return this._worldMatrix},e.prototype._update=function(e){var t=this.minimumWorld,i=this.maximumWorld,n=this.directions,o=this.vectorsWorld,a=this.vectors;if(e.isIdentity()){for(t.copyFrom(this.minimum),i.copyFrom(this.maximum),s=0;s<8;++s)o[s].copyFrom(a[s]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),i.setAll(-Number.MAX_VALUE);for(var s=0;s<8;++s){var c=o[s];r.e.TransformCoordinatesToRef(a[s],e,c),t.minimizeInPlace(c),i.maximizeInPlace(c)}i.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),i.addToRef(t,this.centerWorld).scaleInPlace(.5)}r.e.FromArrayToRef(e.m,0,n[0]),r.e.FromArrayToRef(e.m,4,n[1]),r.e.FromArrayToRef(e.m,8,n[2]),this._worldMatrix=e},e.prototype.isInFrustum=function(t){return e.IsInFrustum(this.vectorsWorld,t)},e.prototype.isCompletelyInFrustum=function(t){return e.IsCompletelyInFrustum(this.vectorsWorld,t)},e.prototype.intersectsPoint=function(e){var t=this.minimumWorld,i=this.maximumWorld,n=t.x,r=t.y,a=t.z,s=i.x,c=i.y,l=i.z,u=e.x,h=e.y,d=e.z,f=-o.a;return!(s-u<f||f>u-n||c-h<f||f>h-r||l-d<f||f>d-a)},e.prototype.intersectsSphere=function(t){return e.IntersectsSphere(this.minimumWorld,this.maximumWorld,t.centerWorld,t.radiusWorld)},e.prototype.intersectsMinMax=function(e,t){var i=this.minimumWorld,n=this.maximumWorld,r=i.x,o=i.y,a=i.z,s=n.x,c=n.y,l=n.z,u=e.x,h=e.y,d=e.z,f=t.x,p=t.y,_=t.z;return!(s<u||r>f||c<h||o>p||l<d||a>_)},e.Intersects=function(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)},e.IntersectsSphere=function(t,i,n,o){var a=e.TmpVector3[0];return r.e.ClampToRef(n,t,i,a),r.e.DistanceSquared(n,a)<=o*o},e.IsCompletelyInFrustum=function(e,t){for(var i=0;i<6;++i)for(var n=t[i],r=0;r<8;++r)if(n.dotCoordinate(e[r])<0)return!1;return!0},e.IsInFrustum=function(e,t){for(var i=0;i<6;++i){for(var n=!0,r=t[i],o=0;o<8;++o)if(r.dotCoordinate(e[o])>=0){n=!1;break}if(n)return!1}return!0},e.TmpVector3=n.a.BuildArray(3,r.e.Zero),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(38),r=function(){function e(){}return e.SetImmediate=function(e){n.a.IsWindowObjectExist()&&window.setImmediate?window.setImmediate(e):setTimeout(e,1)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(0),r=i(2),o=function(){function e(){this.previousWorldMatrices={},this.previousBones={}}return e.AddUniforms=function(e){e.push("previousWorld","previousViewProjection")},e.AddSamplers=function(e){},e.prototype.bindForSubMesh=function(e,t,i,o,a){t.prePassRenderer&&t.prePassRenderer.enabled&&-1!==t.prePassRenderer.getIndex(r.a.PREPASS_VELOCITY_TEXTURE_TYPE)&&(this.previousWorldMatrices[i.uniqueId]||(this.previousWorldMatrices[i.uniqueId]=n.a.Identity()),this.previousViewProjection||(this.previousViewProjection=t.getTransformMatrix()),e.setMatrix("previousWorld",this.previousWorldMatrices[i.uniqueId]),e.setMatrix("previousViewProjection",this.previousViewProjection),this.previousWorldMatrices[i.uniqueId]=o.clone(),this.previousViewProjection=t.getTransformMatrix().clone())},e}()},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.lightFragmentDeclaration="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};\nuniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\nuniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.lightUboDeclaration="#ifdef LIGHT{X}\nuniform Light{X}\n{\nvec4 vLightData;\nvec4 vLightDiffuse;\nvec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;\nvec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;\nvec2 depthValues;\n} light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.imageProcessingDeclaration="#ifdef EXPOSURE\nuniform float exposureLinear;\n#endif\n#ifdef CONTRAST\nuniform float contrast;\n#endif\n#ifdef VIGNETTE\nuniform vec2 vInverseScreenSize;\nuniform vec4 vignetteSettings1;\nuniform vec4 vignetteSettings2;\n#endif\n#ifdef COLORCURVES\nuniform vec4 vCameraColorCurveNegative;\nuniform vec4 vCameraColorCurveNeutral;\nuniform vec4 vCameraColorCurvePositive;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform vec4 colorTransformSettings;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.imageProcessingFunctions="#if defined(COLORGRADING) && !defined(COLORGRADING3D)\n\n#define inline\nvec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)\n{\nfloat sliceSize=2.0*sampler3dSetting.x;\n#ifdef SAMPLER3DGREENDEPTH\nfloat sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;\n#else\nfloat sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;\n#endif\nfloat sliceInteger=floor(sliceContinuous);\n\n\nfloat sliceFraction=sliceContinuous-sliceInteger;\n#ifdef SAMPLER3DGREENDEPTH\nvec2 sliceUV=color.rb;\n#else\nvec2 sliceUV=color.rg;\n#endif\nsliceUV.x*=sliceSize;\nsliceUV.x+=sliceInteger*sliceSize;\nsliceUV=saturate(sliceUV);\nvec4 slice0Color=texture2D(colorTransform,sliceUV);\nsliceUV.x+=sliceSize;\nsliceUV=saturate(sliceUV);\nvec4 slice1Color=texture2D(colorTransform,sliceUV);\nvec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);\n#ifdef SAMPLER3DBGRMAP\ncolor.rgb=result.rgb;\n#else\ncolor.rgb=result.bgr;\n#endif\nreturn color;\n}\n#endif\n#ifdef TONEMAPPING_ACES\n\n\n\n\n\nconst mat3 ACESInputMat=mat3(\nvec3(0.59719,0.07600,0.02840),\nvec3(0.35458,0.90834,0.13383),\nvec3(0.04823,0.01566,0.83777)\n);\n\nconst mat3 ACESOutputMat=mat3(\nvec3( 1.60475,-0.10208,-0.00327),\nvec3(-0.53108,1.10813,-0.07276),\nvec3(-0.07367,-0.00605,1.07602)\n);\nvec3 RRTAndODTFit(vec3 v)\n{\nvec3 a=v*(v+0.0245786)-0.000090537;\nvec3 b=v*(0.983729*v+0.4329510)+0.238081;\nreturn a/b;\n}\nvec3 ACESFitted(vec3 color)\n{\ncolor=ACESInputMat*color;\n\ncolor=RRTAndODTFit(color);\ncolor=ACESOutputMat*color;\n\ncolor=saturate(color);\nreturn color;\n}\n#endif\nvec4 applyImageProcessing(vec4 result) {\n#ifdef EXPOSURE\nresult.rgb*=exposureLinear;\n#endif\n#ifdef VIGNETTE\n\nvec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;\nviewportXY=viewportXY*2.0-1.0;\nvec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);\nfloat vignetteTerm=dot(vignetteXY1,vignetteXY1);\nfloat vignette=pow(vignetteTerm,vignetteSettings2.w);\n\nvec3 vignetteColor=vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);\nresult.rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nresult.rgb=mix(vignetteColor,result.rgb,vignette);\n#endif\n#endif\n#ifdef TONEMAPPING\n#ifdef TONEMAPPING_ACES\nresult.rgb=ACESFitted(result.rgb);\n#else\nconst float tonemappingCalibration=1.590579;\nresult.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);\n#endif\n#endif\n\nresult.rgb=toGammaSpace(result.rgb);\nresult.rgb=saturate(result.rgb);\n#ifdef CONTRAST\n\nvec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);\nif (contrast<1.0) {\n\nresult.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);\n} else {\n\nresult.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);\n}\n#endif\n\n#ifdef COLORGRADING\nvec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;\n#else\nvec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;\n#endif\nresult.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\n\nfloat luma=getLuminance(result.rgb);\nvec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));\nvec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;\nresult.rgb*=colorCurve.rgb;\nresult.rgb=mix(vec3(luma),result.rgb,colorCurve.a);\n#endif\nreturn result;\n}"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.clipPlaneFragment="#ifdef CLIPPLANE\nif (fClipDistance>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE2\nif (fClipDistance2>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE3\nif (fClipDistance3>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE4\nif (fClipDistance4>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE5\nif (fClipDistance5>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE6\nif (fClipDistance6>0.0)\n{\ndiscard;\n}\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.clipPlaneVertex="#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nfClipDistance2=dot(worldPos,vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nfClipDistance3=dot(worldPos,vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nfClipDistance4=dot(worldPos,vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nfClipDistance5=dot(worldPos,vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nfClipDistance6=dot(worldPos,vClipPlane6);\n#endif"},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this._count=0,this._data={}}return e.prototype.copyFrom=function(e){var t=this;this.clear(),e.forEach(function(e,i){return t.add(e,i)})},e.prototype.get=function(e){var t=this._data[e];if(void 0!==t)return t},e.prototype.getOrAddWithFactory=function(e,t){var i=this.get(e);return void 0!==i||(i=t(e))&&this.add(e,i),i},e.prototype.getOrAdd=function(e,t){var i=this.get(e);return void 0!==i?i:(this.add(e,t),t)},e.prototype.contains=function(e){return void 0!==this._data[e]},e.prototype.add=function(e,t){return void 0===this._data[e]&&(this._data[e]=t,++this._count,!0)},e.prototype.set=function(e,t){return void 0!==this._data[e]&&(this._data[e]=t,!0)},e.prototype.getAndRemove=function(e){var t=this.get(e);return void 0!==t?(delete this._data[e],--this._count,t):null},e.prototype.remove=function(e){return!!this.contains(e)&&(delete this._data[e],--this._count,!0)},e.prototype.clear=function(){this._data={},this._count=0},Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){for(var t in this._data)e(t,this._data[t])},e.prototype.first=function(e){for(var t in this._data){var i=e(t,this._data[t]);if(i)return i}return null},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(44),r=i(0),o=function(){function e(e,t,i){this.center=r.e.Zero(),this.centerWorld=r.e.Zero(),this.minimum=r.e.Zero(),this.maximum=r.e.Zero(),this.reConstruct(e,t,i)}return e.prototype.reConstruct=function(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);var n=r.e.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=.5*n,this._update(i||r.a.IdentityReadOnly)},e.prototype.scale=function(t){var i=this.radius*t,n=e.TmpVector3,r=n[0].setAll(i),o=this.center.subtractToRef(r,n[1]),a=this.center.addToRef(r,n[2]);return this.reConstruct(o,a,this._worldMatrix),this},e.prototype.getWorldMatrix=function(){return this._worldMatrix},e.prototype._update=function(t){if(t.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{r.e.TransformCoordinatesToRef(this.center,t,this.centerWorld);var i=e.TmpVector3[0];r.e.TransformNormalFromFloatsToRef(1,1,1,t,i),this.radiusWorld=Math.max(Math.abs(i.x),Math.abs(i.y),Math.abs(i.z))*this.radius}},e.prototype.isInFrustum=function(e){for(var t=this.centerWorld,i=this.radiusWorld,n=0;n<6;n++)if(e[n].dotCoordinate(t)<=-i)return!1;return!0},e.prototype.isCenterInFrustum=function(e){for(var t=this.centerWorld,i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0},e.prototype.intersectsPoint=function(e){var t=r.e.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld<t)},e.Intersects=function(e,t){var i=r.e.DistanceSquared(e.centerWorld,t.centerWorld),n=e.radiusWorld+t.radiusWorld;return!(n*n<i)},e.TmpVector3=n.a.BuildArray(3,r.e.Zero),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(e,t,i){this.bu=e,this.bv=t,this.distance=i,this.faceId=0,this.subMeshId=0}},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.clipPlaneFragmentDeclaration="#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nvarying float fClipDistance6;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.logDepthDeclaration="#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.clipPlaneVertexDeclaration="#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nvarying float fClipDistance6;\n#endif"},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.prototype.attributeProcessor=function(e){return e.replace("attribute","in")},e.prototype.varyingProcessor=function(e,t){return e.replace("varying",t?"in":"out")},e.prototype.postProcessor=function(e,t,i){var n=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),i)e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(n?"":"out vec4 glFragColor;\n")+"void main(");else if(-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;return e},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.BindClipPlane=function(e,t){if(t.clipPlane){var i=t.clipPlane;e.setFloat4("vClipPlane",i.normal.x,i.normal.y,i.normal.z,i.d)}t.clipPlane2&&(i=t.clipPlane2,e.setFloat4("vClipPlane2",i.normal.x,i.normal.y,i.normal.z,i.d)),t.clipPlane3&&(i=t.clipPlane3,e.setFloat4("vClipPlane3",i.normal.x,i.normal.y,i.normal.z,i.d)),t.clipPlane4&&(i=t.clipPlane4,e.setFloat4("vClipPlane4",i.normal.x,i.normal.y,i.normal.z,i.d)),t.clipPlane5&&(i=t.clipPlane5,e.setFloat4("vClipPlane5",i.normal.x,i.normal.y,i.normal.z,i.d)),t.clipPlane6&&(i=t.clipPlane6,e.setFloat4("vClipPlane6",i.normal.x,i.normal.y,i.normal.z,i.d))},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.RandomId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var n=i(1),r=i(3),o=i(9),a=function(){function e(){this._dirty=!0,this._tempColor=new o.b(0,0,0,0),this._globalCurve=new o.b(0,0,0,0),this._highlightsCurve=new o.b(0,0,0,0),this._midtonesCurve=new o.b(0,0,0,0),this._shadowsCurve=new o.b(0,0,0,0),this._positiveCurve=new o.b(0,0,0,0),this._negativeCurve=new o.b(0,0,0,0),this._globalHue=30,this._globalDensity=0,this._globalSaturation=0,this._globalExposure=0,this._highlightsHue=30,this._highlightsDensity=0,this._highlightsSaturation=0,this._highlightsExposure=0,this._midtonesHue=30,this._midtonesDensity=0,this._midtonesSaturation=0,this._midtonesExposure=0,this._shadowsHue=30,this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}return Object.defineProperty(e.prototype,"globalHue",{get:function(){return this._globalHue},set:function(e){this._globalHue=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalDensity",{get:function(){return this._globalDensity},set:function(e){this._globalDensity=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalSaturation",{get:function(){return this._globalSaturation},set:function(e){this._globalSaturation=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalExposure",{get:function(){return this._globalExposure},set:function(e){this._globalExposure=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightsHue",{get:function(){return this._highlightsHue},set:function(e){this._highlightsHue=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightsDensity",{get:function(){return this._highlightsDensity},set:function(e){this._highlightsDensity=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightsSaturation",{get:function(){return this._highlightsSaturation},set:function(e){this._highlightsSaturation=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightsExposure",{get:function(){return this._highlightsExposure},set:function(e){this._highlightsExposure=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"midtonesHue",{get:function(){return this._midtonesHue},set:function(e){this._midtonesHue=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"midtonesDensity",{get:function(){return this._midtonesDensity},set:function(e){this._midtonesDensity=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"midtonesSaturation",{get:function(){return this._midtonesSaturation},set:function(e){this._midtonesSaturation=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"midtonesExposure",{get:function(){return this._midtonesExposure},set:function(e){this._midtonesExposure=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowsHue",{get:function(){return this._shadowsHue},set:function(e){this._shadowsHue=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowsDensity",{get:function(){return this._shadowsDensity},set:function(e){this._shadowsDensity=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowsSaturation",{get:function(){return this._shadowsSaturation},set:function(e){this._shadowsSaturation=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowsExposure",{get:function(){return this._shadowsExposure},set:function(e){this._shadowsExposure=e,this._dirty=!0},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"ColorCurves"},e.Bind=function(e,t,i,n,r){void 0===i&&(i="vCameraColorCurvePositive"),void 0===n&&(n="vCameraColorCurveNeutral"),void 0===r&&(r="vCameraColorCurveNegative"),e._dirty&&(e._dirty=!1,e.getColorGradingDataToRef(e._globalHue,e._globalDensity,e._globalSaturation,e._globalExposure,e._globalCurve),e.getColorGradingDataToRef(e._highlightsHue,e._highlightsDensity,e._highlightsSaturation,e._highlightsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._highlightsCurve),e.getColorGradingDataToRef(e._midtonesHue,e._midtonesDensity,e._midtonesSaturation,e._midtonesExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._midtonesCurve),e.getColorGradingDataToRef(e._shadowsHue,e._shadowsDensity,e._shadowsSaturation,e._shadowsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._shadowsCurve),e._highlightsCurve.subtractToRef(e._midtonesCurve,e._positiveCurve),e._midtonesCurve.subtractToRef(e._shadowsCurve,e._negativeCurve)),t&&(t.setFloat4(i,e._positiveCurve.r,e._positiveCurve.g,e._positiveCurve.b,e._positiveCurve.a),t.setFloat4(n,e._midtonesCurve.r,e._midtonesCurve.g,e._midtonesCurve.b,e._midtonesCurve.a),t.setFloat4(r,e._negativeCurve.r,e._negativeCurve.g,e._negativeCurve.b,e._negativeCurve.a))},e.PrepareUniforms=function(e){e.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")},e.prototype.getColorGradingDataToRef=function(t,i,n,r,o){null!=t&&(t=e.clamp(t,0,360),i=e.clamp(i,-100,100),n=e.clamp(n,-100,100),r=e.clamp(r,-100,100),i=e.applyColorGradingSliderNonlinear(i),i*=.5,r=e.applyColorGradingSliderNonlinear(r),i<0&&(i*=-1,t=(t+180)%360),e.fromHSBToRef(t,i,50+.25*r,o),o.scaleToRef(2,o),o.a=1+.01*n)},e.applyColorGradingSliderNonlinear=function(e){e/=100;var t=Math.abs(e);return t=Math.pow(t,2),e<0&&(t*=-1),100*t},e.fromHSBToRef=function(t,i,n,r){var o=e.clamp(t,0,360),a=e.clamp(i/100,0,1),s=e.clamp(n/100,0,1);if(0===a)r.r=s,r.g=s,r.b=s;else{o/=60;var c=Math.floor(o),l=o-c,u=s*(1-a),h=s*(1-a*l),d=s*(1-a*(1-l));switch(c){case 0:r.r=s,r.g=d,r.b=u;break;case 1:r.r=h,r.g=s,r.b=u;break;case 2:r.r=u,r.g=s,r.b=d;break;case 3:r.r=u,r.g=h,r.b=s;break;case 4:r.r=d,r.g=u,r.b=s;break;default:r.r=s,r.g=u,r.b=h}}r.a=1},e.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},e.prototype.clone=function(){return r.a.Clone(function(){return new e},this)},e.prototype.serialize=function(){return r.a.Serialize(this)},e.Parse=function(t){return r.a.Parse(function(){return new e},t,null,null)},Object(n.c)([Object(r.c)()],e.prototype,"_globalHue",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_globalDensity",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_globalSaturation",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_globalExposure",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_highlightsHue",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_highlightsDensity",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_highlightsSaturation",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_highlightsExposure",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_midtonesHue",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_midtonesDensity",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_midtonesSaturation",void 0),Object(n.c)([Object(r.c)()],e.prototype,"_midtonesExposure",void 0),e}();r.a._ColorCurvesParser=a.Parse},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(8),r=i(11),o=function(){function e(){}return e.Instantiate=function(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];var t=r.a.GetClass(e);if(t)return t;n.a.Warn(e+" not found, you may have missed an import.");for(var i=e.split("."),o=window||this,a=0,s=i.length;a<s;a++)o=o[i[a]];return"function"!=typeof o?null:o},e.RegisteredExternalClasses={},e}()},function(e,t,i){"use strict";var n=i(26),r=i(2);n.a.prototype.setAlphaConstants=function(e,t,i,n){this._alphaState.setAlphaBlendConstants(e,t,i,n)},n.a.prototype.setAlphaMode=function(e,t){if(void 0===t&&(t=!1),this._alphaMode!==e){switch(e){case r.a.ALPHA_DISABLE:this._alphaState.alphaBlend=!1;break;case r.a.ALPHA_PREMULTIPLIED:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_PREMULTIPLIED_PORTERDUFF:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_COMBINE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_ONEONE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_ADD:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_SUBTRACT:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_MULTIPLY:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR,this._gl.ZERO,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_MAXIMIZED:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_INTERPOLATE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR,this._gl.ONE_MINUS_CONSTANT_COLOR,this._gl.CONSTANT_ALPHA,this._gl.ONE_MINUS_CONSTANT_ALPHA),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_SCREENMODE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_ONEONE_ONEONE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_ALPHATOCOLOR:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_REVERSEONEMINUS:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE_MINUS_DST_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_SRC_DSTONEMINUSSRCALPHA:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_ONEONE_ONEZERO:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case r.a.ALPHA_EXCLUSION:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0}t||(this.depthCullingState.depthMask=e===r.a.ALPHA_DISABLE),this._alphaMode=e}},n.a.prototype.getAlphaMode=function(){return this._alphaMode},n.a.prototype.setAlphaEquation=function(e){if(this._alphaEquation!==e){switch(e){case r.a.ALPHA_EQUATION_ADD:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_ADD,this._gl.FUNC_ADD);break;case r.a.ALPHA_EQUATION_SUBSTRACT:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_SUBTRACT,this._gl.FUNC_SUBTRACT);break;case r.a.ALPHA_EQUATION_REVERSE_SUBTRACT:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_REVERSE_SUBTRACT,this._gl.FUNC_REVERSE_SUBTRACT);break;case r.a.ALPHA_EQUATION_MAX:this._alphaState.setAlphaEquationParameters(this._gl.MAX,this._gl.MAX);break;case r.a.ALPHA_EQUATION_MIN:this._alphaState.setAlphaEquationParameters(this._gl.MIN,this._gl.MIN);break;case r.a.ALPHA_EQUATION_DARKEN:this._alphaState.setAlphaEquationParameters(this._gl.MIN,this._gl.FUNC_ADD)}this._alphaEquation=e}},n.a.prototype.getAlphaEquation=function(){return this._alphaEquation}},function(e,t,i){"use strict";var n=i(26);n.a.prototype.updateDynamicIndexBuffer=function(e,t,i){var n;void 0===i&&(i=0),this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(e),n=t instanceof Uint16Array||t instanceof Uint32Array?t:e.is32Bits?new Uint32Array(t):new Uint16Array(t),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,n,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},n.a.prototype.updateDynamicVertexBuffer=function(e,t,i,n){this.bindArrayBuffer(e),void 0===i&&(i=0);var r=t.length||t.byteLength;void 0===n||n>=r&&0===i?t instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,i,new Float32Array(t)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,i,t):t instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,new Float32Array(t).subarray(i,i+n)):(t=t instanceof ArrayBuffer?new Uint8Array(t,i,n):new Uint8Array(t.buffer,t.byteOffset+i,n),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t)),this._resetVertexBufferBinding()}},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.fogFragmentDeclaration="#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vec4 vFogInfos;\nuniform vec3 vFogColor;\nvarying vec3 vFogDistance;\nfloat CalcFogFactor()\n{\nfloat fogCoeff=1.0;\nfloat fogStart=vFogInfos.y;\nfloat fogEnd=vFogInfos.z;\nfloat fogDensity=vFogInfos.w;\nfloat fogDistance=length(vFogDistance);\nif (FOGMODE_LINEAR == vFogInfos.x)\n{\nfogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);\n}\nelse if (FOGMODE_EXP == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDensity);\n}\nelse if (FOGMODE_EXP2 == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);\n}\nreturn clamp(fogCoeff,0.0,1.0);\n}\n#endif"},function(e,t,i){"use strict";var n=i(26),r=i(27);n.a.prototype.createDynamicTexture=function(e,t,i,o){var a=new r.a(this,r.b.Dynamic);return a.baseWidth=e,a.baseHeight=t,i&&(e=this.needPOTTextures?n.a.GetExponentOfTwo(e,this._caps.maxTextureSize):e,t=this.needPOTTextures?n.a.GetExponentOfTwo(t,this._caps.maxTextureSize):t),a.width=e,a.height=t,a.isReady=!1,a.generateMipMaps=i,a.samplingMode=o,this.updateTextureSamplingMode(o,a),this._internalTexturesCache.push(a),a},n.a.prototype.updateDynamicTexture=function(e,t,i,n,r,o){if(void 0===n&&(n=!1),void 0===o&&(o=!1),e){var a=this._gl,s=a.TEXTURE_2D,c=this._bindTextureDirectly(s,e,!0,o);this._unpackFlipY(void 0===i?e.invertY:i),n&&a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);var l=this._getWebGLTextureType(e.type),u=this._getInternalFormat(r||e.format),h=this._getRGBABufferInternalSizedFormat(e.type,u);a.texImage2D(s,0,h,u,l,t),e.generateMipMaps&&a.generateMipmap(s),c||this._bindTextureDirectly(s,null),n&&a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),e.isReady=!0}}},function(e,t,i){"use strict";i.r(t),i.d(t,"AbstractScene",function(){return n.a}),i.d(t,"AbstractActionManager",function(){return r.a}),i.d(t,"Action",function(){return l}),i.d(t,"ActionEvent",function(){return u.a}),i.d(t,"ActionManager",function(){return M}),i.d(t,"Condition",function(){return d}),i.d(t,"ValueCondition",function(){return f}),i.d(t,"PredicateCondition",function(){return p}),i.d(t,"StateCondition",function(){return _}),i.d(t,"SwitchBooleanAction",function(){return v}),i.d(t,"SetStateAction",function(){return b}),i.d(t,"SetValueAction",function(){return y}),i.d(t,"IncrementValueAction",function(){return T}),i.d(t,"PlayAnimationAction",function(){return E}),i.d(t,"StopAnimationAction",function(){return S}),i.d(t,"DoNothingAction",function(){return A}),i.d(t,"CombineAction",function(){return P}),i.d(t,"ExecuteCodeAction",function(){return C}),i.d(t,"SetParentAction",function(){return R}),i.d(t,"PlaySoundAction",function(){return I}),i.d(t,"StopSoundAction",function(){return D}),i.d(t,"InterpolateValueAction",function(){return z}),i.d(t,"Animatable",function(){return ee}),i.d(t,"_IAnimationState",function(){return k}),i.d(t,"Animation",function(){return G}),i.d(t,"TargetedAnimation",function(){return te}),i.d(t,"AnimationGroup",function(){return ie}),i.d(t,"AnimationPropertiesOverride",function(){return ne}),i.d(t,"EasingFunction",function(){return oe}),i.d(t,"CircleEase",function(){return ae}),i.d(t,"BackEase",function(){return se}),i.d(t,"BounceEase",function(){return ce}),i.d(t,"CubicEase",function(){return le}),i.d(t,"ElasticEase",function(){return ue}),i.d(t,"ExponentialEase",function(){return he}),i.d(t,"PowerEase",function(){return de}),i.d(t,"QuadraticEase",function(){return fe}),i.d(t,"QuarticEase",function(){return pe}),i.d(t,"QuinticEase",function(){return _e}),i.d(t,"SineEase",function(){return me}),i.d(t,"BezierCurveEase",function(){return ge}),i.d(t,"RuntimeAnimation",function(){return K}),i.d(t,"AnimationEvent",function(){return ve}),i.d(t,"AnimationKeyInterpolation",function(){return N}),i.d(t,"AnimationRange",function(){return F}),i.d(t,"KeepAssets",function(){return ye}),i.d(t,"InstantiatedEntries",function(){return Te}),i.d(t,"AssetContainer",function(){return Ee}),i.d(t,"Analyser",function(){return Ae}),i.d(t,"AudioEngine",function(){return Pe}),i.d(t,"AudioSceneComponent",function(){return Ie}),i.d(t,"Sound",function(){return xe}),i.d(t,"SoundTrack",function(){return Oe}),i.d(t,"WeightedSound",function(){return De}),i.d(t,"AutoRotationBehavior",function(){return Le}),i.d(t,"BouncingBehavior",function(){return we}),i.d(t,"FramingBehavior",function(){return Fe}),i.d(t,"AttachToBoxBehavior",function(){return Ue}),i.d(t,"FadeInOutBehavior",function(){return Ve}),i.d(t,"MultiPointerScaleBehavior",function(){return Ge}),i.d(t,"PointerDragBehavior",function(){return ke.a}),i.d(t,"SixDofDragBehavior",function(){return He}),i.d(t,"Bone",function(){return $}),i.d(t,"BoneIKController",function(){return Xe}),i.d(t,"BoneLookController",function(){return Ye}),i.d(t,"Skeleton",function(){return tt}),i.d(t,"ArcRotateCameraGamepadInput",function(){return st}),i.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return lt}),i.d(t,"ArcRotateCameraMouseWheelInput",function(){return ut}),i.d(t,"ArcRotateCameraPointersInput",function(){return dt}),i.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return pt}),i.d(t,"FlyCameraKeyboardInput",function(){return _t}),i.d(t,"FlyCameraMouseInput",function(){return mt}),i.d(t,"FollowCameraKeyboardMoveInput",function(){return gt}),i.d(t,"FollowCameraMouseWheelInput",function(){return vt}),i.d(t,"FollowCameraPointersInput",function(){return bt}),i.d(t,"FreeCameraDeviceOrientationInput",function(){return Rt}),i.d(t,"FreeCameraGamepadInput",function(){return xt}),i.d(t,"FreeCameraKeyboardMoveInput",function(){return yt}),i.d(t,"FreeCameraMouseInput",function(){return Tt}),i.d(t,"FreeCameraMouseWheelInput",function(){return At}),i.d(t,"FreeCameraTouchInput",function(){return Pt}),i.d(t,"FreeCameraVirtualJoystickInput",function(){return Dt}),i.d(t,"CameraInputTypes",function(){return it}),i.d(t,"CameraInputsManager",function(){return nt}),i.d(t,"Camera",function(){return je.a}),i.d(t,"TargetCamera",function(){return Lt}),i.d(t,"FreeCamera",function(){return wt}),i.d(t,"FreeCameraInputsManager",function(){return Ct}),i.d(t,"TouchCamera",function(){return Ft}),i.d(t,"ArcRotateCamera",function(){return Bt}),i.d(t,"ArcRotateCameraInputsManager",function(){return ft}),i.d(t,"DeviceOrientationCamera",function(){return Ut}),i.d(t,"FlyCamera",function(){return kt}),i.d(t,"FlyCameraInputsManager",function(){return Vt}),i.d(t,"FollowCamera",function(){return jt}),i.d(t,"ArcFollowCamera",function(){return Wt}),i.d(t,"FollowCameraInputsManager",function(){return Gt}),i.d(t,"GamepadCamera",function(){return ri}),i.d(t,"AnaglyphArcRotateCamera",function(){return di}),i.d(t,"AnaglyphFreeCamera",function(){return fi}),i.d(t,"AnaglyphGamepadCamera",function(){return pi}),i.d(t,"AnaglyphUniversalCamera",function(){return _i}),i.d(t,"StereoscopicArcRotateCamera",function(){return gi}),i.d(t,"StereoscopicFreeCamera",function(){return vi}),i.d(t,"StereoscopicGamepadCamera",function(){return bi}),i.d(t,"StereoscopicUniversalCamera",function(){return yi}),i.d(t,"UniversalCamera",function(){return ni}),i.d(t,"VirtualJoysticksCamera",function(){return Ti}),i.d(t,"VRCameraMetrics",function(){return Ei}),i.d(t,"VRDeviceOrientationArcRotateCamera",function(){return Ii}),i.d(t,"VRDeviceOrientationFreeCamera",function(){return Di}),i.d(t,"VRDeviceOrientationGamepadCamera",function(){return Ni}),i.d(t,"OnAfterEnteringVRObservableEvent",function(){return on}),i.d(t,"VRExperienceHelper",function(){return an}),i.d(t,"WebVRFreeCamera",function(){return wi}),i.d(t,"Collider",function(){return ln}),i.d(t,"DefaultCollisionCoordinator",function(){return un}),i.d(t,"PickingInfo",function(){return hn.a}),i.d(t,"IntersectionInfo",function(){return dn.a}),i.d(t,"_MeshCollisionData",function(){return fn.a}),i.d(t,"BoundingBox",function(){return pn.a}),i.d(t,"BoundingInfo",function(){return _n.a}),i.d(t,"BoundingSphere",function(){return mn.a}),i.d(t,"Octree",function(){return vn}),i.d(t,"OctreeBlock",function(){return gn}),i.d(t,"OctreeSceneComponent",function(){return An}),i.d(t,"Ray",function(){return Xt.a}),i.d(t,"AxesViewer",function(){return Pn.AxesViewer}),i.d(t,"BoneAxesViewer",function(){return Pn.BoneAxesViewer}),i.d(t,"DebugLayerTab",function(){return Pn.DebugLayerTab}),i.d(t,"DebugLayer",function(){return Pn.DebugLayer}),i.d(t,"PhysicsViewer",function(){return Pn.PhysicsViewer}),i.d(t,"RayHelper",function(){return Pn.RayHelper}),i.d(t,"SkeletonViewer",function(){return Pn.SkeletonViewer}),i.d(t,"DeviceInputSystem",function(){return Cn}),i.d(t,"DeviceType",function(){return bn}),i.d(t,"PointerInput",function(){return yn}),i.d(t,"DualShockInput",function(){return Tn}),i.d(t,"XboxInput",function(){return En}),i.d(t,"SwitchInput",function(){return Sn}),i.d(t,"DeviceSource",function(){return Rn}),i.d(t,"DeviceSourceManager",function(){return xn}),i.d(t,"Constants",function(){return g.a}),i.d(t,"ThinEngine",function(){return qe.a}),i.d(t,"Engine",function(){return Se.a}),i.d(t,"EngineStore",function(){return x.a}),i.d(t,"NullEngineOptions",function(){return On.b}),i.d(t,"NullEngine",function(){return On.a}),i.d(t,"_OcclusionDataStorage",function(){return In}),i.d(t,"_forceTransformFeedbackToBundle",function(){return Dn}),i.d(t,"EngineView",function(){return Ln}),i.d(t,"WebGLPipelineContext",function(){return Fn.a}),i.d(t,"WebGL2ShaderProcessor",function(){return Bn.a}),i.d(t,"NativeEngine",function(){return er}),i.d(t,"ShaderCodeInliner",function(){return qn}),i.d(t,"PerformanceConfigurator",function(){return tr.a}),i.d(t,"KeyboardEventTypes",function(){return ct.a}),i.d(t,"KeyboardInfo",function(){return ct.b}),i.d(t,"KeyboardInfoPre",function(){return ct.c}),i.d(t,"PointerEventTypes",function(){return Ne.a}),i.d(t,"PointerInfoBase",function(){return Ne.c}),i.d(t,"PointerInfoPre",function(){return Ne.d}),i.d(t,"PointerInfo",function(){return Ne.b}),i.d(t,"ClipboardEventTypes",function(){return ir}),i.d(t,"ClipboardInfo",function(){return nr}),i.d(t,"DaydreamController",function(){return sr}),i.d(t,"GearVRController",function(){return cr}),i.d(t,"GenericController",function(){return lr}),i.d(t,"OculusTouchController",function(){return ur}),i.d(t,"PoseEnabledControllerType",function(){return zt}),i.d(t,"PoseEnabledControllerHelper",function(){return Qt}),i.d(t,"PoseEnabledController",function(){return qt}),i.d(t,"ViveController",function(){return hr}),i.d(t,"WebVRController",function(){return Fi}),i.d(t,"WindowsMotionController",function(){return fr}),i.d(t,"XRWindowsMotionController",function(){return pr}),i.d(t,"StickValues",function(){return rt}),i.d(t,"Gamepad",function(){return ot}),i.d(t,"GenericPad",function(){return at}),i.d(t,"GamepadManager",function(){return ti}),i.d(t,"GamepadSystemSceneComponent",function(){return ii}),i.d(t,"Xbox360Button",function(){return Yt}),i.d(t,"Xbox360Dpad",function(){return Kt}),i.d(t,"Xbox360Pad",function(){return $t}),i.d(t,"DualShockButton",function(){return Zt}),i.d(t,"DualShockDpad",function(){return Jt}),i.d(t,"DualShockPad",function(){return ei}),i.d(t,"AxisDragGizmo",function(){return _r.a}),i.d(t,"AxisScaleGizmo",function(){return br}),i.d(t,"BoundingBoxGizmo",function(){return Er}),i.d(t,"Gizmo",function(){return gr.a}),i.d(t,"GizmoManager",function(){return Ir}),i.d(t,"PlaneRotationGizmo",function(){return Sr}),i.d(t,"PositionGizmo",function(){return xr}),i.d(t,"RotationGizmo",function(){return Ar}),i.d(t,"ScaleGizmo",function(){return Mr}),i.d(t,"LightGizmo",function(){return Br}),i.d(t,"CameraGizmo",function(){return kr}),i.d(t,"PlaneDragGizmo",function(){return Rr}),i.d(t,"EnvironmentHelper",function(){return Jr}),i.d(t,"PhotoDome",function(){return eo}),i.d(t,"_forceSceneHelpersToBundle",function(){return $o}),i.d(t,"VideoDome",function(){return ta}),i.d(t,"EngineInstrumentation",function(){return na}),i.d(t,"SceneInstrumentation",function(){return ra}),i.d(t,"_TimeToken",function(){return Mn}),i.d(t,"EffectLayer",function(){return oa}),i.d(t,"EffectLayerSceneComponent",function(){return aa}),i.d(t,"GlowLayer",function(){return sa}),i.d(t,"HighlightLayer",function(){return la}),i.d(t,"Layer",function(){return ha}),i.d(t,"LayerSceneComponent",function(){return ua}),i.d(t,"LensFlare",function(){return da}),i.d(t,"LensFlareSystem",function(){return fa}),i.d(t,"LensFlareSystemSceneComponent",function(){return pa}),i.d(t,"Light",function(){return Dr.a}),i.d(t,"ShadowLight",function(){return Nr}),i.d(t,"ShadowGenerator",function(){return ga}),i.d(t,"CascadedShadowGenerator",function(){return Ra}),i.d(t,"ShadowGeneratorSceneComponent",function(){return xa}),i.d(t,"DirectionalLight",function(){return Lr}),i.d(t,"HemisphericLight",function(){return Li.a}),i.d(t,"PointLight",function(){return Oa}),i.d(t,"SpotLight",function(){return Fr}),i.d(t,"DefaultLoadingScreen",function(){return Ma}),i.d(t,"_BabylonLoaderRegistered",function(){return qa}),i.d(t,"BabylonFileLoaderConfiguration",function(){return Za}),i.d(t,"SceneLoaderAnimationGroupLoadingMode",function(){return Qn}),i.d(t,"SceneLoader",function(){return ar}),i.d(t,"SceneLoaderFlags",function(){return or.a}),i.d(t,"BackgroundMaterial",function(){return Zr}),i.d(t,"ColorCurves",function(){return ns.a}),i.d(t,"EffectFallbacks",function(){return Qr.a}),i.d(t,"Effect",function(){return ai.a}),i.d(t,"FresnelParameters",function(){return rs}),i.d(t,"ImageProcessingConfigurationDefines",function(){return Bi.b}),i.d(t,"ImageProcessingConfiguration",function(){return Bi.a}),i.d(t,"Material",function(){return lo.a}),i.d(t,"MaterialDefines",function(){return Xr.a}),i.d(t,"ThinMaterialHelper",function(){return os.a}),i.d(t,"MaterialHelper",function(){return Hr.a}),i.d(t,"MultiMaterial",function(){return Da.a}),i.d(t,"PBRMaterialDefines",function(){return po}),i.d(t,"PBRBaseMaterial",function(){return _o}),i.d(t,"PBRBaseSimpleMaterial",function(){return as}),i.d(t,"PBRMaterial",function(){return mo}),i.d(t,"PBRMetallicRoughnessMaterial",function(){return ss}),i.d(t,"PBRSpecularGlossinessMaterial",function(){return cs}),i.d(t,"PushMaterial",function(){return Yr.a}),i.d(t,"ShaderMaterial",function(){return ls.a}),i.d(t,"StandardMaterialDefines",function(){return Ui.b}),i.d(t,"StandardMaterial",function(){return Ui.a}),i.d(t,"BaseTexture",function(){return Hn.a}),i.d(t,"ColorGradingTexture",function(){return us}),i.d(t,"CubeTexture",function(){return Wr}),i.d(t,"DynamicTexture",function(){return Vi.a}),i.d(t,"EquiRectangularCubeTexture",function(){return hs}),i.d(t,"HDRFiltering",function(){return Ba}),i.d(t,"HDRCubeTexture",function(){return Ua}),i.d(t,"HtmlElementTexture",function(){return ds}),i.d(t,"InternalTextureSource",function(){return Qe.b}),i.d(t,"InternalTexture",function(){return Qe.a}),i.d(t,"_DDSTextureLoader",function(){return So}),i.d(t,"_ENVTextureLoader",function(){return Ao}),i.d(t,"_KTXTextureLoader",function(){return xo}),i.d(t,"_TGATextureLoader",function(){return ps}),i.d(t,"_BasisTextureLoader",function(){return bs}),i.d(t,"MirrorTexture",function(){return zr}),i.d(t,"MultiRenderTarget",function(){return ys}),i.d(t,"TexturePacker",function(){return Es}),i.d(t,"TexturePackerFrame",function(){return Ts}),i.d(t,"CustomProceduralTexture",function(){return Ps}),i.d(t,"NoiseProceduralTexture",function(){return Cs}),i.d(t,"ProceduralTexture",function(){return As}),i.d(t,"ProceduralTextureSceneComponent",function(){return Ss}),i.d(t,"RawCubeTexture",function(){return Ls}),i.d(t,"RawTexture",function(){return et}),i.d(t,"RawTexture2DArray",function(){return ws}),i.d(t,"RawTexture3D",function(){return Fs}),i.d(t,"RefractionTexture",function(){return Bs}),i.d(t,"RenderTargetTexture",function(){return Ri}),i.d(t,"Texture",function(){return Ke.a}),i.d(t,"VideoTexture",function(){return ea}),i.d(t,"UniformBuffer",function(){return Ai.a}),i.d(t,"MaterialFlags",function(){return Kr.a}),i.d(t,"NodeMaterialBlockTargets",function(){return Rs}),i.d(t,"NodeMaterialBlockConnectionPointTypes",function(){return xs}),i.d(t,"NodeMaterialBlockConnectionPointMode",function(){return Os}),i.d(t,"NodeMaterialSystemValues",function(){return Ms}),i.d(t,"NodeMaterialModes",function(){return Is}),i.d(t,"NodeMaterialConnectionPointCompatibilityStates",function(){return Ds}),i.d(t,"NodeMaterialConnectionPointDirection",function(){return Ns}),i.d(t,"NodeMaterialConnectionPoint",function(){return Us}),i.d(t,"NodeMaterialBlock",function(){return ks}),i.d(t,"NodeMaterialDefines",function(){return Ec}),i.d(t,"NodeMaterial",function(){return Sc}),i.d(t,"VertexOutputBlock",function(){return Ws}),i.d(t,"BonesBlock",function(){return Ac}),i.d(t,"InstancesBlock",function(){return Pc}),i.d(t,"MorphTargetsBlock",function(){return Cc}),i.d(t,"LightInformationBlock",function(){return Rc}),i.d(t,"FragmentOutputBlock",function(){return Xs}),i.d(t,"ImageProcessingBlock",function(){return xc}),i.d(t,"PerturbNormalBlock",function(){return Oc}),i.d(t,"DiscardBlock",function(){return Mc}),i.d(t,"FrontFacingBlock",function(){return Ic}),i.d(t,"DerivativeBlock",function(){return Dc}),i.d(t,"FragCoordBlock",function(){return Nc}),i.d(t,"ScreenSizeBlock",function(){return Lc}),i.d(t,"FogBlock",function(){return wc}),i.d(t,"LightBlock",function(){return Fc}),i.d(t,"TextureBlock",function(){return Bc}),i.d(t,"ReflectionTextureBlock",function(){return Vc}),i.d(t,"CurrentScreenBlock",function(){return Zs}),i.d(t,"InputBlock",function(){return qs}),i.d(t,"AnimatedInputBlockTypes",function(){return Hs}),i.d(t,"MultiplyBlock",function(){return oc}),i.d(t,"AddBlock",function(){return kc}),i.d(t,"ScaleBlock",function(){return Gc}),i.d(t,"ClampBlock",function(){return zc}),i.d(t,"CrossBlock",function(){return jc}),i.d(t,"DotBlock",function(){return Wc}),i.d(t,"TransformBlock",function(){return js}),i.d(t,"RemapBlock",function(){return rc}),i.d(t,"NormalizeBlock",function(){return Hc}),i.d(t,"TrigonometryBlockOperations",function(){return vc}),i.d(t,"TrigonometryBlock",function(){return yc}),i.d(t,"ColorMergerBlock",function(){return Xc}),i.d(t,"VectorMergerBlock",function(){return ic}),i.d(t,"ColorSplitterBlock",function(){return gc}),i.d(t,"VectorSplitterBlock",function(){return Yc}),i.d(t,"LerpBlock",function(){return Kc}),i.d(t,"DivideBlock",function(){return Qc}),i.d(t,"SubtractBlock",function(){return qc}),i.d(t,"StepBlock",function(){return Zc}),i.d(t,"OneMinusBlock",function(){return Jc}),i.d(t,"ViewDirectionBlock",function(){return $c}),i.d(t,"FresnelBlock",function(){return el}),i.d(t,"MaxBlock",function(){return tl}),i.d(t,"MinBlock",function(){return il}),i.d(t,"DistanceBlock",function(){return nl}),i.d(t,"LengthBlock",function(){return rl}),i.d(t,"NegateBlock",function(){return ol}),i.d(t,"PowBlock",function(){return al}),i.d(t,"RandomNumberBlock",function(){return sl}),i.d(t,"ArcTan2Block",function(){return cl}),i.d(t,"SmoothStepBlock",function(){return ll}),i.d(t,"ReciprocalBlock",function(){return ul}),i.d(t,"ReplaceColorBlock",function(){return hl}),i.d(t,"PosterizeBlock",function(){return fl}),i.d(t,"WaveBlockKind",function(){return dl}),i.d(t,"WaveBlock",function(){return pl}),i.d(t,"GradientBlockColorStep",function(){return _l}),i.d(t,"GradientBlock",function(){return ml}),i.d(t,"NLerpBlock",function(){return gl}),i.d(t,"WorleyNoise3DBlock",function(){return vl}),i.d(t,"SimplexPerlin3DBlock",function(){return bl}),i.d(t,"NormalBlendBlock",function(){return yl}),i.d(t,"Rotate2dBlock",function(){return Tl}),i.d(t,"ReflectBlock",function(){return El}),i.d(t,"RefractBlock",function(){return Sl}),i.d(t,"DesaturateBlock",function(){return Al}),i.d(t,"PBRMetallicRoughnessBlock",function(){return Nl}),i.d(t,"SheenBlock",function(){return Cl}),i.d(t,"AnisotropyBlock",function(){return Rl}),i.d(t,"ReflectionBlock",function(){return xl}),i.d(t,"ClearCoatBlock",function(){return Ol}),i.d(t,"RefractionBlock",function(){return Ml}),i.d(t,"SubSurfaceBlock",function(){return Il}),i.d(t,"ParticleTextureBlock",function(){return Js}),i.d(t,"ParticleRampGradientBlock",function(){return $s}),i.d(t,"ParticleBlendMultiplyBlock",function(){return ec}),i.d(t,"ModBlock",function(){return Ll}),i.d(t,"NodeMaterialOptimizer",function(){return wl}),i.d(t,"PropertyTypeForEdition",function(){return tc}),i.d(t,"editableInPropertyPage",function(){return nc}),i.d(t,"EffectRenderer",function(){return wa}),i.d(t,"EffectWrapper",function(){return Fa}),i.d(t,"ShadowDepthWrapper",function(){return Ul}),i.d(t,"Scalar",function(){return L.a}),i.d(t,"extractMinAndMaxIndexed",function(){return Vl.b}),i.d(t,"extractMinAndMax",function(){return Vl.a}),i.d(t,"Space",function(){return J.c}),i.d(t,"Axis",function(){return J.a}),i.d(t,"Coordinate",function(){return J.b}),i.d(t,"Color3",function(){return s.a}),i.d(t,"Color4",function(){return s.b}),i.d(t,"TmpColors",function(){return s.c}),i.d(t,"ToGammaSpace",function(){return Nt.b}),i.d(t,"ToLinearSpace",function(){return Nt.c}),i.d(t,"Epsilon",function(){return Nt.a}),i.d(t,"Frustum",function(){return Oi.a}),i.d(t,"Orientation",function(){return re.e}),i.d(t,"BezierCurve",function(){return re.c}),i.d(t,"Angle",function(){return re.a}),i.d(t,"Arc2",function(){return re.b}),i.d(t,"Path2",function(){return re.f}),i.d(t,"Path3D",function(){return re.g}),i.d(t,"Curve3",function(){return re.d}),i.d(t,"Plane",function(){return sn.a}),i.d(t,"Size",function(){return U.a}),i.d(t,"Vector2",function(){return a.d}),i.d(t,"Vector3",function(){return a.e}),i.d(t,"Vector4",function(){return a.f}),i.d(t,"Quaternion",function(){return a.b}),i.d(t,"Matrix",function(){return a.a}),i.d(t,"TmpVectors",function(){return a.c}),i.d(t,"PositionNormalVertex",function(){return Ur}),i.d(t,"PositionNormalTextureVertex",function(){return Vr}),i.d(t,"Viewport",function(){return mi.a}),i.d(t,"SphericalHarmonics",function(){return jn}),i.d(t,"SphericalPolynomial",function(){return Wn}),i.d(t,"AbstractMesh",function(){return ze.a}),i.d(t,"Buffer",function(){return ji.a}),i.d(t,"VertexBuffer",function(){return ji.b}),i.d(t,"DracoCompression",function(){return zl}),i.d(t,"CSG",function(){return Ql}),i.d(t,"Geometry",function(){return Ia.a}),i.d(t,"GroundMesh",function(){return Wi}),i.d(t,"TrailMesh",function(){return ql}),i.d(t,"InstancedMesh",function(){return Zl.a}),i.d(t,"LinesMesh",function(){return Jl.b}),i.d(t,"InstancedLinesMesh",function(){return Jl.a}),i.d(t,"_CreationDataStorage",function(){return be.b}),i.d(t,"_InstancesBatch",function(){return be.c}),i.d(t,"Mesh",function(){return be.a}),i.d(t,"VertexData",function(){return zi.a}),i.d(t,"MeshBuilder",function(){return _u}),i.d(t,"SimplificationSettings",function(){return mu}),i.d(t,"SimplificationQueue",function(){return gu}),i.d(t,"SimplificationType",function(){return fu}),i.d(t,"QuadraticErrorSimplification",function(){return Eu}),i.d(t,"SimplicationQueueSceneComponent",function(){return Su}),i.d(t,"Polygon",function(){return ou}),i.d(t,"PolygonMeshBuilder",function(){return au}),i.d(t,"SubMesh",function(){return jl.a}),i.d(t,"MeshLODLevel",function(){return Au.a}),i.d(t,"TransformNode",function(){return Pr.a}),i.d(t,"BoxBuilder",function(){return mr.a}),i.d(t,"TiledBoxBuilder",function(){return tu}),i.d(t,"DiscBuilder",function(){return eu}),i.d(t,"RibbonBuilder",function(){return $l.a}),i.d(t,"SphereBuilder",function(){return yr.a}),i.d(t,"HemisphereBuilder",function(){return wr}),i.d(t,"CylinderBuilder",function(){return qi.a}),i.d(t,"TorusBuilder",function(){return Qi}),i.d(t,"TorusKnotBuilder",function(){return iu}),i.d(t,"LinesBuilder",function(){return Tr.a}),i.d(t,"PolygonBuilder",function(){return su}),i.d(t,"ShapeBuilder",function(){return Ya.a}),i.d(t,"LatheBuilder",function(){return cu}),i.d(t,"PlaneBuilder",function(){return Cr.a}),i.d(t,"TiledPlaneBuilder",function(){return lu}),i.d(t,"GroundBuilder",function(){return Xi}),i.d(t,"TubeBuilder",function(){return uu}),i.d(t,"PolyhedronBuilder",function(){return Or}),i.d(t,"IcoSphereBuilder",function(){return hu}),i.d(t,"DecalBuilder",function(){return du}),i.d(t,"CapsuleBuilder",function(){return pu}),i.d(t,"DataBuffer",function(){return Un.a}),i.d(t,"WebGLDataBuffer",function(){return Pu.a}),i.d(t,"MorphTarget",function(){return Va}),i.d(t,"MorphTargetManager",function(){return ka}),i.d(t,"RecastJSPlugin",function(){return Cu}),i.d(t,"RecastJSCrowd",function(){return Ru}),i.d(t,"Node",function(){return B.a}),i.d(t,"Database",function(){return Ou}),i.d(t,"BaseParticleSystem",function(){return mc}),i.d(t,"BoxParticleEmitter",function(){return ac}),i.d(t,"ConeParticleEmitter",function(){return sc}),i.d(t,"CylinderParticleEmitter",function(){return cc}),i.d(t,"CylinderDirectedParticleEmitter",function(){return lc}),i.d(t,"HemisphericParticleEmitter",function(){return uc}),i.d(t,"PointParticleEmitter",function(){return hc}),i.d(t,"SphereParticleEmitter",function(){return dc}),i.d(t,"SphereDirectedParticleEmitter",function(){return fc}),i.d(t,"CustomParticleEmitter",function(){return pc}),i.d(t,"MeshParticleEmitter",function(){return _c}),i.d(t,"GPUParticleSystem",function(){return Bu}),i.d(t,"Particle",function(){return Lu}),i.d(t,"ParticleHelper",function(){return Vu}),i.d(t,"ParticleSystem",function(){return Fu}),i.d(t,"ParticleSystemSet",function(){return Uu}),i.d(t,"SolidParticle",function(){return Gu}),i.d(t,"ModelShape",function(){return zu}),i.d(t,"DepthSortedParticle",function(){return ju}),i.d(t,"SolidParticleVertex",function(){return Wu}),i.d(t,"SolidParticleSystem",function(){return Hu}),i.d(t,"CloudPoint",function(){return Xu}),i.d(t,"PointsGroup",function(){return Yu}),i.d(t,"PointColor",function(){return ku}),i.d(t,"PointsCloudSystem",function(){return Ku}),i.d(t,"SubEmitterType",function(){return xu}),i.d(t,"SubEmitter",function(){return wu}),i.d(t,"PhysicsEngine",function(){return ja}),i.d(t,"PhysicsEngineSceneComponent",function(){return Zu}),i.d(t,"PhysicsHelper",function(){return Ju}),i.d(t,"PhysicsRadialExplosionEventOptions",function(){return nh}),i.d(t,"PhysicsUpdraftEventOptions",function(){return rh}),i.d(t,"PhysicsVortexEventOptions",function(){return oh}),i.d(t,"PhysicsRadialImpulseFalloff",function(){return Qu}),i.d(t,"PhysicsUpdraftMode",function(){return qu}),i.d(t,"PhysicsImpostor",function(){return Ga.a}),i.d(t,"PhysicsJoint",function(){return za.e}),i.d(t,"DistanceJoint",function(){return za.a}),i.d(t,"MotorEnabledJoint",function(){return za.d}),i.d(t,"HingeJoint",function(){return za.c}),i.d(t,"Hinge2Joint",function(){return za.b}),i.d(t,"CannonJSPlugin",function(){return Ha}),i.d(t,"AmmoJSPlugin",function(){return Ka}),i.d(t,"OimoJSPlugin",function(){return Xa}),i.d(t,"AnaglyphPostProcess",function(){return hi}),i.d(t,"BlackAndWhitePostProcess",function(){return ah}),i.d(t,"BloomEffect",function(){return uh}),i.d(t,"BloomMergePostProcess",function(){return lh}),i.d(t,"BlurPostProcess",function(){return Gr}),i.d(t,"ChromaticAberrationPostProcess",function(){return hh}),i.d(t,"CircleOfConfusionPostProcess",function(){return dh}),i.d(t,"ColorCorrectionPostProcess",function(){return fh}),i.d(t,"ConvolutionPostProcess",function(){return ph}),i.d(t,"DepthOfFieldBlurPostProcess",function(){return _h}),i.d(t,"DepthOfFieldEffectBlurLevel",function(){return mh}),i.d(t,"DepthOfFieldEffect",function(){return bh}),i.d(t,"DepthOfFieldMergePostProcessOptions",function(){return gh}),i.d(t,"DepthOfFieldMergePostProcess",function(){return vh}),i.d(t,"DisplayPassPostProcess",function(){return yh}),i.d(t,"ExtractHighlightsPostProcess",function(){return ch}),i.d(t,"FilterPostProcess",function(){return Th}),i.d(t,"FxaaPostProcess",function(){return Eh}),i.d(t,"GrainPostProcess",function(){return Sh}),i.d(t,"HighlightsPostProcess",function(){return Ah}),i.d(t,"ImageProcessingPostProcess",function(){return Gi}),i.d(t,"MotionBlurPostProcess",function(){return xh}),i.d(t,"PassPostProcess",function(){return li}),i.d(t,"PassCubePostProcess",function(){return ui}),i.d(t,"PostProcess",function(){return ci}),i.d(t,"PostProcessManager",function(){return Pi.a}),i.d(t,"RefractionPostProcess",function(){return Oh}),i.d(t,"DefaultRenderingPipeline",function(){return Lh}),i.d(t,"LensRenderingPipeline",function(){return wh}),i.d(t,"SSAO2RenderingPipeline",function(){return Bh}),i.d(t,"SSAORenderingPipeline",function(){return Uh}),i.d(t,"StandardRenderingPipeline",function(){return Gh}),i.d(t,"PostProcessRenderEffect",function(){return sh}),i.d(t,"PostProcessRenderPipeline",function(){return Ih}),i.d(t,"PostProcessRenderPipelineManager",function(){return Dh}),i.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return Nh}),i.d(t,"SharpenPostProcess",function(){return Mh}),i.d(t,"StereoscopicInterlacePostProcessI",function(){return jh}),i.d(t,"StereoscopicInterlacePostProcess",function(){return Wh}),i.d(t,"TonemappingOperator",function(){return zh}),i.d(t,"TonemapPostProcess",function(){return Hh}),i.d(t,"VolumetricLightScatteringPostProcess",function(){return Xh}),i.d(t,"VRDistortionCorrectionPostProcess",function(){return Si}),i.d(t,"VRMultiviewToSingleviewPostProcess",function(){return Mi}),i.d(t,"ScreenSpaceReflectionPostProcess",function(){return kh}),i.d(t,"ScreenSpaceCurvaturePostProcess",function(){return Yh}),i.d(t,"ReflectionProbe",function(){return Qa}),i.d(t,"BoundingBoxRenderer",function(){return Kh}),i.d(t,"DepthRenderer",function(){return va}),i.d(t,"DepthRendererSceneComponent",function(){return Qh}),i.d(t,"EdgesRenderer",function(){return Zh}),i.d(t,"LineEdgesRenderer",function(){return Jh}),i.d(t,"GeometryBufferRenderer",function(){return Ph}),i.d(t,"GeometryBufferRendererSceneComponent",function(){return Rh}),i.d(t,"PrePassRenderer",function(){return $h}),i.d(t,"PrePassRendererSceneComponent",function(){return ed}),i.d(t,"SubSurfaceSceneComponent",function(){return nd}),i.d(t,"OutlineRenderer",function(){return rd}),i.d(t,"RenderingGroup",function(){return od.a}),i.d(t,"RenderingGroupInfo",function(){return Ci.a}),i.d(t,"RenderingManager",function(){return Ci.b}),i.d(t,"UtilityLayerRenderer",function(){return vr.a}),i.d(t,"Scene",function(){return Q.a}),i.d(t,"SceneComponentConstants",function(){return Me.a}),i.d(t,"Stage",function(){return Me.b}),i.d(t,"Sprite",function(){return ad}),i.d(t,"SpriteManager",function(){return ld}),i.d(t,"SpriteMap",function(){return hd}),i.d(t,"SpritePackedManager",function(){return dd}),i.d(t,"SpriteSceneComponent",function(){return sd}),i.d(t,"AlphaState",function(){return fd.a}),i.d(t,"DepthCullingState",function(){return pd.a}),i.d(t,"StencilState",function(){return _d.a}),i.d(t,"AndOrNotEvaluator",function(){return md.a}),i.d(t,"AssetTaskState",function(){return ud}),i.d(t,"AbstractAssetTask",function(){return vd}),i.d(t,"AssetsProgressEvent",function(){return bd}),i.d(t,"ContainerAssetTask",function(){return yd}),i.d(t,"MeshAssetTask",function(){return Td}),i.d(t,"TextFileAssetTask",function(){return Ed}),i.d(t,"BinaryFileAssetTask",function(){return Sd}),i.d(t,"ImageAssetTask",function(){return Ad}),i.d(t,"TextureAssetTask",function(){return Pd}),i.d(t,"CubeTextureAssetTask",function(){return Cd}),i.d(t,"HDRCubeTextureAssetTask",function(){return Rd}),i.d(t,"EquiRectangularCubeTextureAssetTask",function(){return xd}),i.d(t,"AssetsManager",function(){return Od}),i.d(t,"BasisTranscodeConfiguration",function(){return ms}),i.d(t,"BasisTools",function(){return gs}),i.d(t,"DDSTools",function(){return Eo}),i.d(t,"expandToProperty",function(){return w.b}),i.d(t,"serialize",function(){return w.c}),i.d(t,"serializeAsTexture",function(){return w.m}),i.d(t,"serializeAsColor3",function(){return w.e}),i.d(t,"serializeAsFresnelParameters",function(){return w.h}),i.d(t,"serializeAsVector2",function(){return w.n}),i.d(t,"serializeAsVector3",function(){return w.o}),i.d(t,"serializeAsMeshReference",function(){return w.k}),i.d(t,"serializeAsColorCurves",function(){return w.g}),i.d(t,"serializeAsColor4",function(){return w.f}),i.d(t,"serializeAsImageProcessingConfiguration",function(){return w.i}),i.d(t,"serializeAsQuaternion",function(){return w.l}),i.d(t,"serializeAsMatrix",function(){return w.j}),i.d(t,"serializeAsCameraReference",function(){return w.d}),i.d(t,"SerializationHelper",function(){return w.a}),i.d(t,"Deferred",function(){return Md}),i.d(t,"EnvironmentTextureTools",function(){return Kn}),i.d(t,"MeshExploder",function(){return Id}),i.d(t,"FilesInput",function(){return Dd}),i.d(t,"CubeMapToSphericalPolynomialTools",function(){return Yn}),i.d(t,"HDRTools",function(){return La}),i.d(t,"PanoramaToCubeMapTools",function(){return Na}),i.d(t,"KhronosTextureContainer",function(){return Po}),i.d(t,"EventState",function(){return o.a}),i.d(t,"Observer",function(){return o.d}),i.d(t,"MultiObserver",function(){return o.b}),i.d(t,"Observable",function(){return o.c}),i.d(t,"PerformanceMonitor",function(){return Nd.a}),i.d(t,"RollingAverage",function(){return Nd.b}),i.d(t,"PromisePolyfill",function(){return Ld.a}),i.d(t,"SceneOptimization",function(){return wd}),i.d(t,"TextureOptimization",function(){return Fd}),i.d(t,"HardwareScalingOptimization",function(){return Bd}),i.d(t,"ShadowsOptimization",function(){return Ud}),i.d(t,"PostProcessesOptimization",function(){return Vd}),i.d(t,"LensFlaresOptimization",function(){return kd}),i.d(t,"CustomOptimization",function(){return Gd}),i.d(t,"ParticlesOptimization",function(){return zd}),i.d(t,"RenderTargetsOptimization",function(){return jd}),i.d(t,"MergeMeshesOptimization",function(){return Wd}),i.d(t,"SceneOptimizerOptions",function(){return Hd}),i.d(t,"SceneOptimizer",function(){return Xd}),i.d(t,"SceneSerializer",function(){return qd}),i.d(t,"SmartArray",function(){return oi.a}),i.d(t,"SmartArrayNoDuplicate",function(){return oi.b}),i.d(t,"StringDictionary",function(){return Mt.a}),i.d(t,"Tags",function(){return Zd.a}),i.d(t,"TextureTools",function(){return Jd}),i.d(t,"TGATools",function(){return fs}),i.d(t,"Tools",function(){return Ce.b}),i.d(t,"className",function(){return Ce.c}),i.d(t,"AsyncLoop",function(){return Ce.a}),i.d(t,"VideoRecorder",function(){return $d}),i.d(t,"JoystickAxis",function(){return Ot}),i.d(t,"VirtualJoystick",function(){return It}),i.d(t,"WorkerPool",function(){return Co}),i.d(t,"Logger",function(){return m.a}),i.d(t,"_TypeStore",function(){return c.a}),i.d(t,"FilesInputStore",function(){return rr.a}),i.d(t,"DeepCopier",function(){return O.a}),i.d(t,"PivotTools",function(){return We.a}),i.d(t,"PrecisionDate",function(){return q.a}),i.d(t,"ScreenshotTools",function(){return ef}),i.d(t,"WebRequest",function(){return V.a}),i.d(t,"InspectableType",function(){return gd}),i.d(t,"BRDFTextureTools",function(){return io}),i.d(t,"RGBDTextureTools",function(){return to}),i.d(t,"ColorGradient",function(){return Mu}),i.d(t,"Color3Gradient",function(){return Iu}),i.d(t,"FactorGradient",function(){return Du}),i.d(t,"GradientHelper",function(){return Nu}),i.d(t,"PerfCounter",function(){return ia.a}),i.d(t,"RetryStrategy",function(){return nf.a}),i.d(t,"CanvasGenerator",function(){return Hi.a}),i.d(t,"LoadFileError",function(){return Nn.b}),i.d(t,"RequestFileError",function(){return Nn.d}),i.d(t,"ReadFileError",function(){return Nn.c}),i.d(t,"FileTools",function(){return Nn.a}),i.d(t,"StringTools",function(){return jr.a}),i.d(t,"DataReader",function(){return rf}),i.d(t,"MinMaxReducer",function(){return ba}),i.d(t,"DepthReducer",function(){return ya}),i.d(t,"DataStorage",function(){return of}),i.d(t,"SceneRecorder",function(){return af}),i.d(t,"KhronosTextureContainer2",function(){return Ro}),i.d(t,"Trajectory",function(){return sf}),i.d(t,"TrajectoryClassifier",function(){return hf}),i.d(t,"TimerState",function(){return Wo}),i.d(t,"setAndStartTimer",function(){return Ko}),i.d(t,"AdvancedTimer",function(){return Qo}),i.d(t,"CopyTools",function(){return df.a}),i.d(t,"WebXRCamera",function(){return Oo}),i.d(t,"WebXREnterExitUIButton",function(){return Ho}),i.d(t,"WebXREnterExitUIOptions",function(){return Xo}),i.d(t,"WebXREnterExitUI",function(){return Yo}),i.d(t,"WebXRExperienceHelper",function(){return Do}),i.d(t,"WebXRInput",function(){return Go}),i.d(t,"WebXRInputSource",function(){return ko}),i.d(t,"WebXRManagedOutputCanvasOptions",function(){return Zi}),i.d(t,"WebXRManagedOutputCanvas",function(){return Ji}),i.d(t,"WebXRState",function(){return Yi}),i.d(t,"WebXRTrackingState",function(){return Ki}),i.d(t,"WebXRSessionManager",function(){return $i}),i.d(t,"WebXRDefaultExperienceOptions",function(){return Zo}),i.d(t,"WebXRDefaultExperience",function(){return Jo}),i.d(t,"WebXRFeatureName",function(){return Mo}),i.d(t,"WebXRFeaturesManager",function(){return Io}),i.d(t,"WebXRAbstractFeature",function(){return zo}),i.d(t,"WebXRHitTestLegacy",function(){return ff}),i.d(t,"WebXRAnchorSystem",function(){return _f}),i.d(t,"WebXRPlaneDetector",function(){return gf}),i.d(t,"WebXRBackgroundRemover",function(){return vf}),i.d(t,"WebXRMotionControllerTeleportation",function(){return qo}),i.d(t,"WebXRControllerPointerSelection",function(){return jo}),i.d(t,"IWebXRControllerPhysicsOptions",function(){return bf}),i.d(t,"WebXRControllerPhysics",function(){return yf}),i.d(t,"WebXRHitTest",function(){return Tf}),i.d(t,"WebXRFeaturePointSystem",function(){return Ef}),i.d(t,"WebXRHand",function(){return Sf}),i.d(t,"WebXRHandTracking",function(){return Af}),i.d(t,"WebXRAbstractMotionController",function(){return Lo}),i.d(t,"WebXRControllerComponent",function(){return No}),i.d(t,"WebXRGenericTriggerMotionController",function(){return wo}),i.d(t,"WebXRMicrosoftMixedRealityController",function(){return Pf}),i.d(t,"WebXRMotionControllerManager",function(){return Uo}),i.d(t,"WebXROculusTouchMotionController",function(){return Rf}),i.d(t,"WebXRHTCViveMotionController",function(){return Of}),i.d(t,"WebXRProfiledMotionController",function(){return Bo});var n=i(35),r=i(91),o=i(6),a=i(0),s=i(9),c=i(11),l=function(){function e(e,t){this.triggerOptions=e,this.onBeforeExecuteObservable=new o.c,e.parameter?(this.trigger=e.trigger,this._triggerParameter=e.parameter):e.trigger?this.trigger=e.trigger:this.trigger=e,this._nextActiveAction=this,this._condition=t}return e.prototype._prepare=function(){},e.prototype.getTriggerParameter=function(){return this._triggerParameter},e.prototype._executeCurrent=function(e){if(this._nextActiveAction._condition){var t=this._nextActiveAction._condition,i=this._actionManager.getScene().getRenderId();if(t._evaluationId===i){if(!t._currentResult)return}else{if(t._evaluationId=i,!t.isValid())return void(t._currentResult=!1);t._currentResult=!0}}this.onBeforeExecuteObservable.notifyObservers(this),this._nextActiveAction.execute(e),this.skipToNextActiveAction()},e.prototype.execute=function(e){},e.prototype.skipToNextActiveAction=function(){this._nextActiveAction._child?(this._nextActiveAction._child._actionManager||(this._nextActiveAction._child._actionManager=this._actionManager),this._nextActiveAction=this._nextActiveAction._child):this._nextActiveAction=this},e.prototype.then=function(e){return this._child=e,e._actionManager=this._actionManager,e._prepare(),e},e.prototype._getProperty=function(e){return this._actionManager._getProperty(e)},e.prototype._getEffectiveTarget=function(e,t){return this._actionManager._getEffectiveTarget(e,t)},e.prototype.serialize=function(e){},e.prototype._serialize=function(e,t){var i={type:1,children:[],name:e.name,properties:e.properties||[]};if(this._child&&this._child.serialize(i),this._condition){var n=this._condition.serialize();return n.children.push(i),t&&t.children.push(n),n}return t&&t.children.push(i),i},e._SerializeValueAsString=function(e){return"number"==typeof e?e.toString():"boolean"==typeof e?e?"true":"false":e instanceof a.d?e.x+", "+e.y:e instanceof a.e?e.x+", "+e.y+", "+e.z:e instanceof s.a?e.r+", "+e.g+", "+e.b:e instanceof s.b?e.r+", "+e.g+", "+e.b+", "+e.a:e},e._GetTargetProperty=function(e){return{name:"target",targetType:e._isMesh?"MeshProperties":e._isLight?"LightProperties":e._isCamera?"CameraProperties":"SceneProperties",value:e._isScene?"Scene":e.name}},e}();c.a.RegisteredTypes["BABYLON.Action"]=l;var u=i(47),h=i(1),d=function(){function e(e){this._actionManager=e}return e.prototype.isValid=function(){return!0},e.prototype._getProperty=function(e){return this._actionManager._getProperty(e)},e.prototype._getEffectiveTarget=function(e,t){return this._actionManager._getEffectiveTarget(e,t)},e.prototype.serialize=function(){},e.prototype._serialize=function(e){return{type:2,children:[],name:e.name,properties:e.properties}},e}(),f=function(e){function t(i,n,r,o,a){void 0===a&&(a=t.IsEqual);var s=e.call(this,i)||this;return s.propertyPath=r,s.value=o,s.operator=a,s._target=n,s._effectiveTarget=s._getEffectiveTarget(n,s.propertyPath),s._property=s._getProperty(s.propertyPath),s}return Object(h.d)(t,e),Object.defineProperty(t,"IsEqual",{get:function(){return t._IsEqual},enumerable:!1,configurable:!0}),Object.defineProperty(t,"IsDifferent",{get:function(){return t._IsDifferent},enumerable:!1,configurable:!0}),Object.defineProperty(t,"IsGreater",{get:function(){return t._IsGreater},enumerable:!1,configurable:!0}),Object.defineProperty(t,"IsLesser",{get:function(){return t._IsLesser},enumerable:!1,configurable:!0}),t.prototype.isValid=function(){switch(this.operator){case t.IsGreater:return this._effectiveTarget[this._property]>this.value;case t.IsLesser:return this._effectiveTarget[this._property]<this.value;case t.IsEqual:case t.IsDifferent:var e;return e=this.value.equals?this.value.equals(this._effectiveTarget[this._property]):this.value===this._effectiveTarget[this._property],this.operator===t.IsEqual?e:!e}return!1},t.prototype.serialize=function(){return this._serialize({name:"ValueCondition",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:l._SerializeValueAsString(this.value)},{name:"operator",value:t.GetOperatorName(this.operator)}]})},t.GetOperatorName=function(e){switch(e){case t._IsEqual:return"IsEqual";case t._IsDifferent:return"IsDifferent";case t._IsGreater:return"IsGreater";case t._IsLesser:return"IsLesser";default:return""}},t._IsEqual=0,t._IsDifferent=1,t._IsGreater=2,t._IsLesser=3,t}(d),p=function(e){function t(t,i){var n=e.call(this,t)||this;return n.predicate=i,n}return Object(h.d)(t,e),t.prototype.isValid=function(){return this.predicate()},t}(d),_=function(e){function t(t,i,n){var r=e.call(this,t)||this;return r.value=n,r._target=i,r}return Object(h.d)(t,e),t.prototype.isValid=function(){return this._target.state===this.value},t.prototype.serialize=function(){return this._serialize({name:"StateCondition",properties:[l._GetTargetProperty(this._target),{name:"value",value:this.value}]})},t}(d);c.a.RegisteredTypes["BABYLON.ValueCondition"]=f,c.a.RegisteredTypes["BABYLON.PredicateCondition"]=p,c.a.RegisteredTypes["BABYLON.StateCondition"]=_;var m=i(8),g=i(2),v=function(e){function t(t,i,n,r){var o=e.call(this,t,r)||this;return o.propertyPath=n,o._target=o._effectiveTarget=i,o}return Object(h.d)(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)},t.prototype.execute=function(){this._effectiveTarget[this._property]=!this._effectiveTarget[this._property]},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SwitchBooleanAction",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath}]},t)},t}(l),b=function(e){function t(t,i,n,r){var o=e.call(this,t,r)||this;return o.value=n,o._target=i,o}return Object(h.d)(t,e),t.prototype.execute=function(){this._target.state=this.value},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SetStateAction",properties:[l._GetTargetProperty(this._target),{name:"value",value:this.value}]},t)},t}(l),y=function(e){function t(t,i,n,r,o){var a=e.call(this,t,o)||this;return a.propertyPath=n,a.value=r,a._target=a._effectiveTarget=i,a}return Object(h.d)(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)},t.prototype.execute=function(){this._effectiveTarget[this._property]=this.value,this._target.markAsDirty&&this._target.markAsDirty(this._property)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SetValueAction",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:l._SerializeValueAsString(this.value)}]},t)},t}(l),T=function(e){function t(t,i,n,r,o){var a=e.call(this,t,o)||this;return a.propertyPath=n,a.value=r,a._target=a._effectiveTarget=i,a}return Object(h.d)(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath),"number"!=typeof this._effectiveTarget[this._property]&&m.a.Warn("Warning: IncrementValueAction can only be used with number values")},t.prototype.execute=function(){this._effectiveTarget[this._property]+=this.value,this._target.markAsDirty&&this._target.markAsDirty(this._property)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"IncrementValueAction",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:l._SerializeValueAsString(this.value)}]},t)},t}(l),E=function(e){function t(t,i,n,r,o,a){var s=e.call(this,t,a)||this;return s.from=n,s.to=r,s.loop=o,s._target=i,s}return Object(h.d)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){this._actionManager.getScene().beginAnimation(this._target,this.from,this.to,this.loop)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"PlayAnimationAction",properties:[l._GetTargetProperty(this._target),{name:"from",value:String(this.from)},{name:"to",value:String(this.to)},{name:"loop",value:l._SerializeValueAsString(this.loop)||!1}]},t)},t}(l),S=function(e){function t(t,i,n){var r=e.call(this,t,n)||this;return r._target=i,r}return Object(h.d)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){this._actionManager.getScene().stopAnimation(this._target)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"StopAnimationAction",properties:[l._GetTargetProperty(this._target)]},t)},t}(l),A=function(e){function t(t,i){return void 0===t&&(t=g.a.ACTION_NothingTrigger),e.call(this,t,i)||this}return Object(h.d)(t,e),t.prototype.execute=function(){},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"DoNothingAction",properties:[]},t)},t}(l),P=function(e){function t(t,i,n){var r=e.call(this,t,n)||this;return r.children=i,r}return Object(h.d)(t,e),t.prototype._prepare=function(){for(var e=0;e<this.children.length;e++)this.children[e]._actionManager=this._actionManager,this.children[e]._prepare()},t.prototype.execute=function(e){for(var t=0;t<this.children.length;t++)this.children[t].execute(e)},t.prototype.serialize=function(t){for(var i=e.prototype._serialize.call(this,{name:"CombineAction",properties:[],combine:[]},t),n=0;n<this.children.length;n++)i.combine.push(this.children[n].serialize(null));return i},t}(l),C=function(e){function t(t,i,n){var r=e.call(this,t,n)||this;return r.func=i,r}return Object(h.d)(t,e),t.prototype.execute=function(e){this.func(e)},t}(l),R=function(e){function t(t,i,n,r){var o=e.call(this,t,r)||this;return o._target=i,o._parent=n,o}return Object(h.d)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){if(this._target.parent!==this._parent){var e=this._parent.getWorldMatrix().clone();e.invert(),this._target.position=a.e.TransformCoordinates(this._target.position,e),this._target.parent=this._parent}},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SetParentAction",properties:[l._GetTargetProperty(this._target),l._GetTargetProperty(this._parent)]},t)},t}(l);c.a.RegisteredTypes["BABYLON.SetParentAction"]=R,c.a.RegisteredTypes["BABYLON.ExecuteCodeAction"]=C,c.a.RegisteredTypes["BABYLON.DoNothingAction"]=A,c.a.RegisteredTypes["BABYLON.StopAnimationAction"]=S,c.a.RegisteredTypes["BABYLON.PlayAnimationAction"]=E,c.a.RegisteredTypes["BABYLON.IncrementValueAction"]=T,c.a.RegisteredTypes["BABYLON.SetValueAction"]=y,c.a.RegisteredTypes["BABYLON.SetStateAction"]=b,c.a.RegisteredTypes["BABYLON.SetParentAction"]=R;var x=i(22),O=i(41),M=function(e){function t(t){var i=e.call(this)||this;return i._scene=t||x.a.LastCreatedScene,t.actionManagers.push(i),i}return Object(h.d)(t,e),t.prototype.dispose=function(){for(var e=this._scene.actionManagers.indexOf(this),i=0;i<this.actions.length;i++){var n=this.actions[i];t.Triggers[n.trigger]--,0===t.Triggers[n.trigger]&&delete t.Triggers[n.trigger]}e>-1&&this._scene.actionManagers.splice(e,1)},t.prototype.getScene=function(){return this._scene},t.prototype.hasSpecificTriggers=function(e){for(var t=0;t<this.actions.length;t++){var i=this.actions[t];if(e.indexOf(i.trigger)>-1)return!0}return!1},t.prototype.hasSpecificTriggers2=function(e,t){for(var i=0;i<this.actions.length;i++){var n=this.actions[i];if(e==n.trigger||t==n.trigger)return!0}return!1},t.prototype.hasSpecificTrigger=function(e,t){for(var i=0;i<this.actions.length;i++){var n=this.actions[i];if(n.trigger===e){if(!t)return!0;if(t(n.getTriggerParameter()))return!0}}return!1},Object.defineProperty(t.prototype,"hasPointerTriggers",{get:function(){for(var e=0;e<this.actions.length;e++){var i=this.actions[e];if(i.trigger>=t.OnPickTrigger&&i.trigger<=t.OnPointerOutTrigger)return!0}return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPickTriggers",{get:function(){for(var e=0;e<this.actions.length;e++){var i=this.actions[e];if(i.trigger>=t.OnPickTrigger&&i.trigger<=t.OnPickUpTrigger)return!0}return!1},enumerable:!1,configurable:!0}),t.prototype.registerAction=function(e){return e.trigger===t.OnEveryFrameTrigger&&this.getScene().actionManager!==this?(m.a.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"),null):(this.actions.push(e),t.Triggers[e.trigger]?t.Triggers[e.trigger]++:t.Triggers[e.trigger]=1,e._actionManager=this,e._prepare(),e)},t.prototype.unregisterAction=function(e){var i=this.actions.indexOf(e);return-1!==i&&(this.actions.splice(i,1),t.Triggers[e.trigger]-=1,0===t.Triggers[e.trigger]&&delete t.Triggers[e.trigger],e._actionManager=null,!0)},t.prototype.processTrigger=function(e,i){for(var n=0;n<this.actions.length;n++){var r=this.actions[n];if(r.trigger===e){if(i&&(e===t.OnKeyUpTrigger||e===t.OnKeyDownTrigger)){var o=r.getTriggerParameter();if(o&&o!==i.sourceEvent.keyCode){if(!o.toLowerCase)continue;var a=o.toLowerCase();if(a!==i.sourceEvent.key){var s=i.sourceEvent.charCode?i.sourceEvent.charCode:i.sourceEvent.keyCode;if(String.fromCharCode(s).toLowerCase()!==a)continue}}}r._executeCurrent(i)}}},t.prototype._getEffectiveTarget=function(e,t){for(var i=t.split("."),n=0;n<i.length-1;n++)e=e[i[n]];return e},t.prototype._getProperty=function(e){var t=e.split(".");return t[t.length-1]},t.prototype.serialize=function(e){for(var i={children:new Array,name:e,type:3,properties:new Array},n=0;n<this.actions.length;n++){var r={type:0,children:new Array,name:t.GetTriggerName(this.actions[n].trigger),properties:new Array},o=this.actions[n].triggerOptions;if(o&&"number"!=typeof o)if(o.parameter instanceof Node)r.properties.push(l._GetTargetProperty(o.parameter));else{var a={};O.a.DeepCopy(o.parameter,a,["mesh"]),o.parameter&&o.parameter.mesh&&(a._meshId=o.parameter.mesh.id),r.properties.push({name:"parameter",targetType:null,value:a})}this.actions[n].serialize(r),i.children.push(r)}return i},t.Parse=function(e,i,n){var r=new t(n);null===i?n.actionManager=r:i.actionManager=r;for(var o=function(e,t,i,n){if(null===n){var r=parseFloat(t);return"true"===t||"false"===t?"true"===t:isNaN(r)?t:r}for(var o=n.split("."),c=t.split(","),l=0;l<o.length;l++)i=i[o[l]];if("boolean"==typeof i)return"true"===c[0];if("string"==typeof i)return c[0];var u=new Array;for(l=0;l<c.length;l++)u.push(parseFloat(c[l]));return i instanceof a.e?a.e.FromArray(u):i instanceof a.f?a.f.FromArray(u):i instanceof s.a?s.a.FromArray(u):i instanceof s.b?s.b.FromArray(u):parseFloat(c[0])},l=function(e,i,a,s,u){if(void 0===u&&(u=null),!e.detached){var h=new Array,p=null,_=null,m=e.combine&&e.combine.length>0;if(2===e.type?h.push(r):h.push(i),m){for(var g=new Array,v=0;v<e.combine.length;v++)l(e.combine[v],t.NothingTrigger,a,s,g);h.push(g)}else for(var b=0;b<e.properties.length;b++){var y=e.properties[b].value,T=e.properties[b].name,E=e.properties[b].targetType;"target"===T?y=p=null!==E&&"SceneProperties"===E?n:n.getNodeByName(y):"parent"===T?y=n.getNodeByName(y):"sound"===T?n.getSoundByName&&(y=n.getSoundByName(y)):"propertyPath"!==T?y=2===e.type&&"operator"===T?f[y]:o(0,y,p,"value"===T?_:null):_=y,h.push(y)}if(null===u?h.push(a):h.push(null),"InterpolateValueAction"===e.name){var S=h[h.length-2];h[h.length-1]=S,h[h.length-2]=a}var P=function(e,t){var i=c.a.GetClass("BABYLON."+e);if(i){var n=Object.create(i.prototype);return n.constructor.apply(n,t),n}}(e.name,h);if(P instanceof d&&null!==a){var C=new A(i,a);s?s.then(C):r.registerAction(C),s=C}for(null===u?P instanceof d?(a=P,P=s):(a=null,s?s.then(P):r.registerAction(P)):u.push(P),b=0;b<e.children.length;b++)l(e.children[b],i,a,P,null)}},u=0;u<e.children.length;u++){var h,p=e.children[u];if(p.properties.length>0){var _=p.properties[0].value,m=null===p.properties[0].targetType?_:n.getMeshByName(_);m._meshId&&(m.mesh=n.getMeshByID(m._meshId)),h={trigger:t[p.name],parameter:m}}else h=t[p.name];for(var g=0;g<p.children.length;g++)p.detached||l(p.children[g],h,null,null)}},t.GetTriggerName=function(e){switch(e){case 0:return"NothingTrigger";case 1:return"OnPickTrigger";case 2:return"OnLeftPickTrigger";case 3:return"OnRightPickTrigger";case 4:return"OnCenterPickTrigger";case 5:return"OnPickDownTrigger";case 6:return"OnPickUpTrigger";case 7:return"OnLongPressTrigger";case 8:return"OnPointerOverTrigger";case 9:return"OnPointerOutTrigger";case 10:return"OnEveryFrameTrigger";case 11:return"OnIntersectionEnterTrigger";case 12:return"OnIntersectionExitTrigger";case 13:return"OnKeyDownTrigger";case 14:return"OnKeyUpTrigger";case 15:return"OnPickOutTrigger";default:return""}},t.NothingTrigger=g.a.ACTION_NothingTrigger,t.OnPickTrigger=g.a.ACTION_OnPickTrigger,t.OnLeftPickTrigger=g.a.ACTION_OnLeftPickTrigger,t.OnRightPickTrigger=g.a.ACTION_OnRightPickTrigger,t.OnCenterPickTrigger=g.a.ACTION_OnCenterPickTrigger,t.OnPickDownTrigger=g.a.ACTION_OnPickDownTrigger,t.OnDoublePickTrigger=g.a.ACTION_OnDoublePickTrigger,t.OnPickUpTrigger=g.a.ACTION_OnPickUpTrigger,t.OnPickOutTrigger=g.a.ACTION_OnPickOutTrigger,t.OnLongPressTrigger=g.a.ACTION_OnLongPressTrigger,t.OnPointerOverTrigger=g.a.ACTION_OnPointerOverTrigger,t.OnPointerOutTrigger=g.a.ACTION_OnPointerOutTrigger,t.OnEveryFrameTrigger=g.a.ACTION_OnEveryFrameTrigger,t.OnIntersectionEnterTrigger=g.a.ACTION_OnIntersectionEnterTrigger,t.OnIntersectionExitTrigger=g.a.ACTION_OnIntersectionExitTrigger,t.OnKeyDownTrigger=g.a.ACTION_OnKeyDownTrigger,t.OnKeyUpTrigger=15,t}(r.a),I=function(e){function t(t,i,n){var r=e.call(this,t,n)||this;return r._sound=i,r}return Object(h.d)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){void 0!==this._sound&&this._sound.play()},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"PlaySoundAction",properties:[{name:"sound",value:this._sound.name}]},t)},t}(l),D=function(e){function t(t,i,n){var r=e.call(this,t,n)||this;return r._sound=i,r}return Object(h.d)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){void 0!==this._sound&&this._sound.stop()},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"StopSoundAction",properties:[{name:"sound",value:this._sound.name}]},t)},t}(l);c.a.RegisteredTypes["BABYLON.PlaySoundAction"]=D,c.a.RegisteredTypes["BABYLON.StopSoundAction"]=D;var N,L=i(14),w=i(3);!function(e){e[e.STEP=1]="STEP"}(N||(N={}));var F=function(){function e(e,t,i){this.name=e,this.from=t,this.to=i}return e.prototype.clone=function(){return new e(this.name,this.from,this.to)},e}(),B=i(29),U=i(77),V=i(49),k=function(){},G=function(){function e(t,i,n,r,o,a){this.name=t,this.targetProperty=i,this.framePerSecond=n,this.dataType=r,this.loopMode=o,this.enableBlending=a,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this.targetPropertyPath=i.split("."),this.dataType=r,this.loopMode=void 0===o?e.ANIMATIONLOOPMODE_CYCLE:o}return e._PrepareAnimation=function(t,i,n,r,o,c,l,u){var h=void 0;if(!isNaN(parseFloat(o))&&isFinite(o)?h=e.ANIMATIONTYPE_FLOAT:o instanceof a.b?h=e.ANIMATIONTYPE_QUATERNION:o instanceof a.e?h=e.ANIMATIONTYPE_VECTOR3:o instanceof a.d?h=e.ANIMATIONTYPE_VECTOR2:o instanceof s.a?h=e.ANIMATIONTYPE_COLOR3:o instanceof s.b?h=e.ANIMATIONTYPE_COLOR4:o instanceof U.a&&(h=e.ANIMATIONTYPE_SIZE),null==h)return null;var d=new e(t,i,n,h,l),f=[{frame:0,value:o},{frame:r,value:c}];return d.setKeys(f),void 0!==u&&d.setEasingFunction(u),d},e.CreateAnimation=function(t,i,n,r){var o=new e(t+"Animation",t,n,i,e.ANIMATIONLOOPMODE_CONSTANT);return o.setEasingFunction(r),o},e.CreateAndStartAnimation=function(t,i,n,r,o,a,s,c,l,u){var h=e._PrepareAnimation(t,n,r,o,a,s,c,l);return h?i.getScene().beginDirectAnimation(i,[h],0,o,1===h.loopMode,1,u):null},e.CreateAndStartHierarchyAnimation=function(t,i,n,r,o,a,s,c,l,u,h){var d=e._PrepareAnimation(t,r,o,a,s,c,l,u);return d?i.getScene().beginDirectHierarchyAnimation(i,n,[d],0,a,1===d.loopMode,1,h):null},e.CreateMergeAndStartAnimation=function(t,i,n,r,o,a,s,c,l,u){var h=e._PrepareAnimation(t,n,r,o,a,s,c,l);return h?(i.animations.push(h),i.getScene().beginAnimation(i,0,o,1===h.loopMode,1,u)):null},e.MakeAnimationAdditive=function(t,i,n,r,o){void 0===i&&(i=0),void 0===r&&(r=!1);var s=t;if(r&&((s=t.clone()).name=o||s.name),!s._keys.length)return s;i=i>=0?i:0;var c=0,l=s._keys[0],u=s._keys.length-1,h=s._keys[u],d={referenceValue:l.value,referencePosition:a.c.Vector3[0],referenceQuaternion:a.c.Quaternion[0],referenceScaling:a.c.Vector3[1],keyPosition:a.c.Vector3[2],keyQuaternion:a.c.Quaternion[1],keyScaling:a.c.Vector3[3]},f=!1,p=l.frame,_=h.frame;if(n){var m=s.getRange(n);m&&(p=m.from,_=m.to)}var g=l.frame===p,v=h.frame===_;if(1===s._keys.length){var b=s._getKeyValue(s._keys[0]);d.referenceValue=b.clone?b.clone():b,f=!0}else i<=l.frame?(b=s._getKeyValue(l.value),d.referenceValue=b.clone?b.clone():b,f=!0):i>=h.frame&&(b=s._getKeyValue(h.value),d.referenceValue=b.clone?b.clone():b,f=!0);for(var y=0;!f||!g||!v&&y<s._keys.length-1;){var T=s._keys[y],E=s._keys[y+1];if(!f&&i>=T.frame&&i<=E.frame){if(b=void 0,i===T.frame)b=s._getKeyValue(T.value);else if(i===E.frame)b=s._getKeyValue(E.value);else{var S={key:y,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};b=s._interpolate(i,S)}d.referenceValue=b.clone?b.clone():b,f=!0}if(!g&&p>=T.frame&&p<=E.frame){if(p===T.frame)c=y;else if(p===E.frame)c=y+1;else{S={key:y,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};var A={frame:p,value:(b=s._interpolate(p,S)).clone?b.clone():b};s._keys.splice(y+1,0,A),c=y+1}g=!0}!v&&_>=T.frame&&_<=E.frame&&(_===T.frame?u=y:_===E.frame?u=y+1:(S={key:y,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},A={frame:_,value:(b=s._interpolate(_,S)).clone?b.clone():b},s._keys.splice(y+1,0,A),u=y+1),v=!0),y++}for(s.dataType===e.ANIMATIONTYPE_QUATERNION?d.referenceValue.normalize().conjugateInPlace():s.dataType===e.ANIMATIONTYPE_MATRIX&&(d.referenceValue.decompose(d.referenceScaling,d.referenceQuaternion,d.referencePosition),d.referenceQuaternion.normalize().conjugateInPlace()),y=c;y<=u;y++)if(A=s._keys[y],!y||s.dataType===e.ANIMATIONTYPE_FLOAT||A.value!==l.value)switch(s.dataType){case e.ANIMATIONTYPE_MATRIX:A.value.decompose(d.keyScaling,d.keyQuaternion,d.keyPosition),d.keyPosition.subtractInPlace(d.referencePosition),d.keyScaling.divideInPlace(d.referenceScaling),d.referenceQuaternion.multiplyToRef(d.keyQuaternion,d.keyQuaternion),a.a.ComposeToRef(d.keyScaling,d.keyQuaternion,d.keyPosition,A.value);break;case e.ANIMATIONTYPE_QUATERNION:d.referenceValue.multiplyToRef(A.value,A.value);break;case e.ANIMATIONTYPE_VECTOR2:case e.ANIMATIONTYPE_VECTOR3:case e.ANIMATIONTYPE_COLOR3:case e.ANIMATIONTYPE_COLOR4:A.value.subtractToRef(d.referenceValue,A.value);break;case e.ANIMATIONTYPE_SIZE:A.value.width-=d.referenceValue.width,A.value.height-=d.referenceValue.height;break;default:A.value-=d.referenceValue}return s},e.TransitionTo=function(e,t,i,n,r,o,a,s){if(void 0===s&&(s=null),a<=0)return i[e]=t,s&&s(),null;var c=r*(a/1e3);o.setKeys([{frame:0,value:i[e].clone?i[e].clone():i[e]},{frame:c,value:t}]),i.animations||(i.animations=[]),i.animations.push(o);var l=n.beginAnimation(i,0,c,!1);return l.onAnimationEnd=s,l},Object.defineProperty(e.prototype,"runtimeAnimations",{get:function(){return this._runtimeAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRunningRuntimeAnimations",{get:function(){for(var e=0,t=this._runtimeAnimations;e<t.length;e++)if(!t[e].isStopped)return!0;return!1},enumerable:!1,configurable:!0}),e.prototype.toString=function(e){var t="Name: "+this.name+", property: "+this.targetProperty;if(t+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],t+=", nKeys: "+(this._keys?this._keys.length:"none"),t+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var i=!0;for(var n in this._ranges)i&&(t+=", ",i=!1),t+=n;t+="}"}return t},e.prototype.addEvent=function(e){this._events.push(e),this._events.sort(function(e,t){return e.frame-t.frame})},e.prototype.removeEvents=function(e){for(var t=0;t<this._events.length;t++)this._events[t].frame===e&&(this._events.splice(t,1),t--)},e.prototype.getEvents=function(){return this._events},e.prototype.createRange=function(e,t,i){this._ranges[e]||(this._ranges[e]=new F(e,t,i))},e.prototype.deleteRange=function(e,t){void 0===t&&(t=!0);var i=this._ranges[e];if(i){if(t)for(var n=i.from,r=i.to,o=this._keys.length-1;o>=0;o--)this._keys[o].frame>=n&&this._keys[o].frame<=r&&this._keys.splice(o,1);this._ranges[e]=null}},e.prototype.getRange=function(e){return this._ranges[e]},e.prototype.getKeys=function(){return this._keys},e.prototype.getHighestFrame=function(){for(var e=0,t=0,i=this._keys.length;t<i;t++)e<this._keys[t].frame&&(e=this._keys[t].frame);return e},e.prototype.getEasingFunction=function(){return this._easingFunction},e.prototype.setEasingFunction=function(e){this._easingFunction=e},e.prototype.floatInterpolateFunction=function(e,t,i){return L.a.Lerp(e,t,i)},e.prototype.floatInterpolateFunctionWithTangents=function(e,t,i,n,r){return L.a.Hermite(e,t,i,n,r)},e.prototype.quaternionInterpolateFunction=function(e,t,i){return a.b.Slerp(e,t,i)},e.prototype.quaternionInterpolateFunctionWithTangents=function(e,t,i,n,r){return a.b.Hermite(e,t,i,n,r).normalize()},e.prototype.vector3InterpolateFunction=function(e,t,i){return a.e.Lerp(e,t,i)},e.prototype.vector3InterpolateFunctionWithTangents=function(e,t,i,n,r){return a.e.Hermite(e,t,i,n,r)},e.prototype.vector2InterpolateFunction=function(e,t,i){return a.d.Lerp(e,t,i)},e.prototype.vector2InterpolateFunctionWithTangents=function(e,t,i,n,r){return a.d.Hermite(e,t,i,n,r)},e.prototype.sizeInterpolateFunction=function(e,t,i){return U.a.Lerp(e,t,i)},e.prototype.color3InterpolateFunction=function(e,t,i){return s.a.Lerp(e,t,i)},e.prototype.color4InterpolateFunction=function(e,t,i){return s.b.Lerp(e,t,i)},e.prototype._getKeyValue=function(e){return"function"==typeof e?e():e},e.prototype._interpolate=function(t,i){if(i.loopMode===e.ANIMATIONLOOPMODE_CONSTANT&&i.repeatCount>0)return i.highLimitValue.clone?i.highLimitValue.clone():i.highLimitValue;var n=this._keys;if(1===n.length)return this._getKeyValue(n[0].value);var r=i.key;if(n[r].frame>=t)for(;r-1>=0&&n[r].frame>=t;)r--;for(var o=r;o<n.length;o++){var a=n[o+1];if(a.frame>=t){i.key=o;var s=n[o],c=this._getKeyValue(s.value);if(s.interpolation===N.STEP)return c;var l=this._getKeyValue(a.value),u=void 0!==s.outTangent&&void 0!==a.inTangent,h=a.frame-s.frame,d=(t-s.frame)/h,f=this.getEasingFunction();switch(null!=f&&(d=f.ease(d)),this.dataType){case e.ANIMATIONTYPE_FLOAT:var p=u?this.floatInterpolateFunctionWithTangents(c,s.outTangent*h,l,a.inTangent*h,d):this.floatInterpolateFunction(c,l,d);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return p;case e.ANIMATIONLOOPMODE_RELATIVE:return i.offsetValue*i.repeatCount+p}break;case e.ANIMATIONTYPE_QUATERNION:var _=u?this.quaternionInterpolateFunctionWithTangents(c,s.outTangent.scale(h),l,a.inTangent.scale(h),d):this.quaternionInterpolateFunction(c,l,d);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return _;case e.ANIMATIONLOOPMODE_RELATIVE:return _.addInPlace(i.offsetValue.scale(i.repeatCount))}return _;case e.ANIMATIONTYPE_VECTOR3:var m=u?this.vector3InterpolateFunctionWithTangents(c,s.outTangent.scale(h),l,a.inTangent.scale(h),d):this.vector3InterpolateFunction(c,l,d);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return m;case e.ANIMATIONLOOPMODE_RELATIVE:return m.add(i.offsetValue.scale(i.repeatCount))}case e.ANIMATIONTYPE_VECTOR2:var g=u?this.vector2InterpolateFunctionWithTangents(c,s.outTangent.scale(h),l,a.inTangent.scale(h),d):this.vector2InterpolateFunction(c,l,d);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return g;case e.ANIMATIONLOOPMODE_RELATIVE:return g.add(i.offsetValue.scale(i.repeatCount))}case e.ANIMATIONTYPE_SIZE:switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(c,l,d);case e.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(c,l,d).add(i.offsetValue.scale(i.repeatCount))}case e.ANIMATIONTYPE_COLOR3:switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(c,l,d);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(c,l,d).add(i.offsetValue.scale(i.repeatCount))}case e.ANIMATIONTYPE_COLOR4:switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color4InterpolateFunction(c,l,d);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color4InterpolateFunction(c,l,d).add(i.offsetValue.scale(i.repeatCount))}case e.ANIMATIONTYPE_MATRIX:switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:if(e.AllowMatricesInterpolation)return this.matrixInterpolateFunction(c,l,d,i.workValue);case e.ANIMATIONLOOPMODE_RELATIVE:return c}}break}}return this._getKeyValue(n[n.length-1].value)},e.prototype.matrixInterpolateFunction=function(t,i,n,r){return e.AllowMatrixDecomposeForInterpolation?r?(a.a.DecomposeLerpToRef(t,i,n,r),r):a.a.DecomposeLerp(t,i,n):r?(a.a.LerpToRef(t,i,n,r),r):a.a.Lerp(t,i,n)},e.prototype.clone=function(){var t=new e(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,this._keys&&t.setKeys(this._keys),this._ranges)for(var i in t._ranges={},this._ranges){var n=this._ranges[i];n&&(t._ranges[i]=n.clone())}return t},e.prototype.setKeys=function(e){this._keys=e.slice(0)},e.prototype.serialize=function(){var t={};t.name=this.name,t.property=this.targetProperty,t.framePerSecond=this.framePerSecond,t.dataType=this.dataType,t.loopBehavior=this.loopMode,t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed;var i=this.dataType;t.keys=[];for(var n=this.getKeys(),r=0;r<n.length;r++){var o=n[r],a={};switch(a.frame=o.frame,i){case e.ANIMATIONTYPE_FLOAT:a.values=[o.value],void 0!==o.inTangent&&a.values.push(o.inTangent),void 0!==o.outTangent&&(void 0===o.inTangent&&a.values.push(void 0),a.values.push(o.outTangent));break;case e.ANIMATIONTYPE_QUATERNION:case e.ANIMATIONTYPE_MATRIX:case e.ANIMATIONTYPE_VECTOR3:case e.ANIMATIONTYPE_COLOR3:case e.ANIMATIONTYPE_COLOR4:a.values=o.value.asArray(),null!=o.inTangent&&a.values.push(o.inTangent.asArray()),null!=o.outTangent&&(void 0===o.inTangent&&a.values.push(void 0),a.values.push(o.outTangent.asArray()))}t.keys.push(a)}for(var s in t.ranges=[],this._ranges){var c=this._ranges[s];if(c){var l={};l.name=s,l.from=c.from,l.to=c.to,t.ranges.push(l)}}return t},e._UniversalLerp=function(e,t,i){var n=e.constructor;return n.Lerp?n.Lerp(e,t,i):n.Slerp?n.Slerp(e,t,i):e.toFixed?e*(1-i)+i*t:t},e.Parse=function(t){var i,n,r=new e(t.name,t.property,t.framePerSecond,t.dataType,t.loopBehavior),o=t.dataType,c=[];for(t.enableBlending&&(r.enableBlending=t.enableBlending),t.blendingSpeed&&(r.blendingSpeed=t.blendingSpeed),n=0;n<t.keys.length;n++){var l,u,h=t.keys[n];switch(o){case e.ANIMATIONTYPE_FLOAT:i=h.values[0],h.values.length>=1&&(l=h.values[1]),h.values.length>=2&&(u=h.values[2]);break;case e.ANIMATIONTYPE_QUATERNION:if(i=a.b.FromArray(h.values),h.values.length>=8){var d=a.b.FromArray(h.values.slice(4,8));d.equals(a.b.Zero())||(l=d)}if(h.values.length>=12){var f=a.b.FromArray(h.values.slice(8,12));f.equals(a.b.Zero())||(u=f)}break;case e.ANIMATIONTYPE_MATRIX:i=a.a.FromArray(h.values);break;case e.ANIMATIONTYPE_COLOR3:i=s.a.FromArray(h.values);break;case e.ANIMATIONTYPE_COLOR4:i=s.b.FromArray(h.values);break;case e.ANIMATIONTYPE_VECTOR3:default:i=a.e.FromArray(h.values)}var p={};p.frame=h.frame,p.value=i,null!=l&&(p.inTangent=l),null!=u&&(p.outTangent=u),c.push(p)}if(r.setKeys(c),t.ranges)for(n=0;n<t.ranges.length;n++)i=t.ranges[n],r.createRange(i.name,i.from,i.to);return r},e.AppendSerializedAnimations=function(e,t){w.a.AppendSerializedAnimations(e,t)},e.ParseFromFileAsync=function(e,t){var i=this;return new Promise(function(n,r){var o=new V.a;o.addEventListener("readystatechange",function(){if(4==o.readyState)if(200==o.status){var t=JSON.parse(o.responseText);if(t.length){for(var a=new Array,s=0,c=t;s<c.length;s++){var l=c[s];a.push(i.Parse(l))}n(a)}else a=i.Parse(t),e&&(a.name=e),n(a)}else r("Unable to load the animation")}),o.open("GET",t),o.send()})},e.CreateFromSnippetAsync=function(e){var t=this;return new Promise(function(i,n){var r=new V.a;r.addEventListener("readystatechange",function(){if(4==r.readyState)if(200==r.status){var o=JSON.parse(JSON.parse(r.responseText).jsonPayload);if(o.animations){for(var a=JSON.parse(o.animations),s=new Array,c=0,l=a;c<l.length;c++){var u=l[c];s.push(t.Parse(u))}i(s)}else a=JSON.parse(o.animation),(s=t.Parse(a)).snippetId=e,i(s)}else n("Unable to load the snippet "+e)}),r.open("GET",t.SnippetUrl+"/"+e.replace(/#/g,"/")),r.send()})},e.AllowMatricesInterpolation=!1,e.AllowMatrixDecomposeForInterpolation=!0,e.SnippetUrl="https://snippet.babylonjs.com",e.ANIMATIONTYPE_FLOAT=0,e.ANIMATIONTYPE_VECTOR3=1,e.ANIMATIONTYPE_QUATERNION=2,e.ANIMATIONTYPE_MATRIX=3,e.ANIMATIONTYPE_COLOR3=4,e.ANIMATIONTYPE_COLOR4=7,e.ANIMATIONTYPE_VECTOR2=5,e.ANIMATIONTYPE_SIZE=6,e.ANIMATIONLOOPMODE_RELATIVE=0,e.ANIMATIONLOOPMODE_CYCLE=1,e.ANIMATIONLOOPMODE_CONSTANT=2,e}();c.a.RegisteredTypes["BABYLON.Animation"]=G,B.a._AnimationRangeFactory=function(e,t,i){return new F(e,t,i)};var z=function(e){function t(t,i,n,r,a,s,c,l){void 0===a&&(a=1e3);var u=e.call(this,t,s)||this;return u.duration=1e3,u.onInterpolationDoneObservable=new o.c,u.propertyPath=n,u.value=r,u.duration=a,u.stopOtherAnimations=c,u.onInterpolationDone=l,u._target=u._effectiveTarget=i,u}return Object(h.d)(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)},t.prototype.execute=function(){var e,t=this,i=this._actionManager.getScene(),n=[{frame:0,value:this._effectiveTarget[this._property]},{frame:100,value:this.value}];if("number"==typeof this.value)e=G.ANIMATIONTYPE_FLOAT;else if(this.value instanceof s.a)e=G.ANIMATIONTYPE_COLOR3;else if(this.value instanceof a.e)e=G.ANIMATIONTYPE_VECTOR3;else if(this.value instanceof a.a)e=G.ANIMATIONTYPE_MATRIX;else{if(!(this.value instanceof a.b))return void m.a.Warn("InterpolateValueAction: Unsupported type ("+typeof this.value+")");e=G.ANIMATIONTYPE_QUATERNION}var r=new G("InterpolateValueAction",this._property,1e3/this.duration*100,e,G.ANIMATIONLOOPMODE_CONSTANT);r.setKeys(n),this.stopOtherAnimations&&i.stopAnimation(this._effectiveTarget),i.beginDirectAnimation(this._effectiveTarget,[r],0,100,!1,1,function(){t.onInterpolationDoneObservable.notifyObservers(t),t.onInterpolationDone&&t.onInterpolationDone()})},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"InterpolateValueAction",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:l._SerializeValueAsString(this.value)},{name:"duration",value:l._SerializeValueAsString(this.duration)},{name:"stopOtherAnimations",value:l._SerializeValueAsString(this.stopOtherAnimations)||!1}]},t)},t}(l);c.a.RegisteredTypes["BABYLON.InterpolateValueAction"]=z;var j=Object.freeze(new a.b(0,0,0,0)),W=Object.freeze(a.e.Zero()),H=Object.freeze(a.d.Zero()),X=Object.freeze(U.a.Zero()),Y=Object.freeze(s.a.Black()),K=function(){function e(e,t,i,n){var r=this;if(this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._ratioOffset=0,this._previousDelay=0,this._previousRatio=0,this._targetIsArray=!1,this._animation=t,this._target=e,this._scene=i,this._host=n,this._activeTargets=[],t._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===G.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=a.a.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,this._minValue=this._keys[0].value,this._maxValue=this._keys[this._keys.length-1].value,0!==this._minFrame){var o={frame:0,value:this._minValue};this._keys.splice(0,0,o)}if(this._target instanceof Array){for(var s=0,c=0,l=this._target;c<l.length;c++){var u=l[c];this._preparePath(u,s),this._getOriginalValues(s),s++}this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];var h=t.getEvents();h&&h.length>0&&h.forEach(function(e){r._events.push(e._clone())}),this._enableBlending=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending}return Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._currentActiveTarget},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAdditive",{get:function(){return this._host&&this._host.isAdditive},enumerable:!1,configurable:!0}),e.prototype._preparePath=function(e,t){void 0===t&&(t=0);var i=this._animation.targetPropertyPath;if(i.length>1){for(var n=e[i[0]],r=1;r<i.length-1;r++)n=n[i[r]];this._targetPath=i[i.length-1],this._activeTargets[t]=n}else this._targetPath=i[0],this._activeTargets[t]=e},Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!1,configurable:!0}),e.prototype.reset=function(e){if(void 0===e&&(e=!1),e)if(this._target instanceof Array)for(var t=0,i=0,n=this._target;i<n.length;i++){var r=n[i];void 0!==this._originalValue[t]&&this._setValue(r,this._activeTargets[t],this._originalValue[t],-1,t),t++}else void 0!==this._originalValue[0]&&this._setValue(this._target,this._directTarget,this._originalValue[0],-1,0);for(this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0,t=0;t<this._events.length;t++)this._events[t].isDone=!1},e.prototype.isStopped=function(){return this._stopped},e.prototype.dispose=function(){var e=this._animation.runtimeAnimations.indexOf(this);e>-1&&this._animation.runtimeAnimations.splice(e,1)},e.prototype.setValue=function(e,t){if(this._targetIsArray)for(var i=0;i<this._target.length;i++){var n=this._target[i];this._setValue(n,this._activeTargets[i],e,t,i)}else this._setValue(this._target,this._directTarget,e,t,0)},e.prototype._getOriginalValues=function(e){var t;void 0===e&&(e=0);var i=this._activeTargets[e];(t=i.getRestPose&&"_matrix"===this._targetPath?i.getRestPose():i[this._targetPath])&&t.clone?this._originalValue[e]=t.clone():this._originalValue[e]=t},e.prototype._setValue=function(e,t,i,n,r){if(this._currentActiveTarget=t,this._weight=n,this._enableBlending&&this._blendingFactor<=1){if(!this._originalBlendValue){var o=t[this._targetPath];o.clone?this._originalBlendValue=o.clone():this._originalBlendValue=o}this._originalBlendValue.m?G.AllowMatrixDecomposeForInterpolation?this._currentValue?a.a.DecomposeLerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=a.a.DecomposeLerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue?a.a.LerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=a.a.Lerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue=G._UniversalLerp(this._originalBlendValue,i,this._blendingFactor);var s=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=s}else this._currentValue=i;-1!==n?this._scene._registerTargetForLateAnimationBinding(this,this._originalValue[r]):t[this._targetPath]=this._currentValue,e.markAsDirty&&e.markAsDirty(this._animation.targetProperty)},e.prototype._getCorrectLoopMode=function(){return this._target&&this._target.animationPropertiesOverride?this._target.animationPropertiesOverride.loopMode:this._animation.loopMode},e.prototype.goToFrame=function(e){var t=this._animation.getKeys();e<t[0].frame?e=t[0].frame:e>t[t.length-1].frame&&(e=t[t.length-1].frame);var i=this._events;if(i.length)for(var n=0;n<i.length;n++)i[n].onlyOnce||(i[n].isDone=i[n].frame<e);this._currentFrame=e;var r=this._animation._interpolate(e,this._animationState);this.setValue(r,-1)},e.prototype._prepareForSpeedRatioChange=function(e){var t=this._previousDelay*(this._animation.framePerSecond*e)/1e3;this._ratioOffset=this._previousRatio-t},e.prototype.animate=function(e,t,i,n,r,o){void 0===o&&(o=-1);var a=this._animation,s=a.targetPropertyPath;if(!s||s.length<1)return this._stopped=!0,!1;var c=!0;(t<this._minFrame||t>this._maxFrame)&&(t=this._minFrame),(i<this._minFrame||i>this._maxFrame)&&(i=this._maxFrame);var l,u,h=i-t,d=e*(a.framePerSecond*r)/1e3+this._ratioOffset,f=0;if(this._previousDelay=e,this._previousRatio=d,!n&&i>=t&&d>=h)c=!1,f=a._getKeyValue(this._maxValue);else if(!n&&t>=i&&d<=h)c=!1,f=a._getKeyValue(this._minValue);else if(this._animationState.loopMode!==G.ANIMATIONLOOPMODE_CYCLE){var p=i.toString()+t.toString();if(!this._offsetsCache[p]){this._animationState.repeatCount=0,this._animationState.loopMode=G.ANIMATIONLOOPMODE_CYCLE;var _=a._interpolate(t,this._animationState),m=a._interpolate(i,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),a.dataType){case G.ANIMATIONTYPE_FLOAT:this._offsetsCache[p]=m-_;break;case G.ANIMATIONTYPE_QUATERNION:this._offsetsCache[p]=m.subtract(_);break;case G.ANIMATIONTYPE_VECTOR3:this._offsetsCache[p]=m.subtract(_);case G.ANIMATIONTYPE_VECTOR2:this._offsetsCache[p]=m.subtract(_);case G.ANIMATIONTYPE_SIZE:this._offsetsCache[p]=m.subtract(_);case G.ANIMATIONTYPE_COLOR3:this._offsetsCache[p]=m.subtract(_)}this._highLimitsCache[p]=m}f=this._highLimitsCache[p],l=this._offsetsCache[p]}if(void 0===l)switch(a.dataType){case G.ANIMATIONTYPE_FLOAT:l=0;break;case G.ANIMATIONTYPE_QUATERNION:l=j;break;case G.ANIMATIONTYPE_VECTOR3:l=W;break;case G.ANIMATIONTYPE_VECTOR2:l=H;break;case G.ANIMATIONTYPE_SIZE:l=X;break;case G.ANIMATIONTYPE_COLOR3:l=Y}if(this._host&&this._host.syncRoot){var g=this._host.syncRoot;u=t+(i-t)*((g.masterFrame-g.fromFrame)/(g.toFrame-g.fromFrame))}else u=c&&0!==h?t+d%h:i;var v=this._events;if((h>0&&this.currentFrame>u||h<0&&this.currentFrame<u)&&(this._onLoop(),v.length))for(var b=0;b<v.length;b++)v[b].onlyOnce||(v[b].isDone=!1);this._currentFrame=u,this._animationState.repeatCount=0===h?0:d/h>>0,this._animationState.highLimitValue=f,this._animationState.offsetValue=l;var y=a._interpolate(u,this._animationState);if(this.setValue(y,o),v.length)for(b=0;b<v.length;b++)if(h>0&&u>=v[b].frame&&v[b].frame>=t||h<0&&u<=v[b].frame&&v[b].frame<=t){var T=v[b];T.isDone||(T.onlyOnce&&(v.splice(b,1),b--),T.isDone=!0,T.action(u))}return c||(this._stopped=!0),c},e}(),Q=i(20),q=i(57),Z=i(44),J=i(23),$=function(e){function t(t,i,n,r,o,s,c){void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===c&&(c=null);var l=e.call(this,t,i.getScene())||this;return l.name=t,l.children=new Array,l.animations=new Array,l._index=null,l._absoluteTransform=new a.a,l._invertedAbsoluteTransform=new a.a,l._scalingDeterminant=1,l._worldTransform=new a.a,l._needToDecompose=!0,l._needToCompose=!1,l._linkedTransformNode=null,l._waitingTransformNodeId=null,l._skeleton=i,l._localMatrix=r?r.clone():a.a.Identity(),l._restPose=o||l._localMatrix.clone(),l._bindPose=l._localMatrix.clone(),l._baseMatrix=s||l._localMatrix.clone(),l._index=c,i.bones.push(l),l.setParent(n,!1),(s||r)&&l._updateDifferenceMatrix(),l}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"_matrix",{get:function(){return this._compose(),this._localMatrix},set:function(e){this._localMatrix.copyFrom(e),this._needToDecompose=!0},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"Bone"},t.prototype.getSkeleton=function(){return this._skeleton},t.prototype.getParent=function(){return this._parent},t.prototype.getChildren=function(){return this.children},t.prototype.getIndex=function(){return null===this._index?this.getSkeleton().bones.indexOf(this):this._index},t.prototype.setParent=function(e,t){if(void 0===t&&(t=!0),this._parent!==e){if(this._parent){var i=this._parent.children.indexOf(this);-1!==i&&this._parent.children.splice(i,1)}this._parent=e,this._parent&&this._parent.children.push(this),t&&this._updateDifferenceMatrix(),this.markAsDirty()}},t.prototype.getLocalMatrix=function(){return this._compose(),this._localMatrix},t.prototype.getBaseMatrix=function(){return this._baseMatrix},t.prototype.getRestPose=function(){return this._restPose},t.prototype.setRestPose=function(e){this._restPose.copyFrom(e)},t.prototype.getBindPose=function(){return this._bindPose},t.prototype.setBindPose=function(e){this._bindPose.copyFrom(e)},t.prototype.getWorldMatrix=function(){return this._worldTransform},t.prototype.returnToRest=function(){this._skeleton._numBonesWithLinkedTransformNode>0?this.updateMatrix(this._restPose,!1,!1):this.updateMatrix(this._restPose,!1,!0)},t.prototype.getInvertedAbsoluteTransform=function(){return this._invertedAbsoluteTransform},t.prototype.getAbsoluteTransform=function(){return this._absoluteTransform},t.prototype.linkTransformNode=function(e){this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode--,this._linkedTransformNode=e,this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode++},t.prototype.getTransformNode=function(){return this._linkedTransformNode},Object.defineProperty(t.prototype,"position",{get:function(){return this._decompose(),this._localPosition},set:function(e){this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this.getRotation()},set:function(e){this.setRotation(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._decompose(),this._localRotation},set:function(e){this.setRotationQuaternion(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this.getScale()},set:function(e){this.setScale(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._skeleton.animationPropertiesOverride},enumerable:!1,configurable:!0}),t.prototype._decompose=function(){this._needToDecompose&&(this._needToDecompose=!1,this._localScaling||(this._localScaling=a.e.Zero(),this._localRotation=a.b.Zero(),this._localPosition=a.e.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))},t.prototype._compose=function(){this._needToCompose&&(this._localScaling?(this._needToCompose=!1,a.a.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix)):this._needToCompose=!1)},t.prototype.updateMatrix=function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!0),this._baseMatrix.copyFrom(e),t&&this._updateDifferenceMatrix(),i?(this._needToCompose=!1,this._localMatrix.copyFrom(e),this._markAsDirtyAndDecompose()):this.markAsDirty()},t.prototype._updateDifferenceMatrix=function(e,t){if(void 0===t&&(t=!0),e||(e=this._baseMatrix),this._parent?e.multiplyToRef(this._parent._absoluteTransform,this._absoluteTransform):this._absoluteTransform.copyFrom(e),this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform),t)for(var i=0;i<this.children.length;i++)this.children[i]._updateDifferenceMatrix();this._scalingDeterminant=this._absoluteTransform.determinant()<0?-1:1},t.prototype.markAsDirty=function(){this._currentRenderId++,this._childUpdateId++,this._skeleton._markAsDirty()},t.prototype._markAsDirtyAndCompose=function(){this.markAsDirty(),this._needToCompose=!0},t.prototype._markAsDirtyAndDecompose=function(){this.markAsDirty(),this._needToDecompose=!0},t.prototype.translate=function(e,i,n){void 0===i&&(i=J.c.LOCAL);var r=this.getLocalMatrix();if(i==J.c.LOCAL)r.addAtIndex(12,e.x),r.addAtIndex(13,e.y),r.addAtIndex(14,e.z);else{var o=null;n&&(o=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var s=t._tmpMats[0],c=t._tmpVecs[0];this._parent?n&&o?(s.copyFrom(this._parent.getAbsoluteTransform()),s.multiplyToRef(o,s)):s.copyFrom(this._parent.getAbsoluteTransform()):a.a.IdentityToRef(s),s.setTranslationFromFloats(0,0,0),s.invert(),a.e.TransformCoordinatesToRef(e,s,c),r.addAtIndex(12,c.x),r.addAtIndex(13,c.y),r.addAtIndex(14,c.z)}this._markAsDirtyAndDecompose()},t.prototype.setPosition=function(e,i,n){void 0===i&&(i=J.c.LOCAL);var r=this.getLocalMatrix();if(i==J.c.LOCAL)r.setTranslationFromFloats(e.x,e.y,e.z);else{var o=null;n&&(o=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var s=t._tmpMats[0],c=t._tmpVecs[0];this._parent?(n&&o?(s.copyFrom(this._parent.getAbsoluteTransform()),s.multiplyToRef(o,s)):s.copyFrom(this._parent.getAbsoluteTransform()),s.invert()):a.a.IdentityToRef(s),a.e.TransformCoordinatesToRef(e,s,c),r.setTranslationFromFloats(c.x,c.y,c.z)}this._markAsDirtyAndDecompose()},t.prototype.setAbsolutePosition=function(e,t){this.setPosition(e,J.c.WORLD,t)},t.prototype.scale=function(e,i,n,r){void 0===r&&(r=!1);var o=this.getLocalMatrix(),s=t._tmpMats[0];a.a.ScalingToRef(e,i,n,s),s.multiplyToRef(o,o),s.invert();for(var c=0,l=this.children;c<l.length;c++){var u=(f=l[c]).getLocalMatrix();u.multiplyToRef(s,u),u.multiplyAtIndex(12,e),u.multiplyAtIndex(13,i),u.multiplyAtIndex(14,n),f._markAsDirtyAndDecompose()}if(this._markAsDirtyAndDecompose(),r)for(var h=0,d=this.children;h<d.length;h++){var f;(f=d[h]).scale(e,i,n,r)}},t.prototype.setScale=function(e){this._decompose(),this._localScaling.copyFrom(e),this._markAsDirtyAndCompose()},t.prototype.getScale=function(){return this._decompose(),this._localScaling},t.prototype.getScaleToRef=function(e){this._decompose(),e.copyFrom(this._localScaling)},t.prototype.setYawPitchRoll=function(e,i,n,r,o){if(void 0===r&&(r=J.c.LOCAL),r===J.c.LOCAL){var s=t._tmpQuat;return a.b.RotationYawPitchRollToRef(e,i,n,s),void this.setRotationQuaternion(s,r,o)}var c=t._tmpMats[0];if(this._getNegativeRotationToRef(c,o)){var l=t._tmpMats[1];a.a.RotationYawPitchRollToRef(e,i,n,l),c.multiplyToRef(l,l),this._rotateWithMatrix(l,r,o)}},t.prototype.rotate=function(e,i,n,r){void 0===n&&(n=J.c.LOCAL);var o=t._tmpMats[0];o.setTranslationFromFloats(0,0,0),a.a.RotationAxisToRef(e,i,o),this._rotateWithMatrix(o,n,r)},t.prototype.setAxisAngle=function(e,i,n,r){if(void 0===n&&(n=J.c.LOCAL),n===J.c.LOCAL){var o=t._tmpQuat;return a.b.RotationAxisToRef(e,i,o),void this.setRotationQuaternion(o,n,r)}var s=t._tmpMats[0];if(this._getNegativeRotationToRef(s,r)){var c=t._tmpMats[1];a.a.RotationAxisToRef(e,i,c),s.multiplyToRef(c,c),this._rotateWithMatrix(c,n,r)}},t.prototype.setRotation=function(e,t,i){void 0===t&&(t=J.c.LOCAL),this.setYawPitchRoll(e.y,e.x,e.z,t,i)},t.prototype.setRotationQuaternion=function(e,i,n){if(void 0===i&&(i=J.c.LOCAL),i===J.c.LOCAL)return this._decompose(),this._localRotation.copyFrom(e),void this._markAsDirtyAndCompose();var r=t._tmpMats[0];if(this._getNegativeRotationToRef(r,n)){var o=t._tmpMats[1];a.a.FromQuaternionToRef(e,o),r.multiplyToRef(o,o),this._rotateWithMatrix(o,i,n)}},t.prototype.setRotationMatrix=function(e,i,n){if(void 0===i&&(i=J.c.LOCAL),i===J.c.LOCAL){var r=t._tmpQuat;return a.b.FromRotationMatrixToRef(e,r),void this.setRotationQuaternion(r,i,n)}var o=t._tmpMats[0];if(this._getNegativeRotationToRef(o,n)){var s=t._tmpMats[1];s.copyFrom(e),o.multiplyToRef(e,s),this._rotateWithMatrix(s,i,n)}},t.prototype._rotateWithMatrix=function(e,i,n){void 0===i&&(i=J.c.LOCAL);var r=this.getLocalMatrix(),o=r.m[12],a=r.m[13],s=r.m[14],c=this.getParent(),l=t._tmpMats[3],u=t._tmpMats[4];c&&i==J.c.WORLD?(n?(l.copyFrom(n.getWorldMatrix()),c.getAbsoluteTransform().multiplyToRef(l,l)):l.copyFrom(c.getAbsoluteTransform()),u.copyFrom(l),u.invert(),r.multiplyToRef(l,r),r.multiplyToRef(e,r),r.multiplyToRef(u,r)):i==J.c.WORLD&&n?(l.copyFrom(n.getWorldMatrix()),u.copyFrom(l),u.invert(),r.multiplyToRef(l,r),r.multiplyToRef(e,r),r.multiplyToRef(u,r)):r.multiplyToRef(e,r),r.setTranslationFromFloats(o,a,s),this.computeAbsoluteTransforms(),this._markAsDirtyAndDecompose()},t.prototype._getNegativeRotationToRef=function(e,i){var n=t._tmpMats[2];return e.copyFrom(this.getAbsoluteTransform()),i&&(e.multiplyToRef(i.getWorldMatrix(),e),a.a.ScalingToRef(i.scaling.x,i.scaling.y,i.scaling.z,n)),e.invert(),!isNaN(e.m[0])&&(n.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyToRef(n,e),!0)},t.prototype.getPosition=function(e,t){void 0===e&&(e=J.c.LOCAL),void 0===t&&(t=null);var i=a.e.Zero();return this.getPositionToRef(e,t,i),i},t.prototype.getPositionToRef=function(e,i,n){if(void 0===e&&(e=J.c.LOCAL),e==J.c.LOCAL){var r=this.getLocalMatrix();n.x=r.m[12],n.y=r.m[13],n.z=r.m[14]}else{var o=null;i&&(o=i.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var a=t._tmpMats[0];i&&o?(a.copyFrom(this.getAbsoluteTransform()),a.multiplyToRef(o,a)):a=this.getAbsoluteTransform(),n.x=a.m[12],n.y=a.m[13],n.z=a.m[14]}},t.prototype.getAbsolutePosition=function(e){void 0===e&&(e=null);var t=a.e.Zero();return this.getPositionToRef(J.c.WORLD,e,t),t},t.prototype.getAbsolutePositionToRef=function(e,t){this.getPositionToRef(J.c.WORLD,e,t)},t.prototype.computeAbsoluteTransforms=function(){if(this._compose(),this._parent)this._localMatrix.multiplyToRef(this._parent._absoluteTransform,this._absoluteTransform);else{this._absoluteTransform.copyFrom(this._localMatrix);var e=this._skeleton.getPoseMatrix();e&&this._absoluteTransform.multiplyToRef(e,this._absoluteTransform)}for(var t=this.children,i=t.length,n=0;n<i;n++)t[n].computeAbsoluteTransforms()},t.prototype.getDirection=function(e,t){void 0===t&&(t=null);var i=a.e.Zero();return this.getDirectionToRef(e,t,i),i},t.prototype.getDirectionToRef=function(e,i,n){void 0===i&&(i=null);var r=null;i&&(r=i.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var o=t._tmpMats[0];o.copyFrom(this.getAbsoluteTransform()),i&&r&&o.multiplyToRef(r,o),a.e.TransformNormalToRef(e,o,n),n.normalize()},t.prototype.getRotation=function(e,t){void 0===e&&(e=J.c.LOCAL),void 0===t&&(t=null);var i=a.e.Zero();return this.getRotationToRef(e,t,i),i},t.prototype.getRotationToRef=function(e,i,n){void 0===e&&(e=J.c.LOCAL),void 0===i&&(i=null);var r=t._tmpQuat;this.getRotationQuaternionToRef(e,i,r),r.toEulerAnglesToRef(n)},t.prototype.getRotationQuaternion=function(e,t){void 0===e&&(e=J.c.LOCAL),void 0===t&&(t=null);var i=a.b.Identity();return this.getRotationQuaternionToRef(e,t,i),i},t.prototype.getRotationQuaternionToRef=function(e,i,n){if(void 0===e&&(e=J.c.LOCAL),void 0===i&&(i=null),e==J.c.LOCAL)this._decompose(),n.copyFrom(this._localRotation);else{var r=t._tmpMats[0],o=this.getAbsoluteTransform();i?o.multiplyToRef(i.getWorldMatrix(),r):r.copyFrom(o),r.multiplyAtIndex(0,this._scalingDeterminant),r.multiplyAtIndex(1,this._scalingDeterminant),r.multiplyAtIndex(2,this._scalingDeterminant),r.decompose(void 0,n,void 0)}},t.prototype.getRotationMatrix=function(e,t){void 0===e&&(e=J.c.LOCAL);var i=a.a.Identity();return this.getRotationMatrixToRef(e,t,i),i},t.prototype.getRotationMatrixToRef=function(e,i,n){if(void 0===e&&(e=J.c.LOCAL),e==J.c.LOCAL)this.getLocalMatrix().getRotationMatrixToRef(n);else{var r=t._tmpMats[0],o=this.getAbsoluteTransform();i?o.multiplyToRef(i.getWorldMatrix(),r):r.copyFrom(o),r.multiplyAtIndex(0,this._scalingDeterminant),r.multiplyAtIndex(1,this._scalingDeterminant),r.multiplyAtIndex(2,this._scalingDeterminant),r.getRotationMatrixToRef(n)}},t.prototype.getAbsolutePositionFromLocal=function(e,t){void 0===t&&(t=null);var i=a.e.Zero();return this.getAbsolutePositionFromLocalToRef(e,t,i),i},t.prototype.getAbsolutePositionFromLocalToRef=function(e,i,n){void 0===i&&(i=null);var r=null;i&&(r=i.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var o=t._tmpMats[0];i&&r?(o.copyFrom(this.getAbsoluteTransform()),o.multiplyToRef(r,o)):o=this.getAbsoluteTransform(),a.e.TransformCoordinatesToRef(e,o,n)},t.prototype.getLocalPositionFromAbsolute=function(e,t){void 0===t&&(t=null);var i=a.e.Zero();return this.getLocalPositionFromAbsoluteToRef(e,t,i),i},t.prototype.getLocalPositionFromAbsoluteToRef=function(e,i,n){void 0===i&&(i=null);var r=null;i&&(r=i.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var o=t._tmpMats[0];o.copyFrom(this.getAbsoluteTransform()),i&&r&&o.multiplyToRef(r,o),o.invert(),a.e.TransformCoordinatesToRef(e,o,n)},t.prototype.setCurrentPoseAsRest=function(){this.setRestPose(this.getLocalMatrix())},t._tmpVecs=Z.a.BuildArray(2,a.e.Zero),t._tmpQuat=a.b.Identity(),t._tmpMats=Z.a.BuildArray(5,a.a.Identity),t}(B.a),ee=function(){function e(e,t,i,n,r,a,s,c,l,u){void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=!1),void 0===a&&(a=1),void 0===u&&(u=!1),this.target=t,this.fromFrame=i,this.toFrame=n,this.loopAnimation=r,this.onAnimationEnd=s,this.onAnimationLoop=l,this.isAdditive=u,this._localDelayOffset=null,this._pausedDelay=null,this._runtimeAnimations=new Array,this._paused=!1,this._speedRatio=1,this._weight=-1,this._syncRoot=null,this.disposeOnEnd=!0,this.animationStarted=!1,this.onAnimationEndObservable=new o.c,this.onAnimationLoopObservable=new o.c,this._scene=e,c&&this.appendAnimations(t,c),this._speedRatio=a,e._activeAnimatables.push(this)}return Object.defineProperty(e.prototype,"syncRoot",{get:function(){return this._syncRoot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"masterFrame",{get:function(){return 0===this._runtimeAnimations.length?0:this._runtimeAnimations[0].currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},set:function(e){this._weight=-1!==e?Math.min(Math.max(e,0),1):-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._speedRatio},set:function(e){for(var t=0;t<this._runtimeAnimations.length;t++)this._runtimeAnimations[t]._prepareForSpeedRatioChange(e);this._speedRatio=e},enumerable:!1,configurable:!0}),e.prototype.syncWith=function(e){if(this._syncRoot=e,e){var t=this._scene._activeAnimatables.indexOf(this);t>-1&&(this._scene._activeAnimatables.splice(t,1),this._scene._activeAnimatables.push(this))}return this},e.prototype.getAnimations=function(){return this._runtimeAnimations},e.prototype.appendAnimations=function(e,t){for(var i=this,n=0;n<t.length;n++){var r=t[n],o=new K(e,r,this._scene,this);o._onLoop=function(){i.onAnimationLoopObservable.notifyObservers(i),i.onAnimationLoop&&i.onAnimationLoop()},this._runtimeAnimations.push(o)}},e.prototype.getAnimationByTargetProperty=function(e){for(var t=this._runtimeAnimations,i=0;i<t.length;i++)if(t[i].animation.targetProperty===e)return t[i].animation;return null},e.prototype.getRuntimeAnimationByTargetProperty=function(e){for(var t=this._runtimeAnimations,i=0;i<t.length;i++)if(t[i].animation.targetProperty===e)return t[i];return null},e.prototype.reset=function(){for(var e=this._runtimeAnimations,t=0;t<e.length;t++)e[t].reset(!0);this._localDelayOffset=null,this._pausedDelay=null},e.prototype.enableBlending=function(e){for(var t=this._runtimeAnimations,i=0;i<t.length;i++)t[i].animation.enableBlending=!0,t[i].animation.blendingSpeed=e},e.prototype.disableBlending=function(){for(var e=this._runtimeAnimations,t=0;t<e.length;t++)e[t].animation.enableBlending=!1},e.prototype.goToFrame=function(e){var t=this._runtimeAnimations;if(t[0]){var i=t[0].animation.framePerSecond,n=t[0].currentFrame,r=0===this.speedRatio?0:(e-n)/i*1e3/this.speedRatio;null===this._localDelayOffset&&(this._localDelayOffset=0),this._localDelayOffset-=r}for(var o=0;o<t.length;o++)t[o].goToFrame(e)},e.prototype.pause=function(){this._paused||(this._paused=!0)},e.prototype.restart=function(){this._paused=!1},e.prototype._raiseOnAnimationEnd=function(){this.onAnimationEnd&&this.onAnimationEnd(),this.onAnimationEndObservable.notifyObservers(this)},e.prototype.stop=function(e,t){if(e||t){var i=this._scene._activeAnimatables.indexOf(this);if(i>-1){for(var n=(o=this._runtimeAnimations).length-1;n>=0;n--){var r=o[n];e&&r.animation.name!=e||t&&!t(r.target)||(r.dispose(),o.splice(n,1))}0==o.length&&(this._scene._activeAnimatables.splice(i,1),this._raiseOnAnimationEnd())}}else if((n=this._scene._activeAnimatables.indexOf(this))>-1){this._scene._activeAnimatables.splice(n,1);var o=this._runtimeAnimations;for(n=0;n<o.length;n++)o[n].dispose();this._raiseOnAnimationEnd()}},e.prototype.waitAsync=function(){var e=this;return new Promise(function(t,i){e.onAnimationEndObservable.add(function(){t(e)},void 0,void 0,e,!0)})},e.prototype._animate=function(e){if(this._paused)return this.animationStarted=!1,null===this._pausedDelay&&(this._pausedDelay=e),!0;if(null===this._localDelayOffset?(this._localDelayOffset=e,this._pausedDelay=null):null!==this._pausedDelay&&(this._localDelayOffset+=e-this._pausedDelay,this._pausedDelay=null),0===this._weight)return!0;var t,i=!1,n=this._runtimeAnimations;for(t=0;t<n.length;t++){var r=n[t].animate(e-this._localDelayOffset,this.fromFrame,this.toFrame,this.loopAnimation,this._speedRatio,this._weight);i=i||r}if(this.animationStarted=i,!i){if(this.disposeOnEnd)for(t=this._scene._activeAnimatables.indexOf(this),this._scene._activeAnimatables.splice(t,1),t=0;t<n.length;t++)n[t].dispose();this._raiseOnAnimationEnd(),this.disposeOnEnd&&(this.onAnimationEnd=null,this.onAnimationLoop=null,this.onAnimationLoopObservable.clear(),this.onAnimationEndObservable.clear())}return i},e}();Q.a.prototype._animate=function(){if(this.animationsEnabled){var e=q.a.Now;if(!this._animationTimeLast){if(this._pendingData.length>0)return;this._animationTimeLast=e}this.deltaTime=this.useConstantAnimationDeltaTime?16:(e-this._animationTimeLast)*this.animationTimeScale,this._animationTimeLast=e;var t=this._activeAnimatables;if(0!==t.length){this._animationTime+=this.deltaTime;for(var i=this._animationTime,n=0;n<t.length;n++){var r=t[n];!r._animate(i)&&r.disposeOnEnd&&n--}this._processLateAnimationBindings()}}},Q.a.prototype.beginWeightedAnimation=function(e,t,i,n,r,o,a,s,c,l,u){void 0===n&&(n=1),void 0===o&&(o=1),void 0===u&&(u=!1);var h=this.beginAnimation(e,t,i,r,o,a,s,!1,c,l,u);return h.weight=n,h},Q.a.prototype.beginAnimation=function(e,t,i,n,r,o,a,s,c,l,u){void 0===r&&(r=1),void 0===s&&(s=!0),void 0===u&&(u=!1),t>i&&r>0&&(r*=-1),s&&this.stopAnimation(e,void 0,c),a||(a=new ee(this,e,t,i,n,r,o,void 0,l,u));var h=!c||c(e);if(e.animations&&h&&a.appendAnimations(e,e.animations),e.getAnimatables)for(var d=e.getAnimatables(),f=0;f<d.length;f++)this.beginAnimation(d[f],t,i,n,r,o,a,s,c,l);return a.reset(),a},Q.a.prototype.beginHierarchyAnimation=function(e,t,i,n,r,o,a,s,c,l,u,h){void 0===o&&(o=1),void 0===c&&(c=!0),void 0===h&&(h=!1);var d=e.getDescendants(t),f=[];f.push(this.beginAnimation(e,i,n,r,o,a,s,c,l,void 0,h));for(var p=0,_=d;p<_.length;p++){var m=_[p];f.push(this.beginAnimation(m,i,n,r,o,a,s,c,l,void 0,h))}return f},Q.a.prototype.beginDirectAnimation=function(e,t,i,n,r,o,a,s,c){return void 0===c&&(c=!1),void 0===o&&(o=1),i>n&&o>0&&(o*=-1),new ee(this,e,i,n,r,o,a,t,s,c)},Q.a.prototype.beginDirectHierarchyAnimation=function(e,t,i,n,r,o,a,s,c,l){void 0===l&&(l=!1);var u=e.getDescendants(t),h=[];h.push(this.beginDirectAnimation(e,i,n,r,o,a,s,c,l));for(var d=0,f=u;d<f.length;d++){var p=f[d];h.push(this.beginDirectAnimation(p,i,n,r,o,a,s,c,l))}return h},Q.a.prototype.getAnimatableByTarget=function(e){for(var t=0;t<this._activeAnimatables.length;t++)if(this._activeAnimatables[t].target===e)return this._activeAnimatables[t];return null},Q.a.prototype.getAllAnimatablesByTarget=function(e){for(var t=[],i=0;i<this._activeAnimatables.length;i++)this._activeAnimatables[i].target===e&&t.push(this._activeAnimatables[i]);return t},Q.a.prototype.stopAnimation=function(e,t,i){for(var n=0,r=this.getAllAnimatablesByTarget(e);n<r.length;n++)r[n].stop(t,i)},Q.a.prototype.stopAllAnimations=function(){if(this._activeAnimatables){for(var e=0;e<this._activeAnimatables.length;e++)this._activeAnimatables[e].stop();this._activeAnimatables=[]}for(var t=0,i=this.animationGroups;t<i.length;t++)i[t].stop()},Q.a.prototype._registerTargetForLateAnimationBinding=function(e,t){var i=e.target;this._registeredForLateAnimationBindings.pushNoDuplicate(i),i._lateAnimationHolders||(i._lateAnimationHolders={}),i._lateAnimationHolders[e.targetPath]||(i._lateAnimationHolders[e.targetPath]={totalWeight:0,totalAdditiveWeight:0,animations:[],additiveAnimations:[],originalValue:t}),e.isAdditive?(i._lateAnimationHolders[e.targetPath].additiveAnimations.push(e),i._lateAnimationHolders[e.targetPath].totalAdditiveWeight+=e.weight):(i._lateAnimationHolders[e.targetPath].animations.push(e),i._lateAnimationHolders[e.targetPath].totalWeight+=e.weight)},Q.a.prototype._processLateAnimationBindingsForMatrices=function(e){if(0===e.totalWeight&&0===e.totalAdditiveWeight)return e.originalValue;var t=1,i=a.c.Vector3[0],n=a.c.Vector3[1],r=a.c.Quaternion[0],o=0,s=e.animations[0],c=e.originalValue,l=1,u=!1;if(e.totalWeight<1)l=1-e.totalWeight,c.decompose(n,r,i);else{if(o=1,t=e.totalWeight,1==(l=s.weight/t)){if(!e.totalAdditiveWeight)return s.currentValue;u=!0}s.currentValue.decompose(n,r,i)}if(!u){n.scaleInPlace(l),i.scaleInPlace(l),r.scaleInPlace(l);for(var h=o;h<e.animations.length;h++)if(0!==(m=e.animations[h]).weight){l=m.weight/t;var d=a.c.Vector3[2],f=a.c.Vector3[3],p=a.c.Quaternion[1];m.currentValue.decompose(f,p,d),f.scaleAndAddToRef(l,n),p.scaleAndAddToRef(l,r),d.scaleAndAddToRef(l,i)}}for(var _=0;_<e.additiveAnimations.length;_++){var m;0!==(m=e.additiveAnimations[_]).weight&&(d=a.c.Vector3[2],f=a.c.Vector3[3],p=a.c.Quaternion[1],m.currentValue.decompose(f,p,d),f.multiplyToRef(n,f),a.e.LerpToRef(n,f,m.weight,n),r.multiplyToRef(p,p),a.b.SlerpToRef(r,p,m.weight,r),d.scaleAndAddToRef(m.weight,i))}var g=s?s._animationState.workValue:a.c.Matrix[0].clone();return a.a.ComposeToRef(n,r,i,g),g},Q.a.prototype._processLateAnimationBindingsForQuaternions=function(e,t){if(0===e.totalWeight&&0===e.totalAdditiveWeight)return t;var i=e.animations[0],n=e.originalValue,r=t;if(0===e.totalWeight&&e.totalAdditiveWeight>0)r.copyFrom(n);else if(1===e.animations.length){if(a.b.SlerpToRef(n,i.currentValue,Math.min(1,e.totalWeight),r),0===e.totalAdditiveWeight)return r}else if(e.animations.length>1){var o=1,s=void 0,c=void 0;if(e.totalWeight<1){var l=1-e.totalWeight;c=[],(s=[]).push(n),c.push(l)}else{if(2===e.animations.length&&(a.b.SlerpToRef(e.animations[0].currentValue,e.animations[1].currentValue,e.animations[1].weight/e.totalWeight,t),0===e.totalAdditiveWeight))return t;s=[],c=[],o=e.totalWeight}for(var u=0;u<e.animations.length;u++){var h=e.animations[u];s.push(h.currentValue),c.push(h.weight/o)}for(var d=0,f=0;f<s.length;)f?(d+=c[f],a.b.SlerpToRef(r,s[f],c[f]/d,r),f++):(a.b.SlerpToRef(s[f],s[f+1],c[f+1]/(c[f]+c[f+1]),t),r=t,d=c[f]+c[f+1],f+=2)}for(var p=0;p<e.additiveAnimations.length;p++)0!==(h=e.additiveAnimations[p]).weight&&(r.multiplyToRef(h.currentValue,a.c.Quaternion[0]),a.b.SlerpToRef(r,a.c.Quaternion[0],h.weight,r));return r},Q.a.prototype._processLateAnimationBindings=function(){if(this._registeredForLateAnimationBindings.length){for(var e=0;e<this._registeredForLateAnimationBindings.length;e++){var t=this._registeredForLateAnimationBindings.data[e];for(var i in t._lateAnimationHolders){var n=t._lateAnimationHolders[i],r=n.animations[0],o=n.originalValue,s=G.AllowMatrixDecomposeForInterpolation&&o.m,c=t[i];if(s)c=this._processLateAnimationBindingsForMatrices(n);else if(void 0!==o.w)c=this._processLateAnimationBindingsForQuaternions(n,c||a.b.Identity());else{var l=0,u=1;if(n.totalWeight<1)c=r&&o.scale?o.scale(1-n.totalWeight):r?o*(1-n.totalWeight):o.clone?o.clone():o;else if(r){u=n.totalWeight;var h=r.weight/u;c=1!==h?r.currentValue.scale?r.currentValue.scale(h):r.currentValue*h:r.currentValue,l=1}for(var d=l;d<n.animations.length;d++)(_=(p=n.animations[d]).weight/u)&&(p.currentValue.scaleAndAddToRef?p.currentValue.scaleAndAddToRef(_,c):c+=p.currentValue*_);for(var f=0;f<n.additiveAnimations.length;f++){var p,_;(_=(p=n.additiveAnimations[f]).weight)&&(p.currentValue.scaleAndAddToRef?p.currentValue.scaleAndAddToRef(_,c):c+=p.currentValue*_)}}t[i]=c}t._lateAnimationHolders={}}this._registeredForLateAnimationBindings.reset()}},$.prototype.copyAnimationRange=function(e,t,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=null),0===this.animations.length&&(this.animations.push(new G(this.name,"_matrix",e.animations[0].framePerSecond,G.ANIMATIONTYPE_MATRIX,0)),this.animations[0].setKeys([]));var o=e.animations[0].getRange(t);if(!o)return!1;for(var a,s,c,l=o.from,u=o.to,h=e.animations[0].getKeys(),d=e.length,f=e.getParent(),p=this.getParent(),_=n&&f&&d&&this.length&&d!==this.length,m=_&&p&&f?p.length/f.length:1,g=n&&!p&&r&&(1!==r.x||1!==r.y||1!==r.z),v=this.animations[0].getKeys(),b=0,y=h.length;b<y;b++)(a=h[b]).frame>=l&&a.frame<=u&&(n?(c=a.value.clone(),_?(s=c.getTranslation(),c.setTranslation(s.scaleInPlace(m))):g&&r?(s=c.getTranslation(),c.setTranslation(s.multiplyInPlace(r))):c=a.value):c=a.value,v.push({frame:a.frame+i,value:c}));return this.animations[0].createRange(t,l+i,u+i),!0};var te=function(){function e(){}return e.prototype.getClassName=function(){return"TargetedAnimation"},e.prototype.serialize=function(){var e={};return e.animation=this.animation.serialize(),e.targetId=this.target.id,e},e}(),ie=function(){function e(e,t){void 0===t&&(t=null),this.name=e,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this._loopAnimation=!1,this._isAdditive=!1,this.onAnimationEndObservable=new o.c,this.onAnimationLoopObservable=new o.c,this.onAnimationGroupLoopObservable=new o.c,this.onAnimationGroupEndObservable=new o.c,this.onAnimationGroupPauseObservable=new o.c,this.onAnimationGroupPlayObservable=new o.c,this._scene=t||x.a.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.addAnimationGroup(this)}return Object.defineProperty(e.prototype,"from",{get:function(){return this._from},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"to",{get:function(){return this._to},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStarted",{get:function(){return this._isStarted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this._isStarted&&!this._isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._speedRatio},set:function(e){if(this._speedRatio!==e){this._speedRatio=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].speedRatio=this._speedRatio}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loopAnimation",{get:function(){return this._loopAnimation},set:function(e){if(this._loopAnimation!==e){this._loopAnimation=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].loopAnimation=this._loopAnimation}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAdditive",{get:function(){return this._isAdditive},set:function(e){if(this._isAdditive!==e){this._isAdditive=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].isAdditive=this._isAdditive}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetedAnimations",{get:function(){return this._targetedAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animatables",{get:function(){return this._animatables},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._targetedAnimations},enumerable:!1,configurable:!0}),e.prototype.addTargetedAnimation=function(e,t){var i=new te;i.animation=e,i.target=t;var n=e.getKeys();return this._from>n[0].frame&&(this._from=n[0].frame),this._to<n[n.length-1].frame&&(this._to=n[n.length-1].frame),this._targetedAnimations.push(i),i},e.prototype.normalize=function(e,t){void 0===e&&(e=null),void 0===t&&(t=null),null==e&&(e=this._from),null==t&&(t=this._to);for(var i=0;i<this._targetedAnimations.length;i++){var n=this._targetedAnimations[i].animation.getKeys(),r=n[0],o=n[n.length-1];if(r.frame>e){var a={frame:e,value:r.value,inTangent:r.inTangent,outTangent:r.outTangent,interpolation:r.interpolation};n.splice(0,0,a)}o.frame<t&&(a={frame:t,value:o.value,inTangent:o.inTangent,outTangent:o.outTangent,interpolation:o.interpolation},n.push(a))}return this._from=e,this._to=t,this},e.prototype._processLoop=function(e,t,i){var n=this;e.onAnimationLoop=function(){n.onAnimationLoopObservable.notifyObservers(t),n._animationLoopFlags[i]||(n._animationLoopFlags[i]=!0,n._animationLoopCount++,n._animationLoopCount===n._targetedAnimations.length&&(n.onAnimationGroupLoopObservable.notifyObservers(n),n._animationLoopCount=0,n._animationLoopFlags=[]))}},e.prototype.start=function(e,t,i,n,r){var o=this;if(void 0===e&&(e=!1),void 0===t&&(t=1),this._isStarted||0===this._targetedAnimations.length)return this;this._loopAnimation=e,this._animationLoopCount=0,this._animationLoopFlags=[];for(var a=function(){var a=s._targetedAnimations[c],l=s._scene.beginDirectAnimation(a.target,[a.animation],void 0!==i?i:s._from,void 0!==n?n:s._to,e,t,void 0,void 0,void 0!==r?r:s._isAdditive);l.onAnimationEnd=function(){o.onAnimationEndObservable.notifyObservers(a),o._checkAnimationGroupEnded(l)},s._processLoop(l,a,c),s._animatables.push(l)},s=this,c=0;c<this._targetedAnimations.length;c++)a();if(this._speedRatio=t,void 0!==i&&void 0!==n)if(i<n&&this._speedRatio<0){var l=n;n=i,i=l}else i>n&&this._speedRatio>0&&(this._speedRatio=-t);return this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.pause=function(){if(!this._isStarted)return this;this._isPaused=!0;for(var e=0;e<this._animatables.length;e++)this._animatables[e].pause();return this.onAnimationGroupPauseObservable.notifyObservers(this),this},e.prototype.play=function(e){return this.isStarted&&this._animatables.length===this._targetedAnimations.length?(void 0!==e&&(this.loopAnimation=e),this.restart()):(this.stop(),this.start(e,this._speedRatio)),this._isPaused=!1,this},e.prototype.reset=function(){if(!this._isStarted)return this.play(),this.goToFrame(0),this.stop(),this;for(var e=0;e<this._animatables.length;e++)this._animatables[e].reset();return this},e.prototype.restart=function(){if(!this._isStarted)return this;for(var e=0;e<this._animatables.length;e++)this._animatables[e].restart();return this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.stop=function(){if(!this._isStarted)return this;for(var e=this._animatables.slice(),t=0;t<e.length;t++)e[t].stop();return this._isStarted=!1,this},e.prototype.setWeightForAllAnimatables=function(e){for(var t=0;t<this._animatables.length;t++)this._animatables[t].weight=e;return this},e.prototype.syncAllAnimationsWith=function(e){for(var t=0;t<this._animatables.length;t++)this._animatables[t].syncWith(e);return this},e.prototype.goToFrame=function(e){if(!this._isStarted)return this;for(var t=0;t<this._animatables.length;t++)this._animatables[t].goToFrame(e);return this},e.prototype.dispose=function(){this._targetedAnimations=[],this._animatables=[];var e=this._scene.animationGroups.indexOf(this);e>-1&&this._scene.animationGroups.splice(e,1),this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()},e.prototype._checkAnimationGroupEnded=function(e){var t=this._animatables.indexOf(e);t>-1&&this._animatables.splice(t,1),0===this._animatables.length&&(this._isStarted=!1,this.onAnimationGroupEndObservable.notifyObservers(this))},e.prototype.clone=function(t,i){for(var n=new e(t||this.name,this._scene),r=0,o=this._targetedAnimations;r<o.length;r++){var a=o[r];n.addTargetedAnimation(a.animation.clone(),i?i(a.target):a.target)}return n},e.prototype.serialize=function(){var e={};e.name=this.name,e.from=this.from,e.to=this.to,e.targetedAnimations=[];for(var t=0;t<this.targetedAnimations.length;t++){var i=this.targetedAnimations[t];e.targetedAnimations[t]=i.serialize()}return e},e.Parse=function(t,i){for(var n=new e(t.name,i),r=0;r<t.targetedAnimations.length;r++){var o=t.targetedAnimations[r],a=G.Parse(o.animation),s=o.targetId;if("influence"===o.animation.property){var c=i.getMorphTargetById(s);c&&n.addTargetedAnimation(a,c)}else{var l=i.getNodeByID(s);null!=l&&n.addTargetedAnimation(a,l)}}return null!==t.from&&null!==t.to&&n.normalize(t.from,t.to),n},e.MakeAnimationAdditive=function(e,t,i,n,r){void 0===t&&(t=0),void 0===n&&(n=!1);var o=e;n&&(o=e.clone(r||o.name));for(var a=o.targetedAnimations,s=0;s<a.length;s++){var c=a[s];G.MakeAnimationAdditive(c.animation,t,i)}return o.isAdditive=!0,o},e.prototype.getClassName=function(){return"AnimationGroup"},e.prototype.toString=function(e){var t="Name: "+this.name;return t+=", type: "+this.getClassName(),e&&(t+=", from: "+this._from,t+=", to: "+this._to,t+=", isStarted: "+this._isStarted,t+=", speedRatio: "+this._speedRatio,t+=", targetedAnimations length: "+this._targetedAnimations.length,t+=", animatables length: "+this._animatables),t},e}(),ne=function(){this.enableBlending=!1,this.blendingSpeed=.01,this.loopMode=G.ANIMATIONLOOPMODE_CYCLE},re=i(72),oe=function(){function e(){this._easingMode=e.EASINGMODE_EASEIN}return e.prototype.setEasingMode=function(e){var t=Math.min(Math.max(e,0),2);this._easingMode=t},e.prototype.getEasingMode=function(){return this._easingMode},e.prototype.easeInCore=function(e){throw new Error("You must implement this method")},e.prototype.ease=function(t){switch(this._easingMode){case e.EASINGMODE_EASEIN:return this.easeInCore(t);case e.EASINGMODE_EASEOUT:return 1-this.easeInCore(1-t)}return t>=.5?.5*(1-this.easeInCore(2*(1-t)))+.5:.5*this.easeInCore(2*t)},e.EASINGMODE_EASEIN=0,e.EASINGMODE_EASEOUT=1,e.EASINGMODE_EASEINOUT=2,e}(),ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){return e=Math.max(0,Math.min(1,e)),1-Math.sqrt(1-e*e)},t}(oe),se=function(e){function t(t){void 0===t&&(t=1);var i=e.call(this)||this;return i.amplitude=t,i}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.amplitude);return Math.pow(e,3)-e*t*Math.sin(3.141592653589793*e)},t}(oe),ce=function(e){function t(t,i){void 0===t&&(t=3),void 0===i&&(i=2);var n=e.call(this)||this;return n.bounces=t,n.bounciness=i,n}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.bounces),i=this.bounciness;i<=1&&(i=1.001);var n=Math.pow(i,t),r=1-i,o=(1-n)/r+.5*n,a=e*o,s=Math.log(-a*(1-i)+1)/Math.log(i),c=Math.floor(s),l=c+1,u=(1-Math.pow(i,c))/(r*o),h=.5*(u+(1-Math.pow(i,l))/(r*o)),d=e-h,f=h-u;return-Math.pow(1/i,t-c)/(f*f)*(d-f)*(d+f)},t}(oe),le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){return e*e*e},t}(oe),ue=function(e){function t(t,i){void 0===t&&(t=3),void 0===i&&(i=3);var n=e.call(this)||this;return n.oscillations=t,n.springiness=i,n}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.oscillations),i=Math.max(0,this.springiness);return(0==i?e:(Math.exp(i*e)-1)/(Math.exp(i)-1))*Math.sin((6.283185307179586*t+1.5707963267948966)*e)},t}(oe),he=function(e){function t(t){void 0===t&&(t=2);var i=e.call(this)||this;return i.exponent=t,i}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)},t}(oe),de=function(e){function t(t){void 0===t&&(t=2);var i=e.call(this)||this;return i.power=t,i}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.power);return Math.pow(e,t)},t}(oe),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){return e*e},t}(oe),pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){return e*e*e*e},t}(oe),_e=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){return e*e*e*e*e},t}(oe),me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){return 1-Math.sin(1.5707963267948966*(1-e))},t}(oe),ge=function(e){function t(t,i,n,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=1);var o=e.call(this)||this;return o.x1=t,o.y1=i,o.x2=n,o.y2=r,o}return Object(h.d)(t,e),t.prototype.easeInCore=function(e){return re.c.Interpolate(e,this.x1,this.y1,this.x2,this.y2)},t}(oe),ve=function(){function e(e,t,i){this.frame=e,this.action=t,this.onlyOnce=i,this.isDone=!1}return e.prototype._clone=function(){return new e(this.frame,this.action,this.onlyOnce)},e}(),be=i(7),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t}(n.a),Te=function(){this.rootNodes=[],this.skeletons=[],this.animationGroups=[]},Ee=function(e){function t(t){var i=e.call(this)||this;return i._wasAddedToScene=!1,i.scene=t,i.sounds=[],i.effectLayers=[],i.layers=[],i.lensFlareSystems=[],i.proceduralTextures=[],i.reflectionProbes=[],t.onDisposeObservable.add(function(){i._wasAddedToScene||i.dispose()}),i}return Object(h.d)(t,e),t.prototype.instantiateModelsToScene=function(e,t){var i=this;void 0===t&&(t=!1);var n={},r={},o=new Te,a=[],s=[],c={doNotInstantiate:!0},l=function(t,i){if(n[t.uniqueId]=i.uniqueId,r[i.uniqueId]=i,e&&(i.name=e(t.name)),i instanceof be.a){var o=i;if(o.morphTargetManager){var a=t.morphTargetManager;o.morphTargetManager=a.clone();for(var s=0;s<a.numTargets;s++){var c=a.getTarget(s),l=o.morphTargetManager.getTarget(s);n[c.uniqueId]=l.uniqueId,r[l.uniqueId]=l}}}};return this.transformNodes.forEach(function(e){if(!e.parent){var t=e.instantiateHierarchy(null,c,function(e,t){l(e,t)});t&&o.rootNodes.push(t)}}),this.meshes.forEach(function(a){if(!a.parent){var u=a.instantiateHierarchy(null,c,function(o,a){if(l(o,a),a.material){var c=a;if(c.material)if(t){var u=o.material;if(-1===s.indexOf(u)){var h=u.clone(e?e(u.name):"Clone of "+u.name);if(s.push(u),n[u.uniqueId]=h.uniqueId,r[h.uniqueId]=h,"MultiMaterial"===u.getClassName()){for(var d=u,f=0,p=d.subMaterials;f<p.length;f++){var _=p[f];_&&(h=_.clone(e?e(_.name):"Clone of "+_.name),s.push(_),n[_.uniqueId]=h.uniqueId,r[h.uniqueId]=h)}d.subMaterials=d.subMaterials.map(function(e){return e&&r[n[e.uniqueId]]})}}c.material=r[n[u.uniqueId]]}else"MultiMaterial"===c.material.getClassName()?-1===i.scene.multiMaterials.indexOf(c.material)&&i.scene.addMultiMaterial(c.material):-1===i.scene.materials.indexOf(c.material)&&i.scene.addMaterial(c.material)}});u&&o.rootNodes.push(u)}}),this.skeletons.forEach(function(t){var s=t.clone(e?e(t.name):"Clone of "+t.name);t.overrideMesh&&(s.overrideMesh=r[n[t.overrideMesh.uniqueId]]);for(var c=0,l=i.meshes;c<l.length;c++){var u=l[c];if(u.skeleton===t&&!u.isAnInstance){if(r[n[u.uniqueId]].skeleton=s,-1!==a.indexOf(s))continue;a.push(s);for(var h=0,d=s.bones;h<d.length;h++){var f=d[h];f._linkedTransformNode&&(f._linkedTransformNode=r[n[f._linkedTransformNode.uniqueId]])}}}o.skeletons.push(s)}),this.animationGroups.forEach(function(e){var t=e.clone(e.name,function(e){return r[n[e.uniqueId]]||e});o.animationGroups.push(t)}),o},t.prototype.addAllToScene=function(){var e=this;this._wasAddedToScene=!0,this.cameras.forEach(function(t){e.scene.addCamera(t)}),this.lights.forEach(function(t){e.scene.addLight(t)}),this.meshes.forEach(function(t){e.scene.addMesh(t)}),this.skeletons.forEach(function(t){e.scene.addSkeleton(t)}),this.animations.forEach(function(t){e.scene.addAnimation(t)}),this.animationGroups.forEach(function(t){e.scene.addAnimationGroup(t)}),this.multiMaterials.forEach(function(t){e.scene.addMultiMaterial(t)}),this.materials.forEach(function(t){e.scene.addMaterial(t)}),this.morphTargetManagers.forEach(function(t){e.scene.addMorphTargetManager(t)}),this.geometries.forEach(function(t){e.scene.addGeometry(t)}),this.transformNodes.forEach(function(t){e.scene.addTransformNode(t)}),this.actionManagers.forEach(function(t){e.scene.addActionManager(t)}),this.textures.forEach(function(t){e.scene.addTexture(t)}),this.reflectionProbes.forEach(function(t){e.scene.addReflectionProbe(t)}),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(var t=0,i=this.scene._serializableComponents;t<i.length;t++)i[t].addFromContainer(this)},t.prototype.removeAllFromScene=function(){var e=this;this._wasAddedToScene=!1,this.cameras.forEach(function(t){e.scene.removeCamera(t)}),this.lights.forEach(function(t){e.scene.removeLight(t)}),this.meshes.forEach(function(t){e.scene.removeMesh(t)}),this.skeletons.forEach(function(t){e.scene.removeSkeleton(t)}),this.animations.forEach(function(t){e.scene.removeAnimation(t)}),this.animationGroups.forEach(function(t){e.scene.removeAnimationGroup(t)}),this.multiMaterials.forEach(function(t){e.scene.removeMultiMaterial(t)}),this.materials.forEach(function(t){e.scene.removeMaterial(t)}),this.morphTargetManagers.forEach(function(t){e.scene.removeMorphTargetManager(t)}),this.geometries.forEach(function(t){e.scene.removeGeometry(t)}),this.transformNodes.forEach(function(t){e.scene.removeTransformNode(t)}),this.actionManagers.forEach(function(t){e.scene.removeActionManager(t)}),this.textures.forEach(function(t){e.scene.removeTexture(t)}),this.reflectionProbes.forEach(function(t){e.scene.removeReflectionProbe(t)}),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(var t=0,i=this.scene._serializableComponents;t<i.length;t++)i[t].removeFromContainer(this)},t.prototype.dispose=function(){this.cameras.forEach(function(e){e.dispose()}),this.cameras=[],this.lights.forEach(function(e){e.dispose()}),this.lights=[],this.meshes.forEach(function(e){e.dispose()}),this.meshes=[],this.skeletons.forEach(function(e){e.dispose()}),this.skeletons=[],this.animationGroups.forEach(function(e){e.dispose()}),this.animationGroups=[],this.multiMaterials.forEach(function(e){e.dispose()}),this.multiMaterials=[],this.materials.forEach(function(e){e.dispose()}),this.materials=[],this.geometries.forEach(function(e){e.dispose()}),this.geometries=[],this.transformNodes.forEach(function(e){e.dispose()}),this.transformNodes=[],this.actionManagers.forEach(function(e){e.dispose()}),this.actionManagers=[],this.textures.forEach(function(e){e.dispose()}),this.textures=[],this.reflectionProbes.forEach(function(e){e.dispose()}),this.reflectionProbes=[],this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(var e=0,t=this.scene._serializableComponents;e<t.length;e++)t[e].removeFromContainer(this,!0)},t.prototype._moveAssets=function(e,t,i){if(e)for(var n=0,r=e;n<r.length;n++){var o=r[n],a=!0;if(i)for(var s=0,c=i;s<c.length;s++)if(o===c[s]){a=!1;break}a&&t.push(o)}},t.prototype.moveAllFromScene=function(e){for(var t in this._wasAddedToScene=!1,void 0===e&&(e=new ye),this)this.hasOwnProperty(t)&&(this[t]=this[t]||("environmentTexture"===t?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.environmentTexture=this.scene.environmentTexture,this.removeAllFromScene()},t.prototype.createRootMesh=function(){var e=new be.a("assetContainerRootMesh",this.scene);return this.meshes.forEach(function(t){t.parent||e.addChild(t)}),this.meshes.unshift(e),e},t.prototype.mergeAnimationsTo=function(e,t,i){if(void 0===e&&(e=x.a.LastCreatedScene),void 0===i&&(i=null),!e)return m.a.Error("No scene available to merge animations to"),[];var n=i||function(t){var i=null,n=t.animations.length?t.animations[0].targetProperty:"",r=t.name.split(".").join("").split("_primitive")[0];switch(n){case"position":case"rotationQuaternion":i=e.getTransformNodeByName(t.name)||e.getTransformNodeByName(r);break;case"influence":i=e.getMorphTargetByName(t.name)||e.getMorphTargetByName(r);break;default:i=e.getNodeByName(t.name)||e.getNodeByName(r)}return i};this.getNodes().forEach(function(e){var t=n(e);if(null!==t){for(var i=function(e){for(var i=0,n=t.animations.filter(function(t){return t.targetProperty===e.targetProperty});i<n.length;i++){var r=n[i],o=t.animations.indexOf(r,0);o>-1&&t.animations.splice(o,1)}},r=0,o=e.animations;r<o.length;r++)i(o[r]);t.animations=t.animations.concat(e.animations)}});var r=new Array;return this.animationGroups.slice().forEach(function(e){r.push(e.clone(e.name,n)),e.animatables.forEach(function(e){e.stop()})}),t.forEach(function(t){var i=n(t.target);i&&(e.beginAnimation(i,t.fromFrame,t.toFrame,t.loopAnimation,t.speedRatio,t.onAnimationEnd?t.onAnimationEnd:void 0,void 0,!0,void 0,t.onAnimationLoop?t.onAnimationLoop:void 0),e.stopAnimation(t.target))}),r},t}(n.a),Se=i(13),Ae=function(){function e(e){this.SMOOTHING=.75,this.FFT_SIZE=512,this.BARGRAPHAMPLITUDE=256,this.DEBUGCANVASPOS={x:20,y:20},this.DEBUGCANVASSIZE={width:320,height:200},this._scene=e,this._audioEngine=Se.a.audioEngine,this._audioEngine.canUseWebAudio&&this._audioEngine.audioContext&&(this._webAudioAnalyser=this._audioEngine.audioContext.createAnalyser(),this._webAudioAnalyser.minDecibels=-140,this._webAudioAnalyser.maxDecibels=0,this._byteFreqs=new Uint8Array(this._webAudioAnalyser.frequencyBinCount),this._byteTime=new Uint8Array(this._webAudioAnalyser.frequencyBinCount),this._floatFreqs=new Float32Array(this._webAudioAnalyser.frequencyBinCount))}return e.prototype.getFrequencyBinCount=function(){return this._audioEngine.canUseWebAudio?this._webAudioAnalyser.frequencyBinCount:0},e.prototype.getByteFrequencyData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)),this._byteFreqs},e.prototype.getByteTimeDomainData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)),this._byteTime},e.prototype.getFloatFrequencyData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)),this._floatFreqs},e.prototype.drawDebugCanvas=function(){var e=this;if(this._audioEngine.canUseWebAudio&&(this._debugCanvas||(this._debugCanvas=document.createElement("canvas"),this._debugCanvas.width=this.DEBUGCANVASSIZE.width,this._debugCanvas.height=this.DEBUGCANVASSIZE.height,this._debugCanvas.style.position="absolute",this._debugCanvas.style.top=this.DEBUGCANVASPOS.y+"px",this._debugCanvas.style.left=this.DEBUGCANVASPOS.x+"px",this._debugCanvasContext=this._debugCanvas.getContext("2d"),document.body.appendChild(this._debugCanvas),this._registerFunc=function(){e.drawDebugCanvas()},this._scene.registerBeforeRender(this._registerFunc)),this._registerFunc&&this._debugCanvasContext)){var t=this.getByteFrequencyData();this._debugCanvasContext.fillStyle="rgb(0, 0, 0)",this._debugCanvasContext.fillRect(0,0,this.DEBUGCANVASSIZE.width,this.DEBUGCANVASSIZE.height);for(var i=0;i<this.getFrequencyBinCount();i++){var n=t[i]/this.BARGRAPHAMPLITUDE,r=this.DEBUGCANVASSIZE.height*n,o=this.DEBUGCANVASSIZE.height-r-1,a=this.DEBUGCANVASSIZE.width/this.getFrequencyBinCount(),s=i/this.getFrequencyBinCount()*360;this._debugCanvasContext.fillStyle="hsl("+s+", 100%, 50%)",this._debugCanvasContext.fillRect(i*a,o,a,r)}}},e.prototype.stopDebugCanvas=function(){this._debugCanvas&&(this._registerFunc&&(this._scene.unregisterBeforeRender(this._registerFunc),this._registerFunc=null),document.body.removeChild(this._debugCanvas),this._debugCanvas=null,this._debugCanvasContext=null)},e.prototype.connectAudioNodes=function(e,t){this._audioEngine.canUseWebAudio&&(e.connect(this._webAudioAnalyser),this._webAudioAnalyser.connect(t))},e.prototype.dispose=function(){this._audioEngine.canUseWebAudio&&this._webAudioAnalyser.disconnect()},e}();Se.a.AudioEngineFactory=function(e){return new Pe(e)};var Pe=function(){function e(e){var t=this;void 0===e&&(e=null),this._audioContext=null,this._audioContextInitialized=!1,this._muteButton=null,this.canUseWebAudio=!1,this.WarnedWebAudioUnsupported=!1,this.isMP3supported=!1,this.isOGGsupported=!1,this.unlocked=!0,this.useCustomUnlockedButton=!1,this.onAudioUnlockedObservable=new o.c,this.onAudioLockedObservable=new o.c,this._tryToRun=!1,this._onResize=function(){t._moveButtonToTopLeft()},void 0===window.AudioContext&&void 0===window.webkitAudioContext||(window.AudioContext=window.AudioContext||window.webkitAudioContext,this.canUseWebAudio=!0);var i=document.createElement("audio");this._hostElement=e;try{i&&i.canPlayType&&(i.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,"")||i.canPlayType("audio/mp3").replace(/^no$/,""))&&(this.isMP3supported=!0)}catch(e){}try{i&&i.canPlayType&&i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(this.isOGGsupported=!0)}catch(e){}}return Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._audioContextInitialized?this.unlocked||this._muteButton||this._displayMuteButton():this._initializeAudioContext(),this._audioContext},enumerable:!1,configurable:!0}),e.prototype.lock=function(){this._triggerSuspendedState()},e.prototype.unlock=function(){this._triggerRunningState()},e.prototype._resumeAudioContext=function(){var e;return void 0!==this._audioContext.resume&&(e=this._audioContext.resume()),e||Promise.resolve()},e.prototype._initializeAudioContext=function(){try{this.canUseWebAudio&&(this._audioContext=new AudioContext,this.masterGain=this._audioContext.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this._audioContext.destination),this._audioContextInitialized=!0,"running"===this._audioContext.state&&this._triggerRunningState())}catch(e){this.canUseWebAudio=!1,m.a.Error("Web Audio: "+e.message)}},e.prototype._triggerRunningState=function(){var e=this;this._tryToRun||(this._tryToRun=!0,this._resumeAudioContext().then(function(){e._tryToRun=!1,e._muteButton&&e._hideMuteButton(),e.unlocked=!0,e.onAudioUnlockedObservable.notifyObservers(e)}).catch(function(){e._tryToRun=!1,e.unlocked=!1}))},e.prototype._triggerSuspendedState=function(){this.unlocked=!1,this.onAudioLockedObservable.notifyObservers(this),this._displayMuteButton()},e.prototype._displayMuteButton=function(){var e=this;if(!this.useCustomUnlockedButton&&!this._muteButton){this._muteButton=document.createElement("BUTTON"),this._muteButton.className="babylonUnmuteIcon",this._muteButton.id="babylonUnmuteIconBtn",this._muteButton.title="Unmute";var t=".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E":"https://cdn.babylonjs.com/Assets/audio.png")+");  background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }",i=document.createElement("style");i.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(i),document.body.appendChild(this._muteButton),this._moveButtonToTopLeft(),this._muteButton.addEventListener("touchend",function(){e._triggerRunningState()},!0),this._muteButton.addEventListener("click",function(){e._triggerRunningState()},!0),window.addEventListener("resize",this._onResize)}},e.prototype._moveButtonToTopLeft=function(){this._hostElement&&this._muteButton&&(this._muteButton.style.top=this._hostElement.offsetTop+20+"px",this._muteButton.style.left=this._hostElement.offsetLeft+20+"px")},e.prototype._hideMuteButton=function(){this._muteButton&&(document.body.removeChild(this._muteButton),this._muteButton=null)},e.prototype.dispose=function(){this.canUseWebAudio&&this._audioContextInitialized&&(this._connectedAnalyser&&this._audioContext&&(this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser.dispose(),this.masterGain.disconnect(),this.masterGain.connect(this._audioContext.destination),this._connectedAnalyser=null),this.masterGain.gain.value=1),this.WarnedWebAudioUnsupported=!1,this._hideMuteButton(),window.removeEventListener("resize",this._onResize),this.onAudioUnlockedObservable.clear(),this.onAudioLockedObservable.clear()},e.prototype.getGlobalVolume=function(){return this.canUseWebAudio&&this._audioContextInitialized?this.masterGain.gain.value:-1},e.prototype.setGlobalVolume=function(e){this.canUseWebAudio&&this._audioContextInitialized&&(this.masterGain.gain.value=e)},e.prototype.connectToAnalyser=function(e){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this.canUseWebAudio&&this._audioContextInitialized&&this._audioContext&&(this._connectedAnalyser=e,this.masterGain.disconnect(),this._connectedAnalyser.connectAudioNodes(this.masterGain,this._audioContext.destination))},e}(),Ce=i(12),Re=i(21),xe=function(){function e(t,i,n,r,s){var c,l,u,h,d=this;if(void 0===r&&(r=null),this.autoplay=!1,this.loop=!1,this.useCustomAttenuation=!1,this.isPlaying=!1,this.isPaused=!1,this.spatialSound=!1,this.refDistance=1,this.rolloffFactor=1,this.maxDistance=100,this.distanceModel="linear",this.metadata=null,this.onEndedObservable=new o.c,this._panningModel="equalpower",this._playbackRate=1,this._streaming=!1,this._startTime=0,this._startOffset=0,this._position=a.e.Zero(),this._positionInEmitterSpace=!1,this._localDirection=new a.e(1,0,0),this._volume=1,this._isReadyToPlay=!1,this._isDirectional=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._coneOuterGain=0,this._isOutputConnected=!1,this._urlType="Unknown",this.name=t,this._scene=n,e._SceneComponentInitialization(n),this._readyToPlayCallback=r,this._customAttenuationFunction=function(e,t,i,n,r){return t<i?e*(1-t/i):0},s&&(this.autoplay=s.autoplay||!1,this.loop=s.loop||!1,void 0!==s.volume&&(this._volume=s.volume),this.spatialSound=null!==(c=s.spatialSound)&&void 0!==c&&c,this.maxDistance=null!==(l=s.maxDistance)&&void 0!==l?l:100,this.useCustomAttenuation=null!==(u=s.useCustomAttenuation)&&void 0!==u&&u,this.rolloffFactor=s.rolloffFactor||1,this.refDistance=s.refDistance||1,this.distanceModel=s.distanceModel||"linear",this._playbackRate=s.playbackRate||1,this._streaming=null!==(h=s.streaming)&&void 0!==h&&h,this._length=s.length,this._offset=s.offset),Se.a.audioEngine.canUseWebAudio&&Se.a.audioEngine.audioContext){this._soundGain=Se.a.audioEngine.audioContext.createGain(),this._soundGain.gain.value=this._volume,this._inputAudioNode=this._soundGain,this._outputAudioNode=this._soundGain,this.spatialSound&&this._createSpatialParameters(),this._scene.mainSoundTrack.addSound(this);var f=!0;if(i)try{"string"==typeof i?this._urlType="String":i instanceof ArrayBuffer?this._urlType="ArrayBuffer":i instanceof MediaStream?this._urlType="MediaStream":Array.isArray(i)&&(this._urlType="Array");var p=[],_=!1;switch(this._urlType){case"MediaStream":this._streaming=!0,this._isReadyToPlay=!0,this._streamingSource=Se.a.audioEngine.audioContext.createMediaStreamSource(i),this.autoplay&&this.play(0,this._offset,this._length),this._readyToPlayCallback&&this._readyToPlayCallback();break;case"ArrayBuffer":i.byteLength>0&&(_=!0,this._soundLoaded(i));break;case"String":p.push(i);case"Array":0===p.length&&(p=i);for(var g=0;g<p.length;g++){var v=p[g];if(_=s&&s.skipCodecCheck||-1!==v.indexOf(".mp3",v.length-4)&&Se.a.audioEngine.isMP3supported||-1!==v.indexOf(".ogg",v.length-4)&&Se.a.audioEngine.isOGGsupported||-1!==v.indexOf(".wav",v.length-4)||-1!==v.indexOf(".m4a",v.length-4)||-1!==v.indexOf("blob:")){this._streaming?(this._htmlAudioElement=new Audio(v),this._htmlAudioElement.controls=!1,this._htmlAudioElement.loop=this.loop,Ce.b.SetCorsBehavior(v,this._htmlAudioElement),this._htmlAudioElement.preload="auto",this._htmlAudioElement.addEventListener("canplaythrough",function(){d._isReadyToPlay=!0,d.autoplay&&d.play(0,d._offset,d._length),d._readyToPlayCallback&&d._readyToPlayCallback()}),document.body.appendChild(this._htmlAudioElement),this._htmlAudioElement.load()):this._scene._loadFile(v,function(e){d._soundLoaded(e)},void 0,!0,!0,function(e){e&&m.a.Error("XHR "+e.status+" error on: "+v+"."),m.a.Error("Sound creation aborted."),d._scene.mainSoundTrack.removeSound(d)});break}}break;default:f=!1}f?_||(this._isReadyToPlay=!0,this._readyToPlayCallback&&window.setTimeout(function(){d._readyToPlayCallback&&d._readyToPlayCallback()},1e3)):m.a.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.")}catch(e){m.a.Error("Unexpected error. Sound creation aborted."),this._scene.mainSoundTrack.removeSound(this)}}else this._scene.mainSoundTrack.addSound(this),Se.a.audioEngine.WarnedWebAudioUnsupported||(m.a.Error("Web Audio is not supported by your browser."),Se.a.audioEngine.WarnedWebAudioUnsupported=!0),this._readyToPlayCallback&&window.setTimeout(function(){d._readyToPlayCallback&&d._readyToPlayCallback()},1e3)}return Object.defineProperty(e.prototype,"currentTime",{get:function(){if(this._htmlAudioElement)return this._htmlAudioElement.currentTime;var e=this._startOffset;return this.isPlaying&&Se.a.audioEngine.audioContext&&(e+=Se.a.audioEngine.audioContext.currentTime-this._startTime),e},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){Se.a.audioEngine.canUseWebAudio&&(this.isPlaying&&this.stop(),this._isReadyToPlay=!1,-1===this.soundTrackId?this._scene.mainSoundTrack.removeSound(this):this._scene.soundTracks&&this._scene.soundTracks[this.soundTrackId].removeSound(this),this._soundGain&&(this._soundGain.disconnect(),this._soundGain=null),this._soundPanner&&(this._soundPanner.disconnect(),this._soundPanner=null),this._soundSource&&(this._soundSource.disconnect(),this._soundSource=null),this._audioBuffer=null,this._htmlAudioElement&&(this._htmlAudioElement.pause(),this._htmlAudioElement.src="",document.body.removeChild(this._htmlAudioElement)),this._streamingSource&&this._streamingSource.disconnect(),this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._connectedTransformNode=null))},e.prototype.isReady=function(){return this._isReadyToPlay},e.prototype._soundLoaded=function(e){var t=this;Se.a.audioEngine.audioContext&&Se.a.audioEngine.audioContext.decodeAudioData(e,function(e){t._audioBuffer=e,t._isReadyToPlay=!0,t.autoplay&&t.play(0,t._offset,t._length),t._readyToPlayCallback&&t._readyToPlayCallback()},function(e){m.a.Error("Error while decoding audio data for: "+t.name+" / Error: "+e)})},e.prototype.setAudioBuffer=function(e){Se.a.audioEngine.canUseWebAudio&&(this._audioBuffer=e,this._isReadyToPlay=!0)},e.prototype.updateOptions=function(e){var t,i,n,r,o,a,s,c,l;e&&(this.loop=null!==(t=e.loop)&&void 0!==t?t:this.loop,this.maxDistance=null!==(i=e.maxDistance)&&void 0!==i?i:this.maxDistance,this.useCustomAttenuation=null!==(n=e.useCustomAttenuation)&&void 0!==n?n:this.useCustomAttenuation,this.rolloffFactor=null!==(r=e.rolloffFactor)&&void 0!==r?r:this.rolloffFactor,this.refDistance=null!==(o=e.refDistance)&&void 0!==o?o:this.refDistance,this.distanceModel=null!==(a=e.distanceModel)&&void 0!==a?a:this.distanceModel,this._playbackRate=null!==(s=e.playbackRate)&&void 0!==s?s:this._playbackRate,this._length=null!==(c=e.length)&&void 0!==c?c:void 0,this._offset=null!==(l=e.offset)&&void 0!==l?l:void 0,this._updateSpatialParameters(),this.isPlaying&&(this._streaming&&this._htmlAudioElement?(this._htmlAudioElement.playbackRate=this._playbackRate,this._htmlAudioElement.loop!==this.loop&&(this._htmlAudioElement.loop=this.loop)):this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate,this._soundSource.loop!==this.loop&&(this._soundSource.loop=this.loop),void 0!==this._offset&&this._soundSource.loopStart!==this._offset&&(this._soundSource.loopStart=this._offset),void 0!==this._length&&this._length!==this._soundSource.loopEnd&&(this._soundSource.loopEnd=(0|this._offset)+this._length))))},e.prototype._createSpatialParameters=function(){Se.a.audioEngine.canUseWebAudio&&Se.a.audioEngine.audioContext&&(this._scene.headphone&&(this._panningModel="HRTF"),this._soundPanner=Se.a.audioEngine.audioContext.createPanner(),this._soundPanner&&this._outputAudioNode&&(this._updateSpatialParameters(),this._soundPanner.connect(this._outputAudioNode),this._inputAudioNode=this._soundPanner))},e.prototype._updateSpatialParameters=function(){this.spatialSound&&this._soundPanner&&(this.useCustomAttenuation?(this._soundPanner.distanceModel="linear",this._soundPanner.maxDistance=Number.MAX_VALUE,this._soundPanner.refDistance=1,this._soundPanner.rolloffFactor=1,this._soundPanner.panningModel=this._panningModel):(this._soundPanner.distanceModel=this.distanceModel,this._soundPanner.maxDistance=this.maxDistance,this._soundPanner.refDistance=this.refDistance,this._soundPanner.rolloffFactor=this.rolloffFactor,this._soundPanner.panningModel=this._panningModel))},e.prototype.switchPanningModelToHRTF=function(){this._panningModel="HRTF",this._switchPanningModel()},e.prototype.switchPanningModelToEqualPower=function(){this._panningModel="equalpower",this._switchPanningModel()},e.prototype._switchPanningModel=function(){Se.a.audioEngine.canUseWebAudio&&this.spatialSound&&this._soundPanner&&(this._soundPanner.panningModel=this._panningModel)},e.prototype.connectToSoundTrackAudioNode=function(e){Se.a.audioEngine.canUseWebAudio&&this._outputAudioNode&&(this._isOutputConnected&&this._outputAudioNode.disconnect(),this._outputAudioNode.connect(e),this._isOutputConnected=!0)},e.prototype.setDirectionalCone=function(e,t,i){t<e?m.a.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."):(this._coneInnerAngle=e,this._coneOuterAngle=t,this._coneOuterGain=i,this._isDirectional=!0,this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._offset,this._length)))},Object.defineProperty(e.prototype,"directionalConeInnerAngle",{get:function(){return this._coneInnerAngle},set:function(e){if(e!=this._coneInnerAngle){if(this._coneOuterAngle<e)return void m.a.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneInnerAngle=e,Se.a.audioEngine.canUseWebAudio&&this.spatialSound&&this._soundPanner&&(this._soundPanner.coneInnerAngle=this._coneInnerAngle)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"directionalConeOuterAngle",{get:function(){return this._coneOuterAngle},set:function(e){if(e!=this._coneOuterAngle){if(e<this._coneInnerAngle)return void m.a.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneOuterAngle=e,Se.a.audioEngine.canUseWebAudio&&this.spatialSound&&this._soundPanner&&(this._soundPanner.coneOuterAngle=this._coneOuterAngle)}},enumerable:!1,configurable:!0}),e.prototype.setPosition=function(e){this._position=e,Se.a.audioEngine.canUseWebAudio&&this.spatialSound&&this._soundPanner&&!isNaN(this._position.x)&&!isNaN(this._position.y)&&!isNaN(this._position.z)&&this._soundPanner.setPosition(this._position.x,this._position.y,this._position.z)},e.prototype.setLocalDirectionToMesh=function(e){this._localDirection=e,Se.a.audioEngine.canUseWebAudio&&this._connectedTransformNode&&this.isPlaying&&this._updateDirection()},e.prototype._updateDirection=function(){if(this._connectedTransformNode&&this._soundPanner){var e=this._connectedTransformNode.getWorldMatrix(),t=a.e.TransformNormal(this._localDirection,e);t.normalize(),this._soundPanner.setOrientation(t.x,t.y,t.z)}},e.prototype.updateDistanceFromListener=function(){if(Se.a.audioEngine.canUseWebAudio&&this._connectedTransformNode&&this.useCustomAttenuation&&this._soundGain&&this._scene.activeCamera){var e=this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);this._soundGain.gain.value=this._customAttenuationFunction(this._volume,e,this.maxDistance,this.refDistance,this.rolloffFactor)}},e.prototype.setAttenuationFunction=function(e){this._customAttenuationFunction=e},e.prototype.play=function(e,t,i){var n=this;if(this._isReadyToPlay&&this._scene.audioEnabled&&Se.a.audioEngine.audioContext)try{this._startOffset<0&&(e=-this._startOffset,this._startOffset=0);var r=e?Se.a.audioEngine.audioContext.currentTime+e:Se.a.audioEngine.audioContext.currentTime;if(this._soundSource&&this._streamingSource||this.spatialSound&&this._soundPanner&&(isNaN(this._position.x)||isNaN(this._position.y)||isNaN(this._position.z)||this._soundPanner.setPosition(this._position.x,this._position.y,this._position.z),this._isDirectional&&(this._soundPanner.coneInnerAngle=this._coneInnerAngle,this._soundPanner.coneOuterAngle=this._coneOuterAngle,this._soundPanner.coneOuterGain=this._coneOuterGain,this._connectedTransformNode?this._updateDirection():this._soundPanner.setOrientation(this._localDirection.x,this._localDirection.y,this._localDirection.z))),this._streaming)this._streamingSource||(this._streamingSource=Se.a.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement),this._htmlAudioElement.onended=function(){n._onended()},this._htmlAudioElement.playbackRate=this._playbackRate),this._streamingSource.disconnect(),this._inputAudioNode&&this._streamingSource.connect(this._inputAudioNode),this._htmlAudioElement&&(o=function(){if(Se.a.audioEngine.unlocked){var e=n._htmlAudioElement.play();void 0!==e&&e.catch(function(e){Se.a.audioEngine.lock(),(n.loop||n.autoplay)&&Se.a.audioEngine.onAudioUnlockedObservable.addOnce(function(){o()})})}else(n.loop||n.autoplay)&&Se.a.audioEngine.onAudioUnlockedObservable.addOnce(function(){o()})})();else{var o=function(){if(Se.a.audioEngine.audioContext){if(i=i||n._length,t=t||n._offset,n._soundSource){var o=n._soundSource;o.onended=function(){o.disconnect()}}if(n._soundSource=Se.a.audioEngine.audioContext.createBufferSource(),n._soundSource&&n._inputAudioNode){n._soundSource.buffer=n._audioBuffer,n._soundSource.connect(n._inputAudioNode),n._soundSource.loop=n.loop,void 0!==t&&(n._soundSource.loopStart=t),void 0!==i&&(n._soundSource.loopEnd=(0|t)+i),n._soundSource.playbackRate.value=n._playbackRate,n._soundSource.onended=function(){n._onended()},r=e?Se.a.audioEngine.audioContext.currentTime+e:Se.a.audioEngine.audioContext.currentTime;var a=n.isPaused?n._startOffset%n._soundSource.buffer.duration:t||0;n._soundSource.start(r,a,n.loop?void 0:i)}}};"suspended"===Se.a.audioEngine.audioContext.state?setTimeout(function(){"suspended"===Se.a.audioEngine.audioContext.state?(Se.a.audioEngine.lock(),(n.loop||n.autoplay)&&Se.a.audioEngine.onAudioUnlockedObservable.addOnce(function(){o()})):o()},500):o()}this._startTime=r,this.isPlaying=!0,this.isPaused=!1}catch(e){m.a.Error("Error while trying to play audio: "+this.name+", "+e.message)}},e.prototype._onended=function(){this.isPlaying=!1,this._startOffset=0,this.onended&&this.onended(),this.onEndedObservable.notifyObservers(this)},e.prototype.stop=function(e){var t=this;if(this.isPlaying)if(this._streaming)this._htmlAudioElement?(this._htmlAudioElement.pause(),this._htmlAudioElement.currentTime>0&&(this._htmlAudioElement.currentTime=0)):this._streamingSource.disconnect(),this.isPlaying=!1;else if(Se.a.audioEngine.audioContext&&this._soundSource){var i=e?Se.a.audioEngine.audioContext.currentTime+e:Se.a.audioEngine.audioContext.currentTime;this._soundSource.stop(i),this._soundSource.onended=function(){t.isPlaying=!1},this.isPaused||(this._startOffset=0)}},e.prototype.pause=function(){this.isPlaying&&(this.isPaused=!0,this._streaming?this._htmlAudioElement?this._htmlAudioElement.pause():this._streamingSource.disconnect():Se.a.audioEngine.audioContext&&(this.stop(0),this._startOffset+=Se.a.audioEngine.audioContext.currentTime-this._startTime))},e.prototype.setVolume=function(e,t){Se.a.audioEngine.canUseWebAudio&&this._soundGain&&(t&&Se.a.audioEngine.audioContext?(this._soundGain.gain.cancelScheduledValues(Se.a.audioEngine.audioContext.currentTime),this._soundGain.gain.setValueAtTime(this._soundGain.gain.value,Se.a.audioEngine.audioContext.currentTime),this._soundGain.gain.linearRampToValueAtTime(e,Se.a.audioEngine.audioContext.currentTime+t)):this._soundGain.gain.value=e),this._volume=e},e.prototype.setPlaybackRate=function(e){this._playbackRate=e,this.isPlaying&&(this._streaming&&this._htmlAudioElement?this._htmlAudioElement.playbackRate=this._playbackRate:this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate))},e.prototype.getVolume=function(){return this._volume},e.prototype.attachToMesh=function(e){var t=this;this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=e,this.spatialSound||(this.spatialSound=!0,this._createSpatialParameters(),this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._offset,this._length))),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=function(e){return t._onRegisterAfterWorldMatrixUpdate(e)},this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)},e.prototype.detachFromMesh=function(){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)},e.prototype._onRegisterAfterWorldMatrixUpdate=function(e){if(this._positionInEmitterSpace)e.worldMatrixFromCache.invertToRef(a.c.Matrix[0]),this.setPosition(a.c.Matrix[0].getTranslation());else if(e.getBoundingInfo){var t=e.getBoundingInfo();this.setPosition(t.boundingSphere.centerWorld)}else this.setPosition(e.absolutePosition);Se.a.audioEngine.canUseWebAudio&&this._isDirectional&&this.isPlaying&&this._updateDirection()},e.prototype.clone=function(){var t=this;if(this._streaming)return null;var i=function(){t._isReadyToPlay?(r._audioBuffer=t.getAudioBuffer(),r._isReadyToPlay=!0,r.autoplay&&r.play(0,t._offset,t._length)):window.setTimeout(i,300)},n={autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,useCustomAttenuation:this.useCustomAttenuation,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel},r=new e(this.name+"_cloned",new ArrayBuffer(0),this._scene,null,n);return this.useCustomAttenuation&&r.setAttenuationFunction(this._customAttenuationFunction),r.setPosition(this._position),r.setPlaybackRate(this._playbackRate),i(),r},e.prototype.getAudioBuffer=function(){return this._audioBuffer},e.prototype.getSoundSource=function(){return this._soundSource},e.prototype.getSoundGain=function(){return this._soundGain},e.prototype.serialize=function(){var e={name:this.name,url:this.name,autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel,playbackRate:this._playbackRate,panningModel:this._panningModel,soundTrackId:this.soundTrackId,metadata:this.metadata};return this.spatialSound&&(this._connectedTransformNode&&(e.connectedMeshId=this._connectedTransformNode.id),e.position=this._position.asArray(),e.refDistance=this.refDistance,e.distanceModel=this.distanceModel,e.isDirectional=this._isDirectional,e.localDirectionToMesh=this._localDirection.asArray(),e.coneInnerAngle=this._coneInnerAngle,e.coneOuterAngle=this._coneOuterAngle,e.coneOuterGain=this._coneOuterGain),e},e.Parse=function(t,i,n,r){var o,s=t.name;o=t.url?n+t.url:n+s;var c,l={autoplay:t.autoplay,loop:t.loop,volume:t.volume,spatialSound:t.spatialSound,maxDistance:t.maxDistance,rolloffFactor:t.rolloffFactor,refDistance:t.refDistance,distanceModel:t.distanceModel,playbackRate:t.playbackRate};if(r){var u=function(){r._isReadyToPlay?(c._audioBuffer=r.getAudioBuffer(),c._isReadyToPlay=!0,c.autoplay&&c.play(0,c._offset,c._length)):window.setTimeout(u,300)};c=new e(s,new ArrayBuffer(0),i,null,l),u()}else c=new e(s,o,i,function(){i._removePendingData(c)},l),i._addPendingData(c);if(t.position){var h=a.e.FromArray(t.position);c.setPosition(h)}if(t.isDirectional&&(c.setDirectionalCone(t.coneInnerAngle||360,t.coneOuterAngle||360,t.coneOuterGain||0),t.localDirectionToMesh)){var d=a.e.FromArray(t.localDirectionToMesh);c.setLocalDirectionToMesh(d)}if(t.connectedMeshId){var f=i.getMeshByID(t.connectedMeshId);f&&c.attachToMesh(f)}return t.metadata&&(c.metadata=t.metadata),c},e._SceneComponentInitialization=function(e){throw Re.a.WarnImport("AudioSceneComponent")},e}(),Oe=function(){function e(e,t){void 0===t&&(t={}),this.id=-1,this._isInitialized=!1,this._scene=e,this.soundCollection=new Array,this._options=t,!this._options.mainTrack&&this._scene.soundTracks&&(this._scene.soundTracks.push(this),this.id=this._scene.soundTracks.length-1)}return e.prototype._initializeSoundTrackAudioGraph=function(){Se.a.audioEngine.canUseWebAudio&&Se.a.audioEngine.audioContext&&(this._outputAudioNode=Se.a.audioEngine.audioContext.createGain(),this._outputAudioNode.connect(Se.a.audioEngine.masterGain),this._options&&this._options.volume&&(this._outputAudioNode.gain.value=this._options.volume),this._isInitialized=!0)},e.prototype.dispose=function(){if(Se.a.audioEngine&&Se.a.audioEngine.canUseWebAudio){for(this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas();this.soundCollection.length;)this.soundCollection[0].dispose();this._outputAudioNode&&this._outputAudioNode.disconnect(),this._outputAudioNode=null}},e.prototype.addSound=function(e){this._isInitialized||this._initializeSoundTrackAudioGraph(),Se.a.audioEngine.canUseWebAudio&&this._outputAudioNode&&e.connectToSoundTrackAudioNode(this._outputAudioNode),e.soundTrackId&&(-1===e.soundTrackId?this._scene.mainSoundTrack.removeSound(e):this._scene.soundTracks&&this._scene.soundTracks[e.soundTrackId].removeSound(e)),this.soundCollection.push(e),e.soundTrackId=this.id},e.prototype.removeSound=function(e){var t=this.soundCollection.indexOf(e);-1!==t&&this.soundCollection.splice(t,1)},e.prototype.setVolume=function(e){Se.a.audioEngine.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.gain.value=e)},e.prototype.switchPanningModelToHRTF=function(){if(Se.a.audioEngine.canUseWebAudio)for(var e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToHRTF()},e.prototype.switchPanningModelToEqualPower=function(){if(Se.a.audioEngine.canUseWebAudio)for(var e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToEqualPower()},e.prototype.connectToAnalyser=function(e){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=e,Se.a.audioEngine.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.disconnect(),this._connectedAnalyser.connectAudioNodes(this._outputAudioNode,Se.a.audioEngine.masterGain))},e}(),Me=i(17);n.a.AddParser(Me.a.NAME_AUDIO,function(e,t,i,n){var r,o=[];if(i.sounds=i.sounds||[],void 0!==e.sounds&&null!==e.sounds)for(var a=0,s=e.sounds.length;a<s;a++){var c=e.sounds[a];Se.a.audioEngine.canUseWebAudio?(c.url||(c.url=c.name),o[c.url]?i.sounds.push(xe.Parse(c,t,n,o[c.url])):(r=xe.Parse(c,t,n),o[c.url]=r,i.sounds.push(r))):i.sounds.push(new xe(c.name,null,t))}o=[]}),Object.defineProperty(Q.a.prototype,"mainSoundTrack",{get:function(){var e=this._getComponent(Me.a.NAME_AUDIO);return e||(e=new Ie(this),this._addComponent(e)),this._mainSoundTrack||(this._mainSoundTrack=new Oe(this,{mainTrack:!0})),this._mainSoundTrack},enumerable:!0,configurable:!0}),Q.a.prototype.getSoundByName=function(e){var t;for(t=0;t<this.mainSoundTrack.soundCollection.length;t++)if(this.mainSoundTrack.soundCollection[t].name===e)return this.mainSoundTrack.soundCollection[t];if(this.soundTracks)for(var i=0;i<this.soundTracks.length;i++)for(t=0;t<this.soundTracks[i].soundCollection.length;t++)if(this.soundTracks[i].soundCollection[t].name===e)return this.soundTracks[i].soundCollection[t];return null},Object.defineProperty(Q.a.prototype,"audioEnabled",{get:function(){var e=this._getComponent(Me.a.NAME_AUDIO);return e||(e=new Ie(this),this._addComponent(e)),e.audioEnabled},set:function(e){var t=this._getComponent(Me.a.NAME_AUDIO);t||(t=new Ie(this),this._addComponent(t)),e?t.enableAudio():t.disableAudio()},enumerable:!0,configurable:!0}),Object.defineProperty(Q.a.prototype,"headphone",{get:function(){var e=this._getComponent(Me.a.NAME_AUDIO);return e||(e=new Ie(this),this._addComponent(e)),e.headphone},set:function(e){var t=this._getComponent(Me.a.NAME_AUDIO);t||(t=new Ie(this),this._addComponent(t)),e?t.switchAudioModeForHeadphones():t.switchAudioModeForNormalSpeakers()},enumerable:!0,configurable:!0}),Object.defineProperty(Q.a.prototype,"audioListenerPositionProvider",{get:function(){var e=this._getComponent(Me.a.NAME_AUDIO);return e||(e=new Ie(this),this._addComponent(e)),e.audioListenerPositionProvider},set:function(e){var t=this._getComponent(Me.a.NAME_AUDIO);if(t||(t=new Ie(this),this._addComponent(t)),"function"!=typeof e)throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3");t.audioListenerPositionProvider=e},enumerable:!0,configurable:!0}),Object.defineProperty(Q.a.prototype,"audioPositioningRefreshRate",{get:function(){var e=this._getComponent(Me.a.NAME_AUDIO);return e||(e=new Ie(this),this._addComponent(e)),e.audioPositioningRefreshRate},set:function(e){var t=this._getComponent(Me.a.NAME_AUDIO);t||(t=new Ie(this),this._addComponent(t)),t.audioPositioningRefreshRate=e},enumerable:!0,configurable:!0});var Ie=function(){function e(e){this.name=Me.a.NAME_AUDIO,this._audioEnabled=!0,this._headphone=!1,this.audioPositioningRefreshRate=500,this._audioListenerPositionProvider=null,this._cachedCameraDirection=new a.e,this._cachedCameraPosition=new a.e,this._lastCheck=0,this.scene=e,e.soundTracks=new Array,e.sounds=new Array}return Object.defineProperty(e.prototype,"audioEnabled",{get:function(){return this._audioEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headphone",{get:function(){return this._headphone},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioListenerPositionProvider",{get:function(){return this._audioListenerPositionProvider},set:function(e){this._audioListenerPositionProvider=e},enumerable:!1,configurable:!0}),e.prototype.register=function(){this.scene._afterRenderStage.registerStep(Me.a.STEP_AFTERRENDER_AUDIO,this,this._afterRender)},e.prototype.rebuild=function(){},e.prototype.serialize=function(e){if(e.sounds=[],this.scene.soundTracks)for(var t=0;t<this.scene.soundTracks.length;t++)for(var i=this.scene.soundTracks[t],n=0;n<i.soundCollection.length;n++)e.sounds.push(i.soundCollection[n].serialize())},e.prototype.addFromContainer=function(e){var t=this;e.sounds&&e.sounds.forEach(function(e){e.play(),e.autoplay=!0,t.scene.mainSoundTrack.addSound(e)})},e.prototype.removeFromContainer=function(e,t){var i=this;void 0===t&&(t=!1),e.sounds&&e.sounds.forEach(function(e){e.stop(),e.autoplay=!1,i.scene.mainSoundTrack.removeSound(e),t&&e.dispose()})},e.prototype.dispose=function(){var e=this.scene;if(e._mainSoundTrack&&e.mainSoundTrack.dispose(),e.soundTracks)for(var t=0;t<e.soundTracks.length;t++)e.soundTracks[t].dispose()},e.prototype.disableAudio=function(){var e,t=this.scene;for(this._audioEnabled=!1,Se.a.audioEngine&&Se.a.audioEngine.audioContext&&Se.a.audioEngine.audioContext.suspend(),e=0;e<t.mainSoundTrack.soundCollection.length;e++)t.mainSoundTrack.soundCollection[e].pause();if(t.soundTracks)for(e=0;e<t.soundTracks.length;e++)for(var i=0;i<t.soundTracks[e].soundCollection.length;i++)t.soundTracks[e].soundCollection[i].pause()},e.prototype.enableAudio=function(){var e,t=this.scene;for(this._audioEnabled=!0,Se.a.audioEngine&&Se.a.audioEngine.audioContext&&Se.a.audioEngine.audioContext.resume(),e=0;e<t.mainSoundTrack.soundCollection.length;e++)t.mainSoundTrack.soundCollection[e].isPaused&&t.mainSoundTrack.soundCollection[e].play();if(t.soundTracks)for(e=0;e<t.soundTracks.length;e++)for(var i=0;i<t.soundTracks[e].soundCollection.length;i++)t.soundTracks[e].soundCollection[i].isPaused&&t.soundTracks[e].soundCollection[i].play()},e.prototype.switchAudioModeForHeadphones=function(){var e=this.scene;if(this._headphone=!0,e.mainSoundTrack.switchPanningModelToHRTF(),e.soundTracks)for(var t=0;t<e.soundTracks.length;t++)e.soundTracks[t].switchPanningModelToHRTF()},e.prototype.switchAudioModeForNormalSpeakers=function(){var e=this.scene;if(this._headphone=!1,e.mainSoundTrack.switchPanningModelToEqualPower(),e.soundTracks)for(var t=0;t<e.soundTracks.length;t++)e.soundTracks[t].switchPanningModelToEqualPower()},e.prototype._afterRender=function(){var t=q.a.Now;if(!(this._lastCheck&&t-this._lastCheck<this.audioPositioningRefreshRate)){this._lastCheck=t;var i=this.scene;if(this._audioEnabled&&i._mainSoundTrack&&i.soundTracks&&(0!==i._mainSoundTrack.soundCollection.length||1!==i.soundTracks.length)){var n=Se.a.audioEngine;if(n&&n.audioContext){if(this._audioListenerPositionProvider){var r=this._audioListenerPositionProvider();r.x=r.x||0,r.y=r.y||0,r.z=r.z||0,n.audioContext.listener.setPosition(r.x,r.y,r.z)}else{var o;if(o=i.activeCameras&&i.activeCameras.length>0?i.activeCameras[0]:i.activeCamera){this._cachedCameraPosition.equals(o.globalPosition)||(this._cachedCameraPosition.copyFrom(o.globalPosition),n.audioContext.listener.setPosition(o.globalPosition.x,o.globalPosition.y,o.globalPosition.z)),o.rigCameras&&o.rigCameras.length>0&&(o=o.rigCameras[0]);var s=a.a.Invert(o.getViewMatrix()),c=a.e.TransformNormal(i.useRightHandedSystem?e._CameraDirectionRH:e._CameraDirectionLH,s);c.normalize(),isNaN(c.x)||isNaN(c.y)||isNaN(c.z)||this._cachedCameraDirection.equals(c)||(this._cachedCameraDirection.copyFrom(c),n.audioContext.listener.setOrientation(c.x,c.y,c.z,0,1,0))}else n.audioContext.listener.setPosition(0,0,0)}var l;for(l=0;l<i.mainSoundTrack.soundCollection.length;l++){var u=i.mainSoundTrack.soundCollection[l];u.useCustomAttenuation&&u.updateDistanceFromListener()}if(i.soundTracks)for(l=0;l<i.soundTracks.length;l++)for(var h=0;h<i.soundTracks[l].soundCollection.length;h++)(u=i.soundTracks[l].soundCollection[h]).useCustomAttenuation&&u.updateDistanceFromListener()}}}},e._CameraDirectionLH=new a.e(0,0,-1),e._CameraDirectionRH=new a.e(0,0,1),e}();xe._SceneComponentInitialization=function(e){var t=e._getComponent(Me.a.NAME_AUDIO);t||(t=new Ie(e),e._addComponent(t))};var De=function(){function e(e,t,i){var n=this;if(this.loop=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._volume=1,this.isPlaying=!1,this.isPaused=!1,this._sounds=[],this._weights=[],t.length!==i.length)throw new Error("Sounds length does not equal weights length");this.loop=e,this._weights=i;for(var r=0,o=0,a=i;o<a.length;o++)r+=a[o];for(var s=r>0?1/r:0,c=0;c<this._weights.length;c++)this._weights[c]*=s;this._sounds=t;for(var l=0,u=this._sounds;l<u.length;l++)u[l].onEndedObservable.add(function(){n._onended()})}return Object.defineProperty(e.prototype,"directionalConeInnerAngle",{get:function(){return this._coneInnerAngle},set:function(e){if(e!==this._coneInnerAngle){if(this._coneOuterAngle<e)return void m.a.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneInnerAngle=e;for(var t=0,i=this._sounds;t<i.length;t++)i[t].directionalConeInnerAngle=e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"directionalConeOuterAngle",{get:function(){return this._coneOuterAngle},set:function(e){if(e!==this._coneOuterAngle){if(e<this._coneInnerAngle)return void m.a.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneOuterAngle=e;for(var t=0,i=this._sounds;t<i.length;t++)i[t].directionalConeOuterAngle=e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(e){if(e!==this._volume)for(var t=0,i=this._sounds;t<i.length;t++)i[t].setVolume(e)},enumerable:!1,configurable:!0}),e.prototype._onended=function(){void 0!==this._currentIndex&&(this._sounds[this._currentIndex].autoplay=!1),this.loop&&this.isPlaying?this.play():this.isPlaying=!1},e.prototype.pause=function(){this.isPaused=!0,void 0!==this._currentIndex&&this._sounds[this._currentIndex].pause()},e.prototype.stop=function(){this.isPlaying=!1,void 0!==this._currentIndex&&this._sounds[this._currentIndex].stop()},e.prototype.play=function(e){if(!this.isPaused){this.stop();for(var t=Math.random(),i=0,n=0;n<this._weights.length;n++)if(t<=(i+=this._weights[n])){this._currentIndex=n;break}}var r=this._sounds[this._currentIndex];r.isReady()?r.play(0,this.isPaused?void 0:e):r.autoplay=!0,this.isPlaying=!0,this.isPaused=!1},e}(),Ne=i(18),Le=function(){function e(){this._zoomStopsAnimation=!1,this._idleRotationSpeed=.05,this._idleRotationWaitTime=2e3,this._idleRotationSpinupTime=2e3,this._isPointerDown=!1,this._lastFrameTime=null,this._lastInteractionTime=-1/0,this._cameraRotationSpeed=0,this._lastFrameRadius=0}return Object.defineProperty(e.prototype,"name",{get:function(){return"AutoRotation"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomStopsAnimation",{get:function(){return this._zoomStopsAnimation},set:function(e){this._zoomStopsAnimation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationSpeed",{get:function(){return this._idleRotationSpeed},set:function(e){this._idleRotationSpeed=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationWaitTime",{get:function(){return this._idleRotationWaitTime},set:function(e){this._idleRotationWaitTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationSpinupTime",{get:function(){return this._idleRotationSpinupTime},set:function(e){this._idleRotationSpinupTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotationInProgress",{get:function(){return Math.abs(this._cameraRotationSpeed)>0},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e){var t=this;this._attachedCamera=e;var i=this._attachedCamera.getScene();this._onPrePointerObservableObserver=i.onPrePointerObservable.add(function(e){e.type!==Ne.a.POINTERDOWN?e.type===Ne.a.POINTERUP&&(t._isPointerDown=!1):t._isPointerDown=!0}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(function(){var e=q.a.Now,i=0;null!=t._lastFrameTime&&(i=e-t._lastFrameTime),t._lastFrameTime=e,t._applyUserInteraction();var n=e-t._lastInteractionTime-t._idleRotationWaitTime,r=Math.max(Math.min(n/t._idleRotationSpinupTime,1),0);t._cameraRotationSpeed=t._idleRotationSpeed*r,t._attachedCamera&&(t._attachedCamera.alpha-=t._cameraRotationSpeed*(i/1e3))})},e.prototype.detach=function(){if(this._attachedCamera){var e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._attachedCamera=null}},e.prototype._userIsZooming=function(){return!!this._attachedCamera&&0!==this._attachedCamera.inertialRadiusOffset},e.prototype._shouldAnimationStopForInteraction=function(){if(!this._attachedCamera)return!1;var e=!1;return this._lastFrameRadius===this._attachedCamera.radius&&0!==this._attachedCamera.inertialRadiusOffset&&(e=!0),this._lastFrameRadius=this._attachedCamera.radius,this._zoomStopsAnimation?e:this._userIsZooming()},e.prototype._applyUserInteraction=function(){this._userIsMoving()&&!this._shouldAnimationStopForInteraction()&&(this._lastInteractionTime=q.a.Now)},e.prototype._userIsMoving=function(){return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)},e}(),we=function(){function e(){this.transitionDuration=450,this.lowerRadiusTransitionRange=2,this.upperRadiusTransitionRange=-2,this._autoTransitionRange=!1,this._radiusIsAnimating=!1,this._radiusBounceTransition=null,this._animatables=new Array}return Object.defineProperty(e.prototype,"name",{get:function(){return"Bouncing"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoTransitionRange",{get:function(){return this._autoTransitionRange},set:function(e){var t=this;if(this._autoTransitionRange!==e){this._autoTransitionRange=e;var i=this._attachedCamera;i&&(e?this._onMeshTargetChangedObserver=i.onMeshTargetChangedObservable.add(function(e){if(e){e.computeWorldMatrix(!0);var i=e.getBoundingInfo().diagonalLength;t.lowerRadiusTransitionRange=.05*i,t.upperRadiusTransitionRange=.05*i}}):this._onMeshTargetChangedObserver&&i.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))}},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e){var t=this;this._attachedCamera=e,this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(function(){t._attachedCamera&&(t._isRadiusAtLimit(t._attachedCamera.lowerRadiusLimit)&&t._applyBoundRadiusAnimation(t.lowerRadiusTransitionRange),t._isRadiusAtLimit(t._attachedCamera.upperRadiusLimit)&&t._applyBoundRadiusAnimation(t.upperRadiusTransitionRange))})},e.prototype.detach=function(){this._attachedCamera&&(this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null)},e.prototype._isRadiusAtLimit=function(e){return!!this._attachedCamera&&this._attachedCamera.radius===e&&!this._radiusIsAnimating},e.prototype._applyBoundRadiusAnimation=function(t){var i=this;if(this._attachedCamera){this._radiusBounceTransition||(e.EasingFunction.setEasingMode(e.EasingMode),this._radiusBounceTransition=G.CreateAnimation("radius",G.ANIMATIONTYPE_FLOAT,60,e.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;var n=G.TransitionTo("radius",this._attachedCamera.radius+t,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,function(){return i._clearAnimationLocks()});n&&this._animatables.push(n)}},e.prototype._clearAnimationLocks=function(){this._radiusIsAnimating=!1,this._attachedCamera&&(this._attachedCamera.wheelPrecision=this._cachedWheelPrecision)},e.prototype.stopAllAnimations=function(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()},e.EasingFunction=new se(.3),e.EasingMode=oe.EASINGMODE_EASEOUT,e}(),Fe=function(){function e(){this._mode=e.FitFrustumSidesMode,this._radiusScale=1,this._positionScale=.5,this._defaultElevation=.3,this._elevationReturnTime=1500,this._elevationReturnWaitTime=1e3,this._zoomStopsAnimation=!1,this._framingTime=1500,this.autoCorrectCameraLimitsAndSensibility=!0,this._isPointerDown=!1,this._lastInteractionTime=-1/0,this._animatables=new Array,this._betaIsAnimating=!1}return Object.defineProperty(e.prototype,"name",{get:function(){return"Framing"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(e){this._mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radiusScale",{get:function(){return this._radiusScale},set:function(e){this._radiusScale=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"positionScale",{get:function(){return this._positionScale},set:function(e){this._positionScale=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultElevation",{get:function(){return this._defaultElevation},set:function(e){this._defaultElevation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elevationReturnTime",{get:function(){return this._elevationReturnTime},set:function(e){this._elevationReturnTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elevationReturnWaitTime",{get:function(){return this._elevationReturnWaitTime},set:function(e){this._elevationReturnWaitTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomStopsAnimation",{get:function(){return this._zoomStopsAnimation},set:function(e){this._zoomStopsAnimation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"framingTime",{get:function(){return this._framingTime},set:function(e){this._framingTime=e},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t){var i=this;this._attachedCamera=t;var n=this._attachedCamera.getScene();e.EasingFunction.setEasingMode(e.EasingMode),this._onPrePointerObservableObserver=n.onPrePointerObservable.add(function(e){e.type!==Ne.a.POINTERDOWN?e.type===Ne.a.POINTERUP&&(i._isPointerDown=!1):i._isPointerDown=!0}),this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(function(e){e&&i.zoomOnMesh(e)}),this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(function(){i._applyUserInteraction(),i._maintainCameraAboveGround()})},e.prototype.detach=function(){if(this._attachedCamera){var e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null}},e.prototype.zoomOnMesh=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),e.computeWorldMatrix(!0);var n=e.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(n.minimumWorld,n.maximumWorld,t,i)},e.prototype.zoomOnMeshHierarchy=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),e.computeWorldMatrix(!0);var n=e.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(n.min,n.max,t,i)},e.prototype.zoomOnMeshesHierarchy=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null);for(var n=new a.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new a.e(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),o=0;o<e.length;o++){var s=e[o].getHierarchyBoundingVectors(!0);a.e.CheckExtends(s.min,n,r),a.e.CheckExtends(s.max,n,r)}this.zoomOnBoundingInfo(n,r,t,i)},e.prototype.zoomOnBoundingInfo=function(t,i,n,r){var o,s=this;if(void 0===n&&(n=!1),void 0===r&&(r=null),this._attachedCamera){var c=t.y,l=c+(i.y-c)*this._positionScale,u=i.subtract(t).scale(.5);if(n)o=new a.e(0,l,0);else{var h=t.add(u);o=new a.e(h.x,l,h.z)}this._vectorTransition||(this._vectorTransition=G.CreateAnimation("target",G.ANIMATIONTYPE_VECTOR3,60,e.EasingFunction)),this._betaIsAnimating=!0;var d=G.TransitionTo("target",o,this._attachedCamera,this._attachedCamera.getScene(),60,this._vectorTransition,this._framingTime);d&&this._animatables.push(d);var f=0;if(this._mode===e.FitFrustumSidesMode){var p=this._calculateLowerRadiusFromModelBoundingSphere(t,i);this.autoCorrectCameraLimitsAndSensibility&&(this._attachedCamera.lowerRadiusLimit=u.length()+this._attachedCamera.minZ),f=p}else this._mode===e.IgnoreBoundsSizeMode&&(f=this._calculateLowerRadiusFromModelBoundingSphere(t,i),this.autoCorrectCameraLimitsAndSensibility&&null===this._attachedCamera.lowerRadiusLimit&&(this._attachedCamera.lowerRadiusLimit=this._attachedCamera.minZ));if(this.autoCorrectCameraLimitsAndSensibility){var _=i.subtract(t).length();this._attachedCamera.panningSensibility=5e3/_,this._attachedCamera.wheelPrecision=100/f}this._radiusTransition||(this._radiusTransition=G.CreateAnimation("radius",G.ANIMATIONTYPE_FLOAT,60,e.EasingFunction)),(d=G.TransitionTo("radius",f,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusTransition,this._framingTime,function(){s.stopAllAnimations(),r&&r(),s._attachedCamera&&s._attachedCamera.useInputToRestoreState&&s._attachedCamera.storeState()}))&&this._animatables.push(d)}},e.prototype._calculateLowerRadiusFromModelBoundingSphere=function(t,i){var n=i.subtract(t).length(),r=this._getFrustumSlope(),o=.5*n*this._radiusScale,a=o*Math.sqrt(1+1/(r.x*r.x)),s=o*Math.sqrt(1+1/(r.y*r.y)),c=Math.max(a,s),l=this._attachedCamera;return l?(l.lowerRadiusLimit&&this._mode===e.IgnoreBoundsSizeMode&&(c=c<l.lowerRadiusLimit?l.lowerRadiusLimit:c),l.upperRadiusLimit&&(c=c>l.upperRadiusLimit?l.upperRadiusLimit:c),c):0},e.prototype._maintainCameraAboveGround=function(){var t=this;if(!(this._elevationReturnTime<0)){var i=q.a.Now-this._lastInteractionTime,n=.5*Math.PI-this._defaultElevation,r=.5*Math.PI;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>r&&i>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=G.CreateAnimation("beta",G.ANIMATIONTYPE_FLOAT,60,e.EasingFunction));var o=G.TransitionTo("beta",n,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,function(){t._clearAnimationLocks(),t.stopAllAnimations()});o&&this._animatables.push(o)}}},e.prototype._getFrustumSlope=function(){var e=this._attachedCamera;if(!e)return a.d.Zero();var t=e.getScene().getEngine().getAspectRatio(e),i=Math.tan(e.fov/2),n=i*t;return new a.d(n,i)},e.prototype._clearAnimationLocks=function(){this._betaIsAnimating=!1},e.prototype._applyUserInteraction=function(){this.isUserIsMoving&&(this._lastInteractionTime=q.a.Now,this.stopAllAnimations(),this._clearAnimationLocks())},e.prototype.stopAllAnimations=function(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()},Object.defineProperty(e.prototype,"isUserIsMoving",{get:function(){return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)},enumerable:!1,configurable:!0}),e.EasingFunction=new he,e.EasingMode=oe.EASINGMODE_EASEINOUT,e.IgnoreBoundsSizeMode=0,e.FitFrustumSidesMode=1,e}(),Be=function(e,t,i,n){void 0===t&&(t=new a.e),void 0===i&&(i=0),void 0===n&&(n=!1),this.direction=e,this.rotatedDirection=t,this.diff=i,this.ignore=n},Ue=function(){function e(e){this.ui=e,this.name="AttachToBoxBehavior",this.distanceAwayFromFace=.15,this.distanceAwayFromBottomOfFace=.15,this._faceVectors=[new Be(a.e.Up()),new Be(a.e.Down()),new Be(a.e.Left()),new Be(a.e.Right()),new Be(a.e.Forward()),new Be(a.e.Forward().scaleInPlace(-1))],this._tmpMatrix=new a.a,this._tmpVector=new a.e,this._zeroVector=a.e.Zero(),this._lookAtTmpMatrix=new a.a}return e.prototype.init=function(){},e.prototype._closestFace=function(e){var t=this;return this._faceVectors.forEach(function(i){t._target.rotationQuaternion||(t._target.rotationQuaternion=a.b.RotationYawPitchRoll(t._target.rotation.y,t._target.rotation.x,t._target.rotation.z)),t._target.rotationQuaternion.toRotationMatrix(t._tmpMatrix),a.e.TransformCoordinatesToRef(i.direction,t._tmpMatrix,i.rotatedDirection),i.diff=a.e.GetAngleBetweenVectors(i.rotatedDirection,e,a.e.Cross(i.rotatedDirection,e))}),this._faceVectors.reduce(function(e,t){return e.ignore?t:t.ignore||e.diff<t.diff?e:t},this._faceVectors[0])},e.prototype._lookAtToRef=function(e,t,i){void 0===t&&(t=new a.e(0,1,0)),a.a.LookAtLHToRef(this._zeroVector,e,t,this._lookAtTmpMatrix),this._lookAtTmpMatrix.invert(),a.b.FromRotationMatrixToRef(this._lookAtTmpMatrix,i)},e.prototype.attach=function(e){var t=this;this._target=e,this._scene=this._target.getScene(),this._onRenderObserver=this._scene.onBeforeRenderObservable.add(function(){if(t._scene.activeCamera){var i=t._scene.activeCamera.position;t._scene.activeCamera.devicePosition&&(i=t._scene.activeCamera.devicePosition);var n=t._closestFace(i.subtract(e.position));t._scene.activeCamera.leftCamera?t._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(t._tmpMatrix):t._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(t._tmpMatrix),a.e.TransformCoordinatesToRef(a.e.Up(),t._tmpMatrix,t._tmpVector),t._faceVectors.forEach(function(e){n.direction.x&&e.direction.x&&(e.ignore=!0),n.direction.y&&e.direction.y&&(e.ignore=!0),n.direction.z&&e.direction.z&&(e.ignore=!0)});var r=t._closestFace(t._tmpVector);t._faceVectors.forEach(function(e){e.ignore=!1}),t.ui.position.copyFrom(e.position),n.direction.x&&(n.rotatedDirection.scaleToRef(e.scaling.x/2+t.distanceAwayFromFace,t._tmpVector),t.ui.position.addInPlace(t._tmpVector)),n.direction.y&&(n.rotatedDirection.scaleToRef(e.scaling.y/2+t.distanceAwayFromFace,t._tmpVector),t.ui.position.addInPlace(t._tmpVector)),n.direction.z&&(n.rotatedDirection.scaleToRef(e.scaling.z/2+t.distanceAwayFromFace,t._tmpVector),t.ui.position.addInPlace(t._tmpVector)),t.ui.rotationQuaternion||(t.ui.rotationQuaternion=a.b.RotationYawPitchRoll(t.ui.rotation.y,t.ui.rotation.x,t.ui.rotation.z)),n.rotatedDirection.scaleToRef(-1,t._tmpVector),t._lookAtToRef(t._tmpVector,r.rotatedDirection,t.ui.rotationQuaternion),r.direction.x&&t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace-e.scaling.x/2,t._tmpVector),r.direction.y&&t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace-e.scaling.y/2,t._tmpVector),r.direction.z&&t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace-e.scaling.z/2,t._tmpVector),t.ui.position.addInPlace(t._tmpVector)}})},e.prototype.detach=function(){this._scene.onBeforeRenderObservable.remove(this._onRenderObserver)},e}(),Ve=function(){function e(){var e=this;this.delay=0,this.fadeInTime=300,this._millisecondsPerFrame=1e3/60,this._hovered=!1,this._hoverValue=0,this._ownerNode=null,this._update=function(){if(e._ownerNode){if(e._hoverValue+=e._hovered?e._millisecondsPerFrame:-e._millisecondsPerFrame,e._setAllVisibility(e._ownerNode,(e._hoverValue-e.delay)/e.fadeInTime),e._ownerNode.visibility>1)return e._setAllVisibility(e._ownerNode,1),void(e._hoverValue=e.fadeInTime+e.delay);if(e._ownerNode.visibility<0&&(e._setAllVisibility(e._ownerNode,0),e._hoverValue<0))return void(e._hoverValue=0);setTimeout(e._update,e._millisecondsPerFrame)}}}return Object.defineProperty(e.prototype,"name",{get:function(){return"FadeInOut"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e){this._ownerNode=e,this._setAllVisibility(this._ownerNode,0)},e.prototype.detach=function(){this._ownerNode=null},e.prototype.fadeIn=function(e){this._hovered=e,this._update()},e.prototype._setAllVisibility=function(e,t){var i=this;e.visibility=t,e.getChildMeshes().forEach(function(e){i._setAllVisibility(e,t)})},e}(),ke=i(65),Ge=function(){function e(){this._startDistance=0,this._initialScale=new a.e(0,0,0),this._targetScale=new a.e(0,0,0),this._sceneRenderObserver=null,this._dragBehaviorA=new ke.a({}),this._dragBehaviorA.moveAttached=!1,this._dragBehaviorB=new ke.a({}),this._dragBehaviorB.moveAttached=!1}return Object.defineProperty(e.prototype,"name",{get:function(){return"MultiPointerScale"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype._getCurrentDistance=function(){return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length()},e.prototype.attach=function(e){var t=this;this._ownerNode=e,this._dragBehaviorA.onDragStartObservable.add(function(i){t._dragBehaviorA.dragging&&t._dragBehaviorB.dragging&&(t._dragBehaviorA.currentDraggingPointerID==t._dragBehaviorB.currentDraggingPointerID?t._dragBehaviorA.releaseDrag():(t._initialScale.copyFrom(e.scaling),t._startDistance=t._getCurrentDistance()))}),this._dragBehaviorB.onDragStartObservable.add(function(i){t._dragBehaviorA.dragging&&t._dragBehaviorB.dragging&&(t._dragBehaviorA.currentDraggingPointerID==t._dragBehaviorB.currentDraggingPointerID?t._dragBehaviorB.releaseDrag():(t._initialScale.copyFrom(e.scaling),t._startDistance=t._getCurrentDistance()))}),[this._dragBehaviorA,this._dragBehaviorB].forEach(function(e){e.onDragObservable.add(function(){if(t._dragBehaviorA.dragging&&t._dragBehaviorB.dragging){var e=t._getCurrentDistance()/t._startDistance;t._initialScale.scaleToRef(e,t._targetScale)}})}),e.addBehavior(this._dragBehaviorA),e.addBehavior(this._dragBehaviorB),this._sceneRenderObserver=e.getScene().onBeforeRenderObservable.add(function(){if(t._dragBehaviorA.dragging&&t._dragBehaviorB.dragging){var i=t._targetScale.subtract(e.scaling).scaleInPlace(.1);i.length()>.01&&e.scaling.addInPlace(i)}})},e.prototype.detach=function(){var e=this;this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver),[this._dragBehaviorA,this._dragBehaviorB].forEach(function(t){t.onDragStartObservable.clear(),t.onDragObservable.clear(),e._ownerNode.removeBehavior(t)})},e}(),ze=i(31),je=i(24),We=i(60),He=function(){function e(){this._sceneRenderObserver=null,this._targetPosition=new a.e(0,0,0),this._moving=!1,this._startingOrientation=new a.b,this._attachedToElement=!1,this.zDragFactor=3,this.rotateDraggedObject=!0,this.dragging=!1,this.dragDeltaRatio=.2,this.currentDraggingPointerID=-1,this.detachCameraControls=!0,this.onDragStartObservable=new o.c,this.onDragObservable=new o.c,this.onDragEndObservable=new o.c}return Object.defineProperty(e.prototype,"name",{get:function(){return"SixDofDrag"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},Object.defineProperty(e.prototype,"_pointerCamera",{get:function(){return this._scene.cameraToUseForPointers?this._scene.cameraToUseForPointers:this._scene.activeCamera},enumerable:!1,configurable:!0}),e.prototype.attach=function(t){var i=this;this._ownerNode=t,this._scene=this._ownerNode.getScene(),e._virtualScene||(e._virtualScene=new Q.a(this._scene.getEngine(),{virtual:!0}),e._virtualScene.detachControl(),this._scene.getEngine().scenes.pop());var n=null,r=new a.e(0,0,0);this._virtualOriginMesh=new ze.a("",e._virtualScene),this._virtualOriginMesh.rotationQuaternion=new a.b,this._virtualDragMesh=new ze.a("",e._virtualScene),this._virtualDragMesh.rotationQuaternion=new a.b,this._pointerObserver=this._scene.onPointerObservable.add(function(e,t){if(e.type==Ne.a.POINTERDOWN){if(!i.dragging&&e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh&&e.pickInfo.ray&&(u=e.pickInfo.pickedMesh,i._ownerNode==u||u.isDescendantOf(i._ownerNode))){i._pointerCamera&&i._pointerCamera.cameraRigMode==je.a.RIG_MODE_NONE&&e.pickInfo.ray.origin.copyFrom(i._pointerCamera.globalPosition),n=i._ownerNode,We.a._RemoveAndStorePivotPoint(n),r.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.add(e.pickInfo.ray.direction)),i._virtualOriginMesh.removeChild(i._virtualDragMesh),n.computeWorldMatrix(),i._virtualDragMesh.position.copyFrom(n.absolutePosition),n.rotationQuaternion||(n.rotationQuaternion=a.b.RotationYawPitchRoll(n.rotation.y,n.rotation.x,n.rotation.z));var o=n.parent;n.setParent(null),i._virtualDragMesh.rotationQuaternion.copyFrom(n.rotationQuaternion),n.setParent(o),i._virtualOriginMesh.addChild(i._virtualDragMesh),i._targetPosition.copyFrom(i._virtualDragMesh.absolutePosition),i.dragging=!0,i.currentDraggingPointerID=e.event.pointerId,i.detachCameraControls&&i._pointerCamera&&!i._pointerCamera.leftCamera&&(i._pointerCamera.inputs.attachedToElement?(i._pointerCamera.detachControl(),i._attachedToElement=!0):i._attachedToElement=!1),We.a._RestorePivotPoint(n),i.onDragStartObservable.notifyObservers({})}}else if(e.type==Ne.a.POINTERUP||e.type==Ne.a.POINTERDOUBLETAP)i.currentDraggingPointerID==e.event.pointerId&&(i.dragging=!1,i._moving=!1,i.currentDraggingPointerID=-1,n=null,i._virtualOriginMesh.removeChild(i._virtualDragMesh),i.detachCameraControls&&i._attachedToElement&&i._pointerCamera&&!i._pointerCamera.leftCamera&&(i._pointerCamera.attachControl(!0),i._attachedToElement=!1),i.onDragEndObservable.notifyObservers({}));else if(e.type==Ne.a.POINTERMOVE&&i.currentDraggingPointerID==e.event.pointerId&&i.dragging&&e.pickInfo&&e.pickInfo.ray&&n){var s=i.zDragFactor;i._pointerCamera&&i._pointerCamera.cameraRigMode==je.a.RIG_MODE_NONE&&(e.pickInfo.ray.origin.copyFrom(i._pointerCamera.globalPosition),s=0);var c=e.pickInfo.ray.origin.subtract(r);r.copyFrom(e.pickInfo.ray.origin);var l=-a.e.Dot(c,e.pickInfo.ray.direction);i._virtualOriginMesh.addChild(i._virtualDragMesh),i._virtualDragMesh.position.z-=i._virtualDragMesh.position.z<1?l*i.zDragFactor:l*s*i._virtualDragMesh.position.z,i._virtualDragMesh.position.z<0&&(i._virtualDragMesh.position.z=0),i._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.add(e.pickInfo.ray.direction)),i._virtualOriginMesh.removeChild(i._virtualDragMesh),i._targetPosition.copyFrom(i._virtualDragMesh.absolutePosition),n.parent&&a.e.TransformCoordinatesToRef(i._targetPosition,a.a.Invert(n.parent.getWorldMatrix()),i._targetPosition),i._moving||i._startingOrientation.copyFrom(i._virtualDragMesh.rotationQuaternion),i._moving=!0}var u});var o=new a.b;this._sceneRenderObserver=t.getScene().onBeforeRenderObservable.add(function(){if(i.dragging&&i._moving&&n){if(We.a._RemoveAndStorePivotPoint(n),n.position.addInPlace(i._targetPosition.subtract(n.position).scale(i.dragDeltaRatio)),i.rotateDraggedObject){o.copyFrom(i._startingOrientation),o.x=-o.x,o.y=-o.y,o.z=-o.z,i._virtualDragMesh.rotationQuaternion.multiplyToRef(o,o),a.b.RotationYawPitchRollToRef(o.toEulerAngles("xyz").y,0,0,o),o.multiplyToRef(i._startingOrientation,o);var e=n.parent;(!e||e.scaling&&!e.scaling.isNonUniformWithinEpsilon(.001))&&(n.setParent(null),a.b.SlerpToRef(n.rotationQuaternion,o,i.dragDeltaRatio,n.rotationQuaternion),n.setParent(e))}We.a._RestorePivotPoint(n),i.onDragObservable.notifyObservers()}})},e.prototype.detach=function(){this._scene&&(this.detachCameraControls&&this._attachedToElement&&this._pointerCamera&&!this._pointerCamera.leftCamera&&(this._pointerCamera.attachControl(!0),this._attachedToElement=!1),this._scene.onPointerObservable.remove(this._pointerObserver)),this._ownerNode&&this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver),this._virtualOriginMesh&&this._virtualOriginMesh.dispose(),this._virtualDragMesh&&this._virtualDragMesh.dispose(),this.onDragEndObservable.clear(),this.onDragObservable.clear(),this.onDragStartObservable.clear()},e}(),Xe=function(){function e(e,t,i){if(this.targetPosition=a.e.Zero(),this.poleTargetPosition=a.e.Zero(),this.poleTargetLocalOffset=a.e.Zero(),this.poleAngle=0,this.slerpAmount=1,this._bone1Quat=a.b.Identity(),this._bone1Mat=a.a.Identity(),this._bone2Ang=Math.PI,this._maxAngle=Math.PI,this._rightHandedSystem=!1,this._bendAxis=a.e.Right(),this._slerping=!1,this._adjustRoll=0,this._bone2=t,this._bone1=t.getParent(),this._bone1){this.mesh=e;var n=t.getPosition();if(t.getAbsoluteTransform().determinant()>0&&(this._rightHandedSystem=!0,this._bendAxis.x=0,this._bendAxis.y=0,this._bendAxis.z=-1,n.x>n.y&&n.x>n.z&&(this._adjustRoll=.5*Math.PI,this._bendAxis.z=1)),this._bone1.length){var r=this._bone1.getScale(),o=this._bone2.getScale();this._bone1Length=this._bone1.length*r.y*this.mesh.scaling.y,this._bone2Length=this._bone2.length*o.y*this.mesh.scaling.y}else if(this._bone1.children[0]){e.computeWorldMatrix(!0);var s=this._bone2.children[0].getAbsolutePosition(e),c=this._bone2.getAbsolutePosition(e),l=this._bone1.getAbsolutePosition(e);this._bone1Length=a.e.Distance(s,c),this._bone2Length=a.e.Distance(c,l)}this._bone1.getRotationMatrixToRef(J.c.WORLD,e,this._bone1Mat),this.maxAngle=Math.PI,i&&(i.targetMesh&&(this.targetMesh=i.targetMesh,this.targetMesh.computeWorldMatrix(!0)),i.poleTargetMesh?(this.poleTargetMesh=i.poleTargetMesh,this.poleTargetMesh.computeWorldMatrix(!0)):i.poleTargetBone?this.poleTargetBone=i.poleTargetBone:this._bone1.getParent()&&(this.poleTargetBone=this._bone1.getParent()),i.poleTargetLocalOffset&&this.poleTargetLocalOffset.copyFrom(i.poleTargetLocalOffset),i.poleAngle&&(this.poleAngle=i.poleAngle),i.bendAxis&&this._bendAxis.copyFrom(i.bendAxis),i.maxAngle&&(this.maxAngle=i.maxAngle),i.slerpAmount&&(this.slerpAmount=i.slerpAmount))}}return Object.defineProperty(e.prototype,"maxAngle",{get:function(){return this._maxAngle},set:function(e){this._setMaxAngle(e)},enumerable:!1,configurable:!0}),e.prototype._setMaxAngle=function(e){e<0&&(e=0),(e>Math.PI||null==e)&&(e=Math.PI),this._maxAngle=e;var t=this._bone1Length,i=this._bone2Length;this._maxReach=Math.sqrt(t*t+i*i-2*t*i*Math.cos(e))},e.prototype.update=function(){var t=this._bone1;if(t){var i=this.targetPosition,n=this.poleTargetPosition,r=e._tmpMats[0],o=e._tmpMats[1];this.targetMesh&&i.copyFrom(this.targetMesh.getAbsolutePosition()),this.poleTargetBone?this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset,this.mesh,n):this.poleTargetMesh&&a.e.TransformCoordinatesToRef(this.poleTargetLocalOffset,this.poleTargetMesh.getWorldMatrix(),n);var s=e._tmpVecs[0],c=e._tmpVecs[1],l=e._tmpVecs[2],u=e._tmpVecs[3],h=e._tmpVecs[4],d=e._tmpQuat;t.getAbsolutePositionToRef(this.mesh,s),n.subtractToRef(s,h),0==h.x&&0==h.y&&0==h.z?h.y=1:h.normalize(),i.subtractToRef(s,u),u.normalize(),a.e.CrossToRef(u,h,c),c.normalize(),a.e.CrossToRef(u,c,l),l.normalize(),a.a.FromXYZAxesToRef(l,u,c,r);var f=this._bone1Length,p=this._bone2Length,_=a.e.Distance(s,i);this._maxReach>0&&(_=Math.min(this._maxReach,_));var m=(p*p+_*_-f*f)/(2*p*_),g=(_*_+f*f-p*p)/(2*_*f);m>1&&(m=1),g>1&&(g=1),m<-1&&(m=-1),g<-1&&(g=-1);var v=Math.acos(m),b=Math.acos(g),y=-v-b;if(this._rightHandedSystem)a.a.RotationYawPitchRollToRef(0,0,this._adjustRoll,o),o.multiplyToRef(r,r),a.a.RotationAxisToRef(this._bendAxis,b,o),o.multiplyToRef(r,r);else{var T=e._tmpVecs[5];T.copyFrom(this._bendAxis),T.x*=-1,a.a.RotationAxisToRef(T,-b,o),o.multiplyToRef(r,r)}this.poleAngle&&(a.a.RotationAxisToRef(u,this.poleAngle,o),r.multiplyToRef(o,r)),this._bone1&&(this.slerpAmount<1?(this._slerping||a.b.FromRotationMatrixToRef(this._bone1Mat,this._bone1Quat),a.b.FromRotationMatrixToRef(r,d),a.b.SlerpToRef(this._bone1Quat,d,this.slerpAmount,this._bone1Quat),y=this._bone2Ang*(1-this.slerpAmount)+y*this.slerpAmount,this._bone1.setRotationQuaternion(this._bone1Quat,J.c.WORLD,this.mesh),this._slerping=!0):(this._bone1.setRotationMatrix(r,J.c.WORLD,this.mesh),this._bone1Mat.copyFrom(r),this._slerping=!1)),this._bone2.setAxisAngle(this._bendAxis,y,J.c.LOCAL),this._bone2Ang=y}},e._tmpVecs=[a.e.Zero(),a.e.Zero(),a.e.Zero(),a.e.Zero(),a.e.Zero(),a.e.Zero()],e._tmpQuat=a.b.Identity(),e._tmpMats=[a.a.Identity(),a.a.Identity()],e}(),Ye=function(){function e(e,t,i,n){if(this.upAxis=a.e.Up(),this.upAxisSpace=J.c.LOCAL,this.adjustYaw=0,this.adjustPitch=0,this.adjustRoll=0,this.slerpAmount=1,this._boneQuat=a.b.Identity(),this._slerping=!1,this._firstFrameSkipped=!1,this._fowardAxis=a.e.Forward(),this.mesh=e,this.bone=t,this.target=i,n&&(n.adjustYaw&&(this.adjustYaw=n.adjustYaw),n.adjustPitch&&(this.adjustPitch=n.adjustPitch),n.adjustRoll&&(this.adjustRoll=n.adjustRoll),null!=n.maxYaw?this.maxYaw=n.maxYaw:this.maxYaw=Math.PI,null!=n.minYaw?this.minYaw=n.minYaw:this.minYaw=-Math.PI,null!=n.maxPitch?this.maxPitch=n.maxPitch:this.maxPitch=Math.PI,null!=n.minPitch?this.minPitch=n.minPitch:this.minPitch=-Math.PI,null!=n.slerpAmount&&(this.slerpAmount=n.slerpAmount),null!=n.upAxis&&(this.upAxis=n.upAxis),null!=n.upAxisSpace&&(this.upAxisSpace=n.upAxisSpace),null!=n.yawAxis||null!=n.pitchAxis)){var r=J.a.Y,o=J.a.X;null!=n.yawAxis&&(r=n.yawAxis.clone()).normalize(),null!=n.pitchAxis&&(o=n.pitchAxis.clone()).normalize();var s=a.e.Cross(o,r);this._transformYawPitch=a.a.Identity(),a.a.FromXYZAxesToRef(o,r,s,this._transformYawPitch),this._transformYawPitchInv=this._transformYawPitch.clone(),this._transformYawPitch.invert()}t.getParent()||this.upAxisSpace!=J.c.BONE||(this.upAxisSpace=J.c.LOCAL)}return Object.defineProperty(e.prototype,"minYaw",{get:function(){return this._minYaw},set:function(e){this._minYaw=e,this._minYawSin=Math.sin(e),this._minYawCos=Math.cos(e),null!=this._maxYaw&&(this._midYawConstraint=.5*this._getAngleDiff(this._minYaw,this._maxYaw)+this._minYaw,this._yawRange=this._maxYaw-this._minYaw)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxYaw",{get:function(){return this._maxYaw},set:function(e){this._maxYaw=e,this._maxYawSin=Math.sin(e),this._maxYawCos=Math.cos(e),null!=this._minYaw&&(this._midYawConstraint=.5*this._getAngleDiff(this._minYaw,this._maxYaw)+this._minYaw,this._yawRange=this._maxYaw-this._minYaw)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minPitch",{get:function(){return this._minPitch},set:function(e){this._minPitch=e,this._minPitchTan=Math.tan(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxPitch",{get:function(){return this._maxPitch},set:function(e){this._maxPitch=e,this._maxPitchTan=Math.tan(e)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this.slerpAmount<1&&!this._firstFrameSkipped)this._firstFrameSkipped=!0;else{var t=this.bone,i=e._tmpVecs[0];t.getAbsolutePositionToRef(this.mesh,i);var n=this.target,r=e._tmpMats[0],o=e._tmpMats[1],s=this.mesh,c=t.getParent(),l=e._tmpVecs[1];l.copyFrom(this.upAxis),this.upAxisSpace==J.c.BONE&&c?(this._transformYawPitch&&a.e.TransformCoordinatesToRef(l,this._transformYawPitchInv,l),c.getDirectionToRef(l,this.mesh,l)):this.upAxisSpace==J.c.LOCAL&&(s.getDirectionToRef(l,l),1==s.scaling.x&&1==s.scaling.y&&1==s.scaling.z||l.normalize());var u=!1,h=!1;if(this._maxYaw==Math.PI&&this._minYaw==-Math.PI||(u=!0),this._maxPitch==Math.PI&&this._minPitch==-Math.PI||(h=!0),u||h){var d=e._tmpMats[2],f=e._tmpMats[3];if(this.upAxisSpace==J.c.BONE&&1==l.y&&c)c.getRotationMatrixToRef(J.c.WORLD,this.mesh,d);else if(this.upAxisSpace!=J.c.LOCAL||1!=l.y||c){(_=e._tmpVecs[2]).copyFrom(this._fowardAxis),this._transformYawPitch&&a.e.TransformCoordinatesToRef(_,this._transformYawPitchInv,_),c?c.getDirectionToRef(_,this.mesh,_):s.getDirectionToRef(_,_);var p=a.e.Cross(l,_);p.normalize();var _=a.e.Cross(p,l);a.a.FromXYZAxesToRef(p,l,_,d)}else d.copyFrom(s.getWorldMatrix());d.invertToRef(f);var m=null;if(h){var g=e._tmpVecs[3];n.subtractToRef(i,g),a.e.TransformCoordinatesToRef(g,f,g),m=Math.sqrt(g.x*g.x+g.z*g.z);var v=Math.atan2(g.y,m),b=v;v>this._maxPitch?(g.y=this._maxPitchTan*m,b=this._maxPitch):v<this._minPitch&&(g.y=this._minPitchTan*m,b=this._minPitch),v!=b&&(a.e.TransformCoordinatesToRef(g,d,g),g.addInPlace(i),n=g)}if(u){g=e._tmpVecs[4],n.subtractToRef(i,g),a.e.TransformCoordinatesToRef(g,f,g);var y=Math.atan2(g.x,g.z),T=y;if((y>this._maxYaw||y<this._minYaw)&&(null==m&&(m=Math.sqrt(g.x*g.x+g.z*g.z)),this._yawRange>Math.PI?this._isAngleBetween(y,this._maxYaw,this._midYawConstraint)?(g.z=this._maxYawCos*m,g.x=this._maxYawSin*m,T=this._maxYaw):this._isAngleBetween(y,this._midYawConstraint,this._minYaw)&&(g.z=this._minYawCos*m,g.x=this._minYawSin*m,T=this._minYaw):y>this._maxYaw?(g.z=this._maxYawCos*m,g.x=this._maxYawSin*m,T=this._maxYaw):y<this._minYaw&&(g.z=this._minYawCos*m,g.x=this._minYawSin*m,T=this._minYaw)),this._slerping&&this._yawRange>Math.PI){var E=e._tmpVecs[8];E.copyFrom(J.a.Z),this._transformYawPitch&&a.e.TransformCoordinatesToRef(E,this._transformYawPitchInv,E);var S=e._tmpMats[4];this._boneQuat.toRotationMatrix(S),this.mesh.getWorldMatrix().multiplyToRef(S,S),a.e.TransformCoordinatesToRef(E,S,E),a.e.TransformCoordinatesToRef(E,f,E);var A=Math.atan2(E.x,E.z);if(this._getAngleBetween(A,y)>this._getAngleBetween(A,this._midYawConstraint)){null==m&&(m=Math.sqrt(g.x*g.x+g.z*g.z));var P=this._getAngleBetween(A,this._maxYaw);this._getAngleBetween(A,this._minYaw)<P?(T=A+.75*Math.PI,g.z=Math.cos(T)*m,g.x=Math.sin(T)*m):(T=A-.75*Math.PI,g.z=Math.cos(T)*m,g.x=Math.sin(T)*m)}}y!=T&&(a.e.TransformCoordinatesToRef(g,d,g),g.addInPlace(i),n=g)}}var C=e._tmpVecs[5],R=e._tmpVecs[6],x=e._tmpVecs[7],O=e._tmpQuat;n.subtractToRef(i,C),C.normalize(),a.e.CrossToRef(l,C,R),R.normalize(),a.e.CrossToRef(C,R,x),x.normalize(),a.a.FromXYZAxesToRef(R,x,C,r),0===R.x&&0===R.y&&0===R.z||0===x.x&&0===x.y&&0===x.z||0===C.x&&0===C.y&&0===C.z||((this.adjustYaw||this.adjustPitch||this.adjustRoll)&&(a.a.RotationYawPitchRollToRef(this.adjustYaw,this.adjustPitch,this.adjustRoll,o),o.multiplyToRef(r,r)),this.slerpAmount<1?(this._slerping||this.bone.getRotationQuaternionToRef(J.c.WORLD,this.mesh,this._boneQuat),this._transformYawPitch&&this._transformYawPitch.multiplyToRef(r,r),a.b.FromRotationMatrixToRef(r,O),a.b.SlerpToRef(this._boneQuat,O,this.slerpAmount,this._boneQuat),this.bone.setRotationQuaternion(this._boneQuat,J.c.WORLD,this.mesh),this._slerping=!0):(this._transformYawPitch&&this._transformYawPitch.multiplyToRef(r,r),this.bone.setRotationMatrix(r,J.c.WORLD,this.mesh),this._slerping=!1))}},e.prototype._getAngleDiff=function(e,t){var i=t-e;return(i%=2*Math.PI)>Math.PI?i-=2*Math.PI:i<-Math.PI&&(i+=2*Math.PI),i},e.prototype._getAngleBetween=function(e,t){var i=0;return(i=(e=(e%=2*Math.PI)<0?e+2*Math.PI:e)<(t=(t%=2*Math.PI)<0?t+2*Math.PI:t)?t-e:e-t)>Math.PI&&(i=2*Math.PI-i),i},e.prototype._isAngleBetween=function(e,t,i){if(e=(e%=2*Math.PI)<0?e+2*Math.PI:e,(t=(t%=2*Math.PI)<0?t+2*Math.PI:t)<(i=(i%=2*Math.PI)<0?i+2*Math.PI:i)){if(e>t&&e<i)return!0}else if(e>i&&e<t)return!0;return!1},e._tmpVecs=Z.a.BuildArray(10,a.e.Zero),e._tmpQuat=a.b.Identity(),e._tmpMats=Z.a.BuildArray(5,a.a.Identity),e}(),Ke=i(10),Qe=i(27),qe=i(26);function Ze(e,t,i,n){var r;r=n===g.a.TEXTURETYPE_FLOAT?new Float32Array(t*i*4):new Uint32Array(t*i*4);for(var o=0;o<t;o++)for(var a=0;a<i;a++){var s=3*(a*t+o),c=4*(a*t+o);r[c+0]=e[s+0],r[c+1]=e[s+1],r[c+2]=e[s+2],r[c+3]=1}return r}function Je(e){return function(t,i,n,r,o,a,s,c,l,u){void 0===l&&(l=null),void 0===u&&(u=g.a.TEXTURETYPE_UNSIGNED_INT);var h=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,d=e?Qe.b.Raw3D:Qe.b.Raw2DArray,f=new Qe.a(this,d);f.baseWidth=i,f.baseHeight=n,f.baseDepth=r,f.width=i,f.height=n,f.depth=r,f.format=o,f.type=u,f.generateMipMaps=a,f.samplingMode=c,e?f.is3D=!0:f.is2DArray=!0,this._doNotHandleContextLost||(f._bufferView=t),e?this.updateRawTexture3D(f,t,o,s,l,u):this.updateRawTexture2DArray(f,t,o,s,l,u),this._bindTextureDirectly(h,f,!0);var p=this._getSamplingParameters(c,a);return this._gl.texParameteri(h,this._gl.TEXTURE_MAG_FILTER,p.mag),this._gl.texParameteri(h,this._gl.TEXTURE_MIN_FILTER,p.min),a&&this._gl.generateMipmap(h),this._bindTextureDirectly(h,null),this._internalTexturesCache.push(f),f}}function $e(e){return function(t,i,n,r,o,a){void 0===o&&(o=null),void 0===a&&(a=g.a.TEXTURETYPE_UNSIGNED_INT);var s=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,c=this._getWebGLTextureType(a),l=this._getInternalFormat(n),u=this._getRGBABufferInternalSizedFormat(a,n);this._bindTextureDirectly(s,t,!0),this._unpackFlipY(void 0===r||!!r),this._doNotHandleContextLost||(t._bufferView=i,t.format=n,t.invertY=r,t._compression=o),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),o&&i?this._gl.compressedTexImage3D(s,0,this.getCaps().s3tc[o],t.width,t.height,t.depth,0,i):this._gl.texImage3D(s,0,u,t.width,t.height,t.depth,0,l,c,i),t.generateMipMaps&&this._gl.generateMipmap(s),this._bindTextureDirectly(s,null),t.isReady=!0}}qe.a.prototype.updateRawTexture=function(e,t,i,n,r,o){if(void 0===r&&(r=null),void 0===o&&(o=g.a.TEXTURETYPE_UNSIGNED_INT),e){var a=this._getRGBABufferInternalSizedFormat(o,i),s=this._getInternalFormat(i),c=this._getWebGLTextureType(o);this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(e._bufferView=t,e.format=i,e.type=o,e.invertY=n,e._compression=r),e.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),r&&t?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[r],e.width,e.height,0,t):this._gl.texImage2D(this._gl.TEXTURE_2D,0,a,e.width,e.height,0,s,c,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}},qe.a.prototype.createRawTexture=function(e,t,i,n,r,o,a,s,c){void 0===s&&(s=null),void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT);var l=new Qe.a(this,Qe.b.Raw);l.baseWidth=t,l.baseHeight=i,l.width=t,l.height=i,l.format=n,l.generateMipMaps=r,l.samplingMode=a,l.invertY=o,l._compression=s,l.type=c,this._doNotHandleContextLost||(l._bufferView=e),this.updateRawTexture(l,e,n,o,s,c),this._bindTextureDirectly(this._gl.TEXTURE_2D,l,!0);var u=this._getSamplingParameters(a,r);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,u.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,u.min),r&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(l),l},qe.a.prototype.createRawCubeTexture=function(e,t,i,n,r,o,a,s){void 0===s&&(s=null);var c=this._gl,l=new Qe.a(this,Qe.b.CubeRaw);l.isCube=!0,l.format=i,l.type=n,this._doNotHandleContextLost||(l._bufferViewArray=e);var u=this._getWebGLTextureType(n),h=this._getInternalFormat(i);h===c.RGB&&(h=c.RGBA),u!==c.FLOAT||this._caps.textureFloatLinearFiltering?u!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?u!==c.FLOAT||this._caps.textureFloatRender?u!==c.HALF_FLOAT||this._caps.colorBufferFloat||(r=!1,m.a.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(r=!1,m.a.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(r=!1,a=g.a.TEXTURE_NEAREST_SAMPLINGMODE,m.a.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(r=!1,a=g.a.TEXTURE_NEAREST_SAMPLINGMODE,m.a.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."));var d=t,f=d;l.width=d,l.height=f,!this.needPOTTextures||Ce.b.IsExponentOfTwo(l.width)&&Ce.b.IsExponentOfTwo(l.height)||(r=!1),e&&this.updateRawCubeTexture(l,e,i,n,o,s),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,l,!0),e&&r&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);var p=this._getSamplingParameters(a,r);return c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_MAG_FILTER,p.mag),c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_MIN_FILTER,p.min),c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,null),l.generateMipMaps=r,l},qe.a.prototype.updateRawCubeTexture=function(e,t,i,n,r,o,a){void 0===o&&(o=null),void 0===a&&(a=0),e._bufferViewArray=t,e.format=i,e.type=n,e.invertY=r,e._compression=o;var s=this._gl,c=this._getWebGLTextureType(n),l=this._getInternalFormat(i),u=this._getRGBABufferInternalSizedFormat(n),h=!1;l===s.RGB&&(l=s.RGBA,h=!0),this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===r||!!r),e.width%4!=0&&s.pixelStorei(s.UNPACK_ALIGNMENT,1);for(var d=0;d<6;d++){var f=t[d];o?s.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+d,a,this.getCaps().s3tc[o],e.width,e.height,0,f):(h&&(f=Ze(f,e.width,e.height,n)),s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+d,a,u,e.width,e.height,0,l,c,f))}(!this.needPOTTextures||Ce.b.IsExponentOfTwo(e.width)&&Ce.b.IsExponentOfTwo(e.height))&&e.generateMipMaps&&0===a&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},qe.a.prototype.createRawCubeTextureFromUrl=function(e,t,i,n,r,o,a,s,c,l,u,h){var d=this;void 0===c&&(c=null),void 0===l&&(l=null),void 0===u&&(u=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===h&&(h=!1);var f=this._gl,p=this.createRawCubeTexture(null,i,n,r,!o,h,u,null);return null==t||t._addPendingData(p),p.url=e,this._internalTexturesCache.push(p),this._loadFile(e,function(e){!function(e){var i=p.width,o=a(e);if(o){if(s){var l=d._getWebGLTextureType(r),u=d._getInternalFormat(n),_=d._getRGBABufferInternalSizedFormat(r),m=!1;u===f.RGB&&(u=f.RGBA,m=!0),d._bindTextureDirectly(f.TEXTURE_CUBE_MAP,p,!0),d._unpackFlipY(!1);for(var g=s(o),v=0;v<g.length;v++)for(var b=i>>v,y=0;y<6;y++){var T=g[v][y];m&&(T=Ze(T,b,b,r)),f.texImage2D(y,v,_,b,b,0,u,l,T)}d._bindTextureDirectly(f.TEXTURE_CUBE_MAP,null)}else d.updateRawCubeTexture(p,o,n,r,h);p.isReady=!0,null==t||t._removePendingData(p),c&&c()}}(e)},void 0,null==t?void 0:t.offlineProvider,!0,function(e,i){null==t||t._removePendingData(p),l&&e&&l(e.status+" "+e.statusText,i)}),p},qe.a.prototype.createRawTexture2DArray=Je(!1),qe.a.prototype.createRawTexture3D=Je(!0),qe.a.prototype.updateRawTexture2DArray=$e(!1),qe.a.prototype.updateRawTexture3D=$e(!0);var et=function(e){function t(t,i,n,r,o,a,s,c,l){void 0===a&&(a=!0),void 0===s&&(s=!1),void 0===c&&(c=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===l&&(l=g.a.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,null,o,!a,s)||this;return u.format=r,u._engine?(u._texture=u._engine.createRawTexture(t,i,n,r,a,s,c,null,l),u.wrapU=Ke.a.CLAMP_ADDRESSMODE,u.wrapV=Ke.a.CLAMP_ADDRESSMODE,u):u}return Object(h.d)(t,e),t.prototype.update=function(e){this._getEngine().updateRawTexture(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t.CreateLuminanceTexture=function(e,i,n,r,o,a,s){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,i,n,g.a.TEXTUREFORMAT_LUMINANCE,r,o,a,s)},t.CreateLuminanceAlphaTexture=function(e,i,n,r,o,a,s){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,i,n,g.a.TEXTUREFORMAT_LUMINANCE_ALPHA,r,o,a,s)},t.CreateAlphaTexture=function(e,i,n,r,o,a,s){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,i,n,g.a.TEXTUREFORMAT_ALPHA,r,o,a,s)},t.CreateRGBTexture=function(e,i,n,r,o,a,s,c){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT),new t(e,i,n,g.a.TEXTUREFORMAT_RGB,r,o,a,s,c)},t.CreateRGBATexture=function(e,i,n,r,o,a,s,c){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT),new t(e,i,n,g.a.TEXTUREFORMAT_RGBA,r,o,a,s,c)},t.CreateRTexture=function(e,i,n,r,o,a,s,c){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=Ke.a.TRILINEAR_SAMPLINGMODE),void 0===c&&(c=g.a.TEXTURETYPE_FLOAT),new t(e,i,n,g.a.TEXTUREFORMAT_R,r,o,a,s,c)},t}(Ke.a),tt=function(){function e(e,t,i){this.name=e,this.id=t,this.bones=new Array,this.needInitialSkinMatrix=!1,this.overrideMesh=null,this._isDirty=!0,this._meshesWithPoseMatrix=new Array,this._identity=a.a.Identity(),this._ranges={},this._lastAbsoluteTransformsUpdateId=-1,this._canUseTextureForBones=!1,this._uniqueId=0,this._numBonesWithLinkedTransformNode=0,this._hasWaitingData=null,this._waitingOverrideMeshId=null,this.doNotSerialize=!1,this._useTextureToStoreBoneMatrices=!0,this._animationPropertiesOverride=null,this.onBeforeComputeObservable=new o.c,this.bones=[],this._scene=i||x.a.LastCreatedScene,this._uniqueId=this._scene.getUniqueId(),this._scene.addSkeleton(this),this._isDirty=!0;var n=this._scene.getEngine().getCaps();this._canUseTextureForBones=n.textureFloat&&n.maxVertexTextureImageUnits>0}return Object.defineProperty(e.prototype,"useTextureToStoreBoneMatrices",{get:function(){return this._useTextureToStoreBoneMatrices},set:function(e){this._useTextureToStoreBoneMatrices=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUsingTextureForMatrices",{get:function(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"Skeleton"},e.prototype.getChildren=function(){return this.bones.filter(function(e){return!e.getParent()})},e.prototype.getTransformMatrices=function(e){return this.needInitialSkinMatrix&&e._bonesTransformMatrices?e._bonesTransformMatrices:(this._transformMatrices||this.prepare(),this._transformMatrices)},e.prototype.getTransformMatrixTexture=function(e){return this.needInitialSkinMatrix&&e._transformMatrixTexture?e._transformMatrixTexture:this._transformMatrixTexture},e.prototype.getScene=function(){return this._scene},e.prototype.toString=function(e){var t="Name: "+this.name+", nBones: "+this.bones.length;if(t+=", nAnimationRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var i=!0;for(var n in this._ranges)i&&(t+=", ",i=!1),t+=n;t+="}"}return t},e.prototype.getBoneIndexByName=function(e){for(var t=0,i=this.bones.length;t<i;t++)if(this.bones[t].name===e)return t;return-1},e.prototype.createAnimationRange=function(e,t,i){if(!this._ranges[e]){this._ranges[e]=new F(e,t,i);for(var n=0,r=this.bones.length;n<r;n++)this.bones[n].animations[0]&&this.bones[n].animations[0].createRange(e,t,i)}},e.prototype.deleteAnimationRange=function(e,t){void 0===t&&(t=!0);for(var i=0,n=this.bones.length;i<n;i++)this.bones[i].animations[0]&&this.bones[i].animations[0].deleteRange(e,t);this._ranges[e]=null},e.prototype.getAnimationRange=function(e){return this._ranges[e]||null},e.prototype.getAnimationRanges=function(){var e,t=[];for(e in this._ranges)t.push(this._ranges[e]);return t},e.prototype.copyAnimationRange=function(e,t,i){if(void 0===i&&(i=!1),this._ranges[t]||!e.getAnimationRange(t))return!1;var n,r,o=!0,a=this._getHighestAnimationFrame()+1,s={},c=e.bones;for(r=0,n=c.length;r<n;r++)s[c[r].name]=c[r];this.bones.length!==c.length&&(m.a.Warn("copyAnimationRange: this rig has "+this.bones.length+" bones, while source as "+c.length),o=!1);var l=i&&this.dimensionsAtRest&&e.dimensionsAtRest?this.dimensionsAtRest.divide(e.dimensionsAtRest):null;for(r=0,n=this.bones.length;r<n;r++){var u=this.bones[r].name,h=s[u];h?o=o&&this.bones[r].copyAnimationRange(h,t,a,i,l):(m.a.Warn("copyAnimationRange: not same rig, missing source bone "+u),o=!1)}var d=e.getAnimationRange(t);return d&&(this._ranges[t]=new F(t,d.from+a,d.to+a)),o},e.prototype.returnToRest=function(){for(var e=a.c.Vector3[0],t=a.c.Quaternion[0],i=a.c.Vector3[1],n=0;n<this.bones.length;n++){var r=this.bones[n];-1!==r._index&&(r.returnToRest(),r._linkedTransformNode&&(r.getRestPose().decompose(e,t,i),r._linkedTransformNode.position=i.clone(),r._linkedTransformNode.rotationQuaternion=t.clone(),r._linkedTransformNode.scaling=e.clone()))}},e.prototype._getHighestAnimationFrame=function(){for(var e=0,t=0,i=this.bones.length;t<i;t++)if(this.bones[t].animations[0]){var n=this.bones[t].animations[0].getHighestFrame();e<n&&(e=n)}return e},e.prototype.beginAnimation=function(e,t,i,n){var r=this.getAnimationRange(e);return r?this._scene.beginAnimation(this,r.from,r.to,t,i,n):null},e.MakeAnimationAdditive=function(e,t,i){void 0===t&&(t=0);var n=e.getAnimationRange(i);if(!n)return null;for(var r=e._scene.getAllAnimatablesByTarget(e),o=null,a=0;a<r.length;a++){var s=r[a];if(s.fromFrame===(null==n?void 0:n.from)&&s.toFrame===(null==n?void 0:n.to)){o=s;break}}var c=e.getAnimatables();for(a=0;a<c.length;a++){var l=c[a].animations;if(l)for(var u=0;u<l.length;u++)G.MakeAnimationAdditive(l[u],t,i)}return o&&(o.isAdditive=!0),e},e.prototype._markAsDirty=function(){this._isDirty=!0},e.prototype._registerMeshWithPoseMatrix=function(e){this._meshesWithPoseMatrix.push(e)},e.prototype._unregisterMeshWithPoseMatrix=function(e){var t=this._meshesWithPoseMatrix.indexOf(e);t>-1&&this._meshesWithPoseMatrix.splice(t,1)},e.prototype._computeTransformMatrices=function(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(var i=0;i<this.bones.length;i++){var n=this.bones[i];n._childUpdateId++;var r=n.getParent();if(r?n.getLocalMatrix().multiplyToRef(r.getWorldMatrix(),n.getWorldMatrix()):t?n.getLocalMatrix().multiplyToRef(t,n.getWorldMatrix()):n.getWorldMatrix().copyFrom(n.getLocalMatrix()),-1!==n._index){var o=null===n._index?i:n._index;n.getInvertedAbsoluteTransform().multiplyToArray(n.getWorldMatrix(),e,16*o)}}this._identity.copyToArray(e,16*this.bones.length)},e.prototype.prepare=function(){if(this._numBonesWithLinkedTransformNode>0)for(var e=0,t=this.bones;e<t.length;e++){var i=t[e];i._linkedTransformNode&&(i._linkedTransformNode.computeWorldMatrix(),i._matrix=i._linkedTransformNode._localMatrix,i.markAsDirty())}if(this._isDirty){if(this.needInitialSkinMatrix)for(var n=0;n<this._meshesWithPoseMatrix.length;n++){var r=this._meshesWithPoseMatrix[n],o=r.getPoseMatrix();if(r._bonesTransformMatrices&&r._bonesTransformMatrices.length===16*(this.bones.length+1)||(r._bonesTransformMatrices=new Float32Array(16*(this.bones.length+1))),this._synchronizedWithMesh!==r){this._synchronizedWithMesh=r;for(var s=0;s<this.bones.length;s++){var c=this.bones[s];c.getParent()||(c.getBaseMatrix().multiplyToRef(o,a.c.Matrix[1]),c._updateDifferenceMatrix(a.c.Matrix[1]))}if(this.isUsingTextureForMatrices){var l=4*(this.bones.length+1);r._transformMatrixTexture&&r._transformMatrixTexture.getSize().width===l||(r._transformMatrixTexture&&r._transformMatrixTexture.dispose(),r._transformMatrixTexture=et.CreateRGBATexture(r._bonesTransformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,g.a.TEXTURE_NEAREST_SAMPLINGMODE,g.a.TEXTURETYPE_FLOAT))}}this._computeTransformMatrices(r._bonesTransformMatrices,o),this.isUsingTextureForMatrices&&r._transformMatrixTexture&&r._transformMatrixTexture.update(r._bonesTransformMatrices)}else this._transformMatrices&&this._transformMatrices.length===16*(this.bones.length+1)||(this._transformMatrices=new Float32Array(16*(this.bones.length+1)),this.isUsingTextureForMatrices&&(this._transformMatrixTexture&&this._transformMatrixTexture.dispose(),this._transformMatrixTexture=et.CreateRGBATexture(this._transformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,g.a.TEXTURE_NEAREST_SAMPLINGMODE,g.a.TEXTURETYPE_FLOAT))),this._computeTransformMatrices(this._transformMatrices,null),this.isUsingTextureForMatrices&&this._transformMatrixTexture&&this._transformMatrixTexture.update(this._transformMatrices);this._isDirty=!1,this._scene._activeBones.addCount(this.bones.length,!1)}},e.prototype.getAnimatables=function(){if(!this._animatables||this._animatables.length!==this.bones.length){this._animatables=[];for(var e=0;e<this.bones.length;e++)this._animatables.push(this.bones[e])}return this._animatables},e.prototype.clone=function(t,i){var n=new e(t,i||t,this._scene);n.needInitialSkinMatrix=this.needInitialSkinMatrix,n.overrideMesh=this.overrideMesh;for(var r=0;r<this.bones.length;r++){var o=this.bones[r],a=null,s=o.getParent();if(s){var c=this.bones.indexOf(s);a=n.bones[c]}var l=new $(o.name,n,a,o.getBaseMatrix().clone(),o.getRestPose().clone());l._index=o._index,o._linkedTransformNode&&l.linkTransformNode(o._linkedTransformNode),O.a.DeepCopy(o.animations,l.animations)}if(this._ranges)for(var u in n._ranges={},this._ranges){var h=this._ranges[u];h&&(n._ranges[u]=h.clone())}return this._isDirty=!0,n},e.prototype.enableBlending=function(e){void 0===e&&(e=.01),this.bones.forEach(function(t){t.animations.forEach(function(t){t.enableBlending=!0,t.blendingSpeed=e})})},e.prototype.dispose=function(){this._meshesWithPoseMatrix=[],this.getScene().stopAnimation(this),this.getScene().removeSkeleton(this),this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null)},e.prototype.serialize=function(){var e,t,i={};i.name=this.name,i.id=this.id,this.dimensionsAtRest&&(i.dimensionsAtRest=this.dimensionsAtRest.asArray()),i.bones=[],i.needInitialSkinMatrix=this.needInitialSkinMatrix,i.overrideMeshId=null===(e=this.overrideMesh)||void 0===e?void 0:e.id;for(var n=0;n<this.bones.length;n++){var r=this.bones[n],o=r.getParent(),a={parentBoneIndex:o?this.bones.indexOf(o):-1,index:r.getIndex(),name:r.name,matrix:r.getBaseMatrix().toArray(),rest:r.getRestPose().toArray(),linkedTransformNodeId:null===(t=r.getTransformNode())||void 0===t?void 0:t.id};for(var s in i.bones.push(a),r.length&&(a.length=r.length),r.metadata&&(a.metadata=r.metadata),r.animations&&r.animations.length>0&&(a.animation=r.animations[0].serialize()),i.ranges=[],this._ranges){var c=this._ranges[s];if(c){var l={};l.name=s,l.from=c.from,l.to=c.to,i.ranges.push(l)}}}return i},e.Parse=function(t,i){var n,r=new e(t.name,t.id,i);for(t.dimensionsAtRest&&(r.dimensionsAtRest=a.e.FromArray(t.dimensionsAtRest)),r.needInitialSkinMatrix=t.needInitialSkinMatrix,t.overrideMeshId&&(r._hasWaitingData=!0,r._waitingOverrideMeshId=t.overrideMeshId),n=0;n<t.bones.length;n++){var o=t.bones[n],s=t.bones[n].index,c=null;o.parentBoneIndex>-1&&(c=r.bones[o.parentBoneIndex]);var l=o.rest?a.a.FromArray(o.rest):null,u=new $(o.name,r,c,a.a.FromArray(o.matrix),l,null,s);void 0!==o.id&&null!==o.id&&(u.id=o.id),o.length&&(u.length=o.length),o.metadata&&(u.metadata=o.metadata),o.animation&&u.animations.push(G.Parse(o.animation)),void 0!==o.linkedTransformNodeId&&null!==o.linkedTransformNodeId&&(r._hasWaitingData=!0,u._waitingTransformNodeId=o.linkedTransformNodeId)}if(t.ranges)for(n=0;n<t.ranges.length;n++){var h=t.ranges[n];r.createAnimationRange(h.name,h.from,h.to)}return r},e.prototype.computeAbsoluteTransforms=function(e){void 0===e&&(e=!1);var t=this._scene.getRenderId();(this._lastAbsoluteTransformsUpdateId!=t||e)&&(this.bones[0].computeAbsoluteTransforms(),this._lastAbsoluteTransformsUpdateId=t)},e.prototype.getPoseMatrix=function(){var e=null;return this._meshesWithPoseMatrix.length>0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e},e.prototype.sortBones=function(){for(var e=new Array,t=new Array(this.bones.length),i=0;i<this.bones.length;i++)this._sortBones(i,e,t);this.bones=e},e.prototype._sortBones=function(e,t,i){if(!i[e]){i[e]=!0;var n=this.bones[e];void 0===n._index&&(n._index=e);var r=n.getParent();r&&this._sortBones(this.bones.indexOf(r),t,i),t.push(n)}},e.prototype.setCurrentPoseAsRest=function(){this.bones.forEach(function(e){e.setCurrentPoseAsRest()})},e}(),it={},nt=function(){function e(e){this.attachedToElement=!1,this.attached={},this.camera=e,this.checkInputs=function(){}}return e.prototype.add=function(e){var t=e.getSimpleName();this.attached[t]?m.a.Warn("camera input of type "+t+" already exists on camera"):(this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedToElement&&e.attachControl())},e.prototype.remove=function(e){for(var t in this.attached){var i=this.attached[t];i===e&&(i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck())}},e.prototype.removeByType=function(e){for(var t in this.attached){var i=this.attached[t];i.getClassName()===e&&(i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck())}},e.prototype._addCheckInputs=function(e){var t=this.checkInputs;return function(){t(),e()}},e.prototype.attachInput=function(e){this.attachedToElement&&e.attachControl(this.noPreventDefault)},e.prototype.attachElement=function(e){if(void 0===e&&(e=!1),!this.attachedToElement)for(var t in e=!je.a.ForceAttachControlToAlwaysPreventDefault&&e,this.attachedToElement=!0,this.noPreventDefault=e,this.attached)this.attached[t].attachControl(e)},e.prototype.detachElement=function(e){for(var t in void 0===e&&(e=!1),this.attached)this.attached[t].detachControl(),e&&(this.attached[t].camera=null);this.attachedToElement=!1},e.prototype.rebuildInputCheck=function(){for(var e in this.checkInputs=function(){},this.attached){var t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}},e.prototype.clear=function(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=function(){}},e.prototype.serialize=function(e){var t={};for(var i in this.attached){var n=this.attached[i],r=w.a.Serialize(n);t[n.getClassName()]=r}e.inputsmgr=t},e.prototype.parse=function(e){var t=e.inputsmgr;if(t){for(var i in this.clear(),t)if(o=it[i]){var n=t[i],r=w.a.Parse(function(){return new o},n,null);this.add(r)}}else for(var i in this.attached){var o;(o=it[this.attached[i].getClassName()])&&(r=w.a.Parse(function(){return new o},e,null),this.remove(this.attached[i]),this.add(r))}},e}(),rt=function(e,t){this.x=e,this.y=t},ot=function(){function e(t,i,n,r,o,a,s){void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=2),void 0===s&&(s=3),this.id=t,this.index=i,this.browserGamepad=n,this._leftStick={x:0,y:0},this._rightStick={x:0,y:0},this._isConnected=!0,this._invertLeftStickY=!1,this.type=e.GAMEPAD,this._leftStickAxisX=r,this._leftStickAxisY=o,this._rightStickAxisX=a,this._rightStickAxisY=s,this.browserGamepad.axes.length>=2&&(this._leftStick={x:this.browserGamepad.axes[this._leftStickAxisX],y:this.browserGamepad.axes[this._leftStickAxisY]}),this.browserGamepad.axes.length>=4&&(this._rightStick={x:this.browserGamepad.axes[this._rightStickAxisX],y:this.browserGamepad.axes[this._rightStickAxisY]})}return Object.defineProperty(e.prototype,"isConnected",{get:function(){return this._isConnected},enumerable:!1,configurable:!0}),e.prototype.onleftstickchanged=function(e){this._onleftstickchanged=e},e.prototype.onrightstickchanged=function(e){this._onrightstickchanged=e},Object.defineProperty(e.prototype,"leftStick",{get:function(){return this._leftStick},set:function(e){!this._onleftstickchanged||this._leftStick.x===e.x&&this._leftStick.y===e.y||this._onleftstickchanged(e),this._leftStick=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightStick",{get:function(){return this._rightStick},set:function(e){!this._onrightstickchanged||this._rightStick.x===e.x&&this._rightStick.y===e.y||this._onrightstickchanged(e),this._rightStick=e},enumerable:!1,configurable:!0}),e.prototype.update=function(){this._leftStick&&(this.leftStick={x:this.browserGamepad.axes[this._leftStickAxisX],y:this.browserGamepad.axes[this._leftStickAxisY]},this._invertLeftStickY&&(this.leftStick.y*=-1)),this._rightStick&&(this.rightStick={x:this.browserGamepad.axes[this._rightStickAxisX],y:this.browserGamepad.axes[this._rightStickAxisY]})},e.prototype.dispose=function(){},e.GAMEPAD=0,e.GENERIC=1,e.XBOX=2,e.POSE_ENABLED=3,e.DUALSHOCK=4,e}(),at=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r.onButtonDownObservable=new o.c,r.onButtonUpObservable=new o.c,r.type=ot.GENERIC,r._buttons=new Array(n.buttons.length),r}return Object(h.d)(t,e),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype._setButtonValue=function(e,t,i){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(i),this.onButtonDownObservable.notifyObservers(i)),0===e&&(this._onbuttonup&&this._onbuttonup(i),this.onButtonUpObservable.notifyObservers(i))),e},t.prototype.update=function(){e.prototype.update.call(this);for(var t=0;t<this._buttons.length;t++)this._buttons[t]=this._setButtonValue(this.browserGamepad.buttons[t].value,this._buttons[t],t)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear()},t}(ot),st=function(){function e(){this.gamepadRotationSensibility=80,this.gamepadMoveSensibility=40,this._yAxisScale=1}return Object.defineProperty(e.prototype,"invertYAxis",{get:function(){return 1!==this._yAxisScale},set:function(e){this._yAxisScale=e?-1:1},enumerable:!1,configurable:!0}),e.prototype.attachControl=function(){var e=this,t=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=t.onGamepadConnectedObservable.add(function(t){t.type!==ot.POSE_ENABLED&&(e.gamepad&&t.type!==ot.XBOX||(e.gamepad=t))}),this._onGamepadDisconnectedObserver=t.onGamepadDisconnectedObservable.add(function(t){e.gamepad===t&&(e.gamepad=null)}),this.gamepad=t.getGamepadByType(ot.XBOX)},e.prototype.detachControl=function(e){this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),this.gamepad=null},e.prototype.checkInputs=function(){if(this.gamepad){var e=this.camera,t=this.gamepad.rightStick;if(t){if(0!=t.x){var i=t.x/this.gamepadRotationSensibility;0!=i&&Math.abs(i)>.005&&(e.inertialAlphaOffset+=i)}if(0!=t.y){var n=t.y/this.gamepadRotationSensibility*this._yAxisScale;0!=n&&Math.abs(n)>.005&&(e.inertialBetaOffset+=n)}}var r=this.gamepad.leftStick;if(r&&0!=r.y){var o=r.y/this.gamepadMoveSensibility;0!=o&&Math.abs(o)>.005&&(this.camera.inertialRadiusOffset-=o)}}},e.prototype.getClassName=function(){return"ArcRotateCameraGamepadInput"},e.prototype.getSimpleName=function(){return"gamepad"},Object(h.c)([Object(w.c)()],e.prototype,"gamepadRotationSensibility",void 0),Object(h.c)([Object(w.c)()],e.prototype,"gamepadMoveSensibility",void 0),e}();it.ArcRotateCameraGamepadInput=st;var ct=i(66),lt=function(){function e(){this.keysUp=[38],this.keysDown=[40],this.keysLeft=[37],this.keysRight=[39],this.keysReset=[220],this.panningSensibility=50,this.zoomingSensibility=25,this.useAltToZoom=!0,this.angularSpeed=.01,this._keys=new Array}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){t._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(i){var n,r=i.event;r.metaKey||(i.type===ct.a.KEYDOWN?(t._ctrlPressed=r.ctrlKey,t._altPressed=r.altKey,(-1!==t.keysUp.indexOf(r.keyCode)||-1!==t.keysDown.indexOf(r.keyCode)||-1!==t.keysLeft.indexOf(r.keyCode)||-1!==t.keysRight.indexOf(r.keyCode)||-1!==t.keysReset.indexOf(r.keyCode))&&(-1===(n=t._keys.indexOf(r.keyCode))&&t._keys.push(r.keyCode),r.preventDefault&&(e||r.preventDefault()))):-1===t.keysUp.indexOf(r.keyCode)&&-1===t.keysDown.indexOf(r.keyCode)&&-1===t.keysLeft.indexOf(r.keyCode)&&-1===t.keysRight.indexOf(r.keyCode)&&-1===t.keysReset.indexOf(r.keyCode)||((n=t._keys.indexOf(r.keyCode))>=0&&t._keys.splice(n,1),r.preventDefault&&(e||r.preventDefault())))}))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.checkInputs=function(){if(this._onKeyboardObserver)for(var e=this.camera,t=0;t<this._keys.length;t++){var i=this._keys[t];-1!==this.keysLeft.indexOf(i)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningX-=1/this.panningSensibility:e.inertialAlphaOffset-=this.angularSpeed:-1!==this.keysUp.indexOf(i)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningY+=1/this.panningSensibility:this._altPressed&&this.useAltToZoom?e.inertialRadiusOffset+=1/this.zoomingSensibility:e.inertialBetaOffset-=this.angularSpeed:-1!==this.keysRight.indexOf(i)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningX+=1/this.panningSensibility:e.inertialAlphaOffset+=this.angularSpeed:-1!==this.keysDown.indexOf(i)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningY-=1/this.panningSensibility:this._altPressed&&this.useAltToZoom?e.inertialRadiusOffset-=1/this.zoomingSensibility:e.inertialBetaOffset+=this.angularSpeed:-1!==this.keysReset.indexOf(i)&&e.useInputToRestoreState&&e.restoreState()}},e.prototype.getClassName=function(){return"ArcRotateCameraKeyboardMoveInput"},e.prototype.getSimpleName=function(){return"keyboard"},Object(h.c)([Object(w.c)()],e.prototype,"keysUp",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysDown",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysLeft",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRight",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysReset",void 0),Object(h.c)([Object(w.c)()],e.prototype,"panningSensibility",void 0),Object(h.c)([Object(w.c)()],e.prototype,"zoomingSensibility",void 0),Object(h.c)([Object(w.c)()],e.prototype,"useAltToZoom",void 0),Object(h.c)([Object(w.c)()],e.prototype,"angularSpeed",void 0),e}();it.ArcRotateCameraKeyboardMoveInput=lt;var ut=function(){function e(){this.wheelPrecision=3,this.wheelDeltaPercentage=0}return e.prototype.computeDeltaFromMouseWheelLegacyEvent=function(e,t){var i=.01*e*this.wheelDeltaPercentage*t;return e>0?i/(1+this.wheelDeltaPercentage):i*(1+this.wheelDeltaPercentage)},e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this._wheel=function(i,n){if(i.type===Ne.a.POINTERWHEEL){var r,o=i.event,a=0,s=o;if(r=s.wheelDelta?s.wheelDelta:60*-(o.deltaY||o.detail),t.wheelDeltaPercentage){if((a=t.computeDeltaFromMouseWheelLegacyEvent(r,t.camera.radius))>0){for(var c=t.camera.radius,l=t.camera.inertialRadiusOffset+a,u=0;u<20&&Math.abs(l)>.001;u++)c-=l,l*=t.camera.inertia;c=L.a.Clamp(c,0,Number.MAX_VALUE),a=t.computeDeltaFromMouseWheelLegacyEvent(r,c)}}else a=r/(40*t.wheelPrecision);a&&(t.camera.inertialRadiusOffset+=a),o.preventDefault&&(e||o.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,Ne.a.POINTERWHEEL)},e.prototype.detachControl=function(e){this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._wheel=null)},e.prototype.getClassName=function(){return"ArcRotateCameraMouseWheelInput"},e.prototype.getSimpleName=function(){return"mousewheel"},Object(h.c)([Object(w.c)()],e.prototype,"wheelPrecision",void 0),Object(h.c)([Object(w.c)()],e.prototype,"wheelDeltaPercentage",void 0),e}();it.ArcRotateCameraMouseWheelInput=ut;var ht=function(){function e(){this.buttons=[0,1,2]}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments);var i=this.camera.getEngine(),n=i.getInputElement(),r=0,o=null;this.pointA=null,this.pointB=null,this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._pointerInput=function(a,s){var c=a.event,l="touch"===c.pointerType;if(!i.isInVRExclusivePointerMode&&(a.type===Ne.a.POINTERMOVE||-1!==t.buttons.indexOf(c.button))){var u=c.srcElement||c.target;if(t._altKey=c.altKey,t._ctrlKey=c.ctrlKey,t._metaKey=c.metaKey,t._shiftKey=c.shiftKey,t._buttonsPressed=c.buttons,i.isPointerLock){var h=c.movementX||c.mozMovementX||c.webkitMovementX||c.msMovementX||0,d=c.movementY||c.mozMovementY||c.webkitMovementY||c.msMovementY||0;t.onTouch(null,h,d),t.pointA=null,t.pointB=null}else if(a.type===Ne.a.POINTERDOWN&&u){try{u.setPointerCapture(c.pointerId)}catch(e){}null===t.pointA?t.pointA={x:c.clientX,y:c.clientY,pointerId:c.pointerId,type:c.pointerType}:null===t.pointB&&(t.pointB={x:c.clientX,y:c.clientY,pointerId:c.pointerId,type:c.pointerType}),t.onButtonDown(c),e||(c.preventDefault(),n&&n.focus())}else if(a.type===Ne.a.POINTERDOUBLETAP)t.onDoubleTap(c.pointerType);else if(a.type===Ne.a.POINTERUP&&u){try{u.releasePointerCapture(c.pointerId)}catch(e){}l||(t.pointB=null),i._badOS?t.pointA=t.pointB=null:t.pointB&&t.pointA&&t.pointA.pointerId==c.pointerId?(t.pointA=t.pointB,t.pointB=null):t.pointA&&t.pointB&&t.pointB.pointerId==c.pointerId?t.pointB=null:t.pointA=t.pointB=null,(0!==r||o)&&(t.onMultiTouch(t.pointA,t.pointB,r,0,o,null),r=0,o=null),t.onButtonUp(c),e||c.preventDefault()}else if(a.type===Ne.a.POINTERMOVE)if(e||c.preventDefault(),t.pointA&&null===t.pointB)h=c.clientX-t.pointA.x,d=c.clientY-t.pointA.y,t.onTouch(t.pointA,h,d),t.pointA.x=c.clientX,t.pointA.y=c.clientY;else if(t.pointA&&t.pointB){var f=t.pointA.pointerId===c.pointerId?t.pointA:t.pointB;f.x=c.clientX,f.y=c.clientY;var p=t.pointA.x-t.pointB.x,_=t.pointA.y-t.pointB.y,m=p*p+_*_,g={x:(t.pointA.x+t.pointB.x)/2,y:(t.pointA.y+t.pointB.y)/2,pointerId:c.pointerId,type:a.type};t.onMultiTouch(t.pointA,t.pointB,r,m,o,g),o=g,r=m}}},this._observer=this.camera.getScene().onPointerObservable.add(this._pointerInput,Ne.a.POINTERDOWN|Ne.a.POINTERUP|Ne.a.POINTERMOVE),this._onLostFocus=function(){t.pointA=t.pointB=null,r=0,o=null,t.onLostFocus()},n&&n.addEventListener("contextmenu",this.onContextMenu.bind(this),!1);var a=this.camera.getScene().getEngine().getHostWindow();a&&Ce.b.RegisterTopRootEvents(a,[{name:"blur",handler:this._onLostFocus}])},e.prototype.detachControl=function(e){if(this._onLostFocus){var t=this.camera.getScene().getEngine().getHostWindow();t&&Ce.b.UnregisterTopRootEvents(t,[{name:"blur",handler:this._onLostFocus}])}if(this._observer){if(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this.onContextMenu){var i=this.camera.getScene().getEngine().getInputElement();i&&i.removeEventListener("contextmenu",this.onContextMenu)}this._onLostFocus=null}this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0},e.prototype.getClassName=function(){return"BaseCameraPointersInput"},e.prototype.getSimpleName=function(){return"pointers"},e.prototype.onDoubleTap=function(e){},e.prototype.onTouch=function(e,t,i){},e.prototype.onMultiTouch=function(e,t,i,n,r,o){},e.prototype.onContextMenu=function(e){e.preventDefault()},e.prototype.onButtonDown=function(e){},e.prototype.onButtonUp=function(e){},e.prototype.onLostFocus=function(){},Object(h.c)([Object(w.c)()],e.prototype,"buttons",void 0),e}(),dt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[0,1,2],t.angularSensibilityX=1e3,t.angularSensibilityY=1e3,t.pinchPrecision=12,t.pinchDeltaPercentage=0,t.useNaturalPinchZoom=!1,t.panningSensibility=1e3,t.multiTouchPanning=!0,t.multiTouchPanAndZoom=!0,t.pinchInwards=!0,t._isPanClick=!1,t._twoFingerActivityCount=0,t._isPinching=!1,t}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ArcRotateCameraPointersInput"},t.prototype.onTouch=function(e,t,i){0!==this.panningSensibility&&(this._ctrlKey&&this.camera._useCtrlForPanning||this._isPanClick)?(this.camera.inertialPanningX+=-t/this.panningSensibility,this.camera.inertialPanningY+=i/this.panningSensibility):(this.camera.inertialAlphaOffset-=t/this.angularSensibilityX,this.camera.inertialBetaOffset-=i/this.angularSensibilityY)},t.prototype.onDoubleTap=function(e){this.camera.useInputToRestoreState&&this.camera.restoreState()},t.prototype.onMultiTouch=function(e,t,i,n,r,o){if(!(0===i&&null===r||0===n&&null===o)){var a=this.pinchInwards?1:-1;if(this.multiTouchPanAndZoom){if(this.useNaturalPinchZoom?this.camera.radius=this.camera.radius*Math.sqrt(i)/Math.sqrt(n):this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=.001*(n-i)*this.camera.radius*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(n-i)/(this.pinchPrecision*a*(this.angularSensibilityX+this.angularSensibilityY)/2),0!==this.panningSensibility&&r&&o){var s=o.x-r.x,c=o.y-r.y;this.camera.inertialPanningX+=-s/this.panningSensibility,this.camera.inertialPanningY+=c/this.panningSensibility}}else{this._twoFingerActivityCount++;var l=Math.sqrt(i),u=Math.sqrt(n);this._isPinching||this._twoFingerActivityCount<20&&Math.abs(u-l)>this.camera.pinchToPanMaxDistance?(this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=.001*(n-i)*this.camera.radius*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(n-i)/(this.pinchPrecision*a*(this.angularSensibilityX+this.angularSensibilityY)/2),this._isPinching=!0):0!==this.panningSensibility&&this.multiTouchPanning&&o&&r&&(s=o.x-r.x,c=o.y-r.y,this.camera.inertialPanningX+=-s/this.panningSensibility,this.camera.inertialPanningY+=c/this.panningSensibility)}}},t.prototype.onButtonDown=function(e){this._isPanClick=e.button===this.camera._panningMouseButton},t.prototype.onButtonUp=function(e){this._twoFingerActivityCount=0,this._isPinching=!1},t.prototype.onLostFocus=function(){this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1},Object(h.c)([Object(w.c)()],t.prototype,"buttons",void 0),Object(h.c)([Object(w.c)()],t.prototype,"angularSensibilityX",void 0),Object(h.c)([Object(w.c)()],t.prototype,"angularSensibilityY",void 0),Object(h.c)([Object(w.c)()],t.prototype,"pinchPrecision",void 0),Object(h.c)([Object(w.c)()],t.prototype,"pinchDeltaPercentage",void 0),Object(h.c)([Object(w.c)()],t.prototype,"useNaturalPinchZoom",void 0),Object(h.c)([Object(w.c)()],t.prototype,"panningSensibility",void 0),Object(h.c)([Object(w.c)()],t.prototype,"multiTouchPanning",void 0),Object(h.c)([Object(w.c)()],t.prototype,"multiTouchPanAndZoom",void 0),t}(ht);it.ArcRotateCameraPointersInput=dt;var ft=function(e){function t(t){return e.call(this,t)||this}return Object(h.d)(t,e),t.prototype.addMouseWheel=function(){return this.add(new ut),this},t.prototype.addPointers=function(){return this.add(new dt),this},t.prototype.addKeyboard=function(){return this.add(new lt),this},t}(nt);ft.prototype.addVRDeviceOrientation=function(){return this.add(new pt),this};var pt=function(){function e(){this.alphaCorrection=1,this.gammaCorrection=1,this._alpha=0,this._gamma=0,this._dirty=!1,this._deviceOrientationHandler=this._onOrientationEvent.bind(this)}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this.camera.attachControl(e);var i=this.camera.getScene().getEngine().getHostWindow();i&&("undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(e){"granted"===e?i.addEventListener("deviceorientation",t._deviceOrientationHandler):Ce.b.Warn("Permission not granted.")}).catch(function(e){Ce.b.Error(e)}):i.addEventListener("deviceorientation",this._deviceOrientationHandler))},e.prototype._onOrientationEvent=function(e){null!==e.alpha&&(this._alpha=(0|+e.alpha)*this.alphaCorrection),null!==e.gamma&&(this._gamma=(0|+e.gamma)*this.gammaCorrection),this._dirty=!0},e.prototype.checkInputs=function(){this._dirty&&(this._dirty=!1,this._gamma<0&&(this._gamma=180+this._gamma),this.camera.alpha=-this._alpha/180*Math.PI%Math.PI*2,this.camera.beta=this._gamma/180*Math.PI)},e.prototype.detachControl=function(e){window.removeEventListener("deviceorientation",this._deviceOrientationHandler)},e.prototype.getClassName=function(){return"ArcRotateCameraVRDeviceOrientationInput"},e.prototype.getSimpleName=function(){return"VRDeviceOrientation"},e}();it.ArcRotateCameraVRDeviceOrientationInput=pt;var _t=function(){function e(){this.keysForward=[87],this.keysBackward=[83],this.keysUp=[69],this.keysDown=[81],this.keysRight=[68],this.keysLeft=[65],this._keys=new Array}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){t._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(i){var n,r=i.event;i.type===ct.a.KEYDOWN?-1===t.keysForward.indexOf(r.keyCode)&&-1===t.keysBackward.indexOf(r.keyCode)&&-1===t.keysUp.indexOf(r.keyCode)&&-1===t.keysDown.indexOf(r.keyCode)&&-1===t.keysLeft.indexOf(r.keyCode)&&-1===t.keysRight.indexOf(r.keyCode)||(-1===(n=t._keys.indexOf(r.keyCode))&&t._keys.push(r.keyCode),e||r.preventDefault()):-1===t.keysForward.indexOf(r.keyCode)&&-1===t.keysBackward.indexOf(r.keyCode)&&-1===t.keysUp.indexOf(r.keyCode)&&-1===t.keysDown.indexOf(r.keyCode)&&-1===t.keysLeft.indexOf(r.keyCode)&&-1===t.keysRight.indexOf(r.keyCode)||((n=t._keys.indexOf(r.keyCode))>=0&&t._keys.splice(n,1),e||r.preventDefault())}))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.getClassName=function(){return"FlyCameraKeyboardInput"},e.prototype._onLostFocus=function(e){this._keys=[]},e.prototype.getSimpleName=function(){return"keyboard"},e.prototype.checkInputs=function(){if(this._onKeyboardObserver)for(var e=this.camera,t=0;t<this._keys.length;t++){var i=this._keys[t],n=e._computeLocalCameraSpeed();-1!==this.keysForward.indexOf(i)?e._localDirection.copyFromFloats(0,0,n):-1!==this.keysBackward.indexOf(i)?e._localDirection.copyFromFloats(0,0,-n):-1!==this.keysUp.indexOf(i)?e._localDirection.copyFromFloats(0,n,0):-1!==this.keysDown.indexOf(i)?e._localDirection.copyFromFloats(0,-n,0):-1!==this.keysRight.indexOf(i)?e._localDirection.copyFromFloats(n,0,0):-1!==this.keysLeft.indexOf(i)&&e._localDirection.copyFromFloats(-n,0,0),e.getScene().useRightHandedSystem&&(e._localDirection.z*=-1),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),a.e.TransformNormalToRef(e._localDirection,e._cameraTransformMatrix,e._transformedDirection),e.cameraDirection.addInPlace(e._transformedDirection)}},Object(h.c)([Object(w.c)()],e.prototype,"keysForward",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysBackward",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysUp",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysDown",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRight",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysLeft",void 0),e}();it.FlyCameraKeyboardInput=_t;var mt=function(){function e(e){void 0===e&&(e=!0),this.buttons=[0,1,2],this.buttonsYaw=[-1,0,1],this.buttonsPitch=[-1,0,1],this.buttonsRoll=[2],this.activeButton=-1,this.angularSensibility=1e3,this.previousPosition=null}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this.noPreventDefault=e,this._observer=this.camera.getScene().onPointerObservable.add(function(e,i){t._pointerInput(e,i)},Ne.a.POINTERDOWN|Ne.a.POINTERUP|Ne.a.POINTERMOVE),this._rollObserver=this.camera.getScene().onBeforeRenderObservable.add(function(){t.camera.rollCorrect&&t.camera.restoreRoll(t.camera.rollCorrect)})},e.prototype.detachControl=function(e){this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver),this._observer=null,this._rollObserver=null,this.previousPosition=null,this.noPreventDefault=void 0)},e.prototype.getClassName=function(){return"FlyCameraMouseInput"},e.prototype.getSimpleName=function(){return"mouse"},e.prototype._pointerInput=function(e,t){var i=e.event,n=this.camera.getEngine();if(!n.isInVRExclusivePointerMode&&(this.touchEnabled||"touch"!==i.pointerType)&&(e.type===Ne.a.POINTERMOVE||-1!==this.buttons.indexOf(i.button))){var r=i.srcElement||i.target;if(e.type===Ne.a.POINTERDOWN&&r){try{r.setPointerCapture(i.pointerId)}catch(i){}this.previousPosition={x:i.clientX,y:i.clientY},this.activeButton=i.button,this.noPreventDefault||(i.preventDefault(),this.element.focus()),n.isPointerLock&&this._onMouseMove(e.event)}else if(e.type===Ne.a.POINTERUP&&r){try{r.releasePointerCapture(i.pointerId)}catch(i){}this.activeButton=-1,this.previousPosition=null,this.noPreventDefault||i.preventDefault()}else if(e.type===Ne.a.POINTERMOVE){if(!this.previousPosition)return void(n.isPointerLock&&this._onMouseMove(e.event));var o=i.clientX-this.previousPosition.x,a=i.clientY-this.previousPosition.y;this.rotateCamera(o,a),this.previousPosition={x:i.clientX,y:i.clientY},this.noPreventDefault||i.preventDefault()}}},e.prototype._onMouseMove=function(e){var t=this.camera.getEngine();if(t.isPointerLock&&!t.isInVRExclusivePointerMode){var i=e.movementX||e.mozMovementX||e.webkitMovementX||e.msMovementX||0,n=e.movementY||e.mozMovementY||e.webkitMovementY||e.msMovementY||0;this.rotateCamera(i,n),this.previousPosition=null,this.noPreventDefault||e.preventDefault()}},e.prototype.rotateCamera=function(e,t){var i=this,n=this.camera;this.camera.getScene().useRightHandedSystem&&(e*=-1),n.parent&&n.parent._getWorldMatrixDeterminant()<0&&(e*=-1);var r,o=e/this.angularSensibility,s=t/this.angularSensibility,c=a.b.RotationYawPitchRoll(n.rotation.y,n.rotation.x,n.rotation.z);if(this.buttonsPitch.some(function(e){return e===i.activeButton})&&(r=a.b.RotationAxis(J.a.X,s),c.multiplyInPlace(r)),this.buttonsYaw.some(function(e){return e===i.activeButton})){r=a.b.RotationAxis(J.a.Y,o),c.multiplyInPlace(r);var l=n.bankedTurnLimit+n._trackRoll;if(n.bankedTurn&&-l<n.rotation.z&&n.rotation.z<l){var u=n.bankedTurnMultiplier*-o;r=a.b.RotationAxis(J.a.Z,u),c.multiplyInPlace(r)}}this.buttonsRoll.some(function(e){return e===i.activeButton})&&(r=a.b.RotationAxis(J.a.Z,-o),n._trackRoll-=o,c.multiplyInPlace(r)),c.toEulerAnglesToRef(n.rotation)},Object(h.c)([Object(w.c)()],e.prototype,"buttons",void 0),Object(h.c)([Object(w.c)()],e.prototype,"angularSensibility",void 0),e}();it.FlyCameraMouseInput=mt;var gt=function(){function e(){this.keysHeightOffsetIncr=[38],this.keysHeightOffsetDecr=[40],this.keysHeightOffsetModifierAlt=!1,this.keysHeightOffsetModifierCtrl=!1,this.keysHeightOffsetModifierShift=!1,this.keysRotationOffsetIncr=[37],this.keysRotationOffsetDecr=[39],this.keysRotationOffsetModifierAlt=!1,this.keysRotationOffsetModifierCtrl=!1,this.keysRotationOffsetModifierShift=!1,this.keysRadiusIncr=[40],this.keysRadiusDecr=[38],this.keysRadiusModifierAlt=!0,this.keysRadiusModifierCtrl=!1,this.keysRadiusModifierShift=!1,this.heightSensibility=1,this.rotationSensibility=1,this.radiusSensibility=1,this._keys=new Array}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){t._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(i){var n,r=i.event;r.metaKey||(i.type===ct.a.KEYDOWN?(t._ctrlPressed=r.ctrlKey,t._altPressed=r.altKey,t._shiftPressed=r.shiftKey,(-1!==t.keysHeightOffsetIncr.indexOf(r.keyCode)||-1!==t.keysHeightOffsetDecr.indexOf(r.keyCode)||-1!==t.keysRotationOffsetIncr.indexOf(r.keyCode)||-1!==t.keysRotationOffsetDecr.indexOf(r.keyCode)||-1!==t.keysRadiusIncr.indexOf(r.keyCode)||-1!==t.keysRadiusDecr.indexOf(r.keyCode))&&(-1===(n=t._keys.indexOf(r.keyCode))&&t._keys.push(r.keyCode),r.preventDefault&&(e||r.preventDefault()))):-1===t.keysHeightOffsetIncr.indexOf(r.keyCode)&&-1===t.keysHeightOffsetDecr.indexOf(r.keyCode)&&-1===t.keysRotationOffsetIncr.indexOf(r.keyCode)&&-1===t.keysRotationOffsetDecr.indexOf(r.keyCode)&&-1===t.keysRadiusIncr.indexOf(r.keyCode)&&-1===t.keysRadiusDecr.indexOf(r.keyCode)||((n=t._keys.indexOf(r.keyCode))>=0&&t._keys.splice(n,1),r.preventDefault&&(e||r.preventDefault())))}))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.checkInputs=function(){var e=this;this._onKeyboardObserver&&this._keys.forEach(function(t){-1!==e.keysHeightOffsetIncr.indexOf(t)&&e._modifierHeightOffset()?e.camera.heightOffset+=e.heightSensibility:-1!==e.keysHeightOffsetDecr.indexOf(t)&&e._modifierHeightOffset()?e.camera.heightOffset-=e.heightSensibility:-1!==e.keysRotationOffsetIncr.indexOf(t)&&e._modifierRotationOffset()?(e.camera.rotationOffset+=e.rotationSensibility,e.camera.rotationOffset%=360):-1!==e.keysRotationOffsetDecr.indexOf(t)&&e._modifierRotationOffset()?(e.camera.rotationOffset-=e.rotationSensibility,e.camera.rotationOffset%=360):-1!==e.keysRadiusIncr.indexOf(t)&&e._modifierRadius()?e.camera.radius+=e.radiusSensibility:-1!==e.keysRadiusDecr.indexOf(t)&&e._modifierRadius()&&(e.camera.radius-=e.radiusSensibility)})},e.prototype.getClassName=function(){return"FollowCameraKeyboardMoveInput"},e.prototype.getSimpleName=function(){return"keyboard"},e.prototype._modifierHeightOffset=function(){return this.keysHeightOffsetModifierAlt===this._altPressed&&this.keysHeightOffsetModifierCtrl===this._ctrlPressed&&this.keysHeightOffsetModifierShift===this._shiftPressed},e.prototype._modifierRotationOffset=function(){return this.keysRotationOffsetModifierAlt===this._altPressed&&this.keysRotationOffsetModifierCtrl===this._ctrlPressed&&this.keysRotationOffsetModifierShift===this._shiftPressed},e.prototype._modifierRadius=function(){return this.keysRadiusModifierAlt===this._altPressed&&this.keysRadiusModifierCtrl===this._ctrlPressed&&this.keysRadiusModifierShift===this._shiftPressed},Object(h.c)([Object(w.c)()],e.prototype,"keysHeightOffsetIncr",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysHeightOffsetDecr",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysHeightOffsetModifierAlt",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysHeightOffsetModifierCtrl",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysHeightOffsetModifierShift",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRotationOffsetIncr",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRotationOffsetDecr",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRotationOffsetModifierAlt",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRotationOffsetModifierCtrl",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRotationOffsetModifierShift",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRadiusIncr",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRadiusDecr",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRadiusModifierAlt",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRadiusModifierCtrl",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRadiusModifierShift",void 0),Object(h.c)([Object(w.c)()],e.prototype,"heightSensibility",void 0),Object(h.c)([Object(w.c)()],e.prototype,"rotationSensibility",void 0),Object(h.c)([Object(w.c)()],e.prototype,"radiusSensibility",void 0),e}();it.FollowCameraKeyboardMoveInput=gt;var vt=function(){function e(){this.axisControlRadius=!0,this.axisControlHeight=!1,this.axisControlRotation=!1,this.wheelPrecision=3,this.wheelDeltaPercentage=0}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this._wheel=function(i,n){if(i.type===Ne.a.POINTERWHEEL){var r=i.event,o=0,a=Math.max(-1,Math.min(1,r.deltaY||r.wheelDelta||-r.detail));t.wheelDeltaPercentage?(console.assert(t.axisControlRadius+t.axisControlHeight+t.axisControlRotation<=1,"wheelDeltaPercentage only usable when mouse wheel controlls ONE axis. Currently enabled: axisControlRadius: "+t.axisControlRadius+", axisControlHeightOffset: "+t.axisControlHeight+", axisControlRotationOffset: "+t.axisControlRotation),t.axisControlRadius?o=.01*a*t.wheelDeltaPercentage*t.camera.radius:t.axisControlHeight?o=.01*a*t.wheelDeltaPercentage*t.camera.heightOffset:t.axisControlRotation&&(o=.01*a*t.wheelDeltaPercentage*t.camera.rotationOffset)):o=a*t.wheelPrecision,o&&(t.axisControlRadius?t.camera.radius+=o:t.axisControlHeight?t.camera.heightOffset-=o:t.axisControlRotation&&(t.camera.rotationOffset-=o)),r.preventDefault&&(e||r.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,Ne.a.POINTERWHEEL)},e.prototype.detachControl=function(e){this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._wheel=null)},e.prototype.getClassName=function(){return"ArcRotateCameraMouseWheelInput"},e.prototype.getSimpleName=function(){return"mousewheel"},Object(h.c)([Object(w.c)()],e.prototype,"axisControlRadius",void 0),Object(h.c)([Object(w.c)()],e.prototype,"axisControlHeight",void 0),Object(h.c)([Object(w.c)()],e.prototype,"axisControlRotation",void 0),Object(h.c)([Object(w.c)()],e.prototype,"wheelPrecision",void 0),Object(h.c)([Object(w.c)()],e.prototype,"wheelDeltaPercentage",void 0),e}();it.FollowCameraMouseWheelInput=vt;var bt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.angularSensibilityX=1,t.angularSensibilityY=1,t.pinchPrecision=1e4,t.pinchDeltaPercentage=0,t.axisXControlRadius=!1,t.axisXControlHeight=!1,t.axisXControlRotation=!0,t.axisYControlRadius=!1,t.axisYControlHeight=!0,t.axisYControlRotation=!1,t.axisPinchControlRadius=!0,t.axisPinchControlHeight=!1,t.axisPinchControlRotation=!1,t.warningEnable=!0,t._warningCounter=0,t}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FollowCameraPointersInput"},t.prototype.onTouch=function(e,t,i){this._warning(),this.axisXControlRotation?this.camera.rotationOffset+=t/this.angularSensibilityX:this.axisYControlRotation&&(this.camera.rotationOffset+=i/this.angularSensibilityX),this.axisXControlHeight?this.camera.heightOffset+=t/this.angularSensibilityY:this.axisYControlHeight&&(this.camera.heightOffset+=i/this.angularSensibilityY),this.axisXControlRadius?this.camera.radius-=t/this.angularSensibilityY:this.axisYControlRadius&&(this.camera.radius-=i/this.angularSensibilityY)},t.prototype.onMultiTouch=function(e,t,i,n,r,o){if(!(0===i&&null===r||0===n&&null===o)){var a=(n-i)/(this.pinchPrecision*(this.angularSensibilityX+this.angularSensibilityY)/2);this.pinchDeltaPercentage?(a*=.01*this.pinchDeltaPercentage,this.axisPinchControlRotation&&(this.camera.rotationOffset+=a*this.camera.rotationOffset),this.axisPinchControlHeight&&(this.camera.heightOffset+=a*this.camera.heightOffset),this.axisPinchControlRadius&&(this.camera.radius-=a*this.camera.radius)):(this.axisPinchControlRotation&&(this.camera.rotationOffset+=a),this.axisPinchControlHeight&&(this.camera.heightOffset+=a),this.axisPinchControlRadius&&(this.camera.radius-=a))}},t.prototype._warning=function(){if(this.warningEnable&&this._warningCounter++%100==0){var e="It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: ";console.assert(this.axisXControlRotation+this.axisXControlHeight+this.axisXControlRadius<=1,e+"axisXControlRotation: "+this.axisXControlRotation+", axisXControlHeight: "+this.axisXControlHeight+", axisXControlRadius: "+this.axisXControlRadius),console.assert(this.axisYControlRotation+this.axisYControlHeight+this.axisYControlRadius<=1,e+"axisYControlRotation: "+this.axisYControlRotation+", axisYControlHeight: "+this.axisYControlHeight+", axisYControlRadius: "+this.axisYControlRadius),console.assert(this.axisPinchControlRotation+this.axisPinchControlHeight+this.axisPinchControlRadius<=1,e+"axisPinchControlRotation: "+this.axisPinchControlRotation+", axisPinchControlHeight: "+this.axisPinchControlHeight+", axisPinchControlRadius: "+this.axisPinchControlRadius)}},Object(h.c)([Object(w.c)()],t.prototype,"angularSensibilityX",void 0),Object(h.c)([Object(w.c)()],t.prototype,"angularSensibilityY",void 0),Object(h.c)([Object(w.c)()],t.prototype,"pinchPrecision",void 0),Object(h.c)([Object(w.c)()],t.prototype,"pinchDeltaPercentage",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisXControlRadius",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisXControlHeight",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisXControlRotation",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisYControlRadius",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisYControlHeight",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisYControlRotation",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisPinchControlRadius",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisPinchControlHeight",void 0),Object(h.c)([Object(w.c)()],t.prototype,"axisPinchControlRotation",void 0),t}(ht);it.FollowCameraPointersInput=bt;var yt=function(){function e(){this.keysUp=[38],this.keysUpward=[33],this.keysDown=[40],this.keysDownward=[34],this.keysLeft=[37],this.keysRight=[39],this._keys=new Array}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){t._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(i){var n,r=i.event;r.metaKey||(i.type===ct.a.KEYDOWN?-1===t.keysUp.indexOf(r.keyCode)&&-1===t.keysDown.indexOf(r.keyCode)&&-1===t.keysLeft.indexOf(r.keyCode)&&-1===t.keysRight.indexOf(r.keyCode)&&-1===t.keysUpward.indexOf(r.keyCode)&&-1===t.keysDownward.indexOf(r.keyCode)||(-1===(n=t._keys.indexOf(r.keyCode))&&t._keys.push(r.keyCode),e||r.preventDefault()):-1===t.keysUp.indexOf(r.keyCode)&&-1===t.keysDown.indexOf(r.keyCode)&&-1===t.keysLeft.indexOf(r.keyCode)&&-1===t.keysRight.indexOf(r.keyCode)&&-1===t.keysUpward.indexOf(r.keyCode)&&-1===t.keysDownward.indexOf(r.keyCode)||((n=t._keys.indexOf(r.keyCode))>=0&&t._keys.splice(n,1),e||r.preventDefault()))}))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.checkInputs=function(){if(this._onKeyboardObserver)for(var e=this.camera,t=0;t<this._keys.length;t++){var i=this._keys[t],n=e._computeLocalCameraSpeed();-1!==this.keysLeft.indexOf(i)?e._localDirection.copyFromFloats(-n,0,0):-1!==this.keysUp.indexOf(i)?e._localDirection.copyFromFloats(0,0,n):-1!==this.keysRight.indexOf(i)?e._localDirection.copyFromFloats(n,0,0):-1!==this.keysDown.indexOf(i)?e._localDirection.copyFromFloats(0,0,-n):-1!==this.keysUpward.indexOf(i)?e._localDirection.copyFromFloats(0,n,0):-1!==this.keysDownward.indexOf(i)&&e._localDirection.copyFromFloats(0,-n,0),e.getScene().useRightHandedSystem&&(e._localDirection.z*=-1),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),a.e.TransformNormalToRef(e._localDirection,e._cameraTransformMatrix,e._transformedDirection),e.cameraDirection.addInPlace(e._transformedDirection)}},e.prototype.getClassName=function(){return"FreeCameraKeyboardMoveInput"},e.prototype._onLostFocus=function(){this._keys=[]},e.prototype.getSimpleName=function(){return"keyboard"},Object(h.c)([Object(w.c)()],e.prototype,"keysUp",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysUpward",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysDown",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysDownward",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysLeft",void 0),Object(h.c)([Object(w.c)()],e.prototype,"keysRight",void 0),e}();it.FreeCameraKeyboardMoveInput=yt;var Tt=function(){function e(e){void 0===e&&(e=!0),this.touchEnabled=e,this.buttons=[0,1,2],this.angularSensibility=2e3,this.previousPosition=null,this.onPointerMovedObservable=new o.c,this._allowCameraRotation=!0}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments);var i=this.camera.getEngine(),n=i.getInputElement();this._pointerInput||(this._pointerInput=function(r){var o=r.event;if(!i.isInVRExclusivePointerMode&&(t.touchEnabled||"touch"!==o.pointerType)&&(r.type===Ne.a.POINTERMOVE||-1!==t.buttons.indexOf(o.button))){var a=o.srcElement||o.target;if(r.type===Ne.a.POINTERDOWN&&a){try{a.setPointerCapture(o.pointerId)}catch(e){}t.previousPosition={x:o.clientX,y:o.clientY},e||(o.preventDefault(),n&&n.focus()),i.isPointerLock&&t._onMouseMove&&t._onMouseMove(r.event)}else if(r.type===Ne.a.POINTERUP&&a){try{a.releasePointerCapture(o.pointerId)}catch(e){}t.previousPosition=null,e||o.preventDefault()}else if(r.type===Ne.a.POINTERMOVE){if(!t.previousPosition)return void(i.isPointerLock&&t._onMouseMove&&t._onMouseMove(r.event));var s=o.clientX-t.previousPosition.x,c=o.clientY-t.previousPosition.y;t.camera.getScene().useRightHandedSystem&&(s*=-1),t.camera.parent&&t.camera.parent._getWorldMatrixDeterminant()<0&&(s*=-1),t._allowCameraRotation&&(t.camera.cameraRotation.y+=s/t.angularSensibility,t.camera.cameraRotation.x+=c/t.angularSensibility),t.onPointerMovedObservable.notifyObservers({offsetX:s,offsetY:c}),t.previousPosition={x:o.clientX,y:o.clientY},e||o.preventDefault()}}}),this._onMouseMove=function(n){if(i.isPointerLock&&!i.isInVRExclusivePointerMode){var r=n.movementX||n.mozMovementX||n.webkitMovementX||n.msMovementX||0;t.camera.getScene().useRightHandedSystem&&(r*=-1),t.camera.parent&&t.camera.parent._getWorldMatrixDeterminant()<0&&(r*=-1),t.camera.cameraRotation.y+=r/t.angularSensibility;var o=n.movementY||n.mozMovementY||n.webkitMovementY||n.msMovementY||0;t.camera.cameraRotation.x+=o/t.angularSensibility,t.previousPosition=null,e||n.preventDefault()}},this._observer=this.camera.getScene().onPointerObservable.add(this._pointerInput,Ne.a.POINTERDOWN|Ne.a.POINTERUP|Ne.a.POINTERMOVE),n&&n.addEventListener("contextmenu",this.onContextMenu.bind(this),!1)},e.prototype.onContextMenu=function(e){e.preventDefault()},e.prototype.detachControl=function(e){if(this._observer){if(this.camera.getScene().onPointerObservable.remove(this._observer),this.onContextMenu){var t=this.camera.getEngine().getInputElement();t&&t.removeEventListener("contextmenu",this.onContextMenu)}this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this.previousPosition=null}},e.prototype.getClassName=function(){return"FreeCameraMouseInput"},e.prototype.getSimpleName=function(){return"mouse"},Object(h.c)([Object(w.c)()],e.prototype,"buttons",void 0),Object(h.c)([Object(w.c)()],e.prototype,"angularSensibility",void 0),e}();it.FreeCameraMouseInput=Tt;var Et,St=function(){function e(){this.wheelPrecisionX=3,this.wheelPrecisionY=3,this.wheelPrecisionZ=3,this.onChangedObservable=new o.c,this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments),this._wheel=function(i){if(i.type===Ne.a.POINTERWHEEL){var n=i.event,r=n.deltaMode===WheelEvent.DOM_DELTA_LINE?t._ffMultiplier:1;void 0!==n.deltaY?(t._wheelDeltaX+=t.wheelPrecisionX*r*n.deltaX/t._normalize,t._wheelDeltaY-=t.wheelPrecisionY*r*n.deltaY/t._normalize,t._wheelDeltaZ+=t.wheelPrecisionZ*r*n.deltaZ/t._normalize):void 0!==n.wheelDeltaY?(t._wheelDeltaX+=t.wheelPrecisionX*r*n.wheelDeltaX/t._normalize,t._wheelDeltaY-=t.wheelPrecisionY*r*n.wheelDeltaY/t._normalize,t._wheelDeltaZ+=t.wheelPrecisionZ*r*n.wheelDeltaZ/t._normalize):n.wheelDelta&&(t._wheelDeltaY-=t.wheelPrecisionY*n.wheelDelta/t._normalize),n.preventDefault&&(e||n.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,Ne.a.POINTERWHEEL)},e.prototype.detachControl=function(e){this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._wheel=null),this.onChangedObservable&&this.onChangedObservable.clear()},e.prototype.checkInputs=function(){this.onChangedObservable.notifyObservers({wheelDeltaX:this._wheelDeltaX,wheelDeltaY:this._wheelDeltaY,wheelDeltaZ:this._wheelDeltaZ}),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0},e.prototype.getClassName=function(){return"BaseCameraMouseWheelInput"},e.prototype.getSimpleName=function(){return"mousewheel"},Object(h.c)([Object(w.c)()],e.prototype,"wheelPrecisionX",void 0),Object(h.c)([Object(w.c)()],e.prototype,"wheelPrecisionY",void 0),Object(h.c)([Object(w.c)()],e.prototype,"wheelPrecisionZ",void 0),e}();!function(e){e[e.MoveRelative=0]="MoveRelative",e[e.RotateRelative=1]="RotateRelative",e[e.MoveScene=2]="MoveScene"}(Et||(Et={}));var At=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._moveRelative=a.e.Zero(),t._rotateRelative=a.e.Zero(),t._moveScene=a.e.Zero(),t._wheelXAction=Et.MoveRelative,t._wheelXActionCoordinate=J.b.X,t._wheelYAction=Et.MoveRelative,t._wheelYActionCoordinate=J.b.Z,t._wheelZAction=null,t._wheelZActionCoordinate=null,t}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FreeCameraMouseWheelInput"},Object.defineProperty(t.prototype,"wheelXMoveRelative",{get:function(){return this._wheelXAction!==Et.MoveRelative?null:this._wheelXActionCoordinate},set:function(e){null===e&&this._wheelXAction!==Et.MoveRelative||(this._wheelXAction=Et.MoveRelative,this._wheelXActionCoordinate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelYMoveRelative",{get:function(){return this._wheelYAction!==Et.MoveRelative?null:this._wheelYActionCoordinate},set:function(e){null===e&&this._wheelYAction!==Et.MoveRelative||(this._wheelYAction=Et.MoveRelative,this._wheelYActionCoordinate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelZMoveRelative",{get:function(){return this._wheelZAction!==Et.MoveRelative?null:this._wheelZActionCoordinate},set:function(e){null===e&&this._wheelZAction!==Et.MoveRelative||(this._wheelZAction=Et.MoveRelative,this._wheelZActionCoordinate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelXRotateRelative",{get:function(){return this._wheelXAction!==Et.RotateRelative?null:this._wheelXActionCoordinate},set:function(e){null===e&&this._wheelXAction!==Et.RotateRelative||(this._wheelXAction=Et.RotateRelative,this._wheelXActionCoordinate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelYRotateRelative",{get:function(){return this._wheelYAction!==Et.RotateRelative?null:this._wheelYActionCoordinate},set:function(e){null===e&&this._wheelYAction!==Et.RotateRelative||(this._wheelYAction=Et.RotateRelative,this._wheelYActionCoordinate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelZRotateRelative",{get:function(){return this._wheelZAction!==Et.RotateRelative?null:this._wheelZActionCoordinate},set:function(e){null===e&&this._wheelZAction!==Et.RotateRelative||(this._wheelZAction=Et.RotateRelative,this._wheelZActionCoordinate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelXMoveScene",{get:function(){return this._wheelXAction!==Et.MoveScene?null:this._wheelXActionCoordinate},set:function(e){null===e&&this._wheelXAction!==Et.MoveScene||(this._wheelXAction=Et.MoveScene,this._wheelXActionCoordinate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelYMoveScene",{get:function(){return this._wheelYAction!==Et.MoveScene?null:this._wheelYActionCoordinate},set:function(e){null===e&&this._wheelYAction!==Et.MoveScene||(this._wheelYAction=Et.MoveScene,this._wheelYActionCoordinate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelZMoveScene",{get:function(){return this._wheelZAction!==Et.MoveScene?null:this._wheelZActionCoordinate},set:function(e){null===e&&this._wheelZAction!==Et.MoveScene||(this._wheelZAction=Et.MoveScene,this._wheelZActionCoordinate=e)},enumerable:!1,configurable:!0}),t.prototype.checkInputs=function(){if(0!==this._wheelDeltaX||0!==this._wheelDeltaY||0!=this._wheelDeltaZ){this._moveRelative.setAll(0),this._rotateRelative.setAll(0),this._moveScene.setAll(0),this._updateCamera(),this.camera.getScene().useRightHandedSystem&&(this._moveRelative.z*=-1);var t=a.a.Zero();this.camera.getViewMatrix().invertToRef(t);var i=a.e.Zero();a.e.TransformNormalToRef(this._moveRelative,t,i),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(i),this.camera.cameraDirection.addInPlace(this._moveScene),e.prototype.checkInputs.call(this)}},t.prototype._updateCamera=function(){var e=this._moveRelative,t=this._rotateRelative,i=this._moveScene,n=function(n,r,o){if(0!==n&&null!==r&&null!==o){var a=null;switch(r){case Et.MoveRelative:a=e;break;case Et.RotateRelative:a=t;break;case Et.MoveScene:a=i}switch(o){case J.b.X:a.set(n,0,0);break;case J.b.Y:a.set(0,n,0);break;case J.b.Z:a.set(0,0,n)}}};n(this._wheelDeltaX,this._wheelXAction,this._wheelXActionCoordinate),n(this._wheelDeltaY,this._wheelYAction,this._wheelYActionCoordinate),n(this._wheelDeltaZ,this._wheelZAction,this._wheelZActionCoordinate)},Object(h.c)([Object(w.c)()],t.prototype,"wheelXMoveRelative",null),Object(h.c)([Object(w.c)()],t.prototype,"wheelYMoveRelative",null),Object(h.c)([Object(w.c)()],t.prototype,"wheelZMoveRelative",null),Object(h.c)([Object(w.c)()],t.prototype,"wheelXRotateRelative",null),Object(h.c)([Object(w.c)()],t.prototype,"wheelYRotateRelative",null),Object(h.c)([Object(w.c)()],t.prototype,"wheelZRotateRelative",null),Object(h.c)([Object(w.c)()],t.prototype,"wheelXMoveScene",null),Object(h.c)([Object(w.c)()],t.prototype,"wheelYMoveScene",null),Object(h.c)([Object(w.c)()],t.prototype,"wheelZMoveScene",null),t}(St);it.FreeCameraMouseWheelInput=At;var Pt=function(){function e(e){void 0===e&&(e=!1),this.allowMouse=e,this.touchAngularSensibility=2e5,this.touchMoveSensibility=250,this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array}return e.prototype.attachControl=function(e){var t=this;e=Ce.b.BackCompatCameraNoPreventDefault(arguments);var i=null;if(void 0===this._pointerInput&&(this._onLostFocus=function(){t._offsetX=null,t._offsetY=null},this._pointerInput=function(n){var r=n.event,o=!t.camera.getEngine().hostInformation.isMobile&&r instanceof MouseEvent;if(t.allowMouse||"mouse"!==r.pointerType&&!o)if(n.type===Ne.a.POINTERDOWN){if(e||r.preventDefault(),t._pointerPressed.push(r.pointerId),1!==t._pointerPressed.length)return;i={x:r.clientX,y:r.clientY}}else if(n.type===Ne.a.POINTERUP){if(e||r.preventDefault(),-1===(a=t._pointerPressed.indexOf(r.pointerId)))return;if(t._pointerPressed.splice(a,1),0!=a)return;i=null,t._offsetX=null,t._offsetY=null}else if(n.type===Ne.a.POINTERMOVE){if(e||r.preventDefault(),!i)return;var a;if(0!=(a=t._pointerPressed.indexOf(r.pointerId)))return;t._offsetX=r.clientX-i.x,t._offsetY=-(r.clientY-i.y)}}),this._observer=this.camera.getScene().onPointerObservable.add(this._pointerInput,Ne.a.POINTERDOWN|Ne.a.POINTERUP|Ne.a.POINTERMOVE),this._onLostFocus){var n=this.camera.getEngine().getInputElement();n&&n.addEventListener("blur",this._onLostFocus)}},e.prototype.detachControl=function(e){if(this._pointerInput){if(this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null),this._onLostFocus){var t=this.camera.getEngine().getInputElement();t&&t.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null}this._pointerPressed=[],this._offsetX=null,this._offsetY=null}},e.prototype.checkInputs=function(){if(null!==this._offsetX&&null!==this._offsetY&&(0!==this._offsetX||0!==this._offsetY)){var e=this.camera;if(e.cameraRotation.y=this._offsetX/this.touchAngularSensibility,this._pointerPressed.length>1)e.cameraRotation.x=-this._offsetY/this.touchAngularSensibility;else{var t=e._computeLocalCameraSpeed(),i=new a.e(0,0,t*this._offsetY/this.touchMoveSensibility);a.a.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(a.e.TransformCoordinates(i,e._cameraRotationMatrix))}}},e.prototype.getClassName=function(){return"FreeCameraTouchInput"},e.prototype.getSimpleName=function(){return"touch"},Object(h.c)([Object(w.c)()],e.prototype,"touchAngularSensibility",void 0),Object(h.c)([Object(w.c)()],e.prototype,"touchMoveSensibility",void 0),e}();it.FreeCameraTouchInput=Pt;var Ct=function(e){function t(t){var i=e.call(this,t)||this;return i._mouseInput=null,i._mouseWheelInput=null,i}return Object(h.d)(t,e),t.prototype.addKeyboard=function(){return this.add(new yt),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this._mouseInput||(this._mouseInput=new Tt(e),this.add(this._mouseInput)),this},t.prototype.removeMouse=function(){return this._mouseInput&&this.remove(this._mouseInput),this},t.prototype.addMouseWheel=function(){return this._mouseWheelInput||(this._mouseWheelInput=new At,this.add(this._mouseWheelInput)),this},t.prototype.removeMouseWheel=function(){return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this},t.prototype.addTouch=function(){return this.add(new Pt),this},t.prototype.clear=function(){e.prototype.clear.call(this),this._mouseInput=null},t}(nt);Ct.prototype.addDeviceOrientation=function(){return this._deviceOrientationInput||(this._deviceOrientationInput=new Rt,this.add(this._deviceOrientationInput)),this};var Rt=function(){function e(){var e=this;this._screenOrientationAngle=0,this._screenQuaternion=new a.b,this._alpha=0,this._beta=0,this._gamma=0,this._onDeviceOrientationChangedObservable=new o.c,this._orientationChanged=function(){e._screenOrientationAngle=void 0!==window.orientation?+window.orientation:window.screen.orientation&&window.screen.orientation.angle?window.screen.orientation.angle:0,e._screenOrientationAngle=-Ce.b.ToRadians(e._screenOrientationAngle/2),e._screenQuaternion.copyFromFloats(0,Math.sin(e._screenOrientationAngle),0,Math.cos(e._screenOrientationAngle))},this._deviceOrientation=function(t){e._alpha=null!==t.alpha?t.alpha:0,e._beta=null!==t.beta?t.beta:0,e._gamma=null!==t.gamma?t.gamma:0,null!==t.alpha&&e._onDeviceOrientationChangedObservable.notifyObservers()},this._constantTranform=new a.b(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this._orientationChanged()}return e.WaitForOrientationChangeAsync=function(e){return new Promise(function(t,i){var n=!1,r=function(){window.removeEventListener("deviceorientation",r),n=!0,t()};e&&setTimeout(function(){n||(window.removeEventListener("deviceorientation",r),i("WaitForOrientationChangeAsync timed out"))},e),"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(e){"granted"==e?window.addEventListener("deviceorientation",r):Ce.b.Warn("Permission not granted.")}).catch(function(e){Ce.b.Error(e)}):window.addEventListener("deviceorientation",r)})},Object.defineProperty(e.prototype,"camera",{get:function(){return this._camera},set:function(e){var t=this;this._camera=e,null==this._camera||this._camera.rotationQuaternion||(this._camera.rotationQuaternion=new a.b),this._camera&&this._camera.onDisposeObservable.add(function(){t._onDeviceOrientationChangedObservable.clear()})},enumerable:!1,configurable:!0}),e.prototype.attachControl=function(){var e=this,t=this.camera.getScene().getEngine().getHostWindow();if(t){var i=function(){t.addEventListener("orientationchange",e._orientationChanged),t.addEventListener("deviceorientation",e._deviceOrientation),e._orientationChanged()};"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(e){"granted"===e?i():Ce.b.Warn("Permission not granted.")}).catch(function(e){Ce.b.Error(e)}):i()}},e.prototype.detachControl=function(e){window.removeEventListener("orientationchange",this._orientationChanged),window.removeEventListener("deviceorientation",this._deviceOrientation),this._alpha=0},e.prototype.checkInputs=function(){this._alpha&&(a.b.RotationYawPitchRollToRef(Ce.b.ToRadians(this._alpha),Ce.b.ToRadians(this._beta),-Ce.b.ToRadians(this._gamma),this.camera.rotationQuaternion),this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion),this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform),this._camera.rotationQuaternion.z*=-1,this._camera.rotationQuaternion.w*=-1)},e.prototype.getClassName=function(){return"FreeCameraDeviceOrientationInput"},e.prototype.getSimpleName=function(){return"deviceOrientation"},e}();it.FreeCameraDeviceOrientationInput=Rt;var xt=function(){function e(){this.gamepadAngularSensibility=200,this.gamepadMoveSensibility=40,this._yAxisScale=1,this._cameraTransform=a.a.Identity(),this._deltaTransform=a.e.Zero(),this._vector3=a.e.Zero(),this._vector2=a.d.Zero()}return Object.defineProperty(e.prototype,"invertYAxis",{get:function(){return 1!==this._yAxisScale},set:function(e){this._yAxisScale=e?-1:1},enumerable:!1,configurable:!0}),e.prototype.attachControl=function(){var e=this,t=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=t.onGamepadConnectedObservable.add(function(t){t.type!==ot.POSE_ENABLED&&(e.gamepad&&t.type!==ot.XBOX||(e.gamepad=t))}),this._onGamepadDisconnectedObserver=t.onGamepadDisconnectedObservable.add(function(t){e.gamepad===t&&(e.gamepad=null)}),this.gamepad=t.getGamepadByType(ot.XBOX),!this.gamepad&&t.gamepads.length&&(this.gamepad=t.gamepads[0])},e.prototype.detachControl=function(e){this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),this.gamepad=null},e.prototype.checkInputs=function(){if(this.gamepad&&this.gamepad.leftStick){var e=this.camera,t=this.gamepad.leftStick,i=t.x/this.gamepadMoveSensibility,n=t.y/this.gamepadMoveSensibility;t.x=Math.abs(i)>.005?0+i:0,t.y=Math.abs(n)>.005?0+n:0;var r=this.gamepad.rightStick;if(r){var o=r.x/this.gamepadAngularSensibility,s=r.y/this.gamepadAngularSensibility*this._yAxisScale;r.x=Math.abs(o)>.001?0+o:0,r.y=Math.abs(s)>.001?0+s:0}else r={x:0,y:0};e.rotationQuaternion?e.rotationQuaternion.toRotationMatrix(this._cameraTransform):a.a.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,this._cameraTransform);var c=50*e._computeLocalCameraSpeed();this._vector3.copyFromFloats(t.x*c,0,-t.y*c),a.e.TransformCoordinatesToRef(this._vector3,this._cameraTransform,this._deltaTransform),e.cameraDirection.addInPlace(this._deltaTransform),this._vector2.copyFromFloats(r.y,r.x),e.cameraRotation.addInPlace(this._vector2)}},e.prototype.getClassName=function(){return"FreeCameraGamepadInput"},e.prototype.getSimpleName=function(){return"gamepad"},Object(h.c)([Object(w.c)()],e.prototype,"gamepadAngularSensibility",void 0),Object(h.c)([Object(w.c)()],e.prototype,"gamepadMoveSensibility",void 0),e}();it.FreeCameraGamepadInput=xt;var Ot,Mt=i(112);!function(e){e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(Ot||(Ot={}));var It=function(){function e(t,i){var n=this,r=Object(h.a)(Object(h.a)({},e._GetDefaultOptions()),i);if(this._leftJoystick=!!t,e._globalJoystickIndex++,this._axisTargetedByLeftAndRight=Ot.X,this._axisTargetedByUpAndDown=Ot.Y,this.reverseLeftRight=!1,this.reverseUpDown=!1,this._touches=new Mt.a,this.deltaPosition=a.e.Zero(),this._joystickSensibility=25,this._inversedSensibility=1/(this._joystickSensibility/1e3),this._onResize=function(t){e.vjCanvasWidth=window.innerWidth,e.vjCanvasHeight=window.innerHeight,e.Canvas&&(e.Canvas.width=e.vjCanvasWidth,e.Canvas.height=e.vjCanvasHeight),e.halfWidth=e.vjCanvasWidth/2},!e.Canvas){window.addEventListener("resize",this._onResize,!1),e.Canvas=document.createElement("canvas"),e.vjCanvasWidth=window.innerWidth,e.vjCanvasHeight=window.innerHeight,e.Canvas.width=window.innerWidth,e.Canvas.height=window.innerHeight,e.Canvas.style.width="100%",e.Canvas.style.height="100%",e.Canvas.style.position="absolute",e.Canvas.style.backgroundColor="transparent",e.Canvas.style.top="0px",e.Canvas.style.left="0px",e.Canvas.style.zIndex="5",e.Canvas.style.msTouchAction="none",e.Canvas.style.touchAction="none",e.Canvas.setAttribute("touch-action","none");var o=e.Canvas.getContext("2d");if(!o)throw new Error("Unable to create canvas for virtual joystick");e.vjCanvasContext=o,e.vjCanvasContext.strokeStyle="#ffffff",e.vjCanvasContext.lineWidth=2,document.body.appendChild(e.Canvas)}e.halfWidth=e.Canvas.width/2,this.pressed=!1,this.limitToContainer=r.limitToContainer,this._joystickColor=r.color,this.containerSize=r.containerSize,this.puckSize=r.puckSize,r.position&&this.setPosition(r.position.x,r.position.y),r.puckImage&&this.setPuckImage(r.puckImage),r.containerImage&&this.setContainerImage(r.containerImage),r.alwaysVisible&&e._alwaysVisibleSticks++,this.alwaysVisible=r.alwaysVisible,this._joystickPointerID=-1,this._joystickPointerPos=new a.d(0,0),this._joystickPreviousPointerPos=new a.d(0,0),this._joystickPointerStartPos=new a.d(0,0),this._deltaJoystickVector=new a.d(0,0),this._onPointerDownHandlerRef=function(e){n._onPointerDown(e)},this._onPointerMoveHandlerRef=function(e){n._onPointerMove(e)},this._onPointerUpHandlerRef=function(e){n._onPointerUp(e)},e.Canvas.addEventListener("pointerdown",this._onPointerDownHandlerRef,!1),e.Canvas.addEventListener("pointermove",this._onPointerMoveHandlerRef,!1),e.Canvas.addEventListener("pointerup",this._onPointerUpHandlerRef,!1),e.Canvas.addEventListener("pointerout",this._onPointerUpHandlerRef,!1),e.Canvas.addEventListener("contextmenu",function(e){e.preventDefault()},!1),requestAnimationFrame(function(){n._drawVirtualJoystick()})}return e._GetDefaultOptions=function(){return{puckSize:40,containerSize:60,color:"cyan",puckImage:void 0,containerImage:void 0,position:void 0,alwaysVisible:!1,limitToContainer:!1}},e.prototype.setJoystickSensibility=function(e){this._joystickSensibility=e,this._inversedSensibility=1/(this._joystickSensibility/1e3)},e.prototype._onPointerDown=function(t){t.preventDefault(),(!0===this._leftJoystick?t.clientX<e.halfWidth:t.clientX>e.halfWidth)&&this._joystickPointerID<0?(this._joystickPointerID=t.pointerId,this._joystickPosition?(this._joystickPointerStartPos=this._joystickPosition.clone(),this._joystickPointerPos=this._joystickPosition.clone(),this._joystickPreviousPointerPos=this._joystickPosition.clone(),this._onPointerMove(t)):(this._joystickPointerStartPos.x=t.clientX,this._joystickPointerStartPos.y=t.clientY,this._joystickPointerPos=this._joystickPointerStartPos.clone(),this._joystickPreviousPointerPos=this._joystickPointerStartPos.clone()),this._deltaJoystickVector.x=0,this._deltaJoystickVector.y=0,this.pressed=!0,this._touches.add(t.pointerId.toString(),t)):e._globalJoystickIndex<2&&this._action&&(this._action(),this._touches.add(t.pointerId.toString(),{x:t.clientX,y:t.clientY,prevX:t.clientX,prevY:t.clientY}))},e.prototype._onPointerMove=function(t){if(this._joystickPointerID==t.pointerId){if(this.limitToContainer){var i=new a.d(t.clientX-this._joystickPointerStartPos.x,t.clientY-this._joystickPointerStartPos.y),n=i.length();n>this.containerSize&&i.scaleInPlace(this.containerSize/n),this._joystickPointerPos.x=this._joystickPointerStartPos.x+i.x,this._joystickPointerPos.y=this._joystickPointerStartPos.y+i.y}else this._joystickPointerPos.x=t.clientX,this._joystickPointerPos.y=t.clientY;this._deltaJoystickVector=this._joystickPointerPos.clone(),this._deltaJoystickVector=this._deltaJoystickVector.subtract(this._joystickPointerStartPos),0<e._alwaysVisibleSticks&&(this._leftJoystick?this._joystickPointerPos.x=Math.min(e.halfWidth,this._joystickPointerPos.x):this._joystickPointerPos.x=Math.max(e.halfWidth,this._joystickPointerPos.x));var r=(this.reverseLeftRight?-1:1)*this._deltaJoystickVector.x/this._inversedSensibility;switch(this._axisTargetedByLeftAndRight){case Ot.X:this.deltaPosition.x=Math.min(1,Math.max(-1,r));break;case Ot.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,r));break;case Ot.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,r))}var o=(this.reverseUpDown?1:-1)*this._deltaJoystickVector.y/this._inversedSensibility;switch(this._axisTargetedByUpAndDown){case Ot.X:this.deltaPosition.x=Math.min(1,Math.max(-1,o));break;case Ot.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,o));break;case Ot.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,o))}}else{var s=this._touches.get(t.pointerId.toString());s&&(s.x=t.clientX,s.y=t.clientY)}},e.prototype._onPointerUp=function(t){if(this._joystickPointerID==t.pointerId)this._clearPreviousDraw(),this._joystickPointerID=-1,this.pressed=!1;else{var i=this._touches.get(t.pointerId.toString());i&&e.vjCanvasContext.clearRect(i.prevX-44,i.prevY-44,88,88)}this._deltaJoystickVector.x=0,this._deltaJoystickVector.y=0,this._touches.remove(t.pointerId.toString())},e.prototype.setJoystickColor=function(e){this._joystickColor=e},Object.defineProperty(e.prototype,"containerSize",{get:function(){return this._joystickContainerSize},set:function(e){this._joystickContainerSize=e,this._clearContainerSize=~~(2.1*this._joystickContainerSize),this._clearContainerSizeOffset=~~(this._clearContainerSize/2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"puckSize",{get:function(){return this._joystickPuckSize},set:function(e){this._joystickPuckSize=e,this._clearPuckSize=~~(2.1*this._joystickPuckSize),this._clearPuckSizeOffset=~~(this._clearPuckSize/2)},enumerable:!1,configurable:!0}),e.prototype.clearPosition=function(){this.alwaysVisible=!1,this._joystickPosition=null},Object.defineProperty(e.prototype,"alwaysVisible",{get:function(){return this._alwaysVisible},set:function(t){this._alwaysVisible!==t&&(t&&this._joystickPosition?(e._alwaysVisibleSticks++,this._alwaysVisible=!0):(e._alwaysVisibleSticks--,this._alwaysVisible=!1))},enumerable:!1,configurable:!0}),e.prototype.setPosition=function(e,t){this._joystickPointerStartPos&&this._clearPreviousDraw(),this._joystickPosition=new a.d(e,t)},e.prototype.setActionOnTouch=function(e){this._action=e},e.prototype.setAxisForLeftRight=function(e){switch(e){case Ot.X:case Ot.Y:case Ot.Z:this._axisTargetedByLeftAndRight=e;break;default:this._axisTargetedByLeftAndRight=Ot.X}},e.prototype.setAxisForUpDown=function(e){switch(e){case Ot.X:case Ot.Y:case Ot.Z:this._axisTargetedByUpAndDown=e;break;default:this._axisTargetedByUpAndDown=Ot.Y}},e.prototype._clearPreviousDraw=function(){var t=this._joystickPosition||this._joystickPointerStartPos;e.vjCanvasContext.clearRect(t.x-this._clearContainerSizeOffset,t.y-this._clearContainerSizeOffset,this._clearContainerSize,this._clearContainerSize),e.vjCanvasContext.clearRect(this._joystickPreviousPointerPos.x-this._clearPuckSizeOffset,this._joystickPreviousPointerPos.y-this._clearPuckSizeOffset,this._clearPuckSize,this._clearPuckSize)},e.prototype.setContainerImage=function(e){var t=this,i=new Image;i.src=e,i.onload=function(){return t._containerImage=i}},e.prototype.setPuckImage=function(e){var t=this,i=new Image;i.src=e,i.onload=function(){return t._puckImage=i}},e.prototype._drawContainer=function(){var t=this._joystickPosition||this._joystickPointerStartPos;this._clearPreviousDraw(),this._containerImage?e.vjCanvasContext.drawImage(this._containerImage,t.x-this.containerSize,t.y-this.containerSize,2*this.containerSize,2*this.containerSize):(e.vjCanvasContext.beginPath(),e.vjCanvasContext.strokeStyle=this._joystickColor,e.vjCanvasContext.lineWidth=2,e.vjCanvasContext.arc(t.x,t.y,this.containerSize,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),e.vjCanvasContext.beginPath(),e.vjCanvasContext.lineWidth=6,e.vjCanvasContext.strokeStyle=this._joystickColor,e.vjCanvasContext.arc(t.x,t.y,this.puckSize,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath())},e.prototype._drawPuck=function(){this._puckImage?e.vjCanvasContext.drawImage(this._puckImage,this._joystickPointerPos.x-this.puckSize,this._joystickPointerPos.y-this.puckSize,2*this.puckSize,2*this.puckSize):(e.vjCanvasContext.beginPath(),e.vjCanvasContext.strokeStyle=this._joystickColor,e.vjCanvasContext.lineWidth=2,e.vjCanvasContext.arc(this._joystickPointerPos.x,this._joystickPointerPos.y,this.puckSize,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath())},e.prototype._drawVirtualJoystick=function(){var t=this;this.alwaysVisible&&this._drawContainer(),this.pressed&&this._touches.forEach(function(i,n){n.pointerId===t._joystickPointerID?(t.alwaysVisible||t._drawContainer(),t._drawPuck(),t._joystickPreviousPointerPos=t._joystickPointerPos.clone()):(e.vjCanvasContext.clearRect(n.prevX-44,n.prevY-44,88,88),e.vjCanvasContext.beginPath(),e.vjCanvasContext.fillStyle="white",e.vjCanvasContext.beginPath(),e.vjCanvasContext.strokeStyle="red",e.vjCanvasContext.lineWidth=6,e.vjCanvasContext.arc(n.x,n.y,40,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),n.prevX=n.x,n.prevY=n.y)}),requestAnimationFrame(function(){t._drawVirtualJoystick()})},e.prototype.releaseCanvas=function(){e.Canvas&&(e.Canvas.removeEventListener("pointerdown",this._onPointerDownHandlerRef),e.Canvas.removeEventListener("pointermove",this._onPointerMoveHandlerRef),e.Canvas.removeEventListener("pointerup",this._onPointerUpHandlerRef),e.Canvas.removeEventListener("pointerout",this._onPointerUpHandlerRef),window.removeEventListener("resize",this._onResize),document.body.removeChild(e.Canvas),e.Canvas=null)},e._globalJoystickIndex=0,e._alwaysVisibleSticks=0,e}();Ct.prototype.addVirtualJoystick=function(){return this.add(new Dt),this};var Dt=function(){function e(){}return e.prototype.getLeftJoystick=function(){return this._leftjoystick},e.prototype.getRightJoystick=function(){return this._rightjoystick},e.prototype.checkInputs=function(){if(this._leftjoystick){var e=this.camera,t=50*e._computeLocalCameraSpeed(),i=a.a.RotationYawPitchRoll(e.rotation.y,e.rotation.x,0),n=a.e.TransformCoordinates(new a.e(this._leftjoystick.deltaPosition.x*t,this._leftjoystick.deltaPosition.y*t,this._leftjoystick.deltaPosition.z*t),i);e.cameraDirection=e.cameraDirection.add(n),e.cameraRotation=e.cameraRotation.addVector3(this._rightjoystick.deltaPosition),this._leftjoystick.pressed||(this._leftjoystick.deltaPosition=this._leftjoystick.deltaPosition.scale(.9)),this._rightjoystick.pressed||(this._rightjoystick.deltaPosition=this._rightjoystick.deltaPosition.scale(.9))}},e.prototype.attachControl=function(){this._leftjoystick=new It(!0),this._leftjoystick.setAxisForUpDown(Ot.Z),this._leftjoystick.setAxisForLeftRight(Ot.X),this._leftjoystick.setJoystickSensibility(.15),this._rightjoystick=new It(!1),this._rightjoystick.setAxisForUpDown(Ot.X),this._rightjoystick.setAxisForLeftRight(Ot.Y),this._rightjoystick.reverseUpDown=!0,this._rightjoystick.setJoystickSensibility(.05),this._rightjoystick.setJoystickColor("yellow")},e.prototype.detachControl=function(e){this._leftjoystick.releaseCanvas(),this._rightjoystick.releaseCanvas()},e.prototype.getClassName=function(){return"FreeCameraVirtualJoystickInput"},e.prototype.getSimpleName=function(){return"virtualJoystick"},e}();it.FreeCameraVirtualJoystickInput=Dt;var Nt=i(28),Lt=function(e){function t(t,i,n,r){void 0===r&&(r=!0);var o=e.call(this,t,i,n,r)||this;return o._tmpUpVector=a.e.Zero(),o._tmpTargetVector=a.e.Zero(),o.cameraDirection=new a.e(0,0,0),o.cameraRotation=new a.d(0,0),o.ignoreParentScaling=!1,o.updateUpVectorFromRotation=!1,o._tmpQuaternion=new a.b,o.rotation=new a.e(0,0,0),o.speed=2,o.noRotationConstraint=!1,o.invertRotation=!1,o.inverseRotationSpeed=.2,o.lockedTarget=null,o._currentTarget=a.e.Zero(),o._initialFocalDistance=1,o._viewMatrix=a.a.Zero(),o._camMatrix=a.a.Zero(),o._cameraTransformMatrix=a.a.Zero(),o._cameraRotationMatrix=a.a.Zero(),o._referencePoint=new a.e(0,0,1),o._transformedReferencePoint=a.e.Zero(),o._defaultUp=a.e.Up(),o._cachedRotationZ=0,o._cachedQuaternionRotationZ=0,o}return Object(h.d)(t,e),t.prototype.getFrontPosition=function(e){this.getWorldMatrix();var t=this.getTarget().subtract(this.position);return t.normalize(),t.scaleInPlace(e),this.globalPosition.add(t)},t.prototype._getLockedTargetPosition=function(){return this.lockedTarget?(this.lockedTarget.absolutePosition&&this.lockedTarget.computeWorldMatrix(),this.lockedTarget.absolutePosition||this.lockedTarget):null},t.prototype.storeState=function(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0)},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.lockedTarget=new a.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new a.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new a.b(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this);var i=this._getLockedTargetPosition();i?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(i):this._cache.lockedTarget=i.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)},t.prototype._isSynchronizedViewMatrix=function(){if(!e.prototype._isSynchronizedViewMatrix.call(this))return!1;var t=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(t):!t)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))},t.prototype._computeLocalCameraSpeed=function(){var e=this.getEngine();return this.speed*Math.sqrt(e.getDeltaTime()/(100*e.getFps()))},t.prototype.setTarget=function(e){this.upVector.normalize(),this._initialFocalDistance=e.subtract(this.position).length(),this.position.z===e.z&&(this.position.z+=Nt.a),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),a.a.LookAtLHToRef(this.position,e,this._defaultUp,this._camMatrix),this._camMatrix.invert(),this.rotation.x=Math.atan(this._camMatrix.m[6]/this._camMatrix.m[10]);var t=e.subtract(this.position);t.x>=0?this.rotation.y=-Math.atan(t.z/t.x)+Math.PI/2:this.rotation.y=-Math.atan(t.z/t.x)-Math.PI/2,this.rotation.z=0,isNaN(this.rotation.x)&&(this.rotation.x=0),isNaN(this.rotation.y)&&(this.rotation.y=0),isNaN(this.rotation.z)&&(this.rotation.z=0),this.rotationQuaternion&&a.b.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion)},Object.defineProperty(t.prototype,"target",{get:function(){return this.getTarget()},set:function(e){this.setTarget(e)},enumerable:!1,configurable:!0}),t.prototype.getTarget=function(){return this._currentTarget},t.prototype._decideIfNeedsToMove=function(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0},t.prototype._updatePosition=function(){if(this.parent)return this.parent.getWorldMatrix().invertToRef(a.c.Matrix[0]),a.e.TransformNormalToRef(this.cameraDirection,a.c.Matrix[0],a.c.Vector3[0]),void this.position.addInPlace(a.c.Vector3[0]);this.position.addInPlace(this.cameraDirection)},t.prototype._checkInputs=function(){var t=this.invertRotation?-this.inverseRotationSpeed:1,i=this._decideIfNeedsToMove(),n=Math.abs(this.cameraRotation.x)>0||Math.abs(this.cameraRotation.y)>0;i&&this._updatePosition(),n&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this.rotation),this.rotation.x+=this.cameraRotation.x*t,this.rotation.y+=this.cameraRotation.y*t,this.noRotationConstraint||(this.rotation.x>1.570796&&(this.rotation.x=1.570796),this.rotation.x<-1.570796&&(this.rotation.x=-1.570796)),this.rotationQuaternion&&this.rotation.lengthSquared()&&a.b.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion)),i&&(Math.abs(this.cameraDirection.x)<this.speed*Nt.a&&(this.cameraDirection.x=0),Math.abs(this.cameraDirection.y)<this.speed*Nt.a&&(this.cameraDirection.y=0),Math.abs(this.cameraDirection.z)<this.speed*Nt.a&&(this.cameraDirection.z=0),this.cameraDirection.scaleInPlace(this.inertia)),n&&(Math.abs(this.cameraRotation.x)<this.speed*Nt.a&&(this.cameraRotation.x=0),Math.abs(this.cameraRotation.y)<this.speed*Nt.a&&(this.cameraRotation.y=0),this.cameraRotation.scaleInPlace(this.inertia)),e.prototype._checkInputs.call(this)},t.prototype._updateCameraRotationMatrix=function(){this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):a.a.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)},t.prototype._rotateUpVectorWithCameraRotationMatrix=function(){return a.e.TransformNormalToRef(this._defaultUp,this._cameraRotationMatrix,this.upVector),this},t.prototype._getViewMatrix=function(){return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!=this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),a.e.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?J.a.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(a.b.FromEulerVectorToRef(this.rotation,this._tmpQuaternion),J.a.Y.rotateByQuaternionToRef(this._tmpQuaternion,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix},t.prototype._computeViewMatrix=function(e,t,i){if(this.ignoreParentScaling){if(this.parent){var n=this.parent.getWorldMatrix();a.e.TransformCoordinatesToRef(e,n,this._globalPosition),a.e.TransformCoordinatesToRef(t,n,this._tmpTargetVector),a.e.TransformNormalToRef(i,n,this._tmpUpVector),this._markSyncedWithParent()}else this._globalPosition.copyFrom(e),this._tmpTargetVector.copyFrom(t),this._tmpUpVector.copyFrom(i);this.getScene().useRightHandedSystem?a.a.LookAtRHToRef(this._globalPosition,this._tmpTargetVector,this._tmpUpVector,this._viewMatrix):a.a.LookAtLHToRef(this._globalPosition,this._tmpTargetVector,this._tmpUpVector,this._viewMatrix)}else this.getScene().useRightHandedSystem?a.a.LookAtRHToRef(e,t,i,this._viewMatrix):a.a.LookAtLHToRef(e,t,i,this._viewMatrix),this.parent?(n=this.parent.getWorldMatrix(),this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(n,this._viewMatrix),this._viewMatrix.getTranslationToRef(this._globalPosition),this._viewMatrix.invert(),this._markSyncedWithParent()):this._globalPosition.copyFrom(e)},t.prototype.createRigCamera=function(e,i){if(this.cameraRigMode!==je.a.RIG_MODE_NONE){var n=new t(e,this.position.clone(),this.getScene());return n.isRigCamera=!0,n.rigParent=this,this.cameraRigMode!==je.a.RIG_MODE_VR&&this.cameraRigMode!==je.a.RIG_MODE_WEBVR||(this.rotationQuaternion||(this.rotationQuaternion=new a.b),n._cameraRigParams={},n.rotationQuaternion=new a.b),n}return null},t.prototype._updateRigCameras=function(){var t=this._rigCameras[0],i=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case je.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case je.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:case je.a.RIG_MODE_STEREOSCOPIC_INTERLACED:var n=this.cameraRigMode===je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,r=this.cameraRigMode===je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*n,t),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*r,i);break;case je.a.RIG_MODE_VR:t.rotationQuaternion?(t.rotationQuaternion.copyFrom(this.rotationQuaternion),i.rotationQuaternion.copyFrom(this.rotationQuaternion)):(t.rotation.copyFrom(this.rotation),i.rotation.copyFrom(this.rotation)),t.position.copyFrom(this.position),i.position.copyFrom(this.position)}e.prototype._updateRigCameras.call(this)},t.prototype._getRigCamPositionAndTarget=function(e,i){this.getTarget().subtractToRef(this.position,t._TargetFocalPoint),t._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);var n=t._TargetFocalPoint.addInPlace(this.position);a.a.TranslationToRef(-n.x,-n.y,-n.z,t._TargetTransformMatrix),t._TargetTransformMatrix.multiplyToRef(a.a.RotationAxis(i.upVector,e),t._RigCamTransformMatrix),a.a.TranslationToRef(n.x,n.y,n.z,t._TargetTransformMatrix),t._RigCamTransformMatrix.multiplyToRef(t._TargetTransformMatrix,t._RigCamTransformMatrix),a.e.TransformCoordinatesToRef(this.position,t._RigCamTransformMatrix,i.position),i.setTarget(n)},t.prototype.getClassName=function(){return"TargetCamera"},t._RigCamTransformMatrix=new a.a,t._TargetTransformMatrix=new a.a,t._TargetFocalPoint=new a.e,Object(h.c)([Object(w.o)()],t.prototype,"rotation",void 0),Object(h.c)([Object(w.c)()],t.prototype,"speed",void 0),Object(h.c)([Object(w.k)("lockedTargetId")],t.prototype,"lockedTarget",void 0),t}(je.a),wt=function(e){function t(t,i,n,r){void 0===r&&(r=!0);var o=e.call(this,t,i,n,r)||this;return o.ellipsoid=new a.e(.5,1,.5),o.ellipsoidOffset=new a.e(0,0,0),o.checkCollisions=!1,o.applyGravity=!1,o._needMoveForGravity=!1,o._oldPosition=a.e.Zero(),o._diffPosition=a.e.Zero(),o._newPosition=a.e.Zero(),o._collisionMask=-1,o._onCollisionPositionChange=function(e,t,i){var n;void 0===i&&(i=null),n=t,o._newPosition.copyFrom(n),o._newPosition.subtractToRef(o._oldPosition,o._diffPosition),o._diffPosition.length()>Se.a.CollisionsEpsilon&&(o.position.addInPlace(o._diffPosition),o.onCollide&&i&&o.onCollide(i))},o.inputs=new Ct(o),o.inputs.addKeyboard().addMouse(),o}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"angularSensibility",{get:function(){var e=this.inputs.attached.mouse;return e?e.angularSensibility:0},set:function(e){var t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysUp",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUp:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysUpward",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUpward:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUpward=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysDown",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDown:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDown=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysDownward",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDownward:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDownward=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysLeft",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysLeft:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysRight",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysRight:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysRight=e)},enumerable:!1,configurable:!0}),t.prototype.attachControl=function(e,t){t=Ce.b.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t)},t.prototype.detachControl=function(e){this.inputs.detachElement(),this.cameraDirection=new a.e(0,0,0),this.cameraRotation=new a.d(0,0)},Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),t.prototype._collideWithWorld=function(e){(this.parent?a.e.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position).subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);var t=this.getScene().collisionCoordinator;this._collider||(this._collider=t.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;var i=e;this.applyGravity&&(i=e.add(this.getScene().gravity)),t.getNewPosition(this._oldPosition,i,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)},t.prototype._checkInputs=function(){this._localDirection||(this._localDirection=a.e.Zero(),this._transformedDirection=a.e.Zero()),this.inputs.checkInputs(),e.prototype._checkInputs.call(this)},t.prototype._decideIfNeedsToMove=function(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0},t.prototype._updatePosition=function(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):e.prototype._updatePosition.call(this)},t.prototype.dispose=function(){this.inputs.clear(),e.prototype.dispose.call(this)},t.prototype.getClassName=function(){return"FreeCamera"},Object(h.c)([Object(w.o)()],t.prototype,"ellipsoid",void 0),Object(h.c)([Object(w.o)()],t.prototype,"ellipsoidOffset",void 0),Object(h.c)([Object(w.c)()],t.prototype,"checkCollisions",void 0),Object(h.c)([Object(w.c)()],t.prototype,"applyGravity",void 0),t}(Lt);B.a.AddNodeConstructor("TouchCamera",function(e,t){return function(){return new Ft(e,a.e.Zero(),t)}});var Ft=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r.inputs.addTouch(),r._setupInputs(),r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"touchAngularSensibility",{get:function(){var e=this.inputs.attached.touch;return e?e.touchAngularSensibility:0},set:function(e){var t=this.inputs.attached.touch;t&&(t.touchAngularSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"touchMoveSensibility",{get:function(){var e=this.inputs.attached.touch;return e?e.touchMoveSensibility:0},set:function(e){var t=this.inputs.attached.touch;t&&(t.touchMoveSensibility=e)},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"TouchCamera"},t.prototype._setupInputs=function(){var e=this.inputs.attached.touch,t=this.inputs.attached.mouse;t?t.touchEnabled=!1:e.allowMouse=!0},t}(wt);B.a.AddNodeConstructor("ArcRotateCamera",function(e,t){return function(){return new Bt(e,0,0,1,a.e.Zero(),t)}});var Bt=function(e){function t(t,i,n,r,s,c,l){void 0===l&&(l=!0);var u=e.call(this,t,a.e.Zero(),c,l)||this;return u.inertialAlphaOffset=0,u.inertialBetaOffset=0,u.inertialRadiusOffset=0,u.lowerAlphaLimit=null,u.upperAlphaLimit=null,u.lowerBetaLimit=.01,u.upperBetaLimit=Math.PI-.01,u.lowerRadiusLimit=null,u.upperRadiusLimit=null,u.inertialPanningX=0,u.inertialPanningY=0,u.pinchToPanMaxDistance=20,u.panningDistanceLimit=null,u.panningOriginTarget=a.e.Zero(),u.panningInertia=.9,u.zoomOnFactor=1,u.targetScreenOffset=a.d.Zero(),u.allowUpsideDown=!0,u.useInputToRestoreState=!0,u._viewMatrix=new a.a,u.panningAxis=new a.e(1,1,0),u.onMeshTargetChangedObservable=new o.c,u.checkCollisions=!1,u.collisionRadius=new a.e(.5,.5,.5),u._previousPosition=a.e.Zero(),u._collisionVelocity=a.e.Zero(),u._newPosition=a.e.Zero(),u._computationVector=a.e.Zero(),u._onCollisionPositionChange=function(e,t,i){void 0===i&&(i=null),i?(u.setPosition(t),u.onCollide&&u.onCollide(i)):u._previousPosition.copyFrom(u._position);var n=Math.cos(u.alpha),r=Math.sin(u.alpha),o=Math.cos(u.beta),a=Math.sin(u.beta);0===a&&(a=1e-4);var s=u._getTargetPosition();u._computationVector.copyFromFloats(u.radius*n*a,u.radius*o,u.radius*r*a),s.addToRef(u._computationVector,u._newPosition),u._position.copyFrom(u._newPosition);var c=u.upVector;u.allowUpsideDown&&u.beta<0&&(c=(c=c.clone()).negate()),u._computeViewMatrix(u._position,s,c),u._viewMatrix.addAtIndex(12,u.targetScreenOffset.x),u._viewMatrix.addAtIndex(13,u.targetScreenOffset.y),u._collisionTriggered=!1},u._target=a.e.Zero(),s&&u.setTarget(s),u.alpha=i,u.beta=n,u.radius=r,u.getViewMatrix(),u.inputs=new ft(u),u.inputs.addKeyboard().addMouseWheel().addPointers(),u}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"target",{get:function(){return this._target},set:function(e){this.setTarget(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this.setPosition(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"upVector",{get:function(){return this._upVector},set:function(e){this._upToYMatrix||(this._YToUpMatrix=new a.a,this._upToYMatrix=new a.a,this._upVector=a.e.Zero()),e.normalize(),this._upVector.copyFrom(e),this.setMatUp()},enumerable:!1,configurable:!0}),t.prototype.setMatUp=function(){a.a.RotationAlignToRef(a.e.UpReadOnly,this._upVector,this._YToUpMatrix),a.a.RotationAlignToRef(this._upVector,a.e.UpReadOnly,this._upToYMatrix)},Object.defineProperty(t.prototype,"angularSensibilityX",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityX:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityX=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angularSensibilityY",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityY:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityY=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pinchPrecision",{get:function(){var e=this.inputs.attached.pointers;return e?e.pinchPrecision:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.pinchPrecision=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pinchDeltaPercentage",{get:function(){var e=this.inputs.attached.pointers;return e?e.pinchDeltaPercentage:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.pinchDeltaPercentage=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useNaturalPinchZoom",{get:function(){var e=this.inputs.attached.pointers;return!!e&&e.useNaturalPinchZoom},set:function(e){var t=this.inputs.attached.pointers;t&&(t.useNaturalPinchZoom=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panningSensibility",{get:function(){var e=this.inputs.attached.pointers;return e?e.panningSensibility:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.panningSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysUp",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUp:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysDown",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDown:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDown=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysLeft",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysLeft:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysRight",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysRight:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysRight=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelPrecision",{get:function(){var e=this.inputs.attached.mousewheel;return e?e.wheelPrecision:0},set:function(e){var t=this.inputs.attached.mousewheel;t&&(t.wheelPrecision=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelDeltaPercentage",{get:function(){var e=this.inputs.attached.mousewheel;return e?e.wheelDeltaPercentage:0},set:function(e){var t=this.inputs.attached.mousewheel;t&&(t.wheelDeltaPercentage=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bouncingBehavior",{get:function(){return this._bouncingBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useBouncingBehavior",{get:function(){return null!=this._bouncingBehavior},set:function(e){e!==this.useBouncingBehavior&&(e?(this._bouncingBehavior=new we,this.addBehavior(this._bouncingBehavior)):this._bouncingBehavior&&(this.removeBehavior(this._bouncingBehavior),this._bouncingBehavior=null))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"framingBehavior",{get:function(){return this._framingBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useFramingBehavior",{get:function(){return null!=this._framingBehavior},set:function(e){e!==this.useFramingBehavior&&(e?(this._framingBehavior=new Fe,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoRotationBehavior",{get:function(){return this._autoRotationBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useAutoRotationBehavior",{get:function(){return null!=this._autoRotationBehavior},set:function(e){e!==this.useAutoRotationBehavior&&(e?(this._autoRotationBehavior=new Le,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))},enumerable:!1,configurable:!0}),t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache._target=new a.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.alpha=void 0,this._cache.beta=void 0,this._cache.radius=void 0,this._cache.targetScreenOffset=a.d.Zero()},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)},t.prototype._getTargetPosition=function(){if(this._targetHost&&this._targetHost.getAbsolutePosition){var e=this._targetHost.absolutePosition;this._targetBoundingCenter?e.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(e)}return this._getLockedTargetPosition()||this._target},t.prototype.storeState=function(){return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),this._storedTargetScreenOffset=this.targetScreenOffset.clone(),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0)},t.prototype._isSynchronizedViewMatrix=function(){return!!e.prototype._isSynchronizedViewMatrix.call(this)&&this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset)},t.prototype.attachControl=function(e,t,i,n){var r=this;void 0===i&&(i=!0),void 0===n&&(n=2),t=Ce.b.BackCompatCameraNoPreventDefault(arguments),this._useCtrlForPanning=i,this._panningMouseButton=n,"boolean"==typeof arguments[0]&&(arguments.length>1&&(this._useCtrlForPanning=arguments[1]),arguments.length>2&&(this._panningMouseButton=arguments[2])),this.inputs.attachElement(t),this._reset=function(){r.inertialAlphaOffset=0,r.inertialBetaOffset=0,r.inertialRadiusOffset=0,r.inertialPanningX=0,r.inertialPanningY=0}},t.prototype.detachControl=function(e){this.inputs.detachElement(),this._reset&&this._reset()},t.prototype._checkInputs=function(){if(!this._collisionTriggered){if(this.inputs.checkInputs(),0!==this.inertialAlphaOffset||0!==this.inertialBetaOffset||0!==this.inertialRadiusOffset){var t=this.inertialAlphaOffset;this.beta<=0&&(t*=-1),this.getScene().useRightHandedSystem&&(t*=-1),this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(t*=-1),this.alpha+=t,this.beta+=this.inertialBetaOffset,this.radius-=this.inertialRadiusOffset,this.inertialAlphaOffset*=this.inertia,this.inertialBetaOffset*=this.inertia,this.inertialRadiusOffset*=this.inertia,Math.abs(this.inertialAlphaOffset)<Nt.a&&(this.inertialAlphaOffset=0),Math.abs(this.inertialBetaOffset)<Nt.a&&(this.inertialBetaOffset=0),Math.abs(this.inertialRadiusOffset)<this.speed*Nt.a&&(this.inertialRadiusOffset=0)}0===this.inertialPanningX&&0===this.inertialPanningY||(this._localDirection||(this._localDirection=a.e.Zero(),this._transformedDirection=a.e.Zero()),this._localDirection.copyFromFloats(this.inertialPanningX,this.inertialPanningY,this.inertialPanningY),this._localDirection.multiplyInPlace(this.panningAxis),this._viewMatrix.invertToRef(this._cameraTransformMatrix),a.e.TransformNormalToRef(this._localDirection,this._cameraTransformMatrix,this._transformedDirection),this.panningAxis.y||(this._transformedDirection.y=0),this._targetHost||(this.panningDistanceLimit?(this._transformedDirection.addInPlace(this._target),a.e.DistanceSquared(this._transformedDirection,this.panningOriginTarget)<=this.panningDistanceLimit*this.panningDistanceLimit&&this._target.copyFrom(this._transformedDirection)):this._target.addInPlace(this._transformedDirection)),this.inertialPanningX*=this.panningInertia,this.inertialPanningY*=this.panningInertia,Math.abs(this.inertialPanningX)<this.speed*Nt.a&&(this.inertialPanningX=0),Math.abs(this.inertialPanningY)<this.speed*Nt.a&&(this.inertialPanningY=0)),this._checkLimits(),e.prototype._checkInputs.call(this)}},t.prototype._checkLimits=function(){null===this.lowerBetaLimit||void 0===this.lowerBetaLimit?this.allowUpsideDown&&this.beta>Math.PI&&(this.beta=this.beta-2*Math.PI):this.beta<this.lowerBetaLimit&&(this.beta=this.lowerBetaLimit),null===this.upperBetaLimit||void 0===this.upperBetaLimit?this.allowUpsideDown&&this.beta<-Math.PI&&(this.beta=this.beta+2*Math.PI):this.beta>this.upperBetaLimit&&(this.beta=this.upperBetaLimit),null!==this.lowerAlphaLimit&&this.alpha<this.lowerAlphaLimit&&(this.alpha=this.lowerAlphaLimit),null!==this.upperAlphaLimit&&this.alpha>this.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),null!==this.lowerRadiusLimit&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit,this.inertialRadiusOffset=0),null!==this.upperRadiusLimit&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0)},t.prototype.rebuildAnglesAndRadius=function(){this._position.subtractToRef(this._getTargetPosition(),this._computationVector),0===this._upVector.x&&1===this._upVector.y&&0===this._upVector.z||a.e.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),0===this.radius&&(this.radius=1e-4);var e=this.alpha;0===this._computationVector.x&&0===this._computationVector.z?this.alpha=Math.PI/2:this.alpha=Math.acos(this._computationVector.x/Math.sqrt(Math.pow(this._computationVector.x,2)+Math.pow(this._computationVector.z,2))),this._computationVector.z<0&&(this.alpha=2*Math.PI-this.alpha);var t=Math.round((e-this.alpha)/(2*Math.PI));this.alpha+=2*t*Math.PI,this.beta=Math.acos(this._computationVector.y/this.radius),this._checkLimits()},t.prototype.setPosition=function(e){this._position.equals(e)||(this._position.copyFrom(e),this.rebuildAnglesAndRadius())},t.prototype.setTarget=function(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=!1),e.getBoundingInfo)this._targetBoundingCenter=t?e.getBoundingInfo().boundingBox.centerWorld.clone():null,e.computeWorldMatrix(),this._targetHost=e,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{var n=e,r=this._getTargetPosition();if(r&&!i&&r.equals(n))return;this._targetHost=null,this._target=n,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}this.rebuildAnglesAndRadius()},t.prototype._getViewMatrix=function(){var e=Math.cos(this.alpha),t=Math.sin(this.alpha),i=Math.cos(this.beta),n=Math.sin(this.beta);0===n&&(n=1e-4),0===this.radius&&(this.radius=1e-4);var r=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*e*n,this.radius*i,this.radius*t*n),0===this._upVector.x&&1===this._upVector.y&&0===this._upVector.z||a.e.TransformCoordinatesToRef(this._computationVector,this._YToUpMatrix,this._computationVector),r.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){var o=this.getScene().collisionCoordinator;this._collider||(this._collider=o.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,o.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);var s=this.upVector;this.allowUpsideDown&&n<0&&(s=s.negate()),this._computeViewMatrix(this._position,r,s),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget=r,this._viewMatrix},t.prototype.zoomOn=function(e,t){void 0===t&&(t=!1),e=e||this.getScene().meshes;var i=be.a.MinMax(e),n=a.e.Distance(i.min,i.max);this.radius=n*this.zoomOnFactor,this.focusOn({min:i.min,max:i.max,distance:n},t)},t.prototype.focusOn=function(e,t){var i,n;if(void 0===t&&(t=!1),void 0===e.min){var r=e||this.getScene().meshes;i=be.a.MinMax(r),n=a.e.Distance(i.min,i.max)}else i=e,n=e.distance;this._target=be.a.Center(i),t||(this.maxZ=2*n)},t.prototype.createRigCamera=function(e,i){var n=0;switch(this.cameraRigMode){case je.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case je.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:case je.a.RIG_MODE_STEREOSCOPIC_INTERLACED:case je.a.RIG_MODE_VR:n=this._cameraRigParams.stereoHalfAngle*(0===i?1:-1);break;case je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:n=this._cameraRigParams.stereoHalfAngle*(0===i?-1:1)}var r=new t(e,this.alpha+n,this.beta,this.radius,this._target,this.getScene());return r._cameraRigParams={},r.isRigCamera=!0,r.rigParent=this,r.upVector=this.upVector,r},t.prototype._updateRigCameras=function(){var t=this._rigCameras[0],i=this._rigCameras[1];switch(t.beta=i.beta=this.beta,this.cameraRigMode){case je.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case je.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:case je.a.RIG_MODE_STEREOSCOPIC_INTERLACED:case je.a.RIG_MODE_VR:t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,i.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,i.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle}e.prototype._updateRigCameras.call(this)},t.prototype.dispose=function(){this.inputs.clear(),e.prototype.dispose.call(this)},t.prototype.getClassName=function(){return"ArcRotateCamera"},Object(h.c)([Object(w.c)()],t.prototype,"alpha",void 0),Object(h.c)([Object(w.c)()],t.prototype,"beta",void 0),Object(h.c)([Object(w.c)()],t.prototype,"radius",void 0),Object(h.c)([Object(w.o)("target")],t.prototype,"_target",void 0),Object(h.c)([Object(w.c)()],t.prototype,"inertialAlphaOffset",void 0),Object(h.c)([Object(w.c)()],t.prototype,"inertialBetaOffset",void 0),Object(h.c)([Object(w.c)()],t.prototype,"inertialRadiusOffset",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lowerAlphaLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"upperAlphaLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lowerBetaLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"upperBetaLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lowerRadiusLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"upperRadiusLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"inertialPanningX",void 0),Object(h.c)([Object(w.c)()],t.prototype,"inertialPanningY",void 0),Object(h.c)([Object(w.c)()],t.prototype,"pinchToPanMaxDistance",void 0),Object(h.c)([Object(w.c)()],t.prototype,"panningDistanceLimit",void 0),Object(h.c)([Object(w.o)()],t.prototype,"panningOriginTarget",void 0),Object(h.c)([Object(w.c)()],t.prototype,"panningInertia",void 0),Object(h.c)([Object(w.c)()],t.prototype,"zoomOnFactor",void 0),Object(h.c)([Object(w.c)()],t.prototype,"targetScreenOffset",void 0),Object(h.c)([Object(w.c)()],t.prototype,"allowUpsideDown",void 0),Object(h.c)([Object(w.c)()],t.prototype,"useInputToRestoreState",void 0),t}(Lt);B.a.AddNodeConstructor("DeviceOrientationCamera",function(e,t){return function(){return new Ut(e,a.e.Zero(),t)}});var Ut=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r._tmpDragQuaternion=new a.b,r._disablePointerInputWhenUsingDeviceOrientation=!0,r._dragFactor=0,r._quaternionCache=new a.b,r.inputs.addDeviceOrientation(),r.inputs._deviceOrientationInput&&r.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce(function(){r._disablePointerInputWhenUsingDeviceOrientation&&r.inputs._mouseInput&&(r.inputs._mouseInput._allowCameraRotation=!1,r.inputs._mouseInput.onPointerMovedObservable.add(function(e){0!=r._dragFactor&&(r._initialQuaternion||(r._initialQuaternion=new a.b),a.b.FromEulerAnglesToRef(0,e.offsetX*r._dragFactor,0,r._tmpDragQuaternion),r._initialQuaternion.multiplyToRef(r._tmpDragQuaternion,r._initialQuaternion))}))}),r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"disablePointerInputWhenUsingDeviceOrientation",{get:function(){return this._disablePointerInputWhenUsingDeviceOrientation},set:function(e){this._disablePointerInputWhenUsingDeviceOrientation=e},enumerable:!1,configurable:!0}),t.prototype.enableHorizontalDragging=function(e){void 0===e&&(e=1/300),this._dragFactor=e},t.prototype.getClassName=function(){return"DeviceOrientationCamera"},t.prototype._checkInputs=function(){e.prototype._checkInputs.call(this),this._quaternionCache.copyFrom(this.rotationQuaternion),this._initialQuaternion&&this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)},t.prototype.resetToCurrentRotation=function(e){var t=this;void 0===e&&(e=J.a.Y),this.rotationQuaternion&&(this._initialQuaternion||(this._initialQuaternion=new a.b),this._initialQuaternion.copyFrom(this._quaternionCache||this.rotationQuaternion),["x","y","z"].forEach(function(i){e[i]?t._initialQuaternion[i]*=-1:t._initialQuaternion[i]=0}),this._initialQuaternion.normalize(),this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion))},t}(wt),Vt=function(e){function t(t){return e.call(this,t)||this}return Object(h.d)(t,e),t.prototype.addKeyboard=function(){return this.add(new _t),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this.add(new mt(e)),this},t}(nt),kt=function(e){function t(t,i,n,r){void 0===r&&(r=!0);var o=e.call(this,t,i,n,r)||this;return o.ellipsoid=new a.e(1,1,1),o.ellipsoidOffset=new a.e(0,0,0),o.checkCollisions=!1,o.applyGravity=!1,o.cameraDirection=a.e.Zero(),o._trackRoll=0,o.rollCorrect=100,o.bankedTurn=!1,o.bankedTurnLimit=Math.PI/2,o.bankedTurnMultiplier=1,o._needMoveForGravity=!1,o._oldPosition=a.e.Zero(),o._diffPosition=a.e.Zero(),o._newPosition=a.e.Zero(),o._collisionMask=-1,o._onCollisionPositionChange=function(e,t,i){var n;void 0===i&&(i=null),n=t,o._newPosition.copyFrom(n),o._newPosition.subtractToRef(o._oldPosition,o._diffPosition),o._diffPosition.length()>Se.a.CollisionsEpsilon&&(o.position.addInPlace(o._diffPosition),o.onCollide&&i&&o.onCollide(i))},o.inputs=new Vt(o),o.inputs.addKeyboard().addMouse(),o}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"angularSensibility",{get:function(){var e=this.inputs.attached.mouse;return e?e.angularSensibility:0},set:function(e){var t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysForward",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysForward:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysForward=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysBackward",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysBackward:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysBackward=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysUp",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUp:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysDown",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDown:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDown=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysLeft",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysLeft:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysRight",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysRight:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysRight=e)},enumerable:!1,configurable:!0}),t.prototype.attachControl=function(e,t){t=Ce.b.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t)},t.prototype.detachControl=function(){this.inputs.detachElement(),this.cameraDirection=new a.e(0,0,0)},Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),t.prototype._collideWithWorld=function(e){(this.parent?a.e.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position).subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);var t=this.getScene().collisionCoordinator;this._collider||(this._collider=t.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;var i=e;this.applyGravity&&(i=e.add(this.getScene().gravity)),t.getNewPosition(this._oldPosition,i,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)},t.prototype._checkInputs=function(){this._localDirection||(this._localDirection=a.e.Zero(),this._transformedDirection=a.e.Zero()),this.inputs.checkInputs(),e.prototype._checkInputs.call(this)},t.prototype._decideIfNeedsToMove=function(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0},t.prototype._updatePosition=function(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):e.prototype._updatePosition.call(this)},t.prototype.restoreRoll=function(e){var t=this._trackRoll,i=t-this.rotation.z;Math.abs(i)>=.001&&(this.rotation.z+=i/e,Math.abs(t-this.rotation.z)<=.001&&(this.rotation.z=t))},t.prototype.dispose=function(){this.inputs.clear(),e.prototype.dispose.call(this)},t.prototype.getClassName=function(){return"FlyCamera"},Object(h.c)([Object(w.o)()],t.prototype,"ellipsoid",void 0),Object(h.c)([Object(w.o)()],t.prototype,"ellipsoidOffset",void 0),Object(h.c)([Object(w.c)()],t.prototype,"checkCollisions",void 0),Object(h.c)([Object(w.c)()],t.prototype,"applyGravity",void 0),t}(Lt),Gt=function(e){function t(t){return e.call(this,t)||this}return Object(h.d)(t,e),t.prototype.addKeyboard=function(){return this.add(new gt),this},t.prototype.addMouseWheel=function(){return this.add(new vt),this},t.prototype.addPointers=function(){return this.add(new bt),this},t.prototype.addVRDeviceOrientation=function(){return console.warn("DeviceOrientation support not yet implemented for FollowCamera."),this},t}(nt);B.a.AddNodeConstructor("FollowCamera",function(e,t){return function(){return new jt(e,a.e.Zero(),t)}}),B.a.AddNodeConstructor("ArcFollowCamera",function(e,t){return function(){return new Wt(e,0,0,1,null,t)}});var zt,jt=function(e){function t(t,i,n,r){void 0===r&&(r=null);var o=e.call(this,t,i,n)||this;return o.radius=12,o.lowerRadiusLimit=null,o.upperRadiusLimit=null,o.rotationOffset=0,o.lowerRotationOffsetLimit=null,o.upperRotationOffsetLimit=null,o.heightOffset=4,o.lowerHeightOffsetLimit=null,o.upperHeightOffsetLimit=null,o.cameraAcceleration=.05,o.maxCameraSpeed=20,o.lockedTarget=r,o.inputs=new Gt(o),o.inputs.addKeyboard().addMouseWheel().addPointers(),o}return Object(h.d)(t,e),t.prototype._follow=function(e){if(e){var t;if(e.rotationQuaternion){var i=new a.a;e.rotationQuaternion.toRotationMatrix(i),t=Math.atan2(i.m[8],i.m[10])}else t=e.rotation.y;var n=Ce.b.ToRadians(this.rotationOffset)+t,r=e.getAbsolutePosition(),o=r.x+Math.sin(n)*this.radius,s=r.z+Math.cos(n)*this.radius,c=o-this.position.x,l=r.y+this.heightOffset-this.position.y,u=s-this.position.z,h=c*this.cameraAcceleration*2,d=l*this.cameraAcceleration,f=u*this.cameraAcceleration*2;(h>this.maxCameraSpeed||h<-this.maxCameraSpeed)&&(h=h<1?-this.maxCameraSpeed:this.maxCameraSpeed),(d>this.maxCameraSpeed||d<-this.maxCameraSpeed)&&(d=d<1?-this.maxCameraSpeed:this.maxCameraSpeed),(f>this.maxCameraSpeed||f<-this.maxCameraSpeed)&&(f=f<1?-this.maxCameraSpeed:this.maxCameraSpeed),this.position=new a.e(this.position.x+h,this.position.y+d,this.position.z+f),this.setTarget(r)}},t.prototype.attachControl=function(e,t){t=Ce.b.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t),this._reset=function(){}},t.prototype.detachControl=function(e){this.inputs.detachElement(),this._reset&&this._reset()},t.prototype._checkInputs=function(){this.inputs.checkInputs(),this._checkLimits(),e.prototype._checkInputs.call(this),this.lockedTarget&&this._follow(this.lockedTarget)},t.prototype._checkLimits=function(){null!==this.lowerRadiusLimit&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit),null!==this.upperRadiusLimit&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit),null!==this.lowerHeightOffsetLimit&&this.heightOffset<this.lowerHeightOffsetLimit&&(this.heightOffset=this.lowerHeightOffsetLimit),null!==this.upperHeightOffsetLimit&&this.heightOffset>this.upperHeightOffsetLimit&&(this.heightOffset=this.upperHeightOffsetLimit),null!==this.lowerRotationOffsetLimit&&this.rotationOffset<this.lowerRotationOffsetLimit&&(this.rotationOffset=this.lowerRotationOffsetLimit),null!==this.upperRotationOffsetLimit&&this.rotationOffset>this.upperRotationOffsetLimit&&(this.rotationOffset=this.upperRotationOffsetLimit)},t.prototype.getClassName=function(){return"FollowCamera"},Object(h.c)([Object(w.c)()],t.prototype,"radius",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lowerRadiusLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"upperRadiusLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"rotationOffset",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lowerRotationOffsetLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"upperRotationOffsetLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"heightOffset",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lowerHeightOffsetLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"upperHeightOffsetLimit",void 0),Object(h.c)([Object(w.c)()],t.prototype,"cameraAcceleration",void 0),Object(h.c)([Object(w.c)()],t.prototype,"maxCameraSpeed",void 0),Object(h.c)([Object(w.k)("lockedTargetId")],t.prototype,"lockedTarget",void 0),t}(Lt),Wt=function(e){function t(t,i,n,r,o,s){var c=e.call(this,t,a.e.Zero(),s)||this;return c.alpha=i,c.beta=n,c.radius=r,c._cartesianCoordinates=a.e.Zero(),c._meshTarget=o,c._follow(),c}return Object(h.d)(t,e),t.prototype._follow=function(){if(this._meshTarget){this._cartesianCoordinates.x=this.radius*Math.cos(this.alpha)*Math.cos(this.beta),this._cartesianCoordinates.y=this.radius*Math.sin(this.beta),this._cartesianCoordinates.z=this.radius*Math.sin(this.alpha)*Math.cos(this.beta);var e=this._meshTarget.getAbsolutePosition();this.position=e.add(this._cartesianCoordinates),this.setTarget(e)}},t.prototype._checkInputs=function(){e.prototype._checkInputs.call(this),this._follow()},t.prototype.getClassName=function(){return"ArcFollowCamera"},t}(Lt),Ht=i(38),Xt=i(39);!function(e){e[e.VIVE=0]="VIVE",e[e.OCULUS=1]="OCULUS",e[e.WINDOWS=2]="WINDOWS",e[e.GEAR_VR=3]="GEAR_VR",e[e.DAYDREAM=4]="DAYDREAM",e[e.GENERIC=5]="GENERIC"}(zt||(zt={}));var Yt,Kt,Qt=function(){function e(){}return e.InitiateController=function(e){for(var t=0,i=this._ControllerFactories;t<i.length;t++){var n=i[t];if(n.canCreate(e))return n.create(e)}if(this._DefaultControllerFactory)return this._DefaultControllerFactory(e);throw"The type of gamepad you are trying to load needs to be imported first or is not supported."},e._ControllerFactories=[],e._DefaultControllerFactory=null,e}(),qt=function(e){function t(t){var i=e.call(this,t.id,t.index,t)||this;return i.isXR=!1,i._deviceRoomPosition=a.e.Zero(),i._deviceRoomRotationQuaternion=new a.b,i.devicePosition=a.e.Zero(),i.deviceRotationQuaternion=new a.b,i.deviceScaleFactor=1,i._trackPosition=!0,i._maxRotationDistFromHeadset=Math.PI/5,i._draggedRoomRotation=0,i._leftHandSystemQuaternion=new a.b,i._deviceToWorld=a.a.Identity(),i._pointingPoseNode=null,i._workingMatrix=a.a.Identity(),i._meshAttachedObservable=new o.c,i.type=ot.POSE_ENABLED,i.controllerType=zt.GENERIC,i.position=a.e.Zero(),i.rotationQuaternion=new a.b,i._calculatedPosition=a.e.Zero(),i._calculatedRotation=new a.b,a.b.RotationYawPitchRollToRef(Math.PI,0,0,i._leftHandSystemQuaternion),i}return Object(h.d)(t,e),t.prototype._disableTrackPosition=function(e){this._trackPosition&&(this._calculatedPosition.copyFrom(e),this._trackPosition=!1)},t.prototype.update=function(){e.prototype.update.call(this),this._updatePoseAndMesh()},t.prototype._updatePoseAndMesh=function(){if(!this.isXR){var e=this.browserGamepad.pose;if(this.updateFromDevice(e),!this._trackPosition&&x.a.LastCreatedScene&&x.a.LastCreatedScene.activeCamera&&x.a.LastCreatedScene.activeCamera.devicePosition&&((t=x.a.LastCreatedScene.activeCamera)._computeDevicePosition(),this._deviceToWorld.setTranslation(t.devicePosition),t.deviceRotationQuaternion)){var t;(t=t)._deviceRoomRotationQuaternion.toEulerAnglesToRef(a.c.Vector3[0]);var i=Math.atan2(Math.sin(a.c.Vector3[0].y-this._draggedRoomRotation),Math.cos(a.c.Vector3[0].y-this._draggedRoomRotation));if(Math.abs(i)>this._maxRotationDistFromHeadset){var n=i-(i<0?-this._maxRotationDistFromHeadset:this._maxRotationDistFromHeadset);this._draggedRoomRotation+=n;var r=Math.sin(-n),o=Math.cos(-n);this._calculatedPosition.x=this._calculatedPosition.x*o-this._calculatedPosition.z*r,this._calculatedPosition.z=this._calculatedPosition.x*r+this._calculatedPosition.z*o}}a.e.TransformCoordinatesToRef(this._calculatedPosition,this._deviceToWorld,this.devicePosition),this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix),a.b.FromRotationMatrixToRef(this._workingMatrix,this.deviceRotationQuaternion),this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation),this._mesh&&(this._mesh.position.copyFrom(this.devicePosition),this._mesh.rotationQuaternion&&this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion))}},t.prototype.updateFromDevice=function(e){if(!this.isXR&&e){this.rawPose=e,e.position&&(this._deviceRoomPosition.copyFromFloats(e.position[0],e.position[1],-e.position[2]),this._mesh&&this._mesh.getScene().useRightHandedSystem&&(this._deviceRoomPosition.z*=-1),this._trackPosition&&this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor,this._calculatedPosition),this._calculatedPosition.addInPlace(this.position));var t=this.rawPose;e.orientation&&t.orientation&&4===t.orientation.length&&(this._deviceRoomRotationQuaternion.copyFromFloats(t.orientation[0],t.orientation[1],-t.orientation[2],-t.orientation[3]),this._mesh&&(this._mesh.getScene().useRightHandedSystem?(this._deviceRoomRotationQuaternion.z*=-1,this._deviceRoomRotationQuaternion.w*=-1):this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion,this._deviceRoomRotationQuaternion)),this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion,this._calculatedRotation))}},t.prototype.attachToMesh=function(e){if(this._mesh&&(this._mesh.parent=null),this._mesh=e,this._poseControlledCamera&&(this._mesh.parent=this._poseControlledCamera),this._mesh.rotationQuaternion||(this._mesh.rotationQuaternion=new a.b),!this.isXR&&(this._updatePoseAndMesh(),this._pointingPoseNode)){for(var t=[],i=this._pointingPoseNode;i.parent;)t.push(i.parent),i=i.parent;t.reverse().forEach(function(e){e.computeWorldMatrix(!0)})}this._meshAttachedObservable.notifyObservers(e)},t.prototype.attachToPoseControlledCamera=function(e){this._poseControlledCamera=e,this._mesh&&(this._mesh.parent=this._poseControlledCamera)},t.prototype.dispose=function(){this._mesh&&this._mesh.dispose(),this._mesh=null,e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"mesh",{get:function(){return this._mesh},enumerable:!1,configurable:!0}),t.prototype.getForwardRay=function(e){if(void 0===e&&(e=100),!this.mesh)return new Xt.a(a.e.Zero(),new a.e(0,0,1),e);var t=this._pointingPoseNode?this._pointingPoseNode.getWorldMatrix():this.mesh.getWorldMatrix(),i=t.getTranslation(),n=new a.e(0,0,-1),r=a.e.TransformNormal(n,t),o=a.e.Normalize(r);return new Xt.a(i,o,e)},t.POINTING_POSE="POINTING_POSE",t}(ot);!function(e){e[e.A=0]="A",e[e.B=1]="B",e[e.X=2]="X",e[e.Y=3]="Y",e[e.LB=4]="LB",e[e.RB=5]="RB",e[e.Back=8]="Back",e[e.Start=9]="Start",e[e.LeftStick=10]="LeftStick",e[e.RightStick=11]="RightStick"}(Yt||(Yt={})),function(e){e[e.Up=12]="Up",e[e.Down=13]="Down",e[e.Left=14]="Left",e[e.Right=15]="Right"}(Kt||(Kt={}));var Zt,Jt,$t=function(e){function t(t,i,n,r){void 0===r&&(r=!1);var a=e.call(this,t,i,n,0,1,2,3)||this;return a._leftTrigger=0,a._rightTrigger=0,a.onButtonDownObservable=new o.c,a.onButtonUpObservable=new o.c,a.onPadDownObservable=new o.c,a.onPadUpObservable=new o.c,a._buttonA=0,a._buttonB=0,a._buttonX=0,a._buttonY=0,a._buttonBack=0,a._buttonStart=0,a._buttonLB=0,a._buttonRB=0,a._buttonLeftStick=0,a._buttonRightStick=0,a._dPadUp=0,a._dPadDown=0,a._dPadLeft=0,a._dPadRight=0,a._isXboxOnePad=!1,a.type=ot.XBOX,a._isXboxOnePad=r,a}return Object(h.d)(t,e),t.prototype.onlefttriggerchanged=function(e){this._onlefttriggerchanged=e},t.prototype.onrighttriggerchanged=function(e){this._onrighttriggerchanged=e},Object.defineProperty(t.prototype,"leftTrigger",{get:function(){return this._leftTrigger},set:function(e){this._onlefttriggerchanged&&this._leftTrigger!==e&&this._onlefttriggerchanged(e),this._leftTrigger=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightTrigger",{get:function(){return this._rightTrigger},set:function(e){this._onrighttriggerchanged&&this._rightTrigger!==e&&this._onrighttriggerchanged(e),this._rightTrigger=e},enumerable:!1,configurable:!0}),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype.ondpaddown=function(e){this._ondpaddown=e},t.prototype.ondpadup=function(e){this._ondpadup=e},t.prototype._setButtonValue=function(e,t,i){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(i),this.onButtonDownObservable.notifyObservers(i)),0===e&&(this._onbuttonup&&this._onbuttonup(i),this.onButtonUpObservable.notifyObservers(i))),e},t.prototype._setDPadValue=function(e,t,i){return e!==t&&(1===e&&(this._ondpaddown&&this._ondpaddown(i),this.onPadDownObservable.notifyObservers(i)),0===e&&(this._ondpadup&&this._ondpadup(i),this.onPadUpObservable.notifyObservers(i))),e},Object.defineProperty(t.prototype,"buttonA",{get:function(){return this._buttonA},set:function(e){this._buttonA=this._setButtonValue(e,this._buttonA,Yt.A)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonB",{get:function(){return this._buttonB},set:function(e){this._buttonB=this._setButtonValue(e,this._buttonB,Yt.B)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonX",{get:function(){return this._buttonX},set:function(e){this._buttonX=this._setButtonValue(e,this._buttonX,Yt.X)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonY",{get:function(){return this._buttonY},set:function(e){this._buttonY=this._setButtonValue(e,this._buttonY,Yt.Y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonStart",{get:function(){return this._buttonStart},set:function(e){this._buttonStart=this._setButtonValue(e,this._buttonStart,Yt.Start)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonBack",{get:function(){return this._buttonBack},set:function(e){this._buttonBack=this._setButtonValue(e,this._buttonBack,Yt.Back)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonLB",{get:function(){return this._buttonLB},set:function(e){this._buttonLB=this._setButtonValue(e,this._buttonLB,Yt.LB)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonRB",{get:function(){return this._buttonRB},set:function(e){this._buttonRB=this._setButtonValue(e,this._buttonRB,Yt.RB)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonLeftStick",{get:function(){return this._buttonLeftStick},set:function(e){this._buttonLeftStick=this._setButtonValue(e,this._buttonLeftStick,Yt.LeftStick)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonRightStick",{get:function(){return this._buttonRightStick},set:function(e){this._buttonRightStick=this._setButtonValue(e,this._buttonRightStick,Yt.RightStick)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadUp",{get:function(){return this._dPadUp},set:function(e){this._dPadUp=this._setDPadValue(e,this._dPadUp,Kt.Up)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadDown",{get:function(){return this._dPadDown},set:function(e){this._dPadDown=this._setDPadValue(e,this._dPadDown,Kt.Down)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadLeft",{get:function(){return this._dPadLeft},set:function(e){this._dPadLeft=this._setDPadValue(e,this._dPadLeft,Kt.Left)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadRight",{get:function(){return this._dPadRight},set:function(e){this._dPadRight=this._setDPadValue(e,this._dPadRight,Kt.Right)},enumerable:!1,configurable:!0}),t.prototype.update=function(){e.prototype.update.call(this),this._isXboxOnePad,this.buttonA=this.browserGamepad.buttons[0].value,this.buttonB=this.browserGamepad.buttons[1].value,this.buttonX=this.browserGamepad.buttons[2].value,this.buttonY=this.browserGamepad.buttons[3].value,this.buttonLB=this.browserGamepad.buttons[4].value,this.buttonRB=this.browserGamepad.buttons[5].value,this.leftTrigger=this.browserGamepad.buttons[6].value,this.rightTrigger=this.browserGamepad.buttons[7].value,this.buttonBack=this.browserGamepad.buttons[8].value,this.buttonStart=this.browserGamepad.buttons[9].value,this.buttonLeftStick=this.browserGamepad.buttons[10].value,this.buttonRightStick=this.browserGamepad.buttons[11].value,this.dPadUp=this.browserGamepad.buttons[12].value,this.dPadDown=this.browserGamepad.buttons[13].value,this.dPadLeft=this.browserGamepad.buttons[14].value,this.dPadRight=this.browserGamepad.buttons[15].value},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear(),this.onPadDownObservable.clear(),this.onPadUpObservable.clear()},t}(ot);!function(e){e[e.Cross=0]="Cross",e[e.Circle=1]="Circle",e[e.Square=2]="Square",e[e.Triangle=3]="Triangle",e[e.L1=4]="L1",e[e.R1=5]="R1",e[e.Share=8]="Share",e[e.Options=9]="Options",e[e.LeftStick=10]="LeftStick",e[e.RightStick=11]="RightStick"}(Zt||(Zt={})),function(e){e[e.Up=12]="Up",e[e.Down=13]="Down",e[e.Left=14]="Left",e[e.Right=15]="Right"}(Jt||(Jt={}));var ei=function(e){function t(t,i,n){var r=e.call(this,t.replace("STANDARD GAMEPAD","SONY PLAYSTATION DUALSHOCK"),i,n,0,1,2,3)||this;return r._leftTrigger=0,r._rightTrigger=0,r.onButtonDownObservable=new o.c,r.onButtonUpObservable=new o.c,r.onPadDownObservable=new o.c,r.onPadUpObservable=new o.c,r._buttonCross=0,r._buttonCircle=0,r._buttonSquare=0,r._buttonTriangle=0,r._buttonShare=0,r._buttonOptions=0,r._buttonL1=0,r._buttonR1=0,r._buttonLeftStick=0,r._buttonRightStick=0,r._dPadUp=0,r._dPadDown=0,r._dPadLeft=0,r._dPadRight=0,r.type=ot.DUALSHOCK,r}return Object(h.d)(t,e),t.prototype.onlefttriggerchanged=function(e){this._onlefttriggerchanged=e},t.prototype.onrighttriggerchanged=function(e){this._onrighttriggerchanged=e},Object.defineProperty(t.prototype,"leftTrigger",{get:function(){return this._leftTrigger},set:function(e){this._onlefttriggerchanged&&this._leftTrigger!==e&&this._onlefttriggerchanged(e),this._leftTrigger=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightTrigger",{get:function(){return this._rightTrigger},set:function(e){this._onrighttriggerchanged&&this._rightTrigger!==e&&this._onrighttriggerchanged(e),this._rightTrigger=e},enumerable:!1,configurable:!0}),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype.ondpaddown=function(e){this._ondpaddown=e},t.prototype.ondpadup=function(e){this._ondpadup=e},t.prototype._setButtonValue=function(e,t,i){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(i),this.onButtonDownObservable.notifyObservers(i)),0===e&&(this._onbuttonup&&this._onbuttonup(i),this.onButtonUpObservable.notifyObservers(i))),e},t.prototype._setDPadValue=function(e,t,i){return e!==t&&(1===e&&(this._ondpaddown&&this._ondpaddown(i),this.onPadDownObservable.notifyObservers(i)),0===e&&(this._ondpadup&&this._ondpadup(i),this.onPadUpObservable.notifyObservers(i))),e},Object.defineProperty(t.prototype,"buttonCross",{get:function(){return this._buttonCross},set:function(e){this._buttonCross=this._setButtonValue(e,this._buttonCross,Zt.Cross)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonCircle",{get:function(){return this._buttonCircle},set:function(e){this._buttonCircle=this._setButtonValue(e,this._buttonCircle,Zt.Circle)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonSquare",{get:function(){return this._buttonSquare},set:function(e){this._buttonSquare=this._setButtonValue(e,this._buttonSquare,Zt.Square)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonTriangle",{get:function(){return this._buttonTriangle},set:function(e){this._buttonTriangle=this._setButtonValue(e,this._buttonTriangle,Zt.Triangle)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonOptions",{get:function(){return this._buttonOptions},set:function(e){this._buttonOptions=this._setButtonValue(e,this._buttonOptions,Zt.Options)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonShare",{get:function(){return this._buttonShare},set:function(e){this._buttonShare=this._setButtonValue(e,this._buttonShare,Zt.Share)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonL1",{get:function(){return this._buttonL1},set:function(e){this._buttonL1=this._setButtonValue(e,this._buttonL1,Zt.L1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonR1",{get:function(){return this._buttonR1},set:function(e){this._buttonR1=this._setButtonValue(e,this._buttonR1,Zt.R1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonLeftStick",{get:function(){return this._buttonLeftStick},set:function(e){this._buttonLeftStick=this._setButtonValue(e,this._buttonLeftStick,Zt.LeftStick)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonRightStick",{get:function(){return this._buttonRightStick},set:function(e){this._buttonRightStick=this._setButtonValue(e,this._buttonRightStick,Zt.RightStick)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadUp",{get:function(){return this._dPadUp},set:function(e){this._dPadUp=this._setDPadValue(e,this._dPadUp,Jt.Up)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadDown",{get:function(){return this._dPadDown},set:function(e){this._dPadDown=this._setDPadValue(e,this._dPadDown,Jt.Down)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadLeft",{get:function(){return this._dPadLeft},set:function(e){this._dPadLeft=this._setDPadValue(e,this._dPadLeft,Jt.Left)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadRight",{get:function(){return this._dPadRight},set:function(e){this._dPadRight=this._setDPadValue(e,this._dPadRight,Jt.Right)},enumerable:!1,configurable:!0}),t.prototype.update=function(){e.prototype.update.call(this),this.buttonCross=this.browserGamepad.buttons[0].value,this.buttonCircle=this.browserGamepad.buttons[1].value,this.buttonSquare=this.browserGamepad.buttons[2].value,this.buttonTriangle=this.browserGamepad.buttons[3].value,this.buttonL1=this.browserGamepad.buttons[4].value,this.buttonR1=this.browserGamepad.buttons[5].value,this.leftTrigger=this.browserGamepad.buttons[6].value,this.rightTrigger=this.browserGamepad.buttons[7].value,this.buttonShare=this.browserGamepad.buttons[8].value,this.buttonOptions=this.browserGamepad.buttons[9].value,this.buttonLeftStick=this.browserGamepad.buttons[10].value,this.buttonRightStick=this.browserGamepad.buttons[11].value,this.dPadUp=this.browserGamepad.buttons[12].value,this.dPadDown=this.browserGamepad.buttons[13].value,this.dPadLeft=this.browserGamepad.buttons[14].value,this.dPadRight=this.browserGamepad.buttons[15].value},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear(),this.onPadDownObservable.clear(),this.onPadUpObservable.clear()},t}(ot),ti=function(){function e(e){var t=this;if(this._scene=e,this._babylonGamepads=[],this._oneGamepadConnected=!1,this._isMonitoring=!1,this.onGamepadDisconnectedObservable=new o.c,Ht.a.IsWindowObjectExist()?(this._gamepadEventSupported="GamepadEvent"in window,this._gamepadSupport=navigator.getGamepads||navigator.webkitGetGamepads||navigator.msGetGamepads||navigator.webkitGamepads):this._gamepadEventSupported=!1,this.onGamepadConnectedObservable=new o.c(function(e){for(var i in t._babylonGamepads){var n=t._babylonGamepads[i];n&&n._isConnected&&t.onGamepadConnectedObservable.notifyObserver(e,n)}}),this._onGamepadConnectedEvent=function(e){var i,n=e.gamepad;n.index in t._babylonGamepads&&t._babylonGamepads[n.index].isConnected||(t._babylonGamepads[n.index]?((i=t._babylonGamepads[n.index]).browserGamepad=n,i._isConnected=!0):i=t._addNewGamepad(n),t.onGamepadConnectedObservable.notifyObservers(i),t._startMonitoringGamepads())},this._onGamepadDisconnectedEvent=function(e){var i=e.gamepad;for(var n in t._babylonGamepads)if(t._babylonGamepads[n].index===i.index){var r=t._babylonGamepads[n];r._isConnected=!1,t.onGamepadDisconnectedObservable.notifyObservers(r),r.dispose&&r.dispose();break}},this._gamepadSupport)if(this._updateGamepadObjects(),this._babylonGamepads.length&&this._startMonitoringGamepads(),this._gamepadEventSupported){var i=this._scene?this._scene.getEngine().getHostWindow():window;i&&(i.addEventListener("gamepadconnected",this._onGamepadConnectedEvent,!1),i.addEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent,!1))}else this._startMonitoringGamepads()}return Object.defineProperty(e.prototype,"gamepads",{get:function(){return this._babylonGamepads},enumerable:!1,configurable:!0}),e.prototype.getGamepadByType=function(e){void 0===e&&(e=ot.XBOX);for(var t=0,i=this._babylonGamepads;t<i.length;t++){var n=i[t];if(n&&n.type===e)return n}return null},e.prototype.dispose=function(){this._gamepadEventSupported&&(this._onGamepadConnectedEvent&&window.removeEventListener("gamepadconnected",this._onGamepadConnectedEvent),this._onGamepadDisconnectedEvent&&window.removeEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent),this._onGamepadConnectedEvent=null,this._onGamepadDisconnectedEvent=null),this._babylonGamepads.forEach(function(e){e.dispose()}),this.onGamepadConnectedObservable.clear(),this.onGamepadDisconnectedObservable.clear(),this._oneGamepadConnected=!1,this._stopMonitoringGamepads(),this._babylonGamepads=[]},e.prototype._addNewGamepad=function(e){var t;this._oneGamepadConnected||(this._oneGamepadConnected=!0);var i=-1!==e.id.search("054c"),n=-1!==e.id.search("Xbox One");return t=n||-1!==e.id.search("Xbox 360")||-1!==e.id.search("xinput")?new $t(e.id,e.index,e,n):i?new ei(e.id,e.index,e):e.pose?Qt.InitiateController(e):new at(e.id,e.index,e),this._babylonGamepads[t.index]=t,t},e.prototype._startMonitoringGamepads=function(){this._isMonitoring||(this._isMonitoring=!0,this._scene||this._checkGamepadsStatus())},e.prototype._stopMonitoringGamepads=function(){this._isMonitoring=!1},e.prototype._checkGamepadsStatus=function(){var e=this;for(var t in this._updateGamepadObjects(),this._babylonGamepads){var i=this._babylonGamepads[t];i&&i.isConnected&&i.update()}this._isMonitoring&&!this._scene&&Se.a.QueueNewFrame(function(){e._checkGamepadsStatus()})},e.prototype._updateGamepadObjects=function(){for(var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[],t=0;t<e.length;t++){var i=e[t];if(i)if(this._babylonGamepads[i.index])this._babylonGamepads[t].browserGamepad=i,this._babylonGamepads[t].isConnected||(this._babylonGamepads[t]._isConnected=!0,this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[t]));else{var n=this._addNewGamepad(i);this.onGamepadConnectedObservable.notifyObservers(n)}}},e}();Object.defineProperty(Q.a.prototype,"gamepadManager",{get:function(){if(!this._gamepadManager){this._gamepadManager=new ti(this);var e=this._getComponent(Me.a.NAME_GAMEPAD);e||(e=new ii(this),this._addComponent(e))}return this._gamepadManager},enumerable:!0,configurable:!0}),Ct.prototype.addGamepad=function(){return this.add(new xt),this},ft.prototype.addGamepad=function(){return this.add(new st),this};var ii=function(){function e(e){this.name=Me.a.NAME_GAMEPAD,this.scene=e}return e.prototype.register=function(){this.scene._beforeCameraUpdateStage.registerStep(Me.a.STEP_BEFORECAMERAUPDATE_GAMEPAD,this,this._beforeCameraUpdate)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){var e=this.scene._gamepadManager;e&&(e.dispose(),this.scene._gamepadManager=null)},e.prototype._beforeCameraUpdate=function(){var e=this.scene._gamepadManager;e&&e._isMonitoring&&e._checkGamepadsStatus()},e}();B.a.AddNodeConstructor("FreeCamera",function(e,t){return function(){return new ni(e,a.e.Zero(),t)}});var ni=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r.inputs.addGamepad(),r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"gamepadAngularSensibility",{get:function(){var e=this.inputs.attached.gamepad;return e?e.gamepadAngularSensibility:0},set:function(e){var t=this.inputs.attached.gamepad;t&&(t.gamepadAngularSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gamepadMoveSensibility",{get:function(){var e=this.inputs.attached.gamepad;return e?e.gamepadMoveSensibility:0},set:function(e){var t=this.inputs.attached.gamepad;t&&(t.gamepadMoveSensibility=e)},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"UniversalCamera"},t}(Ft);je.a._createDefaultParsedCamera=function(e,t){return new ni(e,a.e.Zero(),t)},B.a.AddNodeConstructor("GamepadCamera",function(e,t){return function(){return new ri(e,a.e.Zero(),t)}});var ri=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"GamepadCamera"},t}(ni),oi=i(33),ai=i(5);ai.a.ShadersStore.postprocessVertexShader="\nattribute vec2 position;\nuniform vec2 scale;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n}";var si=i(102);qe.a.prototype.createRenderTargetTexture=function(e,t){var i=new si.a;void 0!==t&&"object"==typeof t?(i.generateMipMaps=t.generateMipMaps,i.generateDepthBuffer=!!t.generateDepthBuffer,i.generateStencilBuffer=!!t.generateStencilBuffer,i.type=void 0===t.type?g.a.TEXTURETYPE_UNSIGNED_INT:t.type,i.samplingMode=void 0===t.samplingMode?g.a.TEXTURE_TRILINEAR_SAMPLINGMODE:t.samplingMode,i.format=void 0===t.format?g.a.TEXTUREFORMAT_RGBA:t.format):(i.generateMipMaps=t,i.generateDepthBuffer=!0,i.generateStencilBuffer=!1,i.type=g.a.TEXTURETYPE_UNSIGNED_INT,i.samplingMode=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,i.format=g.a.TEXTUREFORMAT_RGBA),(i.type!==g.a.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(i.type!==g.a.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(i.samplingMode=g.a.TEXTURE_NEAREST_SAMPLINGMODE),i.type!==g.a.TEXTURETYPE_FLOAT||this._caps.textureFloat||(i.type=g.a.TEXTURETYPE_UNSIGNED_INT,m.a.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var n=this._gl,r=new Qe.a(this,Qe.b.RenderTarget),o=e.width||e,a=e.height||e,s=e.layers||0,c=this._getSamplingParameters(i.samplingMode,!!i.generateMipMaps),l=0!==s?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D,u=this._getRGBABufferInternalSizedFormat(i.type,i.format),h=this._getInternalFormat(i.format),d=this._getWebGLTextureType(i.type);this._bindTextureDirectly(l,r),0!==s?(r.is2DArray=!0,n.texImage3D(l,0,u,o,a,s,0,h,d,null)):n.texImage2D(l,0,u,o,a,0,h,d,null),n.texParameteri(l,n.TEXTURE_MAG_FILTER,c.mag),n.texParameteri(l,n.TEXTURE_MIN_FILTER,c.min),n.texParameteri(l,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(l,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i.generateMipMaps&&this._gl.generateMipmap(l),this._bindTextureDirectly(l,null);var f=this._currentFramebuffer,p=n.createFramebuffer();return this._bindUnboundFramebuffer(p),r._depthStencilBuffer=this._setupFramebufferDepthAttachments(!!i.generateStencilBuffer,i.generateDepthBuffer,o,a),r.is2DArray||n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,r._webGLTexture,0),this._bindUnboundFramebuffer(f),r._framebuffer=p,r.baseWidth=o,r.baseHeight=a,r.width=o,r.height=a,r.depth=s,r.isReady=!0,r.samples=1,r.generateMipMaps=!!i.generateMipMaps,r.samplingMode=i.samplingMode,r.type=i.type,r.format=i.format,r._generateDepthBuffer=i.generateDepthBuffer,r._generateStencilBuffer=!!i.generateStencilBuffer,this._internalTexturesCache.push(r),r},qe.a.prototype.createDepthStencilTexture=function(e,t){if(t.isCube){var i=e.width||e;return this._createDepthStencilCubeTexture(i,t)}return this._createDepthStencilTexture(e,t)},qe.a.prototype._createDepthStencilTexture=function(e,t){var i=this._gl,n=e.layers||0,r=0!==n?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D,o=new Qe.a(this,Qe.b.Depth);if(!this._caps.depthTextureExtension)return m.a.Error("Depth texture is not supported by your browser or hardware."),o;var a=Object(h.a)({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t);this._bindTextureDirectly(r,o,!0),this._setupDepthStencilTexture(o,e,a.generateStencil,a.bilinearFiltering,a.comparisonFunction);var s=a.generateStencil?i.UNSIGNED_INT_24_8:i.UNSIGNED_INT,c=a.generateStencil?i.DEPTH_STENCIL:i.DEPTH_COMPONENT,l=c;return this.webGLVersion>1&&(l=a.generateStencil?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24),o.is2DArray?i.texImage3D(r,0,l,o.width,o.height,n,0,c,s,null):i.texImage2D(r,0,l,o.width,o.height,0,c,s,null),this._bindTextureDirectly(r,null),o};var ci=function(){function e(e,t,i,n,r,s,c,l,u,h,d,f,p,_,m){void 0===c&&(c=g.a.TEXTURE_NEAREST_SAMPLINGMODE),void 0===h&&(h=null),void 0===d&&(d=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===f&&(f="postprocess"),void 0===_&&(_=!1),void 0===m&&(m=g.a.TEXTUREFORMAT_RGBA),this.width=-1,this.height=-1,this.nodeMaterialSource=null,this._outputTexture=null,this.autoClear=!0,this.alphaMode=g.a.ALPHA_DISABLE,this.animations=new Array,this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=g.a.SCALEMODE_FLOOR,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._reusable=!1,this._textures=new oi.a(2),this._currentRenderTextureInd=0,this._scaleRatio=new a.d(1,1),this._texelSize=a.d.Zero(),this.onActivateObservable=new o.c,this.onSizeChangedObservable=new o.c,this.onApplyObservable=new o.c,this.onBeforeRenderObservable=new o.c,this.onAfterRenderObservable=new o.c,this.name=e,null!=s?(this._camera=s,this._scene=s.getScene(),s.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.postProcesses.push(this),this.uniqueId=this._scene.getUniqueId()):l&&(this._engine=l,this._engine.postProcesses.push(this)),this._options=r,this.renderTargetSamplingMode=c||g.a.TEXTURE_NEAREST_SAMPLINGMODE,this._reusable=u||!1,this._textureType=d,this._textureFormat=m,this._samplers=n||[],this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=f,this._parameters=i||[],this._parameters.push("scale"),this._indexParameters=p,_||this.updateEffect(h)}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._samples},set:function(e){var t=this;this._samples=Math.min(e,this._engine.getCaps().maxMSAASamples),this._textures.forEach(function(e){e.samples!==t._samples&&t._engine.updateRenderTargetTextureSampleCount(e,t._samples)})},enumerable:!1,configurable:!0}),e.prototype.getEffectName=function(){return this._fragmentUrl},Object.defineProperty(e.prototype,"onActivate",{set:function(e){this._onActivateObserver&&this.onActivateObservable.remove(this._onActivateObserver),e&&(this._onActivateObserver=this.onActivateObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSizeChanged",{set:function(e){this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onApply",{set:function(e){this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputTexture",{get:function(){return this._textures.data[this._currentRenderTextureInd]},set:function(e){this._forcedOutputTexture=e},enumerable:!1,configurable:!0}),e.prototype.restoreDefaultInputTexture=function(){this._forcedOutputTexture=null},e.prototype.getCamera=function(){return this._camera},Object.defineProperty(e.prototype,"texelSize",{get:function(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.texelSize:(this._forcedOutputTexture&&this._texelSize.copyFromFloats(1/this._forcedOutputTexture.width,1/this._forcedOutputTexture.height),this._texelSize)},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"PostProcess"},e.prototype.getEngine=function(){return this._engine},e.prototype.getEffect=function(){return this._effect},e.prototype.shareOutputWith=function(e){return this._disposeTextures(),this._shareOutputWithPostProcess=e,this},e.prototype.useOwnOutput=function(){0==this._textures.length&&(this._textures=new oi.a(2)),this._shareOutputWithPostProcess=null},e.prototype.updateEffect=function(e,t,i,n,r,o,a,s){void 0===e&&(e=null),void 0===t&&(t=null),void 0===i&&(i=null),this._effect=this._engine.createEffect({vertex:null!=a?a:this._vertexUrl,fragment:null!=s?s:this._fragmentUrl},["position"],t||this._parameters,i||this._samplers,null!==e?e:"",void 0,r,o,n||this._indexParameters)},e.prototype.isReusable=function(){return this._reusable},e.prototype.markTextureDirty=function(){this.width=-1},e.prototype.activate=function(e,t,i){var n=this;void 0===t&&(t=null);var r=(e=e||this._camera).getScene(),o=r.getEngine(),a=o.getCaps().maxTextureSize,s=(t?t.width:this._engine.getRenderWidth(!0))*this._options|0,c=(t?t.height:this._engine.getRenderHeight(!0))*this._options|0,l=e.parent;!l||l.leftCamera!=e&&l.rightCamera!=e||(s/=2);var u,h=this._options.width||s,d=this._options.height||c,f=this.renderTargetSamplingMode!==g.a.TEXTURE_NEAREST_LINEAR&&this.renderTargetSamplingMode!==g.a.TEXTURE_NEAREST_NEAREST&&this.renderTargetSamplingMode!==g.a.TEXTURE_LINEAR_LINEAR;if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this.adaptScaleToCurrentViewport){var p=o.currentViewport;p&&(h*=p.width,d*=p.height)}if((f||this.alwaysForcePOT)&&(this._options.width||(h=o.needPOTTextures?Se.a.GetExponentOfTwo(h,a,this.scaleMode):h),this._options.height||(d=o.needPOTTextures?Se.a.GetExponentOfTwo(d,a,this.scaleMode):d)),this.width!==h||this.height!==d){if(this._textures.length>0){for(var _=0;_<this._textures.length;_++)this._engine._releaseTexture(this._textures.data[_]);this._textures.reset()}this.width=h,this.height=d;var m={width:this.width,height:this.height},v={generateMipMaps:f,generateDepthBuffer:i||0===e._postProcesses.indexOf(this),generateStencilBuffer:(i||0===e._postProcesses.indexOf(this))&&this._engine.isStencilEnable,samplingMode:this.renderTargetSamplingMode,type:this._textureType,format:this._textureFormat};this._textures.push(this._engine.createRenderTargetTexture(m,v)),this._reusable&&this._textures.push(this._engine.createRenderTargetTexture(m,v)),this._texelSize.copyFromFloats(1/this.width,1/this.height),this.onSizeChangedObservable.notifyObservers(this)}this._textures.forEach(function(e){e.samples!==n.samples&&n._engine.updateRenderTargetTextureSampleCount(e,n.samples)})}return this._shareOutputWithPostProcess?u=this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?(u=this._forcedOutputTexture,this.width=this._forcedOutputTexture.width,this.height=this._forcedOutputTexture.height):u=this.inputTexture,this.enablePixelPerfectMode?(this._scaleRatio.copyFromFloats(s/h,c/d),this._engine.bindFramebuffer(u,0,s,c,this.forceFullscreenViewport)):(this._scaleRatio.copyFromFloats(1,1),this._engine.bindFramebuffer(u,0,void 0,void 0,this.forceFullscreenViewport)),this.onActivateObservable.notifyObservers(e),this.autoClear&&this.alphaMode===g.a.ALPHA_DISABLE&&this._engine.clear(this.clearColor?this.clearColor:r.clearColor,r._allowPostProcessClearColor,!0,!0),this._reusable&&(this._currentRenderTextureInd=(this._currentRenderTextureInd+1)%2),u},Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._effect.isSupported},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.aspectRatio:this._forcedOutputTexture?this._forcedOutputTexture.width/this._forcedOutputTexture.height:this.width/this.height},enumerable:!1,configurable:!0}),e.prototype.isReady=function(){return this._effect&&this._effect.isReady()},e.prototype.apply=function(){return this._effect&&this._effect.isReady()?(this._engine.enableEffect(this._effect),this._engine.setState(!1),this._engine.setDepthBuffer(!1),this._engine.setDepthWrite(!1),this._engine.setAlphaMode(this.alphaMode),this.alphaConstants&&this.getEngine().setAlphaConstants(this.alphaConstants.r,this.alphaConstants.g,this.alphaConstants.b,this.alphaConstants.a),e=this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?this._forcedOutputTexture:this.inputTexture,this._effect._bindTexture("textureSampler",e),this._effect.setVector2("scale",this._scaleRatio),this.onApplyObservable.notifyObservers(this._effect),this._effect):null;var e},e.prototype._disposeTextures=function(){if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this._textures.length>0)for(var e=0;e<this._textures.length;e++)this._engine._releaseTexture(this._textures.data[e]);this._textures.dispose()}},e.prototype.setPrePassRenderer=function(e){return!!this._prePassEffectConfiguration&&(this._prePassEffectConfiguration=e.addEffectConfiguration(this._prePassEffectConfiguration),this._prePassEffectConfiguration.enabled=!0,!0)},e.prototype.dispose=function(e){var t;if(e=e||this._camera,this._disposeTextures(),this._scene&&-1!==(t=this._scene.postProcesses.indexOf(this))&&this._scene.postProcesses.splice(t,1),-1!==(t=this._engine.postProcesses.indexOf(this))&&this._engine.postProcesses.splice(t,1),e){if(e.detachPostProcess(this),0===(t=e._postProcesses.indexOf(this))&&e._postProcesses.length>0){var i=this._camera._getFirstPostProcess();i&&i.markTextureDirty()}this.onActivateObservable.clear(),this.onAfterRenderObservable.clear(),this.onApplyObservable.clear(),this.onBeforeRenderObservable.clear(),this.onSizeChangedObservable.clear()}},e.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON."+this.getClassName(),e.cameraId=this.getCamera().id,e.reusable=this._reusable,e.options=this._options,e.textureType=this._textureType,e},e.Parse=function(e,t,i){var n=c.a.GetClass(e.customType);if(!n||!n._Parse)return null;var r=t.getCameraByID(e.cameraId);return r?n._Parse(e,r,t,i):null},Object(h.c)([Object(w.c)()],e.prototype,"uniqueId",void 0),Object(h.c)([Object(w.c)()],e.prototype,"name",void 0),Object(h.c)([Object(w.c)()],e.prototype,"width",void 0),Object(h.c)([Object(w.c)()],e.prototype,"height",void 0),Object(h.c)([Object(w.c)()],e.prototype,"renderTargetSamplingMode",void 0),Object(h.c)([Object(w.f)()],e.prototype,"clearColor",void 0),Object(h.c)([Object(w.c)()],e.prototype,"autoClear",void 0),Object(h.c)([Object(w.c)()],e.prototype,"alphaMode",void 0),Object(h.c)([Object(w.c)()],e.prototype,"alphaConstants",void 0),Object(h.c)([Object(w.c)()],e.prototype,"enablePixelPerfectMode",void 0),Object(h.c)([Object(w.c)()],e.prototype,"forceFullscreenViewport",void 0),Object(h.c)([Object(w.c)()],e.prototype,"scaleMode",void 0),Object(h.c)([Object(w.c)()],e.prototype,"alwaysForcePOT",void 0),Object(h.c)([Object(w.c)("samples")],e.prototype,"_samples",void 0),Object(h.c)([Object(w.c)()],e.prototype,"adaptScaleToCurrentViewport",void 0),e}();c.a.RegisteredTypes["BABYLON.PostProcess"]=ci;ai.a.ShadersStore.passPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}";ai.a.ShadersStore.passCubePixelShader="\nvarying vec2 vUV;\nuniform samplerCube textureSampler;\nvoid main(void)\n{\nvec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));\n#endif\n}";var li=function(e){function t(t,i,n,r,o,a,s,c){return void 0===n&&(n=null),void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1),e.call(this,t,"pass",null,null,i,n,r,o,a,void 0,s,void 0,null,c)||this}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"PassPostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},t}(ci);c.a.RegisteredTypes["BABYLON.PassPostProcess"]=li;var ui=function(e){function t(t,i,n,r,o,a,s,c){void 0===n&&(n=null),void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var l=e.call(this,t,"passCube",null,null,i,n,r,o,a,"#define POSITIVEX",s,void 0,null,c)||this;return l._face=0,l}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"face",{get:function(){return this._face},set:function(e){if(!(e<0||e>5))switch(this._face=e,this._face){case 0:this.updateEffect("#define POSITIVEX");break;case 1:this.updateEffect("#define NEGATIVEX");break;case 2:this.updateEffect("#define POSITIVEY");break;case 3:this.updateEffect("#define NEGATIVEY");break;case 4:this.updateEffect("#define POSITIVEZ");break;case 5:this.updateEffect("#define NEGATIVEZ")}},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PassCubePostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},t}(ci);Se.a._RescalePostProcessFactory=function(e){return new li("rescale",1,null,g.a.TEXTURE_BILINEAR_SAMPLINGMODE,e,!1,g.a.TEXTURETYPE_UNSIGNED_INT)};ai.a.ShadersStore.anaglyphPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D leftSampler;\nvoid main(void)\n{\nvec4 leftFrag=texture2D(leftSampler,vUV);\nleftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);\nvec4 rightFrag=texture2D(textureSampler,vUV);\nrightFrag=vec4(rightFrag.r,1.0,1.0,1.0);\ngl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);\n}";var hi=function(e){function t(t,i,n,r,o,a){var s=e.call(this,t,"anaglyph",null,["leftSampler"],i,n[1],r,o,a)||this;return s._passedProcess=n[0]._rigPostProcess,s.onApplyObservable.add(function(e){e.setTextureFromPostProcess("leftSampler",s._passedProcess)}),s}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"AnaglyphPostProcess"},t}(ci);c.a.RegisteredTypes["BABYLON.AnaglyphPostProcess"]=hi,je.a._setStereoscopicAnaglyphRigMode=function(e){e._rigCameras[0]._rigPostProcess=new li(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new hi(e.name+"_anaglyph",1,e._rigCameras)},B.a.AddNodeConstructor("AnaglyphArcRotateCamera",function(e,t,i){return function(){return new di(e,0,0,1,a.e.Zero(),i.interaxial_distance,t)}});var di=function(e){function t(t,i,n,r,o,a,s){var c=e.call(this,t,i,n,r,o,s)||this;return c.interaxialDistance=a,c.setCameraRigMode(je.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:a}),c}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"AnaglyphArcRotateCamera"},t}(Bt);B.a.AddNodeConstructor("AnaglyphFreeCamera",function(e,t,i){return function(){return new fi(e,a.e.Zero(),i.interaxial_distance,t)}});var fi=function(e){function t(t,i,n,r){var o=e.call(this,t,i,r)||this;return o.interaxialDistance=n,o.setCameraRigMode(je.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:n}),o}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"AnaglyphFreeCamera"},t}(wt);B.a.AddNodeConstructor("AnaglyphGamepadCamera",function(e,t,i){return function(){return new pi(e,a.e.Zero(),i.interaxial_distance,t)}});var pi=function(e){function t(t,i,n,r){var o=e.call(this,t,i,r)||this;return o.interaxialDistance=n,o.setCameraRigMode(je.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:n}),o}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"AnaglyphGamepadCamera"},t}(ri);B.a.AddNodeConstructor("AnaglyphUniversalCamera",function(e,t,i){return function(){return new _i(e,a.e.Zero(),i.interaxial_distance,t)}});var _i=function(e){function t(t,i,n,r){var o=e.call(this,t,i,r)||this;return o.interaxialDistance=n,o.setCameraRigMode(je.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:n}),o}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"AnaglyphUniversalCamera"},t}(ni),mi=i(58);je.a._setStereoscopicRigMode=function(e){var t=e.cameraRigMode===je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL||e.cameraRigMode===je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED,i=e.cameraRigMode===je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;e._rigCameras[i?1:0].viewport=new mi.a(0,0,t?.5:1,t?1:.5),e._rigCameras[i?0:1].viewport=new mi.a(t?.5:0,t?0:.5,t?.5:1,t?1:.5)},B.a.AddNodeConstructor("StereoscopicArcRotateCamera",function(e,t,i){return function(){return new gi(e,0,0,1,a.e.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var gi=function(e){function t(t,i,n,r,o,a,s,c){var l=e.call(this,t,i,n,r,o,c)||this;return l.interaxialDistance=a,l.isStereoscopicSideBySide=s,l.setCameraRigMode(s?je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:je.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:a}),l}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"StereoscopicArcRotateCamera"},t}(Bt);B.a.AddNodeConstructor("StereoscopicFreeCamera",function(e,t,i){return function(){return new vi(e,a.e.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var vi=function(e){function t(t,i,n,r,o){var a=e.call(this,t,i,o)||this;return a.interaxialDistance=n,a.isStereoscopicSideBySide=r,a.setCameraRigMode(r?je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:je.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:n}),a}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"StereoscopicFreeCamera"},t}(wt);B.a.AddNodeConstructor("StereoscopicGamepadCamera",function(e,t,i){return function(){return new bi(e,a.e.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var bi=function(e){function t(t,i,n,r,o){var a=e.call(this,t,i,o)||this;return a.interaxialDistance=n,a.isStereoscopicSideBySide=r,a.setCameraRigMode(r?je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:je.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:n}),a}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"StereoscopicGamepadCamera"},t}(ri);B.a.AddNodeConstructor("StereoscopicFreeCamera",function(e,t,i){return function(){return new yi(e,a.e.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var yi=function(e){function t(t,i,n,r,o){var a=e.call(this,t,i,o)||this;return a.interaxialDistance=n,a.isStereoscopicSideBySide=r,a.setCameraRigMode(r?je.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:je.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:n}),a}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"StereoscopicUniversalCamera"},t}(ni);B.a.AddNodeConstructor("VirtualJoysticksCamera",function(e,t){return function(){return new Ti(e,a.e.Zero(),t)}});var Ti=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r.inputs.addVirtualJoystick(),r}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VirtualJoysticksCamera"},t}(wt),Ei=function(){function e(){this.compensateDistortion=!0,this.multiviewEnabled=!1}return Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return this.hResolution/(2*this.vResolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatioFov",{get:function(){return 2*Math.atan(this.postProcessScaleFactor*this.vScreenSize/(2*this.eyeToScreenDistance))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftHMatrix",{get:function(){var e=4*(this.hScreenSize/4-this.lensSeparationDistance/2)/this.hScreenSize;return a.a.Translation(e,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightHMatrix",{get:function(){var e=4*(this.hScreenSize/4-this.lensSeparationDistance/2)/this.hScreenSize;return a.a.Translation(-e,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftPreViewMatrix",{get:function(){return a.a.Translation(.5*this.interpupillaryDistance,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightPreViewMatrix",{get:function(){return a.a.Translation(-.5*this.interpupillaryDistance,0,0)},enumerable:!1,configurable:!0}),e.GetDefault=function(){var t=new e;return t.hResolution=1280,t.vResolution=800,t.hScreenSize=.149759993,t.vScreenSize=.0935999975,t.vScreenCenter=.0467999987,t.eyeToScreenDistance=.0410000011,t.lensSeparationDistance=.063500002,t.interpupillaryDistance=.064000003,t.distortionK=[1,.219999999,.239999995,0],t.chromaAbCorrection=[.995999992,-.00400000019,1.01400006,0],t.postProcessScaleFactor=1.714605507808412,t.lensCenterOffset=.151976421,t},e}();ai.a.ShadersStore.vrDistortionCorrectionPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 LensCenter;\nuniform vec2 Scale;\nuniform vec2 ScaleIn;\nuniform vec4 HmdWarpParam;\nvec2 HmdWarp(vec2 in01) {\nvec2 theta=(in01-LensCenter)*ScaleIn;\nfloat rSq=theta.x*theta.x+theta.y*theta.y;\nvec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);\nreturn LensCenter+Scale*rvector;\n}\nvoid main(void)\n{\nvec2 tc=HmdWarp(vUV);\nif (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);\nelse{\ngl_FragColor=texture2D(textureSampler,tc);\n}\n}";var Si=function(e){function t(t,i,n,r){var o=e.call(this,t,"vrDistortionCorrection",["LensCenter","Scale","ScaleIn","HmdWarpParam"],null,r.postProcessScaleFactor,i,Ke.a.BILINEAR_SAMPLINGMODE)||this;return o._isRightEye=n,o._distortionFactors=r.distortionK,o._postProcessScaleFactor=r.postProcessScaleFactor,o._lensCenterOffset=r.lensCenterOffset,o.adaptScaleToCurrentViewport=!0,o.onSizeChangedObservable.add(function(){o._scaleIn=new a.d(2,2/o.aspectRatio),o._scaleFactor=new a.d(1/o._postProcessScaleFactor*.5,1/o._postProcessScaleFactor*.5*o.aspectRatio),o._lensCenter=new a.d(o._isRightEye?.5-.5*o._lensCenterOffset:.5+.5*o._lensCenterOffset,.5)}),o.onApplyObservable.add(function(e){e.setFloat2("LensCenter",o._lensCenter.x,o._lensCenter.y),e.setFloat2("Scale",o._scaleFactor.x,o._scaleFactor.y),e.setFloat2("ScaleIn",o._scaleIn.x,o._scaleIn.y),e.setFloat4("HmdWarpParam",o._distortionFactors[0],o._distortionFactors[1],o._distortionFactors[2],o._distortionFactors[3])}),o}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VRDistortionCorrectionPostProcess"},t}(ci);ai.a.ShadersStore.vrMultiviewToSingleviewPixelShader="precision mediump sampler2DArray;\nvarying vec2 vUV;\nuniform sampler2DArray multiviewSampler;\nuniform int imageIndex;\nvoid main(void)\n{\ngl_FragColor=texture(multiviewSampler,vec3(vUV,imageIndex));\n}";var Ai=i(85),Pi=i(95),Ci=i(96);qe.a.prototype.createRenderTargetCubeTexture=function(e,t){var i=Object(h.a)({generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:g.a.TEXTURETYPE_UNSIGNED_INT,samplingMode:g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,format:g.a.TEXTUREFORMAT_RGBA},t);i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(i.type!==g.a.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(i.type!==g.a.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(i.samplingMode=g.a.TEXTURE_NEAREST_SAMPLINGMODE);var n=this._gl,r=new Qe.a(this,Qe.b.RenderTarget);this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,r,!0);var o=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);i.type!==g.a.TEXTURETYPE_FLOAT||this._caps.textureFloat||(i.type=g.a.TEXTURETYPE_UNSIGNED_INT,m.a.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,o.mag),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,o.min),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);for(var a=0;a<6;a++)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),e,e,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);var s=n.createFramebuffer();return this._bindUnboundFramebuffer(s),r._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,e,e),i.generateMipMaps&&n.generateMipmap(n.TEXTURE_CUBE_MAP),this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),r._framebuffer=s,r.width=e,r.height=e,r.isReady=!0,r.isCube=!0,r.samples=1,r.generateMipMaps=i.generateMipMaps,r.samplingMode=i.samplingMode,r.type=i.type,r.format=i.format,r._generateDepthBuffer=i.generateDepthBuffer,r._generateStencilBuffer=i.generateStencilBuffer,this._internalTexturesCache.push(r),r};var Ri=function(e){function t(t,i,n,r,s,c,l,u,h,d,f,p,_){void 0===s&&(s=!0),void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1),void 0===u&&(u=Ke.a.TRILINEAR_SAMPLINGMODE),void 0===h&&(h=!0),void 0===d&&(d=!1),void 0===f&&(f=!1),void 0===p&&(p=g.a.TEXTUREFORMAT_RGBA),void 0===_&&(_=!1);var m=e.call(this,null,n,!r)||this;return m.renderParticles=!0,m.renderSprites=!1,m.ignoreCameraViewport=!1,m.onBeforeBindObservable=new o.c,m.onAfterUnbindObservable=new o.c,m.onBeforeRenderObservable=new o.c,m.onAfterRenderObservable=new o.c,m.onClearObservable=new o.c,m.onResizeObservable=new o.c,m._currentRefreshId=-1,m._refreshRate=1,m._samples=1,m.boundingBoxPosition=a.e.Zero(),(n=m.getScene())?(m._coordinatesMode=Ke.a.PROJECTION_MODE,m.renderList=new Array,m.name=t,m.isRenderTarget=!0,m._initialSizeParameter=i,m._processSizeParameter(i),m._resizeObserver=m.getScene().getEngine().onResizeObservable.add(function(){}),m._generateMipMaps=!!r,m._doNotChangeAspectRatio=s,m._renderingManager=new Ci.b(n),m._renderingManager._useSceneAutoClearSetup=!0,f||(m._renderTargetOptions={generateMipMaps:r,type:c,format:p,samplingMode:u,generateDepthBuffer:h,generateStencilBuffer:d},u===Ke.a.NEAREST_SAMPLINGMODE&&(m.wrapU=Ke.a.CLAMP_ADDRESSMODE,m.wrapV=Ke.a.CLAMP_ADDRESSMODE),_||(l?(m._texture=n.getEngine().createRenderTargetCubeTexture(m.getRenderSize(),m._renderTargetOptions),m.coordinatesMode=Ke.a.INVCUBIC_MODE,m._textureMatrix=a.a.Identity()):m._texture=n.getEngine().createRenderTargetTexture(m._size,m._renderTargetOptions))),m):m}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"renderList",{get:function(){return this._renderList},set:function(e){this._renderList=e,this._renderList&&this._hookArray(this._renderList)},enumerable:!1,configurable:!0}),t.prototype._hookArray=function(e){var t=this,i=e.push;e.push=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=0===e.length,a=i.apply(e,n);return o&&t.getScene()&&t.getScene().meshes.forEach(function(e){e._markSubMeshesAsLightDirty()}),a};var n=e.splice;e.splice=function(i,r){var o=n.apply(e,[i,r]);return 0===e.length&&t.getScene().meshes.forEach(function(e){e._markSubMeshesAsLightDirty()}),o}},Object.defineProperty(t.prototype,"onAfterUnbind",{set:function(e){this._onAfterUnbindObserver&&this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=this.onAfterUnbindObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onClear",{set:function(e){this._onClearObserver&&this.onClearObservable.remove(this._onClearObserver),this._onClearObserver=this.onClearObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderTargetOptions",{get:function(){return this._renderTargetOptions},enumerable:!1,configurable:!0}),t.prototype._onRatioRescale=function(){this._sizeRatio&&this.resize(this._initialSizeParameter)},Object.defineProperty(t.prototype,"boundingBoxSize",{get:function(){return this._boundingBoxSize},set:function(e){if(!this._boundingBoxSize||!this._boundingBoxSize.equals(e)){this._boundingBoxSize=e;var t=this.getScene();t&&t.markAllMaterialsAsDirty(g.a.MATERIAL_TextureDirtyFlag)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthStencilTexture",{get:function(){var e;return(null===(e=this.getInternalTexture())||void 0===e?void 0:e._depthStencilTexture)||null},enumerable:!1,configurable:!0}),t.prototype.createDepthStencilTexture=function(e,t,i){void 0===e&&(e=0),void 0===t&&(t=!0),void 0===i&&(i=!1);var n=this.getInternalTexture();if(this.getScene()&&n){var r=this.getScene().getEngine();n._depthStencilTexture=r.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:i,isCube:this.isCube})}},t.prototype._processSizeParameter=function(e){if(e.ratio){this._sizeRatio=e.ratio;var t=this._getEngine();this._size={width:this._bestReflectionRenderTargetDimension(t.getRenderWidth(),this._sizeRatio),height:this._bestReflectionRenderTargetDimension(t.getRenderHeight(),this._sizeRatio)}}else this._size=e},Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){if(this._samples!==e){var t=this.getScene();t&&(this._samples=t.getEngine().updateRenderTargetTextureSampleCount(this._texture,e))}},enumerable:!1,configurable:!0}),t.prototype.resetRefreshCounter=function(){this._currentRefreshId=-1},Object.defineProperty(t.prototype,"refreshRate",{get:function(){return this._refreshRate},set:function(e){this._refreshRate=e,this.resetRefreshCounter()},enumerable:!1,configurable:!0}),t.prototype.addPostProcess=function(e){if(!this._postProcessManager){var t=this.getScene();if(!t)return;this._postProcessManager=new Pi.a(t),this._postProcesses=new Array}this._postProcesses.push(e),this._postProcesses[0].autoClear=!1},t.prototype.clearPostProcesses=function(e){if(void 0===e&&(e=!1),this._postProcesses){if(e)for(var t=0,i=this._postProcesses;t<i.length;t++)i[t].dispose();this._postProcesses=[]}},t.prototype.removePostProcess=function(e){if(this._postProcesses){var t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses.splice(t,1),this._postProcesses.length>0&&(this._postProcesses[0].autoClear=!1))}},t.prototype._shouldRender=function(){return-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)},t.prototype.getRenderSize=function(){return this.getRenderWidth()},t.prototype.getRenderWidth=function(){return this._size.width?this._size.width:this._size},t.prototype.getRenderHeight=function(){return this._size.width?this._size.height:this._size},t.prototype.getRenderLayers=function(){return this._size.layers||0},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.scale=function(e){var t=Math.max(1,this.getRenderSize()*e);this.resize(t)},t.prototype.getReflectionTextureMatrix=function(){return this.isCube?this._textureMatrix:e.prototype.getReflectionTextureMatrix.call(this)},t.prototype.resize=function(e){var t=this.isCube;this.releaseInternalTexture();var i=this.getScene();i&&(this._processSizeParameter(e),this._texture=t?i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):i.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))},t.prototype.render=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=!1),s=this.getScene()){var i,n=s.getEngine();if(void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses),this._waitingRenderList){this.renderList=[];for(var r=0;r<this._waitingRenderList.length;r++){var o=this._waitingRenderList[r],a=s.getMeshByID(o);a&&this.renderList.push(a)}this._waitingRenderList=void 0}if(this.renderListPredicate){var s;if(this.renderList?this.renderList.length=0:this.renderList=[],!(s=this.getScene()))return;var c=s.meshes;for(r=0;r<c.length;r++){var l=c[r];this.renderListPredicate(l)&&this.renderList.push(l)}}if(this.onBeforeBindObservable.notifyObservers(this),this.activeCamera?(i=this.activeCamera,n.setViewport(this.activeCamera.viewport,this.getRenderWidth(),this.getRenderHeight()),this.activeCamera!==s.activeCamera&&s.setTransformMatrix(this.activeCamera.getViewMatrix(),this.activeCamera.getProjectionMatrix(!0))):(i=s.activeCamera)&&n.setViewport(i.viewport,this.getRenderWidth(),this.getRenderHeight()),this._defaultRenderListPrepared=!1,this.is2DArray)for(var u=0;u<this.getRenderLayers();u++)this.renderToTarget(0,e,t,u,i),s.incrementRenderId(),s.resetCachedMaterial();else if(this.isCube)for(var h=0;h<6;h++)this.renderToTarget(h,e,t,void 0,i),s.incrementRenderId(),s.resetCachedMaterial();else this.renderToTarget(0,e,t,void 0,i);this.onAfterUnbindObservable.notifyObservers(this),s.activeCamera&&((s.getEngine().scenes.length>1||this.activeCamera&&this.activeCamera!==s.activeCamera)&&s.setTransformMatrix(s.activeCamera.getViewMatrix(),s.activeCamera.getProjectionMatrix(!0)),n.setViewport(s.activeCamera.viewport)),s.resetCachedMaterial()}},t.prototype._bestReflectionRenderTargetDimension=function(e,t){var i=e*t,n=Se.a.NearestPOT(i+16384/(128+i));return Math.min(Se.a.FloorPOT(e),n)},t.prototype._prepareRenderingManager=function(e,t,i,n){var r=this.getScene();if(r){this._renderingManager.reset();for(var o=r.getRenderId(),a=0;a<t;a++){var s=e[a];if(s&&!s.isBlocked){if(this.customIsReadyFunction){if(!this.customIsReadyFunction(s,this.refreshRate)){this.resetRefreshCounter();continue}}else if(!s.isReady(0===this.refreshRate)){this.resetRefreshCounter();continue}if(!s._internalAbstractMeshDataInfo._currentLODIsUpToDate&&r.activeCamera&&(s._internalAbstractMeshDataInfo._currentLOD=r.customLODSelector?r.customLODSelector(s,r.activeCamera):s.getLOD(r.activeCamera),s._internalAbstractMeshDataInfo._currentLODIsUpToDate=!0),!s._internalAbstractMeshDataInfo._currentLOD)continue;var c=s._internalAbstractMeshDataInfo._currentLOD;c._preActivateForIntermediateRendering(o);var l;if(l=!(!n||!i)&&0==(s.layerMask&i.layerMask),s.isEnabled()&&s.isVisible&&s.subMeshes&&!l&&(c!==s&&c._activate(o,!0),s._activate(o,!0)&&s.subMeshes.length)){s.isAnInstance?s._internalAbstractMeshDataInfo._actAsRegularMesh&&(c=s):c._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!1,c._internalAbstractMeshDataInfo._isActiveIntermediate=!0;for(var u=0;u<c.subMeshes.length;u++){var h=c.subMeshes[u];this._renderingManager.dispatch(h,c)}}}}for(var d=0;d<r.particleSystems.length;d++){var f=r.particleSystems[d],p=f.emitter;f.isStarted()&&p&&p.position&&p.isEnabled()&&e.indexOf(p)>=0&&this._renderingManager.dispatchParticles(f)}}},t.prototype._bindFrameBuffer=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0);var i=this.getScene();if(i){var n=i.getEngine();this._texture&&n.bindFramebuffer(this._texture,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,0,t)}},t.prototype.unbindFrameBuffer=function(e,t){var i=this;this._texture&&e.unBindFramebuffer(this._texture,this.isCube,function(){i.onAfterRenderObservable.notifyObservers(t)})},t.prototype.renderToTarget=function(e,t,i,n,r){void 0===n&&(n=0),void 0===r&&(r=null);var o=this.getScene();if(o){var a=o.getEngine();if(this._texture){this._postProcessManager?this._postProcessManager._prepareFrame(this._texture,this._postProcesses):t&&o.postProcessManager._prepareFrame(this._texture)||this._bindFrameBuffer(e,n),this.is2DArray?this.onBeforeRenderObservable.notifyObservers(n):this.onBeforeRenderObservable.notifyObservers(e);var s=null,c=this.renderList?this.renderList:o.getActiveMeshes().data,l=this.renderList?this.renderList.length:o.getActiveMeshes().length;this.getCustomRenderList&&(s=this.getCustomRenderList(this.is2DArray?n:e,c,l)),s?this._prepareRenderingManager(s,s.length,r,!1):(this._defaultRenderListPrepared||(this._prepareRenderingManager(c,l,r,!this.renderList),this._defaultRenderListPrepared=!0),s=c),this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(a):a.clear(this.clearColor||o.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||o.updateTransformMatrix(!0);for(var u=0,h=o._beforeRenderTargetDrawStage;u<h.length;u++)h[u].action(this);this._renderingManager.render(this.customRenderFunction,s,this.renderParticles,this.renderSprites);for(var d=0,f=o._afterRenderTargetDrawStage;d<f.length;d++)f[d].action(this);this._postProcessManager?this._postProcessManager._finalizeFrame(!1,this._texture,e,this._postProcesses,this.ignoreCameraViewport):t&&o.postProcessManager._finalizeFrame(!1,this._texture,e),this._doNotChangeAspectRatio||o.updateTransformMatrix(!0),i&&Ce.b.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),a),this.isCube&&5!==e?this.onAfterRenderObservable.notifyObservers(e):(this.isCube&&5===e&&a.generateMipMapsForCubemap(this._texture),this.unbindFrameBuffer(a,e))}}},t.prototype.setRenderingOrder=function(e,t,i,n){void 0===t&&(t=null),void 0===i&&(i=null),void 0===n&&(n=null),this._renderingManager.setRenderingOrder(e,t,i,n)},t.prototype.setRenderingAutoClearDepthStencil=function(e,t){this._renderingManager.setRenderingAutoClearDepthStencil(e,t),this._renderingManager._useSceneAutoClearSetup=!1},t.prototype.clone=function(){var e=this.getSize(),i=new t(this.name,e,this.getScene(),this._renderTargetOptions.generateMipMaps,this._doNotChangeAspectRatio,this._renderTargetOptions.type,this.isCube,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer,this._renderTargetOptions.generateStencilBuffer);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.coordinatesMode=this.coordinatesMode,this.renderList&&(i.renderList=this.renderList.slice(0)),i},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);if(t.renderTargetSize=this.getRenderSize(),t.renderList=[],this.renderList)for(var i=0;i<this.renderList.length;i++)t.renderList.push(this.renderList[i].id);return t},t.prototype.disposeFramebufferObjects=function(){var e=this.getInternalTexture(),t=this.getScene();e&&t&&t.getEngine()._releaseFramebufferObjects(e)},t.prototype.dispose=function(){this.onResizeObservable.clear(),this.onClearObservable.clear(),this.onAfterRenderObservable.clear(),this.onAfterUnbindObservable.clear(),this.onBeforeBindObservable.clear(),this.onBeforeRenderObservable.clear(),this._postProcessManager&&(this._postProcessManager.dispose(),this._postProcessManager=null),this.clearPostProcesses(!0),this._resizeObserver&&(this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this.renderList=null;var t=this.getScene();if(t){var i=t.customRenderTargets.indexOf(this);i>=0&&t.customRenderTargets.splice(i,1);for(var n=0,r=t.cameras;n<r.length;n++){var o=r[n];(i=o.customRenderTargets.indexOf(this))>=0&&o.customRenderTargets.splice(i,1)}this.depthStencilTexture&&this.getScene().getEngine()._releaseTexture(this.depthStencilTexture),e.prototype.dispose.call(this)}},t.prototype._rebuild=function(){this.refreshRate===t.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=t.REFRESHRATE_RENDER_ONCE),this._postProcessManager&&this._postProcessManager._rebuild()},t.prototype.freeRenderingGroups=function(){this._renderingManager&&this._renderingManager.freeRenderingGroups()},t.prototype.getViewCount=function(){return 1},t.REFRESHRATE_RENDER_ONCE=0,t.REFRESHRATE_RENDER_ONEVERYFRAME=1,t.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2,t}(Ke.a);Ke.a._CreateRenderTargetTexture=function(e,t,i,n){return new Ri(e,t,i,n)};var xi=function(e){function t(t,i){void 0===i&&(i=512);var n=e.call(this,"multiview rtt",i,t,!1,!0,Qe.b.Unknown,!1,void 0,!1,!1,!0,void 0,!0)||this,r=t.getEngine().createMultiviewRenderTargetTexture(n.getRenderWidth(),n.getRenderHeight());return r.isMultiview=!0,r.format=g.a.TEXTUREFORMAT_RGBA,n._texture=r,n.samples=n._getEngine().getCaps().maxSamples||n.samples,n}return Object(h.d)(t,e),t.prototype._bindFrameBuffer=function(e){void 0===e&&(e=0),this._texture&&this.getScene().getEngine().bindMultiviewFramebuffer(this._texture)},t.prototype.getViewCount=function(){return 2},t}(Ri),Oi=i(90);Se.a.prototype.createMultiviewRenderTargetTexture=function(e,t){var i=this._gl;if(!this.getCaps().multiview)throw"Multiview is not supported";var n=new Qe.a(this,Qe.b.Unknown,!0);return n.width=e,n.height=t,n._framebuffer=i.createFramebuffer(),n._colorTextureArray=i.createTexture(),i.bindTexture(i.TEXTURE_2D_ARRAY,n._colorTextureArray),i.texStorage3D(i.TEXTURE_2D_ARRAY,1,i.RGBA8,e,t,2),n._depthStencilTextureArray=i.createTexture(),i.bindTexture(i.TEXTURE_2D_ARRAY,n._depthStencilTextureArray),i.texStorage3D(i.TEXTURE_2D_ARRAY,1,i.DEPTH32F_STENCIL8,e,t,2),n.isReady=!0,n},Se.a.prototype.bindMultiviewFramebuffer=function(e){var t=this._gl,i=this.getCaps().oculusMultiview||this.getCaps().multiview;if(this.bindFramebuffer(e,void 0,void 0,void 0,!0),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,e._framebuffer),!e._colorTextureArray||!e._depthStencilTextureArray)throw"Invalid multiview frame buffer";this.getCaps().oculusMultiview?(i.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,e._colorTextureArray,0,e.samples,0,2),i.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,e._depthStencilTextureArray,0,e.samples,0,2)):(i.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,e._colorTextureArray,0,0,2),i.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,e._depthStencilTextureArray,0,0,2))},je.a.prototype._useMultiviewToSingleView=!1,je.a.prototype._multiviewTexture=null,je.a.prototype._resizeOrCreateMultiviewTexture=function(e,t){this._multiviewTexture?this._multiviewTexture.getRenderWidth()==e&&this._multiviewTexture.getRenderHeight()==t||(this._multiviewTexture.dispose(),this._multiviewTexture=new xi(this.getScene(),{width:e,height:t})):this._multiviewTexture=new xi(this.getScene(),{width:e,height:t})},Q.a.prototype._transformMatrixR=a.a.Zero(),Q.a.prototype._multiviewSceneUbo=null,Q.a.prototype._createMultiviewUbo=function(){this._multiviewSceneUbo=new Ai.a(this.getEngine(),void 0,!0),this._multiviewSceneUbo.addUniform("viewProjection",16),this._multiviewSceneUbo.addUniform("viewProjectionR",16),this._multiviewSceneUbo.addUniform("view",16)},Q.a.prototype._updateMultiviewUbo=function(e,t){e&&t&&e.multiplyToRef(t,this._transformMatrixR),e&&t&&(e.multiplyToRef(t,a.c.Matrix[0]),Oi.a.GetRightPlaneToRef(a.c.Matrix[0],this._frustumPlanes[3])),this._multiviewSceneUbo&&(this._multiviewSceneUbo.updateMatrix("viewProjection",this.getTransformMatrix()),this._multiviewSceneUbo.updateMatrix("viewProjectionR",this._transformMatrixR),this._multiviewSceneUbo.updateMatrix("view",this._viewMatrix),this._multiviewSceneUbo.update())},Q.a.prototype._renderMultiviewToSingleView=function(e){e._resizeOrCreateMultiviewTexture(e._rigPostProcess&&e._rigPostProcess&&e._rigPostProcess.width>0?e._rigPostProcess.width:this.getEngine().getRenderWidth(!0),e._rigPostProcess&&e._rigPostProcess&&e._rigPostProcess.height>0?e._rigPostProcess.height:this.getEngine().getRenderHeight(!0)),this._multiviewSceneUbo||this._createMultiviewUbo(),e.outputRenderTarget=e._multiviewTexture,this._renderForCamera(e),e.outputRenderTarget=null;for(var t=0;t<e._rigCameras.length;t++){var i=this.getEngine();this._activeCamera=e._rigCameras[t],i.setViewport(this._activeCamera.viewport),this.postProcessManager&&(this.postProcessManager._prepareFrame(),this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate))}};var Mi=function(e){function t(t,i,n){var r=e.call(this,t,"vrMultiviewToSingleview",["imageIndex"],["multiviewSampler"],n,i,Ke.a.BILINEAR_SAMPLINGMODE)||this;return r.onSizeChangedObservable.add(function(){}),r.onApplyObservable.add(function(e){i._scene.activeCamera&&i._scene.activeCamera.isLeftCamera?e.setInt("imageIndex",0):e.setInt("imageIndex",1),e.setTexture("multiviewSampler",i._multiviewTexture)}),r}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VRMultiviewToSingleviewPostProcess"},t}(ci);je.a._setVRRigMode=function(e,t){var i=t.vrCameraMetrics||Ei.GetDefault();e._rigCameras[0]._cameraRigParams.vrMetrics=i,e._rigCameras[0].viewport=new mi.a(0,0,.5,1),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new a.a,e._rigCameras[0]._cameraRigParams.vrHMatrix=i.leftHMatrix,e._rigCameras[0]._cameraRigParams.vrPreViewMatrix=i.leftPreViewMatrix,e._rigCameras[0].getProjectionMatrix=e._rigCameras[0]._getVRProjectionMatrix,e._rigCameras[1]._cameraRigParams.vrMetrics=i,e._rigCameras[1].viewport=new mi.a(.5,0,.5,1),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new a.a,e._rigCameras[1]._cameraRigParams.vrHMatrix=i.rightHMatrix,e._rigCameras[1]._cameraRigParams.vrPreViewMatrix=i.rightPreViewMatrix,e._rigCameras[1].getProjectionMatrix=e._rigCameras[1]._getVRProjectionMatrix,i.multiviewEnabled&&(e.getScene().getEngine().getCaps().multiview?(e._useMultiviewToSingleView=!0,e._rigPostProcess=new Mi("VRMultiviewToSingleview",e,i.postProcessScaleFactor)):(m.a.Warn("Multiview is not supported, falling back to standard rendering"),i.multiviewEnabled=!1)),i.compensateDistortion&&(e._rigCameras[0]._rigPostProcess=new Si("VR_Distort_Compensation_Left",e._rigCameras[0],!1,i),e._rigCameras[1]._rigPostProcess=new Si("VR_Distort_Compensation_Right",e._rigCameras[1],!0,i))},B.a.AddNodeConstructor("VRDeviceOrientationFreeCamera",function(e,t){return function(){return new Ii(e,0,0,1,a.e.Zero(),t)}});var Ii=function(e){function t(t,i,n,r,o,a,s,c){void 0===s&&(s=!0),void 0===c&&(c=Ei.GetDefault());var l=e.call(this,t,i,n,r,o,a)||this;return c.compensateDistortion=s,l.setCameraRigMode(je.a.RIG_MODE_VR,{vrCameraMetrics:c}),l.inputs.addVRDeviceOrientation(),l}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationArcRotateCamera"},t}(Bt);B.a.AddNodeConstructor("VRDeviceOrientationFreeCamera",function(e,t){return function(){return new Di(e,a.e.Zero(),t)}});var Di=function(e){function t(t,i,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=Ei.GetDefault());var a=e.call(this,t,i,n)||this;return o.compensateDistortion=r,a.setCameraRigMode(je.a.RIG_MODE_VR,{vrCameraMetrics:o}),a}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationFreeCamera"},t}(Ut);B.a.AddNodeConstructor("VRDeviceOrientationGamepadCamera",function(e,t){return function(){return new Ni(e,a.e.Zero(),t)}});var Ni=function(e){function t(t,i,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=Ei.GetDefault());var a=e.call(this,t,i,n,r,o)||this;return a.inputs.addGamepad(),a}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationGamepadCamera"},t}(Di),Li=i(86);je.a._setWebVRRigMode=function(e,t){if(t.vrDisplay){var i=t.vrDisplay.getEyeParameters("left"),n=t.vrDisplay.getEyeParameters("right");e._rigCameras[0].viewport=new mi.a(0,0,.5,1),e._rigCameras[0].setCameraRigParameter("left",!0),e._rigCameras[0].setCameraRigParameter("specs",t.specs),e._rigCameras[0].setCameraRigParameter("eyeParameters",i),e._rigCameras[0].setCameraRigParameter("frameData",t.frameData),e._rigCameras[0].setCameraRigParameter("parentCamera",t.parentCamera),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new a.a,e._rigCameras[0].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[0].parent=e,e._rigCameras[0]._getViewMatrix=e._getWebVRViewMatrix,e._rigCameras[1].viewport=new mi.a(.5,0,.5,1),e._rigCameras[1].setCameraRigParameter("eyeParameters",n),e._rigCameras[1].setCameraRigParameter("specs",t.specs),e._rigCameras[1].setCameraRigParameter("frameData",t.frameData),e._rigCameras[1].setCameraRigParameter("parentCamera",t.parentCamera),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new a.a,e._rigCameras[1].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[1].parent=e,e._rigCameras[1]._getViewMatrix=e._getWebVRViewMatrix}},Object.defineProperty(Se.a.prototype,"isInVRExclusivePointerMode",{get:function(){return this._vrExclusivePointerMode},enumerable:!0,configurable:!0}),Se.a.prototype._prepareVRComponent=function(){this._vrSupported=!1,this._vrExclusivePointerMode=!1,this.onVRDisplayChangedObservable=new o.c,this.onVRRequestPresentComplete=new o.c,this.onVRRequestPresentStart=new o.c},Se.a.prototype.isVRDevicePresent=function(){return!!this._vrDisplay},Se.a.prototype.getVRDevice=function(){return this._vrDisplay},Se.a.prototype.initWebVR=function(){return this.initWebVRAsync(),this.onVRDisplayChangedObservable},Se.a.prototype.initWebVRAsync=function(){var e=this,t=function(){var t={vrDisplay:e._vrDisplay,vrSupported:e._vrSupported};e.onVRDisplayChangedObservable.notifyObservers(t),e._webVRInitPromise=new Promise(function(e){e(t)})};if(!this._onVrDisplayConnect){this._onVrDisplayConnect=function(i){e._vrDisplay=i.display,t()},this._onVrDisplayDisconnect=function(){e._vrDisplay.cancelAnimationFrame(e._frameHandler),e._vrDisplay=void 0,e._frameHandler=Se.a.QueueNewFrame(e._boundRenderFunction),t()},this._onVrDisplayPresentChange=function(){e._vrExclusivePointerMode=e._vrDisplay&&e._vrDisplay.isPresenting};var i=this.getHostWindow();i&&(i.addEventListener("vrdisplayconnect",this._onVrDisplayConnect),i.addEventListener("vrdisplaydisconnect",this._onVrDisplayDisconnect),i.addEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange))}return this._webVRInitPromise=this._webVRInitPromise||this._getVRDisplaysAsync(),this._webVRInitPromise.then(t),this._webVRInitPromise},Se.a.prototype._getVRDisplaysAsync=function(){var e=this;return new Promise(function(t){navigator.getVRDisplays?navigator.getVRDisplays().then(function(i){e._vrSupported=!0,e._vrDisplay=i[0],t({vrDisplay:e._vrDisplay,vrSupported:e._vrSupported})}):(e._vrDisplay=void 0,e._vrSupported=!1,t({vrDisplay:e._vrDisplay,vrSupported:e._vrSupported}))})},Se.a.prototype.enableVR=function(e){var t=this;if(this._vrDisplay&&!this._vrDisplay.isPresenting){this.onVRRequestPresentStart.notifyObservers(this);var i={highRefreshRate:!!this.vrPresentationAttributes&&this.vrPresentationAttributes.highRefreshRate,foveationLevel:this.vrPresentationAttributes?this.vrPresentationAttributes.foveationLevel:1,multiview:(this.getCaps().multiview||this.getCaps().oculusMultiview)&&e.useMultiview};this._vrDisplay.requestPresent([Object(h.a)({source:this.getRenderingCanvas(),attributes:i},i)]).then(function(){t.onVRRequestPresentComplete.notifyObservers(!0),t._onVRFullScreenTriggered()}).catch(function(){t.onVRRequestPresentComplete.notifyObservers(!1)})}},Se.a.prototype._onVRFullScreenTriggered=function(){if(this._vrDisplay&&this._vrDisplay.isPresenting){this._oldSize=new U.a(this.getRenderWidth(),this.getRenderHeight()),this._oldHardwareScaleFactor=this.getHardwareScalingLevel();var e=this._vrDisplay.getEyeParameters("left");this.setHardwareScalingLevel(1),this.setSize(2*e.renderWidth,e.renderHeight)}else this.setHardwareScalingLevel(this._oldHardwareScaleFactor),this.setSize(this._oldSize.width,this._oldSize.height)},Se.a.prototype.disableVR=function(){var e=this;this._vrDisplay&&this._vrDisplay.isPresenting&&this._vrDisplay.exitPresent().then(function(){return e._onVRFullScreenTriggered()}).catch(function(){return e._onVRFullScreenTriggered()}),Ht.a.IsWindowObjectExist()&&(window.removeEventListener("vrdisplaypointerrestricted",this._onVRDisplayPointerRestricted),window.removeEventListener("vrdisplaypointerunrestricted",this._onVRDisplayPointerUnrestricted),this._onVrDisplayConnect&&(window.removeEventListener("vrdisplayconnect",this._onVrDisplayConnect),this._onVrDisplayDisconnect&&window.removeEventListener("vrdisplaydisconnect",this._onVrDisplayDisconnect),this._onVrDisplayPresentChange&&window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),this._onVrDisplayConnect=null,this._onVrDisplayDisconnect=null))},Se.a.prototype._connectVREvents=function(e,t){var i=this;if(this._onVRDisplayPointerRestricted=function(){e&&e.requestPointerLock()},this._onVRDisplayPointerUnrestricted=function(){if(t)t.exitPointerLock&&t.exitPointerLock();else{var e=i.getHostWindow();e.document&&e.document.exitPointerLock&&e.document.exitPointerLock()}},Ht.a.IsWindowObjectExist()){var n=this.getHostWindow();n.addEventListener("vrdisplaypointerrestricted",this._onVRDisplayPointerRestricted,!1),n.addEventListener("vrdisplaypointerunrestricted",this._onVRDisplayPointerUnrestricted,!1)}},Se.a.prototype._submitVRFrame=function(){if(this._vrDisplay&&this._vrDisplay.isPresenting)try{this._vrDisplay.submitFrame()}catch(e){Ce.b.Warn("webVR submitFrame has had an unexpected failure: "+e)}},Se.a.prototype.isVRPresenting=function(){return this._vrDisplay&&this._vrDisplay.isPresenting},Se.a.prototype._requestVRFrame=function(){this._frameHandler=Se.a.QueueNewFrame(this._boundRenderFunction,this._vrDisplay)},B.a.AddNodeConstructor("WebVRFreeCamera",function(e,t){return function(){return new wi(e,a.e.Zero(),t)}}),B.a.AddNodeConstructor("WebVRGamepadCamera",function(e,t){return function(){return new wi(e,a.e.Zero(),t)}});var wi=function(e){function t(t,i,n,r){void 0===r&&(r={});var s=e.call(this,t,i,n)||this;s.webVROptions=r,s._vrDevice=null,s.rawPose=null,s._specsVersion="1.1",s._attached=!1,s._descendants=[],s._deviceRoomPosition=a.e.Zero(),s._deviceRoomRotationQuaternion=a.b.Identity(),s._standingMatrix=null,s.devicePosition=a.e.Zero(),s.deviceRotationQuaternion=a.b.Identity(),s.deviceScaleFactor=1,s._deviceToWorld=a.a.Identity(),s._worldToDevice=a.a.Identity(),s.controllers=[],s.onControllersAttachedObservable=new o.c,s.onControllerMeshLoadedObservable=new o.c,s.onPoseUpdatedFromDeviceObservable=new o.c,s._poseSet=!1,s.rigParenting=!0,s._defaultHeight=void 0,s._detachIfAttached=function(){var e=s.getEngine().getVRDevice();e&&!e.isPresenting&&s.detachControl()},s._workingVector=a.e.Zero(),s._oneVector=a.e.One(),s._workingMatrix=a.a.Identity(),s._tmpMatrix=new a.a,s._cache.position=a.e.Zero(),r.defaultHeight&&(s._defaultHeight=r.defaultHeight,s.position.y=s._defaultHeight),s.minZ=.1,5===arguments.length&&(s.webVROptions=arguments[4]),null==s.webVROptions.trackPosition&&(s.webVROptions.trackPosition=!0),null==s.webVROptions.controllerMeshes&&(s.webVROptions.controllerMeshes=!0),null==s.webVROptions.defaultLightingOnControllers&&(s.webVROptions.defaultLightingOnControllers=!0),s.rotationQuaternion=new a.b,s.webVROptions&&s.webVROptions.positionScale&&(s.deviceScaleFactor=s.webVROptions.positionScale);var c=s.getEngine();return s._onVREnabled=function(e){e&&s.initControllers()},c.onVRRequestPresentComplete.add(s._onVREnabled),c.initWebVR().add(function(e){e.vrDisplay&&s._vrDevice!==e.vrDisplay&&(s._vrDevice=e.vrDisplay,s.setCameraRigMode(je.a.RIG_MODE_WEBVR,{parentCamera:s,vrDisplay:s._vrDevice,frameData:s._frameData,specs:s._specsVersion}),s._attached&&s.getEngine().enableVR(s.webVROptions))}),"undefined"!=typeof VRFrameData&&(s._frameData=new VRFrameData),r.useMultiview&&(s.getScene().getEngine().getCaps().multiview?(s._useMultiviewToSingleView=!0,s._rigPostProcess=new Mi("VRMultiviewToSingleview",s,1)):(m.a.Warn("Multiview is not supported, falling back to standard rendering"),s._useMultiviewToSingleView=!1)),n.onBeforeCameraRenderObservable.add(function(e){e.parent===s&&s.rigParenting&&(s._descendants=s.getDescendants(!0,function(e){var t=s.controllers.some(function(t){return t._mesh===e}),i=-1!==s._rigCameras.indexOf(e);return!t&&!i}),s._descendants.forEach(function(t){t.parent=e}))}),n.onAfterCameraRenderObservable.add(function(e){e.parent===s&&s.rigParenting&&s._descendants.forEach(function(e){e.parent=s})}),s}return Object(h.d)(t,e),t.prototype.deviceDistanceToRoomGround=function(){return this._standingMatrix?(this._standingMatrix.getTranslationToRef(this._workingVector),this._deviceRoomPosition.y+this._workingVector.y):this._defaultHeight||0},t.prototype.useStandingMatrix=function(e){var t=this;void 0===e&&(e=function(e){}),this.getEngine().initWebVRAsync().then(function(i){i.vrDisplay&&i.vrDisplay.stageParameters&&i.vrDisplay.stageParameters.sittingToStandingTransform&&t.webVROptions.trackPosition?(t._standingMatrix=new a.a,a.a.FromFloat32ArrayToRefScaled(i.vrDisplay.stageParameters.sittingToStandingTransform,0,1,t._standingMatrix),t.getScene().useRightHandedSystem||t._standingMatrix&&t._standingMatrix.toggleModelMatrixHandInPlace(),e(!0)):e(!1)})},t.prototype.useStandingMatrixAsync=function(){var e=this;return new Promise(function(t){e.useStandingMatrix(function(e){t(e)})})},t.prototype.dispose=function(){this._detachIfAttached(),this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled),this._updateCacheWhenTrackingDisabledObserver&&this._scene.onBeforeRenderObservable.remove(this._updateCacheWhenTrackingDisabledObserver),e.prototype.dispose.call(this)},t.prototype.getControllerByName=function(e){for(var t=0,i=this.controllers;t<i.length;t++){var n=i[t];if(n.hand===e)return n}return null},Object.defineProperty(t.prototype,"leftController",{get:function(){return this._leftController||(this._leftController=this.getControllerByName("left")),this._leftController},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightController",{get:function(){return this._rightController||(this._rightController=this.getControllerByName("right")),this._rightController},enumerable:!1,configurable:!0}),t.prototype.getForwardRay=function(t){return void 0===t&&(t=100),this.leftCamera?e.prototype.getForwardRay.call(this,t,this.leftCamera.getWorldMatrix(),this.leftCamera.globalPosition):e.prototype.getForwardRay.call(this,t)},t.prototype._checkInputs=function(){this._vrDevice&&this._vrDevice.isPresenting&&(this._vrDevice.getFrameData(this._frameData),this.updateFromDevice(this._frameData.pose)),e.prototype._checkInputs.call(this)},t.prototype.updateFromDevice=function(e){e&&e.orientation&&4===e.orientation.length&&(this.rawPose=e,this._deviceRoomRotationQuaternion.copyFromFloats(e.orientation[0],e.orientation[1],-e.orientation[2],-e.orientation[3]),this.getScene().useRightHandedSystem&&(this._deviceRoomRotationQuaternion.z*=-1,this._deviceRoomRotationQuaternion.w*=-1),this.webVROptions.trackPosition&&this.rawPose.position&&(this._deviceRoomPosition.copyFromFloats(this.rawPose.position[0],this.rawPose.position[1],-this.rawPose.position[2]),this.getScene().useRightHandedSystem&&(this._deviceRoomPosition.z*=-1)),this._poseSet=!0)},t.prototype.attachControl=function(t){t=Ce.b.BackCompatCameraNoPreventDefault(arguments),e.prototype.attachControl.call(this,t),this._attached=!0,t=!je.a.ForceAttachControlToAlwaysPreventDefault&&t,this._vrDevice&&this.getEngine().enableVR(this.webVROptions);var i=this._scene.getEngine().getHostWindow();i&&i.addEventListener("vrdisplaypresentchange",this._detachIfAttached)},t.prototype.detachControl=function(t){this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),e.prototype.detachControl.call(this),this._attached=!1,this.getEngine().disableVR(),window.removeEventListener("vrdisplaypresentchange",this._detachIfAttached)},t.prototype.getClassName=function(){return"WebVRFreeCamera"},t.prototype.resetToCurrentRotation=function(){this._vrDevice.resetPose()},t.prototype._updateRigCameras=function(){var e=this._rigCameras[0],t=this._rigCameras[1];e.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion),t.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion),e.position.copyFrom(this._deviceRoomPosition),t.position.copyFrom(this._deviceRoomPosition)},t.prototype._correctPositionIfNotTrackPosition=function(e,t){void 0===t&&(t=!1),this.rawPose&&this.rawPose.position&&!this.webVROptions.trackPosition&&(a.a.TranslationToRef(this.rawPose.position[0],this.rawPose.position[1],-this.rawPose.position[2],this._tmpMatrix),t||this._tmpMatrix.invert(),this._tmpMatrix.multiplyToRef(e,e))},t.prototype._updateCache=function(t){var i=this;this.rotationQuaternion.equals(this._cache.rotationQuaternion)&&this.position.equals(this._cache.position)||(this.updateCacheCalled||(this.updateCacheCalled=!0,this.update()),this.rotationQuaternion.toRotationMatrix(this._workingMatrix),a.e.TransformCoordinatesToRef(this._deviceRoomPosition,this._workingMatrix,this._workingVector),this.devicePosition.subtractToRef(this._workingVector,this._workingVector),a.a.ComposeToRef(this._oneVector,this.rotationQuaternion,this._workingVector,this._deviceToWorld),this._deviceToWorld.getTranslationToRef(this._workingVector),this._workingVector.addInPlace(this.position),this._workingVector.subtractInPlace(this._cache.position),this._deviceToWorld.setTranslation(this._workingVector),this._deviceToWorld.invertToRef(this._worldToDevice),this.controllers.forEach(function(e){e._deviceToWorld.copyFrom(i._deviceToWorld),i._correctPositionIfNotTrackPosition(e._deviceToWorld),e.update()})),t||e.prototype._updateCache.call(this),this.updateCacheCalled=!1},t.prototype._computeDevicePosition=function(){a.e.TransformCoordinatesToRef(this._deviceRoomPosition,this._deviceToWorld,this.devicePosition)},t.prototype.update=function(){this._computeDevicePosition(),a.a.FromQuaternionToRef(this._deviceRoomRotationQuaternion,this._workingMatrix),this._workingMatrix.multiplyToRef(this._deviceToWorld,this._workingMatrix),a.b.FromRotationMatrixToRef(this._workingMatrix,this.deviceRotationQuaternion),this._poseSet&&this.onPoseUpdatedFromDeviceObservable.notifyObservers(null),e.prototype.update.call(this)},t.prototype._getViewMatrix=function(){return a.a.Identity()},t.prototype._getWebVRViewMatrix=function(){var e=this._cameraRigParams.parentCamera;e._updateCache();var t=this._cameraRigParams.left?this._cameraRigParams.frameData.leftViewMatrix:this._cameraRigParams.frameData.rightViewMatrix;return a.a.FromArrayToRef(t,0,this._webvrViewMatrix),this.getScene().useRightHandedSystem||this._webvrViewMatrix.toggleModelMatrixHandInPlace(),this._webvrViewMatrix.getRotationMatrixToRef(this._cameraRotationMatrix),a.e.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),1!==e.deviceScaleFactor&&(this._webvrViewMatrix.invert(),e.deviceScaleFactor&&(this._webvrViewMatrix.multiplyAtIndex(12,e.deviceScaleFactor),this._webvrViewMatrix.multiplyAtIndex(13,e.deviceScaleFactor),this._webvrViewMatrix.multiplyAtIndex(14,e.deviceScaleFactor)),this._webvrViewMatrix.invert()),e._correctPositionIfNotTrackPosition(this._webvrViewMatrix,!0),e._worldToDevice.multiplyToRef(this._webvrViewMatrix,this._webvrViewMatrix),this._workingMatrix=this._workingMatrix||a.a.Identity(),this._webvrViewMatrix.invertToRef(this._workingMatrix),this._workingMatrix.multiplyToRef(e.getWorldMatrix(),this._workingMatrix),this._workingMatrix.getTranslationToRef(this._globalPosition),this._markSyncedWithParent(),this._webvrViewMatrix},t.prototype._getWebVRProjectionMatrix=function(){var e=this.parent;e._vrDevice.depthNear=e.minZ,e._vrDevice.depthFar=e.maxZ;var t=this._cameraRigParams.left?this._cameraRigParams.frameData.leftProjectionMatrix:this._cameraRigParams.frameData.rightProjectionMatrix;return a.a.FromArrayToRef(t,0,this._projectionMatrix),this.getScene().useRightHandedSystem||this._projectionMatrix.toggleProjectionMatrixHandInPlace(),this._projectionMatrix},t.prototype.initControllers=function(){var e=this;this.controllers=[];var t=this.getScene().gamepadManager;this._onGamepadDisconnectedObserver=t.onGamepadDisconnectedObservable.add(function(t){if(t.type===ot.POSE_ENABLED){var i=t;i.defaultModel&&i.defaultModel.setEnabled(!1),"right"===i.hand&&(e._rightController=null),"left"===i.hand&&(e._leftController=null);var n=e.controllers.indexOf(i);-1!==n&&e.controllers.splice(n,1)}}),this._onGamepadConnectedObserver=t.onGamepadConnectedObservable.add(function(t){if(t.type===ot.POSE_ENABLED){var i=t;if(e.webVROptions.trackPosition||(i._disableTrackPosition(new a.e("left"==i.hand?-.15:.15,-.5,.25)),e._updateCacheWhenTrackingDisabledObserver||(e._updateCacheWhenTrackingDisabledObserver=e._scene.onBeforeRenderObservable.add(function(){e._updateCache()}))),i.deviceScaleFactor=e.deviceScaleFactor,i._deviceToWorld.copyFrom(e._deviceToWorld),e._correctPositionIfNotTrackPosition(i._deviceToWorld),e.webVROptions.controllerMeshes&&(i.defaultModel?i.defaultModel.setEnabled(!0):i.initControllerMesh(e.getScene(),function(t){if(t.scaling.scaleInPlace(e.deviceScaleFactor),e.onControllerMeshLoadedObservable.notifyObservers(i),e.webVROptions.defaultLightingOnControllers){e._lightOnControllers||(e._lightOnControllers=new Li.a("vrControllersLight",new a.e(0,1,0),e.getScene()));var n=function(e,t){var i=e.getChildren();i&&0!==i.length&&i.forEach(function(e){t.includedOnlyMeshes.push(e),n(e,t)})};e._lightOnControllers.includedOnlyMeshes.push(t),n(t,e._lightOnControllers)}})),i.attachToPoseControlledCamera(e),-1===e.controllers.indexOf(i)){e.controllers.push(i);for(var n=!1,r=0;r<e.controllers.length;r++)e.controllers[r].controllerType===zt.VIVE&&(n?e.controllers[r].hand="right":(n=!0,e.controllers[r].hand="left"));e.controllers.length>=2&&e.onControllersAttachedObservable.notifyObservers(e.controllers)}}})},t}(wt),Fi=function(e){function t(t){var i=e.call(this,t)||this;return i.onTriggerStateChangedObservable=new o.c,i.onMainButtonStateChangedObservable=new o.c,i.onSecondaryButtonStateChangedObservable=new o.c,i.onPadStateChangedObservable=new o.c,i.onPadValuesChangedObservable=new o.c,i.pad={x:0,y:0},i._changes={pressChanged:!1,touchChanged:!1,valueChanged:!1,changed:!1},i._buttons=new Array(t.buttons.length),i.hand=t.hand,i}return Object(h.d)(t,e),t.prototype.onButtonStateChange=function(e){this._onButtonStateChange=e},Object.defineProperty(t.prototype,"defaultModel",{get:function(){return this._defaultModel},enumerable:!1,configurable:!0}),t.prototype.update=function(){e.prototype.update.call(this);for(var t=0;t<this._buttons.length;t++)this._setButtonValue(this.browserGamepad.buttons[t],this._buttons[t],t);this.leftStick.x===this.pad.x&&this.leftStick.y===this.pad.y||(this.pad.x=this.leftStick.x,this.pad.y=this.leftStick.y,this.onPadValuesChangedObservable.notifyObservers(this.pad))},t.prototype._setButtonValue=function(e,t,i){e||(e={pressed:!1,touched:!1,value:0}),t?(this._checkChanges(e,t),this._changes.changed&&(this._onButtonStateChange&&this._onButtonStateChange(this.index,i,e),this._handleButtonChange(i,e,this._changes)),this._buttons[i].pressed=e.pressed,this._buttons[i].touched=e.touched,this._buttons[i].value=e.value<1e-8?0:e.value):this._buttons[i]={pressed:e.pressed,touched:e.touched,value:e.value}},t.prototype._checkChanges=function(e,t){return this._changes.pressChanged=e.pressed!==t.pressed,this._changes.touchChanged=e.touched!==t.touched,this._changes.valueChanged=e.value!==t.value,this._changes.changed=this._changes.pressChanged||this._changes.touchChanged||this._changes.valueChanged,this._changes},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._defaultModel=null,this.onTriggerStateChangedObservable.clear(),this.onMainButtonStateChangedObservable.clear(),this.onSecondaryButtonStateChangedObservable.clear(),this.onPadStateChangedObservable.clear(),this.onPadValuesChangedObservable.clear()},t}(qt),Bi=i(42),Ui=i(30),Vi=i(62),ki=(i(108),i(59),i(109),"\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main(void)\n{\nvec4 result=texture2D(textureSampler,vUV);\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\n\nresult.rgb=toLinearSpace(result.rgb);\n#endif\nresult=applyImageProcessing(result);\n#else\n\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\ngl_FragColor=result;\n}");ai.a.ShadersStore.imageProcessingPixelShader=ki;var Gi=function(e){function t(t,i,n,r,o,a,s,c){void 0===n&&(n=null),void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT);var l=e.call(this,t,"imageProcessing",[],[],i,n,r,o,a,null,s,"postprocess",null,!0)||this;return l._fromLinearSpace=!0,l._defines={IMAGEPROCESSING:!1,VIGNETTE:!1,VIGNETTEBLENDMODEMULTIPLY:!1,VIGNETTEBLENDMODEOPAQUE:!1,TONEMAPPING:!1,TONEMAPPING_ACES:!1,CONTRAST:!1,COLORCURVES:!1,COLORGRADING:!1,COLORGRADING3D:!1,FROMLINEARSPACE:!1,SAMPLER3DGREENDEPTH:!1,SAMPLER3DBGRMAP:!1,IMAGEPROCESSINGPOSTPROCESS:!1,EXPOSURE:!1},c?(c.applyByPostProcess=!0,l._attachImageProcessingConfiguration(c,!0),l.fromLinearSpace=!1):(l._attachImageProcessingConfiguration(null,!0),l.imageProcessingConfiguration.applyByPostProcess=!0),l.onApply=function(e){l.imageProcessingConfiguration.bind(e,l.aspectRatio)},l}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){e.applyByPostProcess=!0,this._attachImageProcessingConfiguration(e)},enumerable:!1,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e,t){var i=this;if(void 0===t&&(t=!1),e!==this._imageProcessingConfiguration){if(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e)this._imageProcessingConfiguration=e;else{var n=null,r=this.getEngine(),o=this.getCamera();if(o)n=o.getScene();else if(r&&r.scenes){var a=r.scenes;n=a[a.length-1]}else n=x.a.LastCreatedScene;this._imageProcessingConfiguration=n?n.imageProcessingConfiguration:new Bi.a}this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(function(){i._updateParameters()})),t||this._updateParameters()}},Object.defineProperty(t.prototype,"isSupported",{get:function(){var e=this.getEffect();return!e||e.isSupported},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorCurves",{get:function(){return this.imageProcessingConfiguration.colorCurves},set:function(e){this.imageProcessingConfiguration.colorCurves=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorGradingTexture",{get:function(){return this.imageProcessingConfiguration.colorGradingTexture},set:function(e){this.imageProcessingConfiguration.colorGradingTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exposure",{get:function(){return this.imageProcessingConfiguration.exposure},set:function(e){this.imageProcessingConfiguration.exposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toneMappingType",{get:function(){return this._imageProcessingConfiguration.toneMappingType},set:function(e){this._imageProcessingConfiguration.toneMappingType=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contrast",{get:function(){return this.imageProcessingConfiguration.contrast},set:function(e){this.imageProcessingConfiguration.contrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteStretch",{get:function(){return this.imageProcessingConfiguration.vignetteStretch},set:function(e){this.imageProcessingConfiguration.vignetteStretch=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCentreX",{get:function(){return this.imageProcessingConfiguration.vignetteCentreX},set:function(e){this.imageProcessingConfiguration.vignetteCentreX=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCentreY",{get:function(){return this.imageProcessingConfiguration.vignetteCentreY},set:function(e){this.imageProcessingConfiguration.vignetteCentreY=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteWeight",{get:function(){return this.imageProcessingConfiguration.vignetteWeight},set:function(e){this.imageProcessingConfiguration.vignetteWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteColor",{get:function(){return this.imageProcessingConfiguration.vignetteColor},set:function(e){this.imageProcessingConfiguration.vignetteColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCameraFov",{get:function(){return this.imageProcessingConfiguration.vignetteCameraFov},set:function(e){this.imageProcessingConfiguration.vignetteCameraFov=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteBlendMode",{get:function(){return this.imageProcessingConfiguration.vignetteBlendMode},set:function(e){this.imageProcessingConfiguration.vignetteBlendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteEnabled",{get:function(){return this.imageProcessingConfiguration.vignetteEnabled},set:function(e){this.imageProcessingConfiguration.vignetteEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fromLinearSpace",{get:function(){return this._fromLinearSpace},set:function(e){this._fromLinearSpace!==e&&(this._fromLinearSpace=e,this._updateParameters())},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"ImageProcessingPostProcess"},t.prototype._updateParameters=function(){this._defines.FROMLINEARSPACE=this._fromLinearSpace,this.imageProcessingConfiguration.prepareDefines(this._defines,!0);var e="";for(var t in this._defines)this._defines[t]&&(e+="#define "+t+";\r\n");var i=["textureSampler"],n=["scale"];Bi.a&&(Bi.a.PrepareSamplers(i,this._defines),Bi.a.PrepareUniforms(n,this._defines)),this.updateEffect(e,n,i)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration&&(this.imageProcessingConfiguration.applyByPostProcess=!1)},Object(h.c)([Object(w.c)()],t.prototype,"_fromLinearSpace",void 0),t}(ci),zi=i(16),ji=i(4);be.a._GroundMeshParser=function(e,t){return Wi.Parse(e,t)};var Wi=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.generateOctree=!1,n}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"GroundMesh"},Object.defineProperty(t.prototype,"subdivisions",{get:function(){return Math.min(this._subdivisionsX,this._subdivisionsY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subdivisionsX",{get:function(){return this._subdivisionsX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subdivisionsY",{get:function(){return this._subdivisionsY},enumerable:!1,configurable:!0}),t.prototype.optimize=function(e,t){void 0===t&&(t=32),this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e),this.createOrUpdateSubmeshesOctree&&this.createOrUpdateSubmeshesOctree(t)},t.prototype.getHeightAtCoordinates=function(e,t){var i=this.getWorldMatrix(),n=a.c.Matrix[5];i.invertToRef(n);var r=a.c.Vector3[8];if(a.e.TransformCoordinatesFromFloatsToRef(e,0,t,n,r),e=r.x,t=r.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this.position.y;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());var o=this._getFacetAt(e,t),s=-(o.x*e+o.z*t+o.w)/o.y;return a.e.TransformCoordinatesFromFloatsToRef(0,s,0,i,r),r.y},t.prototype.getNormalAtCoordinates=function(e,t){var i=new a.e(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i},t.prototype.getNormalAtCoordinatesToRef=function(e,t,i){var n=this.getWorldMatrix(),r=a.c.Matrix[5];n.invertToRef(r);var o=a.c.Vector3[8];if(a.e.TransformCoordinatesFromFloatsToRef(e,0,t,r,o),e=o.x,t=o.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());var s=this._getFacetAt(e,t);return a.e.TransformNormalFromFloatsToRef(s.x,s.y,s.z,n,i),this},t.prototype.updateCoordinateHeights=function(){return this._heightQuads&&0!=this._heightQuads.length||this._initHeightQuads(),this._computeHeightQuads(),this},t.prototype._getFacetAt=function(e,t){var i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),n=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),r=this._heightQuads[n*this._subdivisionsX+i];return t<r.slope.x*e+r.slope.y?r.facet1:r.facet2},t.prototype._initHeightQuads=function(){var e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=new Array;for(var i=0;i<t;i++)for(var n=0;n<e;n++){var r={slope:a.d.Zero(),facet1:new a.f(0,0,0,0),facet2:new a.f(0,0,0,0)};this._heightQuads[i*e+n]=r}return this},t.prototype._computeHeightQuads=function(){var e=this.getVerticesData(ji.b.PositionKind);if(!e)return this;for(var t=a.c.Vector3[3],i=a.c.Vector3[2],n=a.c.Vector3[1],r=a.c.Vector3[0],o=a.c.Vector3[4],s=a.c.Vector3[5],c=a.c.Vector3[6],l=a.c.Vector3[7],u=a.c.Vector3[8],h=0,d=0,f=0,p=0,_=0,m=0,g=0,v=this._subdivisionsX,b=this._subdivisionsY,y=0;y<b;y++)for(var T=0;T<v;T++){h=3*T,d=y*(v+1)*3,f=(y+1)*(v+1)*3,t.x=e[d+h],t.y=e[d+h+1],t.z=e[d+h+2],i.x=e[d+h+3],i.y=e[d+h+4],i.z=e[d+h+5],n.x=e[f+h],n.y=e[f+h+1],n.z=e[f+h+2],r.x=e[f+h+3],r.y=e[f+h+4],r.z=e[f+h+5],p=(r.z-t.z)/(r.x-t.x),_=t.z-p*t.x,i.subtractToRef(t,o),n.subtractToRef(t,s),r.subtractToRef(t,c),a.e.CrossToRef(c,s,l),a.e.CrossToRef(o,c,u),l.normalize(),u.normalize(),m=-(l.x*t.x+l.y*t.y+l.z*t.z),g=-(u.x*i.x+u.y*i.y+u.z*i.z);var E=this._heightQuads[y*v+T];E.slope.copyFromFloats(p,_),E.facet1.copyFromFloats(l.x,l.y,l.z,m),E.facet2.copyFromFloats(u.x,u.y,u.z,g)}return this},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t),t.subdivisionsX=this._subdivisionsX,t.subdivisionsY=this._subdivisionsY,t.minX=this._minX,t.maxX=this._maxX,t.minZ=this._minZ,t.maxZ=this._maxZ,t.width=this._width,t.height=this._height},t.Parse=function(e,i){var n=new t(e.name,i);return n._subdivisionsX=e.subdivisionsX||1,n._subdivisionsY=e.subdivisionsY||1,n._minX=e.minX,n._maxX=e.maxX,n._minZ=e.minZ,n._maxZ=e.maxZ,n._width=e.width,n._height=e.height,n},t}(be.a),Hi=i(70);zi.a.CreateGround=function(e){var t,i,n=[],r=[],o=[],s=[],c=e.width||1,l=e.height||1,u=e.subdivisionsX||e.subdivisions||1,h=e.subdivisionsY||e.subdivisions||1;for(t=0;t<=h;t++)for(i=0;i<=u;i++){var d=new a.e(i*c/u-c/2,0,(h-t)*l/h-l/2),f=new a.e(0,1,0);r.push(d.x,d.y,d.z),o.push(f.x,f.y,f.z),s.push(i/u,1-t/h)}for(t=0;t<h;t++)for(i=0;i<u;i++)n.push(i+1+(t+1)*(u+1)),n.push(i+1+t*(u+1)),n.push(i+t*(u+1)),n.push(i+(t+1)*(u+1)),n.push(i+1+(t+1)*(u+1)),n.push(i+t*(u+1));var p=new zi.a;return p.indices=n,p.positions=r,p.normals=o,p.uvs=s,p},zi.a.CreateTiledGround=function(e){var t,i,n,r,o=void 0!==e.xmin&&null!==e.xmin?e.xmin:-1,s=void 0!==e.zmin&&null!==e.zmin?e.zmin:-1,c=void 0!==e.xmax&&null!==e.xmax?e.xmax:1,l=void 0!==e.zmax&&null!==e.zmax?e.zmax:1,u=e.subdivisions||{w:1,h:1},h=e.precision||{w:1,h:1},d=new Array,f=new Array,p=new Array,_=new Array;u.h=u.h<1?1:u.h,u.w=u.w<1?1:u.w,h.w=h.w<1?1:h.w,h.h=h.h<1?1:h.h;var m=(c-o)/u.w,g=(l-s)/u.h;function v(e,n,r,o){var s=f.length/3,c=h.w+1;for(t=0;t<h.h;t++)for(i=0;i<h.w;i++){var l=[s+i+t*c,s+(i+1)+t*c,s+(i+1)+(t+1)*c,s+i+(t+1)*c];d.push(l[1]),d.push(l[2]),d.push(l[3]),d.push(l[0]),d.push(l[1]),d.push(l[3])}var u=a.e.Zero(),m=new a.e(0,1,0);for(t=0;t<=h.h;t++)for(u.z=t*(o-n)/h.h+n,i=0;i<=h.w;i++)u.x=i*(r-e)/h.w+e,u.y=0,f.push(u.x,u.y,u.z),p.push(m.x,m.y,m.z),_.push(i/h.w,t/h.h)}for(n=0;n<u.h;n++)for(r=0;r<u.w;r++)v(o+r*m,s+n*g,o+(r+1)*m,s+(n+1)*g);var b=new zi.a;return b.indices=d,b.positions=f,b.normals=p,b.uvs=_,b},zi.a.CreateGroundFromHeightMap=function(e){var t,i,n=[],r=[],o=[],c=[],l=e.colorFilter||new s.a(.3,.59,.11),u=e.alphaFilter||0,h=!1;if(e.minHeight>e.maxHeight){h=!0;var d=e.maxHeight;e.maxHeight=e.minHeight,e.minHeight=d}for(t=0;t<=e.subdivisions;t++)for(i=0;i<=e.subdivisions;i++){var f=new a.e(i*e.width/e.subdivisions-e.width/2,0,(e.subdivisions-t)*e.height/e.subdivisions-e.height/2),p=4*(((f.x+e.width/2)/e.width*(e.bufferWidth-1)|0)+((1-(f.z+e.height/2)/e.height)*(e.bufferHeight-1)|0)*e.bufferWidth),_=e.buffer[p]/255,m=e.buffer[p+1]/255,g=e.buffer[p+2]/255,v=e.buffer[p+3]/255;h&&(_=1-_,m=1-m,g=1-g);var b=_*l.r+m*l.g+g*l.b;f.y=v>=u?e.minHeight+(e.maxHeight-e.minHeight)*b:e.minHeight-Nt.a,r.push(f.x,f.y,f.z),o.push(0,0,0),c.push(i/e.subdivisions,1-t/e.subdivisions)}for(t=0;t<e.subdivisions;t++)for(i=0;i<e.subdivisions;i++){var y=i+1+(t+1)*(e.subdivisions+1),T=i+1+t*(e.subdivisions+1),E=i+t*(e.subdivisions+1),S=i+(t+1)*(e.subdivisions+1),A=r[3*y+1]>=e.minHeight,P=r[3*T+1]>=e.minHeight,C=r[3*E+1]>=e.minHeight;A&&P&&C&&(n.push(y),n.push(T),n.push(E)),r[3*S+1]>=e.minHeight&&A&&C&&(n.push(S),n.push(y),n.push(E))}zi.a.ComputeNormals(r,n,o);var R=new zi.a;return R.indices=n,R.positions=r,R.normals=o,R.uvs=c,R},be.a.CreateGround=function(e,t,i,n,r,o){var a={width:t,height:i,subdivisions:n,updatable:o};return Xi.CreateGround(e,a,r)},be.a.CreateTiledGround=function(e,t,i,n,r,o,a,s,c){var l={xmin:t,zmin:i,xmax:n,zmax:r,subdivisions:o,precision:a,updatable:c};return Xi.CreateTiledGround(e,l,s)},be.a.CreateGroundFromHeightMap=function(e,t,i,n,r,o,a,s,c,l,u){var h={width:i,height:n,subdivisions:r,minHeight:o,maxHeight:a,updatable:c,onReady:l,alphaFilter:u};return Xi.CreateGroundFromHeightMap(e,t,h,s)};var Xi=function(){function e(){}return e.CreateGround=function(e,t,i){var n=new Wi(e,i);return n._setReady(!1),n._subdivisionsX=t.subdivisionsX||t.subdivisions||1,n._subdivisionsY=t.subdivisionsY||t.subdivisions||1,n._width=t.width||1,n._height=t.height||1,n._maxX=n._width/2,n._maxZ=n._height/2,n._minX=-n._maxX,n._minZ=-n._maxZ,zi.a.CreateGround(t).applyToMesh(n,t.updatable),n._setReady(!0),n},e.CreateTiledGround=function(e,t,i){void 0===i&&(i=null);var n=new be.a(e,i);return zi.a.CreateTiledGround(t).applyToMesh(n,t.updatable),n},e.CreateGroundFromHeightMap=function(e,t,i,n){void 0===n&&(n=null);var r=i.width||10,o=i.height||10,a=i.subdivisions||1,c=i.minHeight||0,l=i.maxHeight||1,u=i.colorFilter||new s.a(.3,.59,.11),h=i.alphaFilter||0,d=i.updatable,f=i.onReady;n=n||x.a.LastCreatedScene;var p=new Wi(e,n);return p._subdivisionsX=a,p._subdivisionsY=a,p._width=r,p._height=o,p._maxX=p._width/2,p._maxZ=p._height/2,p._minX=-p._maxX,p._minZ=-p._maxZ,p._setReady(!1),Ce.b.LoadImage(t,function(e){var t=e.width,i=e.height,s=Hi.a.CreateCanvas(t,i).getContext("2d");if(!s)throw new Error("Unable to get 2d context for CreateGroundFromHeightMap");if(!n.isDisposed){s.drawImage(e,0,0);var _=s.getImageData(0,0,t,i).data;zi.a.CreateGroundFromHeightMap({width:r,height:o,subdivisions:a,minHeight:c,maxHeight:l,colorFilter:u,buffer:_,bufferWidth:t,bufferHeight:i,alphaFilter:h}).applyToMesh(p,d),f&&f(p),p._setReady(!0)}},function(){},n.offlineProvider),p},e}();zi.a.CreateTorus=function(e){for(var t=[],i=[],n=[],r=[],o=e.diameter||1,s=e.thickness||.5,c=e.tessellation||16,l=0===e.sideOrientation?0:e.sideOrientation||zi.a.DEFAULTSIDE,u=c+1,h=0;h<=c;h++)for(var d=h/c,f=h*Math.PI*2/c-Math.PI/2,p=a.a.Translation(o/2,0,0).multiply(a.a.RotationY(f)),_=0;_<=c;_++){var m=1-_/c,g=_*Math.PI*2/c+Math.PI,v=Math.cos(g),b=Math.sin(g),y=new a.e(v,b,0),T=y.scale(s/2),E=new a.d(d,m);T=a.e.TransformCoordinates(T,p),y=a.e.TransformNormal(y,p),i.push(T.x,T.y,T.z),n.push(y.x,y.y,y.z),r.push(E.x,E.y);var S=(h+1)%u,A=(_+1)%u;t.push(h*u+_),t.push(h*u+A),t.push(S*u+_),t.push(h*u+A),t.push(S*u+A),t.push(S*u+_)}zi.a._ComputeSides(l,i,t,n,r,e.frontUVs,e.backUVs);var P=new zi.a;return P.indices=t,P.positions=i,P.normals=n,P.uvs=r,P},be.a.CreateTorus=function(e,t,i,n,r,o,a){var s={diameter:t,thickness:i,tessellation:n,sideOrientation:a,updatable:o};return Qi.CreateTorus(e,s,r)};var Yi,Ki,Qi=function(){function e(){}return e.CreateTorus=function(e,t,i){var n=new be.a(e,i);return t.sideOrientation=be.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,zi.a.CreateTorus(t).applyToMesh(n,t.updatable),n},e}(),qi=i(53),Zi=function(){function e(){}return e.GetDefaults=function(t){var i=new e;return i.canvasOptions={antialias:!0,depth:!0,stencil:!t||t.isStencilEnable,alpha:!0,multiview:!1,framebufferScaleFactor:1},i.newCanvasCssStyle="position:absolute; bottom:0px;right:0px;z-index:10;width:90%;height:100%;background-color: #000000;",i},e}(),Ji=function(){function e(e,t){var i=this;if(void 0===t&&(t=Zi.GetDefaults()),this._options=t,this._canvas=null,this.xrLayer=null,this.onXRLayerInitObservable=new o.c,this._engine=e.scene.getEngine(),t.canvasElement)this._setManagedOutputCanvas(t.canvasElement);else{var n=document.createElement("canvas");n.style.cssText=this._options.newCanvasCssStyle||"position:absolute; bottom:0px;right:0px;",this._setManagedOutputCanvas(n)}e.onXRSessionInit.add(function(){i._addCanvas()}),e.onXRSessionEnded.add(function(){i._removeCanvas()})}return e.prototype.dispose=function(){this._removeCanvas(),this._setManagedOutputCanvas(null)},e.prototype.initializeXRLayerAsync=function(e){var t=this,i=function(){var i=new XRWebGLLayer(e,t.canvasContext,t._options.canvasOptions);return t.onXRLayerInitObservable.notifyObservers(i),i};return this.canvasContext.makeXRCompatible?this.canvasContext.makeXRCompatible().then(function(){return t.xrLayer=i(),t.xrLayer}):(this.xrLayer=i(),Promise.resolve(this.xrLayer))},e.prototype._addCanvas=function(){var e=this;this._canvas&&this._canvas!==this._engine.getRenderingCanvas()&&document.body.appendChild(this._canvas),this.xrLayer?this._setCanvasSize(!0):this.onXRLayerInitObservable.addOnce(function(t){e._setCanvasSize(!0,t)})},e.prototype._removeCanvas=function(){this._canvas&&document.body.contains(this._canvas)&&this._canvas!==this._engine.getRenderingCanvas()&&document.body.removeChild(this._canvas),this._setCanvasSize(!1)},e.prototype._setCanvasSize=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=this.xrLayer),this._canvas&&(e?t&&(this._canvas!==this._engine.getRenderingCanvas()?(this._canvas.style.width=t.framebufferWidth+"px",this._canvas.style.height=t.framebufferHeight+"px"):this._engine.setSize(t.framebufferWidth,t.framebufferHeight)):this._originalCanvasSize&&(this._canvas!==this._engine.getRenderingCanvas()?(this._canvas.style.width=this._originalCanvasSize.width+"px",this._canvas.style.height=this._originalCanvasSize.height+"px"):this._engine.setSize(this._originalCanvasSize.width,this._originalCanvasSize.height)))},e.prototype._setManagedOutputCanvas=function(e){this._removeCanvas(),e?(this._originalCanvasSize={width:e.offsetWidth,height:e.offsetHeight},this._canvas=e,this.canvasContext=this._canvas.getContext("webgl2"),this.canvasContext||(this.canvasContext=this._canvas.getContext("webgl"))):(this._canvas=null,this.canvasContext=null)},e}(),$i=function(){function e(e){this.scene=e,this._sessionEnded=!1,this.baseLayer=null,this.currentTimestamp=-1,this.defaultHeightCompensation=1.7,this.onXRFrameObservable=new o.c,this.onXRReferenceSpaceChanged=new o.c,this.onXRSessionEnded=new o.c,this.onXRSessionInit=new o.c}return Object.defineProperty(e.prototype,"referenceSpace",{get:function(){return this._referenceSpace},set:function(e){this._referenceSpace=e,this.onXRReferenceSpaceChanged.notifyObservers(this._referenceSpace)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._sessionEnded||this.exitXRAsync(),this.onXRFrameObservable.clear(),this.onXRSessionEnded.clear(),this.onXRReferenceSpaceChanged.clear(),this.onXRSessionInit.clear()},e.prototype.exitXRAsync=function(){return this.session&&!this._sessionEnded?(this._sessionEnded=!0,this.session.end().catch(function(e){m.a.Warn("Could not end XR session.")})):Promise.resolve()},e.prototype.getRenderTargetTextureForEye=function(e){return this._rttProvider.getRenderTargetForEye(e)},e.prototype.getWebXRRenderTarget=function(e){var t=this.scene.getEngine();return this._xrNavigator.xr.native?this._xrNavigator.xr.getWebXRRenderTarget(t):((e=e||Zi.GetDefaults(t)).canvasElement=t.getRenderingCanvas()||void 0,new Ji(this,e))},e.prototype.initializeAsync=function(){return this._xrNavigator=navigator,this._xrNavigator.xr?Promise.resolve():Promise.reject("WebXR not available")},e.prototype.initializeSessionAsync=function(e,t){var i=this;return void 0===e&&(e="immersive-vr"),void 0===t&&(t={}),this._xrNavigator.xr.requestSession(e,t).then(function(e){return i.session=e,i.onXRSessionInit.notifyObservers(e),i._sessionEnded=!1,i.session.addEventListener("end",function(){var e=i.scene.getEngine();i._sessionEnded=!0,i._rttProvider=null,e.framebufferDimensionsObject=null,e.restoreDefaultFramebuffer(),e.customAnimationFrameRequester=null,i.onXRSessionEnded.notifyObservers(null),e._renderLoop()},{once:!0}),i.session})},e.prototype.isSessionSupportedAsync=function(t){return e.IsSessionSupportedAsync(t)},e.prototype.resetReferenceSpace=function(){this.referenceSpace=this.baseReferenceSpace},e.prototype.runXRRenderLoop=function(){var e=this,t=this.scene.getEngine();if(t.customAnimationFrameRequester={requestAnimationFrame:this.session.requestAnimationFrame.bind(this.session),renderFunction:function(i,n){e._sessionEnded||(e.currentFrame=n,e.currentTimestamp=i,n&&(t.framebufferDimensionsObject=e.baseLayer,e.onXRFrameObservable.notifyObservers(n),t._renderLoop(),t.framebufferDimensionsObject=null))}},this._xrNavigator.xr.native)this._rttProvider=this._xrNavigator.xr.getNativeRenderTargetProvider(this.session,this._createRenderTargetTexture.bind(this));else{var i=this._createRenderTargetTexture(this.baseLayer.framebufferWidth,this.baseLayer.framebufferHeight,this.baseLayer.framebuffer);this._rttProvider={getRenderTargetForEye:function(){return i}},t.framebufferDimensionsObject=this.baseLayer}"undefined"!=typeof window&&window.cancelAnimationFrame&&window.cancelAnimationFrame(t._frameHandler),t._renderLoop()},e.prototype.setReferenceSpaceTypeAsync=function(e){var t=this;return void 0===e&&(e="local-floor"),this.session.requestReferenceSpace(e).then(function(e){return e},function(e){return m.a.Error("XR.requestReferenceSpace failed for the following reason: "),m.a.Error(e),m.a.Log('Defaulting to universally-supported "viewer" reference space type.'),t.session.requestReferenceSpace("viewer").then(function(e){var i=new XRRigidTransform({x:0,y:-t.defaultHeightCompensation,z:0});return e.getOffsetReferenceSpace(i)},function(e){throw m.a.Error(e),'XR initialization failed: required "viewer" reference space type not supported.'})}).then(function(e){return t.session.requestReferenceSpace("viewer").then(function(i){return t.viewerReferenceSpace=i,e})}).then(function(e){return t.referenceSpace=t.baseReferenceSpace=e,t.referenceSpace})},e.prototype.updateRenderStateAsync=function(e){return e.baseLayer&&(this.baseLayer=e.baseLayer),this.session.updateRenderState(e)},e.IsSessionSupportedAsync=function(e){if(!navigator.xr)return Promise.resolve(!1);var t=navigator.xr.isSessionSupported||navigator.xr.supportsSession;return t?t.call(navigator.xr,e).then(function(e){var t=void 0===e||e;return Promise.resolve(t)}).catch(function(e){return m.a.Warn(e),Promise.resolve(!1)}):Promise.resolve(!1)},e.prototype._createRenderTargetTexture=function(e,t,i){void 0===i&&(i=null);var n=new Qe.a(this.scene.getEngine(),Qe.b.Unknown,!0);n.width=e,n.height=t,n._framebuffer=i;var r=new Ri("XR renderTargetTexture",{width:e,height:t},this.scene,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,!0);return r._texture=n,r},e}();!function(e){e[e.ENTERING_XR=0]="ENTERING_XR",e[e.EXITING_XR=1]="EXITING_XR",e[e.IN_XR=2]="IN_XR",e[e.NOT_IN_XR=3]="NOT_IN_XR"}(Yi||(Yi={})),function(e){e[e.NOT_TRACKING=0]="NOT_TRACKING",e[e.TRACKING_LOST=1]="TRACKING_LOST",e[e.TRACKING=2]="TRACKING"}(Ki||(Ki={}));var en,tn=function(){function e(t,i){if(void 0===i&&(i=null),this.scene=t,this._pointerDownOnMeshAsked=!1,this._isActionableMesh=!1,this._teleportationRequestInitiated=!1,this._teleportationBackRequestInitiated=!1,this._rotationRightAsked=!1,this._rotationLeftAsked=!1,this._dpadPressed=!0,this._activePointer=!1,this._id=e._idCounter++,i)this._gazeTracker=i.clone("gazeTracker");else{this._gazeTracker=be.a.CreateTorus("gazeTracker",.0035,.0025,20,t,!1),this._gazeTracker.bakeCurrentTransformIntoVertices(),this._gazeTracker.isPickable=!1,this._gazeTracker.isVisible=!1;var n=new Ui.a("targetMat",t);n.specularColor=s.a.Black(),n.emissiveColor=new s.a(.7,.7,.7),n.backFaceCulling=!1,this._gazeTracker.material=n}}return e.prototype._getForwardRay=function(e){return new Xt.a(a.e.Zero(),new a.e(0,0,e))},e.prototype._selectionPointerDown=function(){this._pointerDownOnMeshAsked=!0,this._currentHit&&this.scene.simulatePointerDown(this._currentHit,{pointerId:this._id})},e.prototype._selectionPointerUp=function(){this._currentHit&&this.scene.simulatePointerUp(this._currentHit,{pointerId:this._id}),this._pointerDownOnMeshAsked=!1},e.prototype._activatePointer=function(){this._activePointer=!0},e.prototype._deactivatePointer=function(){this._activePointer=!1},e.prototype._updatePointerDistance=function(e){void 0===e&&(e=100)},e.prototype.dispose=function(){this._interactionsEnabled=!1,this._teleportationEnabled=!1,this._gazeTracker&&this._gazeTracker.dispose()},e._idCounter=0,e}(),nn=function(e){function t(t,i,n){var r=e.call(this,i,n)||this;r.webVRController=t,r._laserPointer=be.a.CreateCylinder("laserPointer",1,.004,2e-4,20,1,i,!1);var o=new Ui.a("laserPointerMat",i);if(o.emissiveColor=new s.a(.7,.7,.7),o.alpha=.6,r._laserPointer.material=o,r._laserPointer.rotation.x=Math.PI/2,r._laserPointer.position.z=-.5,r._laserPointer.isVisible=!1,r._laserPointer.isPickable=!1,!t.mesh){var a=new be.a("preloadControllerMesh",i),c=new be.a(qt.POINTING_POSE,i);c.rotation.x=-.7,a.addChild(c),t.attachToMesh(a)}return r._setLaserPointerParent(t.mesh),r._meshAttachedObserver=t._meshAttachedObservable.add(function(e){r._setLaserPointerParent(e)}),r}return Object(h.d)(t,e),t.prototype._getForwardRay=function(e){return this.webVRController.getForwardRay(e)},t.prototype._activatePointer=function(){e.prototype._activatePointer.call(this),this._laserPointer.isVisible=!0},t.prototype._deactivatePointer=function(){e.prototype._deactivatePointer.call(this),this._laserPointer.isVisible=!1},t.prototype._setLaserPointerColor=function(e){this._laserPointer.material.emissiveColor=e},t.prototype._setLaserPointerLightingDisabled=function(e){this._laserPointer.material.disableLighting=e},t.prototype._setLaserPointerParent=function(e){var t=function(e){e.isPickable=!1,e.getChildMeshes().forEach(function(e){t(e)})};t(e);var i=e.getChildren(void 0,!1),n=e;this.webVRController._pointingPoseNode=null;for(var r=0;r<i.length;r++)if(i[r].name&&i[r].name.indexOf(qt.POINTING_POSE)>=0){n=i[r],this.webVRController._pointingPoseNode=n;break}this._laserPointer.parent=n},t.prototype._updatePointerDistance=function(e){void 0===e&&(e=100),this._laserPointer.scaling.y=e,this._laserPointer.position.z=-e/2},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._laserPointer.dispose(),this._meshAttachedObserver&&this.webVRController._meshAttachedObservable.remove(this._meshAttachedObserver)},t}(tn),rn=function(e){function t(t,i){var n=e.call(this,i)||this;return n.getCamera=t,n}return Object(h.d)(t,e),t.prototype._getForwardRay=function(e){var t=this.getCamera();return t?t.getForwardRay(e):new Xt.a(a.e.Zero(),a.e.Forward())},t}(tn),on=function(){},an=function(){function e(t,i){var n=this;if(void 0===i&&(i={}),this.webVROptions=i,this._webVRsupported=!1,this._webVRready=!1,this._webVRrequesting=!1,this._webVRpresenting=!1,this._fullscreenVRpresenting=!1,this.enableGazeEvenWhenNoPointerLock=!1,this.exitVROnDoubleTap=!0,this.onEnteringVRObservable=new o.c,this.onAfterEnteringVRObservable=new o.c,this.onExitingVRObservable=new o.c,this.onControllerMeshLoadedObservable=new o.c,this._useCustomVRButton=!1,this._teleportationRequested=!1,this._teleportActive=!1,this._floorMeshesCollection=[],this._teleportationMode=e.TELEPORTATIONMODE_CONSTANTTIME,this._teleportationTime=122,this._teleportationSpeed=20,this._rotationAllowed=!0,this._teleportBackwardsVector=new a.e(0,-1,-1),this._isDefaultTeleportationTarget=!0,this._teleportationFillColor="#444444",this._teleportationBorderColor="#FFFFFF",this._rotationAngle=0,this._haloCenter=new a.e(0,0,0),this._padSensibilityUp=.65,this._padSensibilityDown=.35,this._leftController=null,this._rightController=null,this._gazeColor=new s.a(.7,.7,.7),this._laserColor=new s.a(.7,.7,.7),this._pickedLaserColor=new s.a(.2,.2,1),this._pickedGazeColor=new s.a(0,0,1),this.onNewMeshSelected=new o.c,this.onMeshSelectedWithController=new o.c,this.onNewMeshPicked=new o.c,this.onBeforeCameraTeleport=new o.c,this.onAfterCameraTeleport=new o.c,this.onSelectedMeshUnselected=new o.c,this.teleportationEnabled=!0,this._teleportationInitialized=!1,this._interactionsEnabled=!1,this._interactionsRequested=!1,this._displayGaze=!0,this._displayLaserPointer=!0,this.updateGazeTrackerScale=!0,this.updateGazeTrackerColor=!0,this.updateControllerLaserColor=!0,this.requestPointerLockOnFullScreen=!0,this.xrTestDone=!1,this._onResize=function(){n.moveButtonToBottomRight(),n._fullscreenVRpresenting&&n._webVRready&&n.exitVR()},this._onFullscreenChange=function(){var e=document;void 0!==e.fullscreen?n._fullscreenVRpresenting=document.fullscreen:void 0!==e.mozFullScreen?n._fullscreenVRpresenting=e.mozFullScreen:void 0!==e.webkitIsFullScreen?n._fullscreenVRpresenting=e.webkitIsFullScreen:void 0!==e.msIsFullScreen?n._fullscreenVRpresenting=e.msIsFullScreen:void 0!==document.msFullscreenElement&&(n._fullscreenVRpresenting=document.msFullscreenElement),!n._fullscreenVRpresenting&&n._inputElement&&(n.exitVR(),!n._useCustomVRButton&&n._btnVR&&(n._btnVR.style.top=n._inputElement.offsetTop+n._inputElement.offsetHeight-70+"px",n._btnVR.style.left=n._inputElement.offsetLeft+n._inputElement.offsetWidth-100+"px",n.updateButtonVisibility()))},this._cachedAngularSensibility={angularSensibilityX:null,angularSensibilityY:null,angularSensibility:null},this.beforeRender=function(){n._leftController&&n._leftController._activePointer&&n._castRayAndSelectObject(n._leftController),n._rightController&&n._rightController._activePointer&&n._castRayAndSelectObject(n._rightController),n._noControllerIsActive&&(n._scene.getEngine().isPointerLock||n.enableGazeEvenWhenNoPointerLock)?n._castRayAndSelectObject(n._cameraGazer):n._cameraGazer._gazeTracker.isVisible=!1},this._onNewGamepadConnected=function(e){if(e.type!==ot.POSE_ENABLED)e.leftStick&&e.onleftstickchanged(function(e){n._teleportationInitialized&&n.teleportationEnabled&&(!n._leftController&&!n._rightController||n._leftController&&!n._leftController._activePointer&&n._rightController&&!n._rightController._activePointer)&&(n._checkTeleportWithRay(e,n._cameraGazer),n._checkTeleportBackwards(e,n._cameraGazer))}),e.rightStick&&e.onrightstickchanged(function(e){n._teleportationInitialized&&n._checkRotate(e,n._cameraGazer)}),e.type===ot.XBOX&&(e.onbuttondown(function(e){n._interactionsEnabled&&e===Yt.A&&n._cameraGazer._selectionPointerDown()}),e.onbuttonup(function(e){n._interactionsEnabled&&e===Yt.A&&n._cameraGazer._selectionPointerUp()}));else{var t=e,i=new nn(t,n._scene,n._cameraGazer._gazeTracker);"right"===t.hand||n._leftController&&n._leftController.webVRController!=t?n._rightController=i:n._leftController=i,n._tryEnableInteractionOnController(i)}},this._tryEnableInteractionOnController=function(e){n._interactionsRequested&&!e._interactionsEnabled&&n._enableInteractionOnController(e),n._teleportationRequested&&!e._teleportationEnabled&&n._enableTeleportationOnController(e)},this._onNewGamepadDisconnected=function(e){e instanceof Fi&&("left"===e.hand&&null!=n._leftController&&(n._leftController.dispose(),n._leftController=null),"right"===e.hand&&null!=n._rightController&&(n._rightController.dispose(),n._rightController=null))},this._workingVector=a.e.Zero(),this._workingQuaternion=a.b.Identity(),this._workingMatrix=a.a.Identity(),this._scene=t,this._inputElement=t.getEngine().getInputElement(),"getVRDisplays"in navigator||(i.useXR=!0),void 0===i.createFallbackVRDeviceOrientationFreeCamera&&(i.createFallbackVRDeviceOrientationFreeCamera=!0),void 0===i.createDeviceOrientationCamera&&(i.createDeviceOrientationCamera=!0),void 0===i.laserToggle&&(i.laserToggle=!0),void 0===i.defaultHeight&&(i.defaultHeight=1.7),i.useCustomVRButton&&(this._useCustomVRButton=!0,i.customVRButton&&(this._btnVR=i.customVRButton)),i.rayLength&&(this._rayLength=i.rayLength),this._defaultHeight=i.defaultHeight,i.positionScale&&(this._rayLength*=i.positionScale,this._defaultHeight*=i.positionScale),this._hasEnteredVR=!1,this._scene.activeCamera?this._position=this._scene.activeCamera.position.clone():this._position=new a.e(0,this._defaultHeight,0),i.createDeviceOrientationCamera||!this._scene.activeCamera){if(this._deviceOrientationCamera=new Ut("deviceOrientationVRHelper",this._position.clone(),t),this._scene.activeCamera&&(this._deviceOrientationCamera.minZ=this._scene.activeCamera.minZ,this._deviceOrientationCamera.maxZ=this._scene.activeCamera.maxZ,this._scene.activeCamera instanceof Lt&&this._scene.activeCamera.rotation)){var r=this._scene.activeCamera;r.rotationQuaternion?this._deviceOrientationCamera.rotationQuaternion.copyFrom(r.rotationQuaternion):this._deviceOrientationCamera.rotationQuaternion.copyFrom(a.b.RotationYawPitchRoll(r.rotation.y,r.rotation.x,r.rotation.z)),this._deviceOrientationCamera.rotation=r.rotation.clone()}this._scene.activeCamera=this._deviceOrientationCamera,this._inputElement&&this._scene.activeCamera.attachControl()}else this._existingCamera=this._scene.activeCamera;this.webVROptions.useXR&&navigator.xr?$i.IsSessionSupportedAsync("immersive-vr").then(function(e){e?(m.a.Log("Using WebXR. It is recommended to use the WebXRDefaultExperience directly"),t.createDefaultXRExperienceAsync({floorMeshes:i.floorMeshes||[]}).then(function(e){n.xr=e,n.xrTestDone=!0,n._cameraGazer=new rn(function(){return n.xr.baseExperience.camera},t),n.xr.baseExperience.onStateChangedObservable.add(function(e){switch(e){case Yi.ENTERING_XR:n.onEnteringVRObservable.notifyObservers(n),n._interactionsEnabled||n.xr.pointerSelection.detach(),n.xr.pointerSelection.displayLaserPointer=n._displayLaserPointer;break;case Yi.EXITING_XR:n.onExitingVRObservable.notifyObservers(n),n._scene.getEngine().resize();break;case Yi.IN_XR:n._hasEnteredVR=!0;break;case Yi.NOT_IN_XR:n._hasEnteredVR=!1}})})):n.completeVRInit(t,i)}):this.completeVRInit(t,i)}return Object.defineProperty(e.prototype,"onEnteringVR",{get:function(){return this.onEnteringVRObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onExitingVR",{get:function(){return this.onExitingVRObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onControllerMeshLoaded",{get:function(){return this.onControllerMeshLoadedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"teleportationTarget",{get:function(){return this._teleportationTarget},set:function(e){e&&(e.name="teleportationTarget",this._isDefaultTeleportationTarget=!1,this._teleportationTarget=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gazeTrackerMesh",{get:function(){return this._cameraGazer._gazeTracker},set:function(e){e&&(this._cameraGazer._gazeTracker&&this._cameraGazer._gazeTracker.dispose(),this._leftController&&this._leftController._gazeTracker&&this._leftController._gazeTracker.dispose(),this._rightController&&this._rightController._gazeTracker&&this._rightController._gazeTracker.dispose(),this._cameraGazer._gazeTracker=e,this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(),this._cameraGazer._gazeTracker.isPickable=!1,this._cameraGazer._gazeTracker.isVisible=!1,this._cameraGazer._gazeTracker.name="gazeTracker",this._leftController&&(this._leftController._gazeTracker=this._cameraGazer._gazeTracker.clone("gazeTracker")),this._rightController&&(this._rightController._gazeTracker=this._cameraGazer._gazeTracker.clone("gazeTracker")))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftControllerGazeTrackerMesh",{get:function(){return this._leftController?this._leftController._gazeTracker:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightControllerGazeTrackerMesh",{get:function(){return this._rightController?this._rightController._gazeTracker:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayGaze",{get:function(){return this._displayGaze},set:function(e){this._displayGaze=e,e||(this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayLaserPointer",{get:function(){return this._displayLaserPointer},set:function(e){this._displayLaserPointer=e,e?(this._rightController&&this._rightController._activatePointer(),this._leftController&&this._leftController._activatePointer()):(this._rightController&&(this._rightController._deactivatePointer(),this._rightController._gazeTracker.isVisible=!1),this._leftController&&(this._leftController._deactivatePointer(),this._leftController._gazeTracker.isVisible=!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceOrientationCamera",{get:function(){return this._deviceOrientationCamera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentVRCamera",{get:function(){return this._webVRready?this._webVRCamera:this._scene.activeCamera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"webVRCamera",{get:function(){return this._webVRCamera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vrDeviceOrientationCamera",{get:function(){return this._vrDeviceOrientationCamera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vrButton",{get:function(){return this._btnVR},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_teleportationRequestInitiated",{get:function(){return this._cameraGazer._teleportationRequestInitiated||null!==this._leftController&&this._leftController._teleportationRequestInitiated||null!==this._rightController&&this._rightController._teleportationRequestInitiated},enumerable:!1,configurable:!0}),e.prototype.completeVRInit=function(e,t){var i=this;if(this.xrTestDone=!0,t.createFallbackVRDeviceOrientationFreeCamera&&(t.useMultiview&&(t.vrDeviceOrientationCameraMetrics||(t.vrDeviceOrientationCameraMetrics=Ei.GetDefault()),t.vrDeviceOrientationCameraMetrics.multiviewEnabled=!0),this._vrDeviceOrientationCamera=new Di("VRDeviceOrientationVRHelper",this._position,this._scene,!0,t.vrDeviceOrientationCameraMetrics),this._vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._webVRCamera=new wi("WebVRHelper",this._position,this._scene,t),this._webVRCamera.useStandingMatrix(),this._cameraGazer=new rn(function(){return i.currentVRCamera},e),!this._useCustomVRButton){this._btnVR=document.createElement("BUTTON"),this._btnVR.className="babylonVRicon",this._btnVR.id="babylonVRiconbtn",this._btnVR.title="Click to switch to VR";var n=".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A":"https://cdn.babylonjs.com/Assets/vrButton.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";n+=".babylonVRicon.vrdisplaypresenting { display: none; }";var r=document.createElement("style");r.appendChild(document.createTextNode(n)),document.getElementsByTagName("head")[0].appendChild(r),this.moveButtonToBottomRight()}this._btnVR&&this._btnVR.addEventListener("click",function(){i.isInVRMode?i._scene.getEngine().disableVR():i.enterVR()});var o=this._scene.getEngine().getHostWindow();o&&(o.addEventListener("resize",this._onResize),document.addEventListener("fullscreenchange",this._onFullscreenChange,!1),document.addEventListener("mozfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("msfullscreenchange",this._onFullscreenChange,!1),document.onmsfullscreenchange=this._onFullscreenChange,t.createFallbackVRDeviceOrientationFreeCamera?this.displayVRButton():this._scene.getEngine().onVRDisplayChangedObservable.add(function(e){e.vrDisplay&&i.displayVRButton()}),this._onKeyDown=function(e){27===e.keyCode&&i.isInVRMode&&i.exitVR()},document.addEventListener("keydown",this._onKeyDown),this._scene.onPrePointerObservable.add(function(){i._hasEnteredVR&&i.exitVROnDoubleTap&&(i.exitVR(),i._fullscreenVRpresenting&&i._scene.getEngine().exitFullscreen())},Ne.a.POINTERDOUBLETAP,!1),this._onVRDisplayChanged=function(e){return i.onVRDisplayChanged(e)},this._onVrDisplayPresentChange=function(){return i.onVrDisplayPresentChange()},this._onVRRequestPresentStart=function(){i._webVRrequesting=!0,i.updateButtonVisibility()},this._onVRRequestPresentComplete=function(){i._webVRrequesting=!1,i.updateButtonVisibility()},e.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChanged),e.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart),e.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete),o.addEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),e.onDisposeObservable.add(function(){i.dispose()}),this._webVRCamera.onControllerMeshLoadedObservable.add(function(e){return i._onDefaultMeshLoaded(e)}),this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected),this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected),this.updateButtonVisibility(),this._circleEase=new ae,this._circleEase.setEasingMode(oe.EASINGMODE_EASEINOUT),this._teleportationEasing=this._circleEase,e.onPointerObservable.add(function(t){i._interactionsEnabled&&e.activeCamera===i.vrDeviceOrientationCamera&&"mouse"===t.event.pointerType&&(t.type===Ne.a.POINTERDOWN?i._cameraGazer._selectionPointerDown():t.type===Ne.a.POINTERUP&&i._cameraGazer._selectionPointerUp())}),this.webVROptions.floorMeshes&&this.enableTeleportation({floorMeshes:this.webVROptions.floorMeshes}))},e.prototype._onDefaultMeshLoaded=function(e){this._leftController&&this._leftController.webVRController==e&&e.mesh&&this._leftController._setLaserPointerParent(e.mesh),this._rightController&&this._rightController.webVRController==e&&e.mesh&&this._rightController._setLaserPointerParent(e.mesh);try{this.onControllerMeshLoadedObservable.notifyObservers(e)}catch(e){m.a.Warn("Error in your custom logic onControllerMeshLoaded: "+e)}},Object.defineProperty(e.prototype,"isInVRMode",{get:function(){return this.xr&&this.webVROptions.useXR&&this.xr.baseExperience.state===Yi.IN_XR||this._webVRpresenting||this._fullscreenVRpresenting},enumerable:!1,configurable:!0}),e.prototype.onVrDisplayPresentChange=function(){var e=this._scene.getEngine().getVRDevice();if(e){var t=this._webVRpresenting;this._webVRpresenting=e.isPresenting,t&&!this._webVRpresenting&&this.exitVR()}else m.a.Warn("Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?");this.updateButtonVisibility()},e.prototype.onVRDisplayChanged=function(e){this._webVRsupported=e.vrSupported,this._webVRready=!!e.vrDisplay,this._webVRpresenting=e.vrDisplay&&e.vrDisplay.isPresenting,this.updateButtonVisibility()},e.prototype.moveButtonToBottomRight=function(){if(this._inputElement&&!this._useCustomVRButton&&this._btnVR){var e=this._inputElement.getBoundingClientRect();this._btnVR.style.top=e.top+e.height-70+"px",this._btnVR.style.left=e.left+e.width-100+"px"}},e.prototype.displayVRButton=function(){this._useCustomVRButton||this._btnVRDisplayed||!this._btnVR||(document.body.appendChild(this._btnVR),this._btnVRDisplayed=!0)},e.prototype.updateButtonVisibility=function(){this._btnVR&&!this._useCustomVRButton&&(this._btnVR.className="babylonVRicon",this.isInVRMode?this._btnVR.className+=" vrdisplaypresenting":(this._webVRready&&(this._btnVR.className+=" vrdisplayready"),this._webVRsupported&&(this._btnVR.className+=" vrdisplaysupported"),this._webVRrequesting&&(this._btnVR.className+=" vrdisplayrequesting")))},e.prototype.enterVR=function(){var e=this;if(this.xr)this.xr.baseExperience.enterXRAsync("immersive-vr","local-floor",this.xr.renderTarget);else{if(this.onEnteringVRObservable)try{this.onEnteringVRObservable.notifyObservers(this)}catch(e){m.a.Warn("Error in your custom logic onEnteringVR: "+e)}if(this._scene.activeCamera){if(this._position=this._scene.activeCamera.position.clone(),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.rotation=a.b.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(),this.vrDeviceOrientationCamera.angularSensibility=2e3),this.webVRCamera){var t=this.webVRCamera.deviceRotationQuaternion.toEulerAngles().y,i=a.b.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles().y-t,n=this.webVRCamera.rotationQuaternion.toEulerAngles().y;this.webVRCamera.rotationQuaternion=a.b.FromEulerAngles(0,n+i,0)}this._existingCamera=this._scene.activeCamera,this._existingCamera.angularSensibilityX&&(this._cachedAngularSensibility.angularSensibilityX=this._existingCamera.angularSensibilityX,this._existingCamera.angularSensibilityX=Number.MAX_VALUE),this._existingCamera.angularSensibilityY&&(this._cachedAngularSensibility.angularSensibilityY=this._existingCamera.angularSensibilityY,this._existingCamera.angularSensibilityY=Number.MAX_VALUE),this._existingCamera.angularSensibility&&(this._cachedAngularSensibility.angularSensibility=this._existingCamera.angularSensibility,this._existingCamera.angularSensibility=Number.MAX_VALUE)}this._webVRrequesting||(this._webVRready?this._webVRpresenting||(this._scene.getEngine().onVRRequestPresentComplete.addOnce(function(t){e.onAfterEnteringVRObservable.notifyObservers({success:t})}),this._webVRCamera.position=this._position,this._scene.activeCamera=this._webVRCamera):this._vrDeviceOrientationCamera&&(this._vrDeviceOrientationCamera.position=this._position,this._scene.activeCamera&&(this._vrDeviceOrientationCamera.minZ=this._scene.activeCamera.minZ),this._scene.activeCamera=this._vrDeviceOrientationCamera,this._scene.getEngine().enterFullscreen(this.requestPointerLockOnFullScreen),this.updateButtonVisibility(),this._vrDeviceOrientationCamera.onViewMatrixChangedObservable.addOnce(function(){e.onAfterEnteringVRObservable.notifyObservers({success:!0})})),this._scene.activeCamera&&this._inputElement&&this._scene.activeCamera.attachControl(),this._interactionsEnabled&&this._scene.registerBeforeRender(this.beforeRender),this._displayLaserPointer&&[this._leftController,this._rightController].forEach(function(e){e&&e._activatePointer()}),this._hasEnteredVR=!0)}},e.prototype.exitVR=function(){if(this.xr)this.xr.baseExperience.exitXRAsync();else if(this._hasEnteredVR){if(this.onExitingVRObservable)try{this.onExitingVRObservable.notifyObservers(this)}catch(e){m.a.Warn("Error in your custom logic onExitingVR: "+e)}this._webVRpresenting&&this._scene.getEngine().disableVR(),this._scene.activeCamera&&(this._position=this._scene.activeCamera.position.clone()),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._deviceOrientationCamera?(this._deviceOrientationCamera.position=this._position,this._scene.activeCamera=this._deviceOrientationCamera,this._cachedAngularSensibility.angularSensibilityX&&(this._deviceOrientationCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._deviceOrientationCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._deviceOrientationCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)):this._existingCamera&&(this._existingCamera.position=this._position,this._scene.activeCamera=this._existingCamera,this._inputElement&&this._scene.activeCamera.attachControl(),this._cachedAngularSensibility.angularSensibilityX&&(this._existingCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._existingCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._existingCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)),this.updateButtonVisibility(),this._interactionsEnabled&&(this._scene.unregisterBeforeRender(this.beforeRender),this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1)),this._scene.getEngine().resize(),[this._leftController,this._rightController].forEach(function(e){e&&e._deactivatePointer()}),this._hasEnteredVR=!1;var e=this._scene.getEngine();e._onVrDisplayPresentChange&&e._onVrDisplayPresentChange()}},Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._scene.activeCamera&&(this._scene.activeCamera.position=e)},enumerable:!1,configurable:!0}),e.prototype.enableInteractions=function(){var e=this;if(!this._interactionsEnabled){if(this._interactionsRequested=!0,this.xr)return void(this.xr.baseExperience.state===Yi.IN_XR&&this.xr.pointerSelection.attach());this._leftController&&this._enableInteractionOnController(this._leftController),this._rightController&&this._enableInteractionOnController(this._rightController),this.raySelectionPredicate=function(t){return t.isVisible&&(t.isPickable||t.name===e._floorMeshName)},this.meshSelectionPredicate=function(){return!0},this._raySelectionPredicate=function(t){return!!(e._isTeleportationFloor(t)||-1===t.name.indexOf("gazeTracker")&&-1===t.name.indexOf("teleportationTarget")&&-1===t.name.indexOf("torusTeleportation"))&&e.raySelectionPredicate(t)},this._interactionsEnabled=!0}},Object.defineProperty(e.prototype,"_noControllerIsActive",{get:function(){return!(this._leftController&&this._leftController._activePointer||this._rightController&&this._rightController._activePointer)},enumerable:!1,configurable:!0}),e.prototype._isTeleportationFloor=function(e){for(var t=0;t<this._floorMeshesCollection.length;t++)if(this._floorMeshesCollection[t].id===e.id)return!0;return!(!this._floorMeshName||e.name!==this._floorMeshName)},e.prototype.addFloorMesh=function(e){this._floorMeshesCollection&&(this._floorMeshesCollection.indexOf(e)>-1||this._floorMeshesCollection.push(e))},e.prototype.removeFloorMesh=function(e){if(this._floorMeshesCollection){var t=this._floorMeshesCollection.indexOf(e);-1!==t&&this._floorMeshesCollection.splice(t,1)}},e.prototype.enableTeleportation=function(e){var t=this;if(void 0===e&&(e={}),!this._teleportationInitialized){if(this._teleportationRequested=!0,this.enableInteractions(),this.webVROptions.useXR&&(e.floorMeshes||e.floorMeshName)){var i=e.floorMeshes||[];if(!i.length){var n=this._scene.getMeshByName(e.floorMeshName);n&&i.push(n)}if(this.xr)return i.forEach(function(e){t.xr.teleportation.addFloorMesh(e)}),void(this.xr.teleportation.attached||this.xr.teleportation.attach());if(!this.xrTestDone){var r=function(){t.xrTestDone&&(t._scene.unregisterBeforeRender(r),t.xr?t.xr.teleportation.attached||t.xr.teleportation.attach():t.enableTeleportation(e))};return void this._scene.registerBeforeRender(r)}}e.floorMeshName&&(this._floorMeshName=e.floorMeshName),e.floorMeshes&&(this._floorMeshesCollection=e.floorMeshes),e.teleportationMode&&(this._teleportationMode=e.teleportationMode),e.teleportationTime&&e.teleportationTime>0&&(this._teleportationTime=e.teleportationTime),e.teleportationSpeed&&e.teleportationSpeed>0&&(this._teleportationSpeed=e.teleportationSpeed),void 0!==e.easingFunction&&(this._teleportationEasing=e.easingFunction),null!=this._leftController&&this._enableTeleportationOnController(this._leftController),null!=this._rightController&&this._enableTeleportationOnController(this._rightController);var o=new Bi.a;o.vignetteColor=new s.b(0,0,0,0),o.vignetteEnabled=!0,this._postProcessMove=new Gi("postProcessMove",1,this._webVRCamera,void 0,void 0,void 0,void 0,o),this._webVRCamera.detachPostProcess(this._postProcessMove),this._teleportationInitialized=!0,this._isDefaultTeleportationTarget&&(this._createTeleportationCircles(),this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor))}},e.prototype._enableInteractionOnController=function(e){var t=this;e.webVRController.mesh&&(e._interactionsEnabled=!0,this.isInVRMode&&this._displayLaserPointer&&e._activatePointer(),this.webVROptions.laserToggle&&e.webVRController.onMainButtonStateChangedObservable.add(function(i){t._displayLaserPointer&&1===i.value&&(e._activePointer?e._deactivatePointer():e._activatePointer(),t.displayGaze&&(e._gazeTracker.isVisible=e._activePointer))}),e.webVRController.onTriggerStateChangedObservable.add(function(i){var n=e;t._noControllerIsActive&&(n=t._cameraGazer),n._pointerDownOnMeshAsked?i.value<t._padSensibilityDown&&n._selectionPointerUp():i.value>t._padSensibilityUp&&n._selectionPointerDown()}))},e.prototype._checkTeleportWithRay=function(e,t){this._teleportationRequestInitiated&&!t._teleportationRequestInitiated||(t._teleportationRequestInitiated?Math.sqrt(e.y*e.y+e.x*e.x)<this._padSensibilityDown&&(this._teleportActive&&this.teleportCamera(this._haloCenter),t._teleportationRequestInitiated=!1):e.y<-this._padSensibilityUp&&t._dpadPressed&&(t._activatePointer(),t._teleportationRequestInitiated=!0))},e.prototype._checkRotate=function(e,t){t._teleportationRequestInitiated||(t._rotationLeftAsked?e.x>-this._padSensibilityDown&&(t._rotationLeftAsked=!1):e.x<-this._padSensibilityUp&&t._dpadPressed&&(t._rotationLeftAsked=!0,this._rotationAllowed&&this._rotateCamera(!1)),t._rotationRightAsked?e.x<this._padSensibilityDown&&(t._rotationRightAsked=!1):e.x>this._padSensibilityUp&&t._dpadPressed&&(t._rotationRightAsked=!0,this._rotationAllowed&&this._rotateCamera(!0)))},e.prototype._checkTeleportBackwards=function(e,t){if(!t._teleportationRequestInitiated)if(e.y>this._padSensibilityUp&&t._dpadPressed){if(!t._teleportationBackRequestInitiated){if(!this.currentVRCamera)return;var i=a.b.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()),n=this.currentVRCamera.position;this.currentVRCamera.devicePosition&&this.currentVRCamera.deviceRotationQuaternion&&(i=this.currentVRCamera.deviceRotationQuaternion,n=this.currentVRCamera.devicePosition),i.toEulerAnglesToRef(this._workingVector),this._workingVector.z=0,this._workingVector.x=0,a.b.RotationYawPitchRollToRef(this._workingVector.y,this._workingVector.x,this._workingVector.z,this._workingQuaternion),this._workingQuaternion.toRotationMatrix(this._workingMatrix),a.e.TransformCoordinatesToRef(this._teleportBackwardsVector,this._workingMatrix,this._workingVector);var r=new Xt.a(n,this._workingVector),o=this._scene.pickWithRay(r,this._raySelectionPredicate);o&&o.pickedPoint&&o.pickedMesh&&this._isTeleportationFloor(o.pickedMesh)&&o.distance<5&&this.teleportCamera(o.pickedPoint),t._teleportationBackRequestInitiated=!0}}else t._teleportationBackRequestInitiated=!1},e.prototype._enableTeleportationOnController=function(e){var t=this;e.webVRController.mesh&&(e._interactionsEnabled||this._enableInteractionOnController(e),e._interactionsEnabled=!0,e._teleportationEnabled=!0,e.webVRController.controllerType===zt.VIVE&&(e._dpadPressed=!1,e.webVRController.onPadStateChangedObservable.add(function(t){e._dpadPressed=t.pressed,e._dpadPressed||(e._rotationLeftAsked=!1,e._rotationRightAsked=!1,e._teleportationBackRequestInitiated=!1)})),e.webVRController.onPadValuesChangedObservable.add(function(i){t.teleportationEnabled&&(t._checkTeleportBackwards(i,e),t._checkTeleportWithRay(i,e)),t._checkRotate(i,e)}))},e.prototype._createTeleportationCircles=function(){this._teleportationTarget=be.a.CreateGround("teleportationTarget",2,2,2,this._scene),this._teleportationTarget.isPickable=!1;var e=new Vi.a("DynamicTexture",512,this._scene,!0);e.hasAlpha=!0;var t=e.getContext();t.beginPath(),t.arc(256,256,200,0,2*Math.PI,!1),t.fillStyle=this._teleportationFillColor,t.fill(),t.lineWidth=10,t.strokeStyle=this._teleportationBorderColor,t.stroke(),t.closePath(),e.update();var i=new Ui.a("TextPlaneMaterial",this._scene);i.diffuseTexture=e,this._teleportationTarget.material=i;var n=be.a.CreateTorus("torusTeleportation",.75,.1,25,this._scene,!1);n.isPickable=!1,n.parent=this._teleportationTarget;var r=new G("animationInnerCircle","position.y",30,G.ANIMATIONTYPE_FLOAT,G.ANIMATIONLOOPMODE_CYCLE),o=[];o.push({frame:0,value:0}),o.push({frame:30,value:.4}),o.push({frame:60,value:0}),r.setKeys(o);var a=new me;a.setEasingMode(oe.EASINGMODE_EASEINOUT),r.setEasingFunction(a),n.animations=[],n.animations.push(r),this._scene.beginAnimation(n,0,60,!0),this._hideTeleportationTarget()},e.prototype._displayTeleportationTarget=function(){this._teleportActive=!0,this._teleportationInitialized&&(this._teleportationTarget.isVisible=!0,this._isDefaultTeleportationTarget&&(this._teleportationTarget.getChildren()[0].isVisible=!0))},e.prototype._hideTeleportationTarget=function(){this._teleportActive=!1,this._teleportationInitialized&&(this._teleportationTarget.isVisible=!1,this._isDefaultTeleportationTarget&&(this._teleportationTarget.getChildren()[0].isVisible=!1))},e.prototype._rotateCamera=function(e){var t=this;if(this.currentVRCamera instanceof wt){e?this._rotationAngle++:this._rotationAngle--,this.currentVRCamera.animations=[];var i=a.b.FromRotationMatrix(a.a.RotationY(Math.PI/4*this._rotationAngle)),n=new G("animationRotation","rotationQuaternion",90,G.ANIMATIONTYPE_QUATERNION,G.ANIMATIONLOOPMODE_CONSTANT),r=[];r.push({frame:0,value:this.currentVRCamera.rotationQuaternion}),r.push({frame:6,value:i}),n.setKeys(r),n.setEasingFunction(this._circleEase),this.currentVRCamera.animations.push(n),this._postProcessMove.animations=[];var o=new G("animationPP","vignetteWeight",90,G.ANIMATIONTYPE_FLOAT,G.ANIMATIONLOOPMODE_CONSTANT),s=[];s.push({frame:0,value:0}),s.push({frame:3,value:4}),s.push({frame:6,value:0}),o.setKeys(s),o.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(o);var c=new G("animationPP2","vignetteStretch",90,G.ANIMATIONTYPE_FLOAT,G.ANIMATIONLOOPMODE_CONSTANT),l=[];l.push({frame:0,value:0}),l.push({frame:3,value:10}),l.push({frame:6,value:0}),c.setKeys(l),c.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(c),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._postProcessMove.samples=4,this._webVRCamera.attachPostProcess(this._postProcessMove),this._scene.beginAnimation(this._postProcessMove,0,6,!1,1,function(){t._webVRCamera.detachPostProcess(t._postProcessMove)}),this._scene.beginAnimation(this.currentVRCamera,0,6,!1,1)}},e.prototype._moveTeleportationSelectorTo=function(e,t,i){if(e.pickedPoint){t._teleportationRequestInitiated&&(this._displayTeleportationTarget(),this._haloCenter.copyFrom(e.pickedPoint),this._teleportationTarget.position.copyFrom(e.pickedPoint));var n=this._convertNormalToDirectionOfRay(e.getNormal(!0,!1),i);if(n){var r=a.e.Cross(J.a.Y,n),o=a.e.Cross(n,r);a.e.RotationFromAxisToRef(o,n,r,this._teleportationTarget.rotation)}this._teleportationTarget.position.y+=.1}},e.prototype.teleportCamera=function(t){var i=this;if(this.currentVRCamera instanceof wt){var n,r;if(this.webVRCamera.leftCamera?(this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition),this._workingVector.subtractInPlace(this.webVRCamera.position),t.subtractToRef(this._workingVector,this._workingVector)):this._workingVector.copyFrom(t),this.isInVRMode?this._workingVector.y+=this.webVRCamera.deviceDistanceToRoomGround()*this._webVRCamera.deviceScaleFactor:this._workingVector.y+=this._defaultHeight,this.onBeforeCameraTeleport.notifyObservers(this._workingVector),this._teleportationMode==e.TELEPORTATIONMODE_CONSTANTSPEED){r=90;var o=a.e.Distance(this.currentVRCamera.position,this._workingVector);n=this._teleportationSpeed/o}else r=Math.round(90*this._teleportationTime/1e3),n=1;this.currentVRCamera.animations=[];var s=new G("animationCameraTeleportation","position",90,G.ANIMATIONTYPE_VECTOR3,G.ANIMATIONLOOPMODE_CONSTANT),c=[{frame:0,value:this.currentVRCamera.position},{frame:r,value:this._workingVector}];s.setKeys(c),s.setEasingFunction(this._teleportationEasing),this.currentVRCamera.animations.push(s),this._postProcessMove.animations=[];var l=Math.round(r/2),u=new G("animationPP","vignetteWeight",90,G.ANIMATIONTYPE_FLOAT,G.ANIMATIONLOOPMODE_CONSTANT),h=[];h.push({frame:0,value:0}),h.push({frame:l,value:8}),h.push({frame:r,value:0}),u.setKeys(h),this._postProcessMove.animations.push(u);var d=new G("animationPP2","vignetteStretch",90,G.ANIMATIONTYPE_FLOAT,G.ANIMATIONLOOPMODE_CONSTANT),f=[];f.push({frame:0,value:0}),f.push({frame:l,value:10}),f.push({frame:r,value:0}),d.setKeys(f),this._postProcessMove.animations.push(d),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._webVRCamera.attachPostProcess(this._postProcessMove),this._scene.beginAnimation(this._postProcessMove,0,r,!1,n,function(){i._webVRCamera.detachPostProcess(i._postProcessMove)}),this._scene.beginAnimation(this.currentVRCamera,0,r,!1,n,function(){i.onAfterCameraTeleport.notifyObservers(i._workingVector)}),this._hideTeleportationTarget()}},e.prototype._convertNormalToDirectionOfRay=function(e,t){return e&&Math.acos(a.e.Dot(e,t.direction))<Math.PI/2&&e.scaleInPlace(-1),e},e.prototype._castRayAndSelectObject=function(e){if(this.currentVRCamera instanceof wt){var t=e._getForwardRay(this._rayLength),i=this._scene.pickWithRay(t,this._raySelectionPredicate);if(i&&(e._laserPointer&&(i.originMesh=e._laserPointer.parent),this._scene.simulatePointerMove(i,{pointerId:e._id})),e._currentHit=i,i&&i.pickedPoint){if(this._displayGaze){var n=1;e._gazeTracker.isVisible=!0,e._isActionableMesh&&(n=3),this.updateGazeTrackerScale&&(e._gazeTracker.scaling.x=i.distance*n,e._gazeTracker.scaling.y=i.distance*n,e._gazeTracker.scaling.z=i.distance*n);var r=this._convertNormalToDirectionOfRay(i.getNormal(),t);if(r){var o=a.e.Cross(J.a.Y,r),s=a.e.Cross(r,o);a.e.RotationFromAxisToRef(s,r,o,e._gazeTracker.rotation)}e._gazeTracker.position.copyFrom(i.pickedPoint),e._gazeTracker.position.x<0?e._gazeTracker.position.x+=.002:e._gazeTracker.position.x-=.002,e._gazeTracker.position.y<0?e._gazeTracker.position.y+=.002:e._gazeTracker.position.y-=.002,e._gazeTracker.position.z<0?e._gazeTracker.position.z+=.002:e._gazeTracker.position.z-=.002}e._updatePointerDistance(i.distance)}else e._updatePointerDistance(),e._gazeTracker.isVisible=!1;if(i&&i.pickedMesh){if(this._teleportationInitialized&&this._isTeleportationFloor(i.pickedMesh)&&i.pickedPoint)return e._currentMeshSelected&&!this._isTeleportationFloor(e._currentMeshSelected)&&this._notifySelectedMeshUnselected(e._currentMeshSelected),e._currentMeshSelected=null,void(e._teleportationRequestInitiated&&this._moveTeleportationSelectorTo(i,e,t));if(i.pickedMesh!==e._currentMeshSelected)if(this.meshSelectionPredicate(i.pickedMesh)){this.onNewMeshPicked.notifyObservers(i),e._currentMeshSelected=i.pickedMesh,i.pickedMesh.isPickable&&i.pickedMesh.actionManager?(this.changeGazeColor(this._pickedGazeColor),this.changeLaserColor(this._pickedLaserColor),e._isActionableMesh=!0):(this.changeGazeColor(this._gazeColor),this.changeLaserColor(this._laserColor),e._isActionableMesh=!1);try{this.onNewMeshSelected.notifyObservers(i.pickedMesh);var c=e;c.webVRController&&this.onMeshSelectedWithController.notifyObservers({mesh:i.pickedMesh,controller:c.webVRController})}catch(e){m.a.Warn("Error while raising onNewMeshSelected or onMeshSelectedWithController: "+e)}}else this._notifySelectedMeshUnselected(e._currentMeshSelected),e._currentMeshSelected=null,this.changeGazeColor(this._gazeColor),this.changeLaserColor(this._laserColor)}else this._notifySelectedMeshUnselected(e._currentMeshSelected),e._currentMeshSelected=null,this.changeGazeColor(this._gazeColor),this.changeLaserColor(this._laserColor)}},e.prototype._notifySelectedMeshUnselected=function(e){e&&this.onSelectedMeshUnselected.notifyObservers(e)},e.prototype.setLaserColor=function(e,t){void 0===t&&(t=this._pickedLaserColor),this._laserColor=e,this._pickedLaserColor=t},e.prototype.setLaserLightingState=function(e){void 0===e&&(e=!0),this._leftController&&this._leftController._setLaserPointerLightingDisabled(!e),this._rightController&&this._rightController._setLaserPointerLightingDisabled(!e)},e.prototype.setGazeColor=function(e,t){void 0===t&&(t=this._pickedGazeColor),this._gazeColor=e,this._pickedGazeColor=t},e.prototype.changeLaserColor=function(e){this.updateControllerLaserColor&&(this._leftController&&this._leftController._setLaserPointerColor(e),this._rightController&&this._rightController._setLaserPointerColor(e))},e.prototype.changeGazeColor=function(e){this.updateGazeTrackerColor&&this._cameraGazer._gazeTracker.material&&(this._cameraGazer._gazeTracker.material.emissiveColor=e,this._leftController&&(this._leftController._gazeTracker.material.emissiveColor=e),this._rightController&&(this._rightController._gazeTracker.material.emissiveColor=e))},e.prototype.dispose=function(){this.isInVRMode&&this.exitVR(),this._postProcessMove&&this._postProcessMove.dispose(),this._webVRCamera&&this._webVRCamera.dispose(),this._vrDeviceOrientationCamera&&this._vrDeviceOrientationCamera.dispose(),!this._useCustomVRButton&&this._btnVR&&this._btnVR.parentNode&&document.body.removeChild(this._btnVR),this._deviceOrientationCamera&&this._scene.activeCamera!=this._deviceOrientationCamera&&this._deviceOrientationCamera.dispose(),this._cameraGazer&&this._cameraGazer.dispose(),this._leftController&&this._leftController.dispose(),this._rightController&&this._rightController.dispose(),this._teleportationTarget&&this._teleportationTarget.dispose(),this.xr&&this.xr.dispose(),this._floorMeshesCollection=[],document.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),window.removeEventListener("resize",this._onResize),document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.onmsfullscreenchange=null,this._scene.getEngine().onVRDisplayChangedObservable.removeCallback(this._onVRDisplayChanged),this._scene.getEngine().onVRRequestPresentStart.removeCallback(this._onVRRequestPresentStart),this._scene.getEngine().onVRRequestPresentComplete.removeCallback(this._onVRRequestPresentComplete),window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected),this._scene.gamepadManager.onGamepadDisconnectedObservable.removeCallback(this._onNewGamepadDisconnected),this._scene.unregisterBeforeRender(this.beforeRender)},e.prototype.getClassName=function(){return"VRExperienceHelper"},e.TELEPORTATIONMODE_CONSTANTTIME=0,e.TELEPORTATIONMODE_CONSTANTSPEED=1,e}(),sn=i(64),cn=(en={root:0,found:!1},function(e,t,i,n){en.root=0,en.found=!1;var r=t*t-4*e*i;if(r<0)return en;var o=Math.sqrt(r),a=(-t-o)/(2*e),s=(-t+o)/(2*e);if(a>s){var c=s;s=a,a=c}return a>0&&a<n?(en.root=a,en.found=!0,en):s>0&&s<n?(en.root=s,en.found=!0,en):en}),ln=function(){function e(){this._collisionPoint=a.e.Zero(),this._planeIntersectionPoint=a.e.Zero(),this._tempVector=a.e.Zero(),this._tempVector2=a.e.Zero(),this._tempVector3=a.e.Zero(),this._tempVector4=a.e.Zero(),this._edge=a.e.Zero(),this._baseToVertex=a.e.Zero(),this._destinationPoint=a.e.Zero(),this._slidePlaneNormal=a.e.Zero(),this._displacementVector=a.e.Zero(),this._radius=a.e.One(),this._retry=0,this._basePointWorld=a.e.Zero(),this._velocityWorld=a.e.Zero(),this._normalizedVelocity=a.e.Zero(),this._collisionMask=-1}return Object.defineProperty(e.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slidePlaneNormal",{get:function(){return this._slidePlaneNormal},enumerable:!1,configurable:!0}),e.prototype._initialize=function(e,t,i){this._velocity=t,a.e.NormalizeToRef(t,this._normalizedVelocity),this._basePoint=e,e.multiplyToRef(this._radius,this._basePointWorld),t.multiplyToRef(this._radius,this._velocityWorld),this._velocityWorldLength=this._velocityWorld.length(),this._epsilon=i,this.collisionFound=!1},e.prototype._checkPointInTriangle=function(e,t,i,n,r){t.subtractToRef(e,this._tempVector),i.subtractToRef(e,this._tempVector2),a.e.CrossToRef(this._tempVector,this._tempVector2,this._tempVector4);var o=a.e.Dot(this._tempVector4,r);return!(o<0)&&(n.subtractToRef(e,this._tempVector3),a.e.CrossToRef(this._tempVector2,this._tempVector3,this._tempVector4),!((o=a.e.Dot(this._tempVector4,r))<0)&&(a.e.CrossToRef(this._tempVector3,this._tempVector,this._tempVector4),(o=a.e.Dot(this._tempVector4,r))>=0))},e.prototype._canDoCollision=function(e,t,i,n){var r=a.e.Distance(this._basePointWorld,e),o=Math.max(this._radius.x,this._radius.y,this._radius.z);return!(r>this._velocityWorldLength+o+t||!function(e,t,i,n){return!(e.x>i.x+n||i.x-n>t.x||e.y>i.y+n||i.y-n>t.y||e.z>i.z+n||i.z-n>t.z)}(i,n,this._basePointWorld,this._velocityWorldLength+o))},e.prototype._testTriangle=function(e,t,i,n,r,o,s){var c,l=!1;t||(t=[]),t[e]||(t[e]=new sn.a(0,0,0,0),t[e].copyFromPoints(i,n,r));var u=t[e];if(o||u.isFrontFacingTo(this._normalizedVelocity,0)){var h=u.signedDistanceTo(this._basePoint),d=a.e.Dot(u.normal,this._velocity);if(0==d){if(Math.abs(h)>=1)return;l=!0,c=0}else{var f=(1-h)/d;if((c=(-1-h)/d)>f){var p=f;f=c,c=p}if(c>1||f<0)return;c<0&&(c=0),c>1&&(c=1)}this._collisionPoint.copyFromFloats(0,0,0);var _=!1,m=1;if(l||(this._basePoint.subtractToRef(u.normal,this._planeIntersectionPoint),this._velocity.scaleToRef(c,this._tempVector),this._planeIntersectionPoint.addInPlace(this._tempVector),this._checkPointInTriangle(this._planeIntersectionPoint,i,n,r,u.normal)&&(_=!0,m=c,this._collisionPoint.copyFrom(this._planeIntersectionPoint))),!_){var g=this._velocity.lengthSquared(),v=g;this._basePoint.subtractToRef(i,this._tempVector);var b=2*a.e.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,T=cn(v,b,y,m);T.found&&(m=T.root,_=!0,this._collisionPoint.copyFrom(i)),this._basePoint.subtractToRef(n,this._tempVector),b=2*a.e.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,(T=cn(v,b,y,m)).found&&(m=T.root,_=!0,this._collisionPoint.copyFrom(n)),this._basePoint.subtractToRef(r,this._tempVector),b=2*a.e.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,(T=cn(v,b,y,m)).found&&(m=T.root,_=!0,this._collisionPoint.copyFrom(r)),n.subtractToRef(i,this._edge),i.subtractToRef(this._basePoint,this._baseToVertex);var E=this._edge.lengthSquared(),S=a.e.Dot(this._edge,this._velocity),A=a.e.Dot(this._edge,this._baseToVertex);if(v=E*-g+S*S,b=E*(2*a.e.Dot(this._velocity,this._baseToVertex))-2*S*A,y=E*(1-this._baseToVertex.lengthSquared())+A*A,(T=cn(v,b,y,m)).found){var P=(S*T.root-A)/E;P>=0&&P<=1&&(m=T.root,_=!0,this._edge.scaleInPlace(P),i.addToRef(this._edge,this._collisionPoint))}r.subtractToRef(n,this._edge),n.subtractToRef(this._basePoint,this._baseToVertex),E=this._edge.lengthSquared(),S=a.e.Dot(this._edge,this._velocity),A=a.e.Dot(this._edge,this._baseToVertex),v=E*-g+S*S,b=E*(2*a.e.Dot(this._velocity,this._baseToVertex))-2*S*A,y=E*(1-this._baseToVertex.lengthSquared())+A*A,(T=cn(v,b,y,m)).found&&(P=(S*T.root-A)/E)>=0&&P<=1&&(m=T.root,_=!0,this._edge.scaleInPlace(P),n.addToRef(this._edge,this._collisionPoint)),i.subtractToRef(r,this._edge),r.subtractToRef(this._basePoint,this._baseToVertex),E=this._edge.lengthSquared(),S=a.e.Dot(this._edge,this._velocity),A=a.e.Dot(this._edge,this._baseToVertex),v=E*-g+S*S,b=E*(2*a.e.Dot(this._velocity,this._baseToVertex))-2*S*A,y=E*(1-this._baseToVertex.lengthSquared())+A*A,(T=cn(v,b,y,m)).found&&(P=(S*T.root-A)/E)>=0&&P<=1&&(m=T.root,_=!0,this._edge.scaleInPlace(P),r.addToRef(this._edge,this._collisionPoint))}if(_){var C=m*this._velocity.length();(!this.collisionFound||C<this._nearestDistance)&&(s.collisionResponse&&(this.intersectionPoint?this.intersectionPoint.copyFrom(this._collisionPoint):this.intersectionPoint=this._collisionPoint.clone(),this._nearestDistance=C,this.collisionFound=!0),this.collidedMesh=s)}}},e.prototype._collide=function(e,t,i,n,r,o,a,s){if(i&&0!==i.length)for(c=n;c<r;c+=3)l=t[i[c]-o],u=t[i[c+1]-o],h=t[i[c+2]-o],this._testTriangle(c,e,h,u,l,a,s);else for(var c=0;c<t.length;c+=3){var l=t[c],u=t[c+1],h=t[c+2];this._testTriangle(c,e,h,u,l,a,s)}},e.prototype._getResponse=function(e,t){e.addToRef(t,this._destinationPoint),t.scaleInPlace(this._nearestDistance/t.length()),this._basePoint.addToRef(t,e),e.subtractToRef(this.intersectionPoint,this._slidePlaneNormal),this._slidePlaneNormal.normalize(),this._slidePlaneNormal.scaleToRef(this._epsilon,this._displacementVector),e.addInPlace(this._displacementVector),this.intersectionPoint.addInPlace(this._displacementVector),this._slidePlaneNormal.scaleInPlace(sn.a.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint,this._slidePlaneNormal,this._destinationPoint)),this._destinationPoint.subtractInPlace(this._slidePlaneNormal),this._destinationPoint.subtractToRef(this.intersectionPoint,t)},e}(),un=function(){function e(){this._scaledPosition=a.e.Zero(),this._scaledVelocity=a.e.Zero(),this._finalPosition=a.e.Zero()}return e.prototype.getNewPosition=function(e,t,i,n,r,o,a){e.divideToRef(i._radius,this._scaledPosition),t.divideToRef(i._radius,this._scaledVelocity),i.collidedMesh=null,i._retry=0,i._initialVelocity=this._scaledVelocity,i._initialPosition=this._scaledPosition,this._collideWithWorld(this._scaledPosition,this._scaledVelocity,i,n,this._finalPosition,r),this._finalPosition.multiplyInPlace(i._radius),o(a,this._finalPosition,i.collidedMesh)},e.prototype.createCollider=function(){return new ln},e.prototype.init=function(e){this._scene=e},e.prototype._collideWithWorld=function(e,t,i,n,r,o){void 0===o&&(o=null);var a=10*Se.a.CollisionsEpsilon;if(i._retry>=n)r.copyFrom(e);else{var s=o?o.collisionMask:i.collisionMask;i._initialize(e,t,a);for(var c=o&&o.surroundingMeshes||this._scene.meshes,l=0;l<c.length;l++){var u=c[l];u.isEnabled()&&u.checkCollisions&&u.subMeshes&&u!==o&&0!=(s&u.collisionGroup)&&u._checkCollision(i)}i.collisionFound?(0===t.x&&0===t.y&&0===t.z||i._getResponse(e,t),t.length()<=a?r.copyFrom(e):(i._retry++,this._collideWithWorld(e,t,i,n,r,o))):e.addToRef(t,r)}},e}();Q.a.CollisionCoordinatorFactory=function(){return new un};var hn=i(54),dn=i(114),fn=i(147),pn=i(103),_n=i(43),mn=i(113),gn=function(){function e(e,t,i,n,r,o){this.entries=new Array,this._boundingVectors=new Array,this._capacity=i,this._depth=n,this._maxDepth=r,this._creationFunc=o,this._minPoint=e,this._maxPoint=t,this._boundingVectors.push(e.clone()),this._boundingVectors.push(t.clone()),this._boundingVectors.push(e.clone()),this._boundingVectors[2].x=t.x,this._boundingVectors.push(e.clone()),this._boundingVectors[3].y=t.y,this._boundingVectors.push(e.clone()),this._boundingVectors[4].z=t.z,this._boundingVectors.push(t.clone()),this._boundingVectors[5].z=e.z,this._boundingVectors.push(t.clone()),this._boundingVectors[6].x=e.x,this._boundingVectors.push(t.clone()),this._boundingVectors[7].y=e.y}return Object.defineProperty(e.prototype,"capacity",{get:function(){return this._capacity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minPoint",{get:function(){return this._minPoint},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxPoint",{get:function(){return this._maxPoint},enumerable:!1,configurable:!0}),e.prototype.addEntry=function(e){if(this.blocks)for(var t=0;t<this.blocks.length;t++)this.blocks[t].addEntry(e);else this._creationFunc(e,this),this.entries.length>this.capacity&&this._depth<this._maxDepth&&this.createInnerBlocks()},e.prototype.removeEntry=function(e){if(this.blocks)for(var t=0;t<this.blocks.length;t++)this.blocks[t].removeEntry(e);else{var i=this.entries.indexOf(e);i>-1&&this.entries.splice(i,1)}},e.prototype.addEntries=function(e){for(var t=0;t<e.length;t++){var i=e[t];this.addEntry(i)}},e.prototype.select=function(e,t,i){if(pn.a.IsInFrustum(this._boundingVectors,e)){if(this.blocks){for(var n=0;n<this.blocks.length;n++)this.blocks[n].select(e,t,i);return}i?t.concat(this.entries):t.concatWithNoDuplicate(this.entries)}},e.prototype.intersects=function(e,t,i,n){if(pn.a.IntersectsSphere(this._minPoint,this._maxPoint,e,t)){if(this.blocks){for(var r=0;r<this.blocks.length;r++)this.blocks[r].intersects(e,t,i,n);return}n?i.concat(this.entries):i.concatWithNoDuplicate(this.entries)}},e.prototype.intersectsRay=function(e,t){if(e.intersectsBoxMinMax(this._minPoint,this._maxPoint)){if(this.blocks){for(var i=0;i<this.blocks.length;i++)this.blocks[i].intersectsRay(e,t);return}t.concatWithNoDuplicate(this.entries)}},e.prototype.createInnerBlocks=function(){e._CreateBlocks(this._minPoint,this._maxPoint,this.entries,this._capacity,this._depth,this._maxDepth,this,this._creationFunc)},e._CreateBlocks=function(t,i,n,r,o,s,c,l){c.blocks=new Array;for(var u=new a.e((i.x-t.x)/2,(i.y-t.y)/2,(i.z-t.z)/2),h=0;h<2;h++)for(var d=0;d<2;d++)for(var f=0;f<2;f++){var p=new e(t.add(u.multiplyByFloats(h,d,f)),t.add(u.multiplyByFloats(h+1,d+1,f+1)),r,o+1,s,l);p.addEntries(n),c.blocks.push(p)}},e}(),vn=function(){function e(e,t,i){void 0===i&&(i=2),this.maxDepth=i,this.dynamicContent=new Array,this._maxBlockCapacity=t||64,this._selectionContent=new oi.b(1024),this._creationFunc=e}return e.prototype.update=function(e,t,i){gn._CreateBlocks(e,t,i,this._maxBlockCapacity,0,this.maxDepth,this,this._creationFunc)},e.prototype.addMesh=function(e){for(var t=0;t<this.blocks.length;t++)this.blocks[t].addEntry(e)},e.prototype.removeMesh=function(e){for(var t=0;t<this.blocks.length;t++)this.blocks[t].removeEntry(e)},e.prototype.select=function(e,t){this._selectionContent.reset();for(var i=0;i<this.blocks.length;i++)this.blocks[i].select(e,this._selectionContent,t);return t?this._selectionContent.concat(this.dynamicContent):this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent},e.prototype.intersects=function(e,t,i){this._selectionContent.reset();for(var n=0;n<this.blocks.length;n++)this.blocks[n].intersects(e,t,this._selectionContent,i);return i?this._selectionContent.concat(this.dynamicContent):this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent},e.prototype.intersectsRay=function(e){this._selectionContent.reset();for(var t=0;t<this.blocks.length;t++)this.blocks[t].intersectsRay(e,this._selectionContent);return this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent},e.CreationFuncForMeshes=function(e,t){var i=e.getBoundingInfo();!e.isBlocked&&i.boundingBox.intersectsMinMax(t.minPoint,t.maxPoint)&&t.entries.push(e)},e.CreationFuncForSubMeshes=function(e,t){e.getBoundingInfo().boundingBox.intersectsMinMax(t.minPoint,t.maxPoint)&&t.entries.push(e)},e}();Q.a.prototype.createOrUpdateSelectionOctree=function(e,t){void 0===e&&(e=64),void 0===t&&(t=2);var i=this._getComponent(Me.a.NAME_OCTREE);i||(i=new An(this),this._addComponent(i)),this._selectionOctree||(this._selectionOctree=new vn(vn.CreationFuncForMeshes,e,t));var n=this.getWorldExtends();return this._selectionOctree.update(n.min,n.max,this.meshes),this._selectionOctree},Object.defineProperty(Q.a.prototype,"selectionOctree",{get:function(){return this._selectionOctree},enumerable:!0,configurable:!0}),ze.a.prototype.createOrUpdateSubmeshesOctree=function(e,t){void 0===e&&(e=64),void 0===t&&(t=2);var i=this.getScene(),n=i._getComponent(Me.a.NAME_OCTREE);n||(n=new An(i),i._addComponent(n)),this._submeshesOctree||(this._submeshesOctree=new vn(vn.CreationFuncForSubMeshes,e,t)),this.computeWorldMatrix(!0);var r=this.getBoundingInfo().boundingBox;return this._submeshesOctree.update(r.minimumWorld,r.maximumWorld,this.subMeshes),this._submeshesOctree};var bn,yn,Tn,En,Sn,An=function(){function e(e){this.name=Me.a.NAME_OCTREE,this.checksIsEnabled=!0,this._tempRay=new Xt.a(a.e.Zero(),new a.e(1,1,1)),this.scene=e,this.scene.getActiveMeshCandidates=this.getActiveMeshCandidates.bind(this),this.scene.getActiveSubMeshCandidates=this.getActiveSubMeshCandidates.bind(this),this.scene.getCollidingSubMeshCandidates=this.getCollidingSubMeshCandidates.bind(this),this.scene.getIntersectingSubMeshCandidates=this.getIntersectingSubMeshCandidates.bind(this)}return e.prototype.register=function(){var e=this;this.scene.onMeshRemovedObservable.add(function(t){var i=e.scene.selectionOctree;if(null!=i){var n=i.dynamicContent.indexOf(t);-1!==n&&i.dynamicContent.splice(n,1)}}),this.scene.onMeshImportedObservable.add(function(t){var i=e.scene.selectionOctree;null!=i&&i.addMesh(t)})},e.prototype.getActiveMeshCandidates=function(){return this.scene._selectionOctree?this.scene._selectionOctree.select(this.scene.frustumPlanes):this.scene._getDefaultMeshCandidates()},e.prototype.getActiveSubMeshCandidates=function(e){return e._submeshesOctree&&e.useOctreeForRenderingSelection?e._submeshesOctree.select(this.scene.frustumPlanes):this.scene._getDefaultSubMeshCandidates(e)},e.prototype.getIntersectingSubMeshCandidates=function(e,t){return e._submeshesOctree&&e.useOctreeForPicking?(Xt.a.TransformToRef(t,e.getWorldMatrix(),this._tempRay),e._submeshesOctree.intersectsRay(this._tempRay)):this.scene._getDefaultSubMeshCandidates(e)},e.prototype.getCollidingSubMeshCandidates=function(e,t){if(e._submeshesOctree&&e.useOctreeForCollisions){var i=t._velocityWorldLength+Math.max(t._radius.x,t._radius.y,t._radius.z);return e._submeshesOctree.intersects(t._basePointWorld,i)}return this.scene._getDefaultSubMeshCandidates(e)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e}(),Pn=i(99);!function(e){e[e.Generic=0]="Generic",e[e.Keyboard=1]="Keyboard",e[e.Mouse=2]="Mouse",e[e.Touch=3]="Touch",e[e.DualShock=4]="DualShock",e[e.Xbox=5]="Xbox",e[e.Switch=6]="Switch"}(bn||(bn={})),function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.LeftClick=2]="LeftClick",e[e.MiddleClick=3]="MiddleClick",e[e.RightClick=4]="RightClick",e[e.BrowserBack=5]="BrowserBack",e[e.BrowserForward=6]="BrowserForward"}(yn||(yn={})),function(e){e[e.Cross=0]="Cross",e[e.Circle=1]="Circle",e[e.Square=2]="Square",e[e.Triangle=3]="Triangle",e[e.L1=4]="L1",e[e.R1=5]="R1",e[e.L2=6]="L2",e[e.R2=7]="R2",e[e.Share=8]="Share",e[e.Options=9]="Options",e[e.L3=10]="L3",e[e.R3=11]="R3",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.TouchPad=17]="TouchPad",e[e.LStickXAxis=18]="LStickXAxis",e[e.LStickYAxis=19]="LStickYAxis",e[e.RStickXAxis=20]="RStickXAxis",e[e.RStickYAxis=21]="RStickYAxis"}(Tn||(Tn={})),function(e){e[e.A=0]="A",e[e.B=1]="B",e[e.X=2]="X",e[e.Y=3]="Y",e[e.LB=4]="LB",e[e.RB=5]="RB",e[e.LT=6]="LT",e[e.RT=7]="RT",e[e.Back=8]="Back",e[e.Start=9]="Start",e[e.LS=10]="LS",e[e.RS=11]="RS",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.LStickXAxis=17]="LStickXAxis",e[e.LStickYAxis=18]="LStickYAxis",e[e.RStickXAxis=19]="RStickXAxis",e[e.RStickYAxis=20]="RStickYAxis"}(En||(En={})),function(e){e[e.B=0]="B",e[e.A=1]="A",e[e.Y=2]="Y",e[e.X=3]="X",e[e.L=4]="L",e[e.R=5]="R",e[e.ZL=6]="ZL",e[e.ZR=7]="ZR",e[e.Minus=8]="Minus",e[e.Plus=9]="Plus",e[e.LS=10]="LS",e[e.RS=11]="RS",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.Capture=17]="Capture",e[e.LStickXAxis=18]="LStickXAxis",e[e.LStickYAxis=19]="LStickYAxis",e[e.RStickXAxis=20]="RStickXAxis",e[e.RStickYAxis=21]="RStickYAxis"}(Sn||(Sn={}));var Cn=function(){function e(e){this.onDeviceDisconnected=function(){},this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._keyboardDownEvent=function(e){},this._keyboardUpEvent=function(e){},this._pointerMoveEvent=function(e){},this._pointerDownEvent=function(e){},this._pointerUpEvent=function(e){},this._gamepadConnectedEvent=function(e){},this._gamepadDisconnectedEvent=function(e){},this._onDeviceConnected=function(){};var t=e.getInputElement();t&&(this._elementToAttachTo=t,this._handleKeyActions(),this._handlePointerActions(),this._handleGamepadActions(),this._checkForConnectedDevices())}return Object.defineProperty(e.prototype,"onDeviceConnected",{get:function(){return this._onDeviceConnected},set:function(e){this._onDeviceConnected=e;for(var t=0;t<this._inputs.length;t++)if(this._inputs[t])for(var i=0;i<this._inputs[t].length;i++)this._inputs[t][i]&&this._onDeviceConnected(t,i)},enumerable:!1,configurable:!0}),e.Create=function(t){return"undefined"!=typeof _native&&_native.DeviceInputSystem?new _native.DeviceInputSystem(t):new e(t)},e.prototype.pollInput=function(e,t,i){var n=this._inputs[e][t];if(!n)throw"Unable to find device "+bn[e];if(this._updateDevice(e,t,i),void 0===n[i])throw"Unable to find input "+i+" for device "+bn[e]+" in slot "+t;return n[i]},e.prototype.dispose=function(){this._keyboardActive&&(window.removeEventListener("keydown",this._keyboardDownEvent),window.removeEventListener("keyup",this._keyboardUpEvent)),this._pointerActive&&(this._elementToAttachTo.removeEventListener("pointermove",this._pointerMoveEvent),this._elementToAttachTo.removeEventListener("pointerdown",this._pointerDownEvent),this._elementToAttachTo.removeEventListener("pointerup",this._pointerUpEvent)),window.removeEventListener("gamepadconnected",this._gamepadConnectedEvent),window.removeEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)},e.prototype._checkForConnectedDevices=function(){for(var e=0,t=navigator.getGamepads();e<t.length;e++){var i=t[e];i&&this._addGamePad(i)}matchMedia("(pointer:fine)").matches&&this._addPointerDevice(bn.Mouse,0,0,0)},e.prototype._addGamePad=function(e){var t=this._getGamepadDeviceType(e.id),i=e.index;this._registerDevice(t,i,e.buttons.length+e.axes.length),this._gamepads=this._gamepads||new Array(e.index+1),this._gamepads[i]=t},e.prototype._addPointerDevice=function(t,i,n,r){this._pointerActive=!0,this._registerDevice(t,i,e._MAX_POINTER_INPUTS);var o=this._inputs[t][i];o[0]=n,o[1]=r},e.prototype._registerDevice=function(e,t,i){if(this._inputs[e]||(this._inputs[e]=[]),!this._inputs[e][t]){for(var n=new Array(i),r=0;r<i;r++)n[r]=0;this._inputs[e][t]=n,this.onDeviceConnected(e,t)}},e.prototype._unregisterDevice=function(e,t){this._inputs[e][t]&&(delete this._inputs[e][t],this.onDeviceDisconnected(e,t))},e.prototype._handleKeyActions=function(){var t=this;this._keyboardDownEvent=function(i){t._keyboardActive||(t._keyboardActive=!0,t._registerDevice(bn.Keyboard,0,e._MAX_KEYCODES));var n=t._inputs[bn.Keyboard][0];n&&(t.onInputChanged&&t.onInputChanged(bn.Keyboard,0,i.keyCode,n[i.keyCode],1),n[i.keyCode]=1)},this._keyboardUpEvent=function(e){var i=t._inputs[bn.Keyboard][0];i&&(t.onInputChanged&&t.onInputChanged(bn.Keyboard,0,e.keyCode,i[e.keyCode],0),i[e.keyCode]=0)},window.addEventListener("keydown",this._keyboardDownEvent),window.addEventListener("keyup",this._keyboardUpEvent)},e.prototype._handlePointerActions=function(){var e=this;this._pointerMoveEvent=function(t){var i="mouse"==t.pointerType?bn.Mouse:bn.Touch,n="mouse"==t.pointerType?0:t.pointerId;e._inputs[i]||(e._inputs[i]=[]),e._inputs[i][n]||e._addPointerDevice(i,n,t.clientX,t.clientY);var r=e._inputs[i][n];r&&(e.onInputChanged&&(e.onInputChanged(i,n,0,r[0],t.clientX),e.onInputChanged(i,n,1,r[1],t.clientY)),r[0]=t.clientX,r[1]=t.clientY)},this._pointerDownEvent=function(t){var i="mouse"==t.pointerType?bn.Mouse:bn.Touch,n="mouse"==t.pointerType?0:t.pointerId;e._inputs[i]||(e._inputs[i]=[]),e._inputs[i][n]||e._addPointerDevice(i,n,t.clientX,t.clientY);var r=e._inputs[i][n];r&&(e.onInputChanged&&(e.onInputChanged(i,n,0,r[0],t.clientX),e.onInputChanged(i,n,1,r[1],t.clientY),e.onInputChanged(i,n,t.button+2,r[t.button+2],1)),r[0]=t.clientX,r[1]=t.clientY,r[t.button+2]=1)},this._pointerUpEvent=function(t){var i="mouse"==t.pointerType?bn.Mouse:bn.Touch,n="mouse"==t.pointerType?0:t.pointerId,r=e._inputs[i][n];r&&(e.onInputChanged&&e.onInputChanged(i,n,t.button+2,r[t.button+2],0),r[0]=t.clientX,r[1]=t.clientY,r[t.button+2]=0),"mouse"!=t.pointerType&&e._unregisterDevice(i,n)},this._elementToAttachTo.addEventListener("pointermove",this._pointerMoveEvent),this._elementToAttachTo.addEventListener("pointerdown",this._pointerDownEvent),this._elementToAttachTo.addEventListener("pointerup",this._pointerUpEvent)},e.prototype._handleGamepadActions=function(){var e=this;this._gamepadConnectedEvent=function(t){e._addGamePad(t.gamepad)},this._gamepadDisconnectedEvent=function(t){if(e._gamepads){var i=e._getGamepadDeviceType(t.gamepad.id),n=t.gamepad.index;e._unregisterDevice(i,n),delete e._gamepads[n]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)},e.prototype._updateDevice=function(e,t,i){var n=navigator.getGamepads()[t];if(n&&e==this._gamepads[t]){var r=this._inputs[e][t];i>=n.buttons.length?r[i]=n.axes[i-n.buttons.length].valueOf():r[i]=n.buttons[i].value}},e.prototype._getGamepadDeviceType=function(e){return-1!==e.indexOf("054c")?bn.DualShock:-1!==e.indexOf("Xbox One")||-1!==e.search("Xbox 360")||-1!==e.search("xinput")?bn.Xbox:-1!==e.indexOf("057e")?bn.Switch:bn.Generic},e._MAX_KEYCODES=255,e._MAX_POINTER_INPUTS=7,e}(),Rn=function(){function e(e,t,i){void 0===i&&(i=0),this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new o.c,this._deviceInputSystem=e}return e.prototype.getInput=function(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)},e}(),xn=function(){function e(e){var t=this;this.onDeviceConnectedObservable=new o.c(function(e){t.getDevices().forEach(function(i){t.onDeviceConnectedObservable.notifyObserver(e,i)})}),this.onDeviceDisconnectedObservable=new o.c;var i=Object.keys(bn).length/2;this._devices=new Array(i),this._firstDevice=new Array(i),this._deviceInputSystem=Cn.Create(e),this._deviceInputSystem.onDeviceConnected=function(e,i){t._addDevice(e,i),t.onDeviceConnectedObservable.notifyObservers(t.getDeviceSource(e,i))},this._deviceInputSystem.onDeviceDisconnected=function(e,i){var n=t.getDeviceSource(e,i);t._removeDevice(e,i),t.onDeviceDisconnectedObservable.notifyObservers(n)},this._deviceInputSystem.onInputChanged||(this._deviceInputSystem.onInputChanged=function(e,i,n,r,o){var a;null===(a=t.getDeviceSource(e,i))||void 0===a||a.onInputChangedObservable.notifyObservers({inputIndex:n,previousState:r,currentState:o})})}return e.prototype.getDeviceSource=function(e,t){if(void 0===t){if(void 0===this._firstDevice[e])return null;t=this._firstDevice[e]}return this._devices[e]&&void 0!==this._devices[e][t]?this._devices[e][t]:null},e.prototype.getDeviceSources=function(e){return this._devices[e].filter(function(e){return!!e})},e.prototype.getDevices=function(){var e=new Array;return this._devices.forEach(function(t){e.push.apply(e,t)}),e},e.prototype.dispose=function(){this.onDeviceConnectedObservable.clear(),this.onDeviceDisconnectedObservable.clear(),this._deviceInputSystem.dispose()},e.prototype._addDevice=function(e,t){this._devices[e]||(this._devices[e]=new Array),this._devices[e][t]||(this._devices[e][t]=new Rn(this._deviceInputSystem,e,t),this._updateFirstDevices(e))},e.prototype._removeDevice=function(e,t){delete this._devices[e][t],this._updateFirstDevices(e)},e.prototype._updateFirstDevices=function(e){switch(e){case bn.Keyboard:case bn.Mouse:this._firstDevice[e]=0;break;case bn.Touch:case bn.DualShock:case bn.Xbox:case bn.Switch:case bn.Generic:var t=this._devices[e];delete this._firstDevice[e];for(var i=0;i<t.length;i++)if(t[i]){this._firstDevice[e]=i;break}}},e}(),On=i(168),Mn=(i(123),function(){this._timeElapsedQueryEnded=!1}),In=function(){this.occlusionInternalRetryCounter=0,this.isOcclusionQueryInProgress=!1,this.isOccluded=!1,this.occlusionRetryCount=-1,this.occlusionType=ze.a.OCCLUSION_TYPE_NONE,this.occlusionQueryAlgorithmType=ze.a.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE};Se.a.prototype.createQuery=function(){return this._gl.createQuery()},Se.a.prototype.deleteQuery=function(e){return this._gl.deleteQuery(e),this},Se.a.prototype.isQueryResultAvailable=function(e){return this._gl.getQueryParameter(e,this._gl.QUERY_RESULT_AVAILABLE)},Se.a.prototype.getQueryResult=function(e){return this._gl.getQueryParameter(e,this._gl.QUERY_RESULT)},Se.a.prototype.beginOcclusionQuery=function(e,t){var i=this._getGlAlgorithmType(e);return this._gl.beginQuery(i,t),this},Se.a.prototype.endOcclusionQuery=function(e){var t=this._getGlAlgorithmType(e);return this._gl.endQuery(t),this},Se.a.prototype._createTimeQuery=function(){var e=this.getCaps().timerQuery;return e.createQueryEXT?e.createQueryEXT():this.createQuery()},Se.a.prototype._deleteTimeQuery=function(e){var t=this.getCaps().timerQuery;t.deleteQueryEXT?t.deleteQueryEXT(e):this.deleteQuery(e)},Se.a.prototype._getTimeQueryResult=function(e){var t=this.getCaps().timerQuery;return t.getQueryObjectEXT?t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT):this.getQueryResult(e)},Se.a.prototype._getTimeQueryAvailability=function(e){var t=this.getCaps().timerQuery;return t.getQueryObjectEXT?t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT):this.isQueryResultAvailable(e)},Se.a.prototype.startTimeQuery=function(){var e=this.getCaps(),t=e.timerQuery;if(!t)return null;var i=new Mn;if(this._gl.getParameter(t.GPU_DISJOINT_EXT),e.canUseTimestampForTimerQuery)i._startTimeQuery=this._createTimeQuery(),t.queryCounterEXT(i._startTimeQuery,t.TIMESTAMP_EXT);else{if(this._currentNonTimestampToken)return this._currentNonTimestampToken;i._timeElapsedQuery=this._createTimeQuery(),t.beginQueryEXT?t.beginQueryEXT(t.TIME_ELAPSED_EXT,i._timeElapsedQuery):this._gl.beginQuery(t.TIME_ELAPSED_EXT,i._timeElapsedQuery),this._currentNonTimestampToken=i}return i},Se.a.prototype.endTimeQuery=function(e){var t=this.getCaps(),i=t.timerQuery;if(!i||!e)return-1;if(t.canUseTimestampForTimerQuery){if(!e._startTimeQuery)return-1;e._endTimeQuery||(e._endTimeQuery=this._createTimeQuery(),i.queryCounterEXT(e._endTimeQuery,i.TIMESTAMP_EXT))}else if(!e._timeElapsedQueryEnded){if(!e._timeElapsedQuery)return-1;i.endQueryEXT?i.endQueryEXT(i.TIME_ELAPSED_EXT):this._gl.endQuery(i.TIME_ELAPSED_EXT),e._timeElapsedQueryEnded=!0}var n=this._gl.getParameter(i.GPU_DISJOINT_EXT),r=!1;if(e._endTimeQuery?r=this._getTimeQueryAvailability(e._endTimeQuery):e._timeElapsedQuery&&(r=this._getTimeQueryAvailability(e._timeElapsedQuery)),r&&!n){var o=0;if(t.canUseTimestampForTimerQuery){if(!e._startTimeQuery||!e._endTimeQuery)return-1;var a=this._getTimeQueryResult(e._startTimeQuery);o=this._getTimeQueryResult(e._endTimeQuery)-a,this._deleteTimeQuery(e._startTimeQuery),this._deleteTimeQuery(e._endTimeQuery),e._startTimeQuery=null,e._endTimeQuery=null}else{if(!e._timeElapsedQuery)return-1;o=this._getTimeQueryResult(e._timeElapsedQuery),this._deleteTimeQuery(e._timeElapsedQuery),e._timeElapsedQuery=null,e._timeElapsedQueryEnded=!1,this._currentNonTimestampToken=null}return o}return-1},Se.a.prototype._getGlAlgorithmType=function(e){return e===ze.a.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE?this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE:this._gl.ANY_SAMPLES_PASSED},Object.defineProperty(ze.a.prototype,"isOcclusionQueryInProgress",{get:function(){return this._occlusionDataStorage.isOcclusionQueryInProgress},set:function(e){this._occlusionDataStorage.isOcclusionQueryInProgress=e},enumerable:!1,configurable:!0}),Object.defineProperty(ze.a.prototype,"_occlusionDataStorage",{get:function(){return this.__occlusionDataStorage||(this.__occlusionDataStorage=new In),this.__occlusionDataStorage},enumerable:!1,configurable:!0}),Object.defineProperty(ze.a.prototype,"isOccluded",{get:function(){return this._occlusionDataStorage.isOccluded},set:function(e){this._occlusionDataStorage.isOccluded=e},enumerable:!0,configurable:!0}),Object.defineProperty(ze.a.prototype,"occlusionQueryAlgorithmType",{get:function(){return this._occlusionDataStorage.occlusionQueryAlgorithmType},set:function(e){this._occlusionDataStorage.occlusionQueryAlgorithmType=e},enumerable:!0,configurable:!0}),Object.defineProperty(ze.a.prototype,"occlusionType",{get:function(){return this._occlusionDataStorage.occlusionType},set:function(e){this._occlusionDataStorage.occlusionType=e},enumerable:!0,configurable:!0}),Object.defineProperty(ze.a.prototype,"occlusionRetryCount",{get:function(){return this._occlusionDataStorage.occlusionRetryCount},set:function(e){this._occlusionDataStorage.occlusionRetryCount=e},enumerable:!0,configurable:!0}),ze.a.prototype._checkOcclusionQuery=function(){var e=this._occlusionDataStorage;if(e.occlusionType===ze.a.OCCLUSION_TYPE_NONE)return e.isOccluded=!1,!1;var t=this.getEngine();if(t.webGLVersion<2)return e.isOccluded=!1,!1;if(!t.isQueryResultAvailable)return e.isOccluded=!1,!1;if(this.isOcclusionQueryInProgress&&this._occlusionQuery)if(t.isQueryResultAvailable(this._occlusionQuery)){var i=t.getQueryResult(this._occlusionQuery);e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=1!==i}else{if(e.occlusionInternalRetryCounter++,!(-1!==e.occlusionRetryCount&&e.occlusionInternalRetryCounter>e.occlusionRetryCount))return!1;e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=e.occlusionType!==ze.a.OCCLUSION_TYPE_OPTIMISTIC&&e.isOccluded}var n=this.getScene();if(n.getBoundingBoxRenderer){var r=n.getBoundingBoxRenderer();this._occlusionQuery||(this._occlusionQuery=t.createQuery()),t.beginOcclusionQuery(e.occlusionQueryAlgorithmType,this._occlusionQuery),r.renderOcclusionBoundingBox(this),t.endOcclusionQuery(e.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0}return e.isOccluded};var Dn=!0;Se.a.prototype.createTransformFeedback=function(){return this._gl.createTransformFeedback()},Se.a.prototype.deleteTransformFeedback=function(e){this._gl.deleteTransformFeedback(e)},Se.a.prototype.bindTransformFeedback=function(e){this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK,e)},Se.a.prototype.beginTransformFeedback=function(e){void 0===e&&(e=!0),this._gl.beginTransformFeedback(e?this._gl.POINTS:this._gl.TRIANGLES)},Se.a.prototype.endTransformFeedback=function(){this._gl.endTransformFeedback()},Se.a.prototype.setTranformFeedbackVaryings=function(e,t){this._gl.transformFeedbackVaryings(e,t,this._gl.INTERLEAVED_ATTRIBS)},Se.a.prototype.bindTransformFeedbackBuffer=function(e){this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER,0,e?e.underlyingResource:null)},i(126),qe.a.prototype.updateVideoTexture=function(e,t,i){if(e&&!e._isDisabled){var n=this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0);this._unpackFlipY(!i);try{if(void 0===this._videoTextureSupported&&(this._gl.getError(),this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t),0!==this._gl.getError()?this._videoTextureSupported=!1:this._videoTextureSupported=!0),this._videoTextureSupported)this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t);else{if(!e._workingCanvas){e._workingCanvas=Hi.a.CreateCanvas(e.width,e.height);var r=e._workingCanvas.getContext("2d");if(!r)throw new Error("Unable to get 2d context");e._workingContext=r,e._workingCanvas.width=e.width,e._workingCanvas.height=e.height}e._workingContext.clearRect(0,0,e.width,e.height),e._workingContext.drawImage(t,0,0,t.videoWidth,t.videoHeight,0,0,e.width,e.height),this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,e._workingCanvas)}e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),n||this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}catch(t){e._isDisabled=!0}}},qe.a.prototype.restoreSingleAttachment=function(){var e=this._gl;this.bindAttachments([e.BACK])},qe.a.prototype.buildTextureLayout=function(e){for(var t=this._gl,i=[],n=0;n<e.length;n++)e[n]?i.push(t["COLOR_ATTACHMENT"+n]):i.push(t.NONE);return i},qe.a.prototype.bindAttachments=function(e){this._gl.drawBuffers(e)},qe.a.prototype.unBindMultiColorAttachmentFramebuffer=function(e,t,i){void 0===t&&(t=!1),this._currentRenderTarget=null;var n=this._gl,r=e[0]._attachments,o=r.length;if(e[0]._MSAAFramebuffer){n.bindFramebuffer(n.READ_FRAMEBUFFER,e[0]._MSAAFramebuffer),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,e[0]._framebuffer);for(var a=0;a<o;a++){for(var s=e[a],c=0;c<o;c++)r[c]=n.NONE;r[a]=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+a:"COLOR_ATTACHMENT"+a+"_WEBGL"],n.readBuffer(r[a]),n.drawBuffers(r),n.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,n.COLOR_BUFFER_BIT,n.NEAREST)}for(a=0;a<o;a++)r[a]=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+a:"COLOR_ATTACHMENT"+a+"_WEBGL"];n.drawBuffers(r)}for(a=0;a<o;a++)!(s=e[a]).generateMipMaps||t||s.isCube||(this._bindTextureDirectly(n.TEXTURE_2D,s,!0),n.generateMipmap(n.TEXTURE_2D),this._bindTextureDirectly(n.TEXTURE_2D,null));i&&(e[0]._MSAAFramebuffer&&this._bindUnboundFramebuffer(e[0]._framebuffer),i()),this._bindUnboundFramebuffer(null)},qe.a.prototype.createMultipleRenderTarget=function(e,t){var i=!1,n=!0,r=!1,o=!1,a=1,s=g.a.TEXTURETYPE_UNSIGNED_INT,c=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,l=new Array,u=new Array;void 0!==t&&(i=void 0!==t.generateMipMaps&&t.generateMipMaps,n=void 0===t.generateDepthBuffer||t.generateDepthBuffer,r=void 0!==t.generateStencilBuffer&&t.generateStencilBuffer,o=void 0!==t.generateDepthTexture&&t.generateDepthTexture,a=t.textureCount||1,t.types&&(l=t.types),t.samplingModes&&(u=t.samplingModes));var h=this._gl,d=h.createFramebuffer();this._bindUnboundFramebuffer(d);for(var f=e.width||e,p=e.height||e,_=[],v=[],b=this._setupFramebufferDepthAttachments(r,n,f,p),y=0;y<a;y++){var T=u[y]||c,E=l[y]||s;(E!==g.a.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(E!==g.a.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(T=g.a.TEXTURE_NEAREST_SAMPLINGMODE);var S=this._getSamplingParameters(T,i);E!==g.a.TEXTURETYPE_FLOAT||this._caps.textureFloat||(E=g.a.TEXTURETYPE_UNSIGNED_INT,m.a.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var A=new Qe.a(this,Qe.b.MultiRenderTarget),P=h[this.webGLVersion>1?"COLOR_ATTACHMENT"+y:"COLOR_ATTACHMENT"+y+"_WEBGL"];_.push(A),v.push(P),h.activeTexture(h["TEXTURE"+y]),h.bindTexture(h.TEXTURE_2D,A._webGLTexture),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,S.mag),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,S.min),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texImage2D(h.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(E),f,p,0,h.RGBA,this._getWebGLTextureType(E),null),h.framebufferTexture2D(h.DRAW_FRAMEBUFFER,P,h.TEXTURE_2D,A._webGLTexture,0),i&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(h.TEXTURE_2D,null),A._framebuffer=d,A._depthStencilBuffer=b,A.baseWidth=f,A.baseHeight=p,A.width=f,A.height=p,A.isReady=!0,A.samples=1,A.generateMipMaps=i,A.samplingMode=T,A.type=E,A._generateDepthBuffer=n,A._generateStencilBuffer=r,A._attachments=v,A._textureArray=_,this._internalTexturesCache.push(A)}if(o&&this._caps.depthTextureExtension){var C=new Qe.a(this,Qe.b.MultiRenderTarget);h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,C._webGLTexture),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texImage2D(h.TEXTURE_2D,0,this.webGLVersion<2?h.DEPTH_COMPONENT:h.DEPTH_COMPONENT16,f,p,0,h.DEPTH_COMPONENT,h.UNSIGNED_SHORT,null),h.framebufferTexture2D(h.FRAMEBUFFER,h.DEPTH_ATTACHMENT,h.TEXTURE_2D,C._webGLTexture,0),C._framebuffer=d,C.baseWidth=f,C.baseHeight=p,C.width=f,C.height=p,C.isReady=!0,C.samples=1,C.generateMipMaps=i,C.samplingMode=h.NEAREST,C._generateDepthBuffer=n,C._generateStencilBuffer=r,_.push(C),this._internalTexturesCache.push(C)}return h.drawBuffers(v),this._bindUnboundFramebuffer(null),this.resetTextureCache(),_},qe.a.prototype.updateMultipleRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e[0].samples===t)return t;var i=e[0]._attachments.length;if(0===i)return 1;var n=this._gl;t=Math.min(t,this.getCaps().maxMSAASamples),e[0]._depthStencilBuffer&&(n.deleteRenderbuffer(e[0]._depthStencilBuffer),e[0]._depthStencilBuffer=null),e[0]._MSAAFramebuffer&&(n.deleteFramebuffer(e[0]._MSAAFramebuffer),e[0]._MSAAFramebuffer=null);for(var r=0;r<i;r++)e[r]._MSAARenderBuffer&&(n.deleteRenderbuffer(e[r]._MSAARenderBuffer),e[r]._MSAARenderBuffer=null);if(t>1&&n.renderbufferStorageMultisample){var o=n.createFramebuffer();if(!o)throw new Error("Unable to create multi sampled framebuffer");this._bindUnboundFramebuffer(o);var a=this._setupFramebufferDepthAttachments(e[0]._generateStencilBuffer,e[0]._generateDepthBuffer,e[0].width,e[0].height,t),s=[];for(r=0;r<i;r++){var c=e[r],l=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+r:"COLOR_ATTACHMENT"+r+"_WEBGL"],u=n.createRenderbuffer();if(!u)throw new Error("Unable to create multi sampled framebuffer");n.bindRenderbuffer(n.RENDERBUFFER,u),n.renderbufferStorageMultisample(n.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(c.type),c.width,c.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,l,n.RENDERBUFFER,u),c._MSAAFramebuffer=o,c._MSAARenderBuffer=u,c.samples=t,c._depthStencilBuffer=a,n.bindRenderbuffer(n.RENDERBUFFER,null),s.push(l)}n.drawBuffers(s)}else this._bindUnboundFramebuffer(e[0]._framebuffer);return this._bindUnboundFramebuffer(null),t};var Nn=i(56);qe.a.prototype._createDepthStencilCubeTexture=function(e,t){var i=new Qe.a(this,Qe.b.Unknown);if(i.isCube=!0,1===this.webGLVersion)return m.a.Error("Depth cube texture is not supported by WebGL 1."),i;var n=Object(h.a)({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),r=this._gl;this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,i,!0),this._setupDepthStencilTexture(i,e,n.generateStencil,n.bilinearFiltering,n.comparisonFunction);for(var o=0;o<6;o++)n.generateStencil?r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,r.DEPTH24_STENCIL8,e,e,0,r.DEPTH_STENCIL,r.UNSIGNED_INT_24_8,null):r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,r.DEPTH_COMPONENT24,e,e,0,r.DEPTH_COMPONENT,r.UNSIGNED_INT,null);return this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,null),i},qe.a.prototype._partialLoadFile=function(e,t,i,n,r){void 0===r&&(r=null),this._loadFile(e,function(e){i[t]=e,i._internalCount++,6===i._internalCount&&n(i)},void 0,void 0,!0,function(e,t){r&&e&&r(e.status+" "+e.statusText,t)})},qe.a.prototype._cascadeLoadFiles=function(e,t,i,n){void 0===n&&(n=null);var r=[];r._internalCount=0;for(var o=0;o<6;o++)this._partialLoadFile(i[o],o,r,t,n)},qe.a.prototype._cascadeLoadImgs=function(e,t,i,n,r){void 0===n&&(n=null);var o=[];o._internalCount=0;for(var a=0;a<6;a++)this._partialLoadImg(i[a],a,o,e,t,n,r)},qe.a.prototype._partialLoadImg=function(e,t,i,n,r,o,a){var s;void 0===o&&(o=null),s=Nn.a.LoadImage(e,function(){s&&(i[t]=s,i._internalCount++,n&&n._removePendingData(s)),6===i._internalCount&&r(i)},function(e,t){n&&n._removePendingData(s),o&&o(e,t)},n?n.offlineProvider:null,a),n&&s&&n._addPendingData(s)},qe.a.prototype._setCubeMapTextureParams=function(e,t){var i=this._gl;i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,t?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),e.samplingMode=t?g.a.TEXTURE_TRILINEAR_SAMPLINGMODE:g.a.TEXTURE_LINEAR_LINEAR,this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)},qe.a.prototype.createCubeTexture=function(e,t,i,n,r,o,a,s,c,l,u,h,d){var f=this;void 0===r&&(r=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===c&&(c=!1),void 0===l&&(l=0),void 0===u&&(u=0),void 0===h&&(h=null);var p=this._gl,_=h||new Qe.a(this,Qe.b.Cube);_.isCube=!0,_.url=e,_.generateMipMaps=!n,_._lodGenerationScale=l,_._lodGenerationOffset=u,this._doNotHandleContextLost||(_._extension=s,_._files=i);var g=e;this._transformTextureUrl&&!h&&(e=this._transformTextureUrl(e));for(var v=e.lastIndexOf("."),b=s||(v>-1?e.substring(v).toLowerCase():""),y=null,T=0,E=qe.a._TextureLoaders;T<E.length;T++){var S=E[T];if(S.canLoad(b)){y=S;break}}if(y){var A=function(e){f._bindTextureDirectly(p.TEXTURE_CUBE_MAP,_,!0),y.loadCubeData(e,_,c,r,o)};i&&6===i.length?y.supportCascades?this._cascadeLoadFiles(t,function(e){return A(e.map(function(e){return new Uint8Array(e)}))},i,o):o?o("Textures type does not support cascades."):m.a.Warn("Texture loader does not support cascades."):this._loadFile(e,function(e){return A(new Uint8Array(e))},void 0,void 0,!0,function(h,p){e===g?o&&h&&o(h.status+" "+h.statusText,p):(m.a.Warn("Failed to load "+e+", falling back to the "+g),f.createCubeTexture(g,t,i,n,r,o,a,s,c,l,u,_,d))})}else{if(!i)throw new Error("Cannot load cubemap because files were not defined");this._cascadeLoadImgs(t,function(e){var t=f.needPOTTextures?qe.a.GetExponentOfTwo(e[0].width,f._caps.maxCubemapTextureSize):e[0].width,i=t,o=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];f._bindTextureDirectly(p.TEXTURE_CUBE_MAP,_,!0),f._unpackFlipY(!1);for(var s=a?f._getInternalFormat(a):f._gl.RGBA,c=0;c<o.length;c++)if(e[c].width!==t||e[c].height!==i){if(f._prepareWorkingCanvas(),!f._workingCanvas||!f._workingContext)return void m.a.Warn("Cannot create canvas to resize texture.");f._workingCanvas.width=t,f._workingCanvas.height=i,f._workingContext.drawImage(e[c],0,0,e[c].width,e[c].height,0,0,t,i),p.texImage2D(o[c],0,s,s,p.UNSIGNED_BYTE,f._workingCanvas)}else p.texImage2D(o[c],0,s,s,p.UNSIGNED_BYTE,e[c]);n||p.generateMipmap(p.TEXTURE_CUBE_MAP),f._setCubeMapTextureParams(_,!n),_.width=t,_.height=i,_.isReady=!0,a&&(_.format=a),_.onLoadedObservable.notifyObservers(_),_.onLoadedObservable.clear(),r&&r()},i,o)}return this._internalTexturesCache.push(_),_},i(153),i(124);var Ln=function(){};function wn(e){if(this._excludedCompressedTextures&&this._excludedCompressedTextures.some(function(t){var i="\\b"+t+"\\b";return e&&(e===t||e.match(new RegExp(i,"g")))}))return e;var t=e.lastIndexOf("."),i=e.lastIndexOf("?"),n=i>-1?e.substring(i,e.length):"";return(t>-1?e.substring(0,t):e)+this._textureFormatInUse+n}Se.a.prototype.getInputElement=function(){return this.inputElement||this.getRenderingCanvas()},Se.a.prototype.registerView=function(e,t){var i=this;this.views||(this.views=[]);for(var n=0,r=this.views;n<r.length;n++){var o=r[n];if(o.target===e)return o}var a=this.getRenderingCanvas();a&&(e.width=a.width,e.height=a.height);var s={target:e,camera:t};return this.views.push(s),t&&t.onDisposeObservable.add(function(){i.unRegisterView(e)}),s},Se.a.prototype.unRegisterView=function(e){if(!this.views)return this;for(var t=0,i=this.views;t<i.length;t++){var n=i[t];if(n.target===e){var r=this.views.indexOf(n);-1!==r&&this.views.splice(r,1);break}}return this},Se.a.prototype._renderViews=function(){if(!this.views)return!1;var e=this.getRenderingCanvas();if(!e)return!1;for(var t=0,i=this.views;t<i.length;t++){var n=i[t],r=n.target,o=r.getContext("2d");if(o){var a=n.camera,s=null,c=null;if(a){if((c=a.getScene()).activeCameras&&c.activeCameras.length)continue;this.activeView=n,s=c.activeCamera,c.activeCamera=a}var l=r.width!==r.clientWidth||r.height!==r.clientHeight;if(r.clientWidth&&r.clientHeight&&l&&(r.width=r.clientWidth,r.height=r.clientHeight,e.width=r.clientWidth,e.height=r.clientHeight,this.resize()),!e.width||!e.height)return!1;this._renderFrame(),o.drawImage(e,0,0),s&&c&&(c.activeCamera=s)}}return this.activeView=null,!0},i(129),Object.defineProperty(Se.a.prototype,"texturesSupported",{get:function(){var e=new Array;return this._caps.astc&&e.push("-astc.ktx"),this._caps.s3tc&&e.push("-dxt.ktx"),this._caps.pvrtc&&e.push("-pvrtc.ktx"),this._caps.etc2&&e.push("-etc2.ktx"),this._caps.etc1&&e.push("-etc1.ktx"),e},enumerable:!0,configurable:!0}),Object.defineProperty(Se.a.prototype,"textureFormatInUse",{get:function(){return this._textureFormatInUse||null},enumerable:!0,configurable:!0}),Se.a.prototype.setCompressedTextureExclusions=function(e){this._excludedCompressedTextures=e},Se.a.prototype.setTextureFormatToUse=function(e){for(var t=this.texturesSupported,i=0,n=t.length;i<n;i++)for(var r=0,o=e.length;r<o;r++)if(t[i]===e[r].toLowerCase())return this._transformTextureUrl=wn.bind(this),this._textureFormatInUse=t[i];return this._textureFormatInUse="",this._transformTextureUrl=null,null};var Fn=i(144),Bn=i(118),Un=i(89),Vn=[Math.sqrt(1/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(3/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(15/(4*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(5/(16*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(15/(16*Math.PI))],kn=[function(e){return 1},function(e){return e.y},function(e){return e.z},function(e){return e.x},function(e){return e.x*e.y},function(e){return e.y*e.z},function(e){return 3*e.z*e.z-1},function(e){return e.x*e.z},function(e){return e.x*e.x-e.y*e.y}],Gn=function(e,t){return Vn[e]*kn[e](t)},zn=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4],jn=function(){function e(){this.preScaled=!1,this.l00=a.e.Zero(),this.l1_1=a.e.Zero(),this.l10=a.e.Zero(),this.l11=a.e.Zero(),this.l2_2=a.e.Zero(),this.l2_1=a.e.Zero(),this.l20=a.e.Zero(),this.l21=a.e.Zero(),this.l22=a.e.Zero()}return e.prototype.addLight=function(e,t,i){var n=new a.e(t.r,t.g,t.b).scale(i);this.l00=this.l00.add(n.scale(Gn(0,e))),this.l1_1=this.l1_1.add(n.scale(Gn(1,e))),this.l10=this.l10.add(n.scale(Gn(2,e))),this.l11=this.l11.add(n.scale(Gn(3,e))),this.l2_2=this.l2_2.add(n.scale(Gn(4,e))),this.l2_1=this.l2_1.add(n.scale(Gn(5,e))),this.l20=this.l20.add(n.scale(Gn(6,e))),this.l21=this.l21.add(n.scale(Gn(7,e))),this.l22=this.l22.add(n.scale(Gn(8,e)))},e.prototype.scaleInPlace=function(e){this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)},e.prototype.convertIncidentRadianceToIrradiance=function(){this.l00.scaleInPlace(zn[0]),this.l1_1.scaleInPlace(zn[1]),this.l10.scaleInPlace(zn[2]),this.l11.scaleInPlace(zn[3]),this.l2_2.scaleInPlace(zn[4]),this.l2_1.scaleInPlace(zn[5]),this.l20.scaleInPlace(zn[6]),this.l21.scaleInPlace(zn[7]),this.l22.scaleInPlace(zn[8])},e.prototype.convertIrradianceToLambertianRadiance=function(){this.scaleInPlace(1/Math.PI)},e.prototype.preScaleForRendering=function(){this.preScaled=!0,this.l00.scaleInPlace(Vn[0]),this.l1_1.scaleInPlace(Vn[1]),this.l10.scaleInPlace(Vn[2]),this.l11.scaleInPlace(Vn[3]),this.l2_2.scaleInPlace(Vn[4]),this.l2_1.scaleInPlace(Vn[5]),this.l20.scaleInPlace(Vn[6]),this.l21.scaleInPlace(Vn[7]),this.l22.scaleInPlace(Vn[8])},e.FromArray=function(t){var i=new e;return a.e.FromArrayToRef(t[0],0,i.l00),a.e.FromArrayToRef(t[1],0,i.l1_1),a.e.FromArrayToRef(t[2],0,i.l10),a.e.FromArrayToRef(t[3],0,i.l11),a.e.FromArrayToRef(t[4],0,i.l2_2),a.e.FromArrayToRef(t[5],0,i.l2_1),a.e.FromArrayToRef(t[6],0,i.l20),a.e.FromArrayToRef(t[7],0,i.l21),a.e.FromArrayToRef(t[8],0,i.l22),i},e.FromPolynomial=function(t){var i=new e;return i.l00=t.xx.scale(.376127).add(t.yy.scale(.376127)).add(t.zz.scale(.376126)),i.l1_1=t.y.scale(.977204),i.l10=t.z.scale(.977204),i.l11=t.x.scale(.977204),i.l2_2=t.xy.scale(1.16538),i.l2_1=t.yz.scale(1.16538),i.l20=t.zz.scale(1.34567).subtract(t.xx.scale(.672834)).subtract(t.yy.scale(.672834)),i.l21=t.zx.scale(1.16538),i.l22=t.xx.scale(1.16538).subtract(t.yy.scale(1.16538)),i.l1_1.scaleInPlace(-1),i.l11.scaleInPlace(-1),i.l2_1.scaleInPlace(-1),i.l21.scaleInPlace(-1),i.scaleInPlace(Math.PI),i},e}(),Wn=function(){function e(){this.x=a.e.Zero(),this.y=a.e.Zero(),this.z=a.e.Zero(),this.xx=a.e.Zero(),this.yy=a.e.Zero(),this.zz=a.e.Zero(),this.xy=a.e.Zero(),this.yz=a.e.Zero(),this.zx=a.e.Zero()}return Object.defineProperty(e.prototype,"preScaledHarmonics",{get:function(){return this._harmonics||(this._harmonics=jn.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics},enumerable:!1,configurable:!0}),e.prototype.addAmbient=function(e){var t=new a.e(e.r,e.g,e.b);this.xx=this.xx.add(t),this.yy=this.yy.add(t),this.zz=this.zz.add(t)},e.prototype.scaleInPlace=function(e){this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)},e.FromHarmonics=function(t){var i=new e;return i._harmonics=t,i.x=t.l11.scale(1.02333).scale(-1),i.y=t.l1_1.scale(1.02333).scale(-1),i.z=t.l10.scale(1.02333),i.xx=t.l00.scale(.886277).subtract(t.l20.scale(.247708)).add(t.l22.scale(.429043)),i.yy=t.l00.scale(.886277).subtract(t.l20.scale(.247708)).subtract(t.l22.scale(.429043)),i.zz=t.l00.scale(.886277).add(t.l20.scale(.495417)),i.yz=t.l2_1.scale(.858086).scale(-1),i.zx=t.l21.scale(.858086).scale(-1),i.xy=t.l2_2.scale(.858086),i.scaleInPlace(1/Math.PI),i},e.FromArray=function(t){var i=new e;return a.e.FromArrayToRef(t[0],0,i.x),a.e.FromArrayToRef(t[1],0,i.y),a.e.FromArrayToRef(t[2],0,i.z),a.e.FromArrayToRef(t[3],0,i.xx),a.e.FromArrayToRef(t[4],0,i.yy),a.e.FromArrayToRef(t[5],0,i.zz),a.e.FromArrayToRef(t[6],0,i.yz),a.e.FromArrayToRef(t[7],0,i.zx),a.e.FromArrayToRef(t[8],0,i.xy),i},e}(),Hn=i(52),Xn=function(e,t,i,n){this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=i,this.worldAxisForFileY=n},Yn=function(){function e(){}return e.ConvertCubeMapTextureToSphericalPolynomial=function(e){if(!e.isCube)return null;var t,i,n=e.getSize().width,r=e.readPixels(0),o=e.readPixels(1);e.isRenderTarget?(t=e.readPixels(3),i=e.readPixels(2)):(t=e.readPixels(2),i=e.readPixels(3));var a=e.readPixels(4),s=e.readPixels(5),c=e.gammaSpace,l=g.a.TEXTUREFORMAT_RGBA,u=g.a.TEXTURETYPE_UNSIGNED_INT;e.textureType!=g.a.TEXTURETYPE_FLOAT&&e.textureType!=g.a.TEXTURETYPE_HALF_FLOAT||(u=g.a.TEXTURETYPE_FLOAT);var h={size:n,right:r,left:o,up:t,down:i,front:a,back:s,format:l,type:u,gammaSpace:c};return this.ConvertCubeMapToSphericalPolynomial(h)},e.ConvertCubeMapToSphericalPolynomial=function(e){for(var t=new jn,i=0,n=2/e.size,r=n,o=.5*n-1,a=0;a<6;a++)for(var c=this.FileFaces[a],l=e[c.name],u=o,h=e.format===g.a.TEXTUREFORMAT_RGBA?4:3,d=0;d<e.size;d++){for(var f=o,p=0;p<e.size;p++){var _=c.worldAxisForFileX.scale(f).add(c.worldAxisForFileY.scale(u)).add(c.worldAxisForNormal);_.normalize();var m=Math.pow(1+f*f+u*u,-1.5),v=l[d*e.size*h+p*h+0],b=l[d*e.size*h+p*h+1],y=l[d*e.size*h+p*h+2];isNaN(v)&&(v=0),isNaN(b)&&(b=0),isNaN(y)&&(y=0),e.type===g.a.TEXTURETYPE_UNSIGNED_INT&&(v/=255,b/=255,y/=255),e.gammaSpace&&(v=Math.pow(L.a.Clamp(v),Nt.c),b=Math.pow(L.a.Clamp(b),Nt.c),y=Math.pow(L.a.Clamp(y),Nt.c)),v=L.a.Clamp(v,0,4096),b=L.a.Clamp(b,0,4096),y=L.a.Clamp(y,0,4096);var T=new s.a(v,b,y);t.addLight(_,T,m),i+=m,f+=n}u+=r}var E=4*Math.PI*6/6/i;return t.scaleInPlace(E),t.convertIncidentRadianceToIrradiance(),t.convertIrradianceToLambertianRadiance(),Wn.FromHarmonics(t)},e.FileFaces=[new Xn("right",new a.e(1,0,0),new a.e(0,0,-1),new a.e(0,-1,0)),new Xn("left",new a.e(-1,0,0),new a.e(0,0,1),new a.e(0,-1,0)),new Xn("up",new a.e(0,1,0),new a.e(1,0,0),new a.e(0,0,1)),new Xn("down",new a.e(0,-1,0),new a.e(1,0,0),new a.e(0,0,-1)),new Xn("front",new a.e(0,0,1),new a.e(1,0,0),new a.e(0,-1,0)),new Xn("back",new a.e(0,0,-1),new a.e(-1,0,0),new a.e(0,-1,0))],e}();Object.defineProperty(Hn.a.prototype,"sphericalPolynomial",{get:function(){if(this._texture){if(this._texture._sphericalPolynomial)return this._texture._sphericalPolynomial;if(this._texture.isReady)return this._texture._sphericalPolynomial=Yn.ConvertCubeMapTextureToSphericalPolynomial(this),this._texture._sphericalPolynomial}return null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0});ai.a.ShadersStore.rgbdEncodePixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void)\n{\ngl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);\n}";ai.a.ShadersStore.rgbdDecodePixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void)\n{\ngl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);\n}";var Kn=function(){function e(){}return e.GetEnvInfo=function(t){for(var i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=0,r=0;r<e._MagicBytes.length;r++)if(i.getUint8(n++)!==e._MagicBytes[r])return m.a.Error("Not a babylon environment map"),null;for(var o="",a=0;a=i.getUint8(n++);)o+=String.fromCharCode(a);var s=JSON.parse(o);return s.specular&&(s.specular.specularDataPosition=n,s.specular.lodGenerationScale=s.specular.lodGenerationScale||.8),s},e.CreateEnvTextureAsync=function(t){var i=this,n=t.getInternalTexture();if(!n)return Promise.reject("The cube texture is invalid.");var r=n.getEngine();if(r&&r.premultipliedAlpha)return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");if(t.textureType===g.a.TEXTURETYPE_UNSIGNED_INT)return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");var o=r.getRenderingCanvas();if(!o)return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");var a=g.a.TEXTURETYPE_FLOAT;if(!r.getCaps().textureFloatRender&&(a=g.a.TEXTURETYPE_HALF_FLOAT,!r.getCaps().textureHalfFloatRender))return Promise.reject("Env texture can only be created when the browser supports half float or full float rendering.");var s=n.width,c=new Q.a(r),l={},u=[],h=L.a.Log2(n.width);h=Math.round(h);for(var d=function(e){for(var i=Math.pow(2,h-e),n=function(n){var s=t.readPixels(n,e),h=r.createRawTexture(s,i,i,g.a.TEXTUREFORMAT_RGBA,!1,!1,g.a.TEXTURE_NEAREST_SAMPLINGMODE,null,a),d=new Promise(function(t,a){var s=new ci("rgbdEncode","rgbdEncode",null,null,1,null,g.a.TEXTURE_NEAREST_SAMPLINGMODE,r,!1,void 0,g.a.TEXTURETYPE_UNSIGNED_INT,void 0,null,!1);s.getEffect().executeWhenCompiled(function(){s.onApply=function(e){e._bindTexture("textureSampler",h)};var a=r.getRenderWidth(),u=r.getRenderHeight();r.setSize(i,i),c.postProcessManager.directRender([s],null),Ce.b.ToBlob(o,function(i){var r=new FileReader;r.onload=function(i){var r=i.target.result;l[6*e+n]=r,t()},r.readAsArrayBuffer(i)}),r.setSize(a,u)})});u.push(d)},s=0;s<6;s++)n(s)},f=0;f<=h;f++)d(f);return Promise.all(u).then(function(){c.dispose();for(var n={version:1,width:s,irradiance:i._CreateEnvTextureIrradiance(t),specular:{mipmaps:[],lodGenerationScale:t.lodGenerationScale}},r=0,o=0;o<=h;o++)for(var a=0;a<6;a++){var u=l[6*o+a].byteLength;n.specular.mipmaps.push({length:u,position:r}),r+=u}for(var d=JSON.stringify(n),f=new ArrayBuffer(d.length+1),p=new Uint8Array(f),_=(o=0,d.length);o<_;o++)p[o]=d.charCodeAt(o);p[d.length]=0;var m=e._MagicBytes.length+r+f.byteLength,g=new ArrayBuffer(m),v=new Uint8Array(g),b=new DataView(g),y=0;for(o=0;o<e._MagicBytes.length;o++)b.setUint8(y++,e._MagicBytes[o]);for(v.set(new Uint8Array(f),y),y+=f.byteLength,o=0;o<=h;o++)for(a=0;a<6;a++){var T=l[6*o+a];v.set(new Uint8Array(T),y),y+=T.byteLength}return g})},e._CreateEnvTextureIrradiance=function(e){var t=e.sphericalPolynomial;return null==t?null:{x:[t.x.x,t.x.y,t.x.z],y:[t.y.x,t.y.y,t.y.z],z:[t.z.x,t.z.y,t.z.z],xx:[t.xx.x,t.xx.y,t.xx.z],yy:[t.yy.x,t.yy.y,t.yy.z],zz:[t.zz.x,t.zz.y,t.zz.z],yz:[t.yz.x,t.yz.y,t.yz.z],zx:[t.zx.x,t.zx.y,t.zx.z],xy:[t.xy.x,t.xy.y,t.xy.z]}},e.CreateImageDataArrayBufferViews=function(e,t){if(1!==t.version)throw new Error('Unsupported babylon environment map version "'+t.version+'"');var i=t.specular,n=L.a.Log2(t.width);if(n=Math.round(n)+1,i.mipmaps.length!==6*n)throw new Error('Unsupported specular mipmaps number "'+i.mipmaps.length+'"');for(var r=new Array(n),o=0;o<n;o++){r[o]=new Array(6);for(var a=0;a<6;a++){var s=i.mipmaps[6*o+a];r[o][a]=new Uint8Array(e.buffer,e.byteOffset+i.specularDataPosition+s.position,s.length)}}return r},e.UploadEnvLevelsAsync=function(t,i,n){if(1!==n.version)throw new Error('Unsupported babylon environment map version "'+n.version+'"');var r=n.specular;if(!r)return Promise.resolve();t._lodGenerationScale=r.lodGenerationScale;var o=e.CreateImageDataArrayBufferViews(i,n);return e.UploadLevelsAsync(t,o)},e._OnImageReadyAsync=function(e,t,i,n,r,o,a,s,c,l,u){return new Promise(function(h,d){if(i){var f=t.createTexture(null,!0,!0,null,g.a.TEXTURE_NEAREST_SAMPLINGMODE,null,function(e){d(e)},e);n.getEffect().executeWhenCompiled(function(){n.onApply=function(e){e._bindTexture("textureSampler",f),e.setFloat2("scale",1,1)},t.scenes[0].postProcessManager.directRender([n],l,!0,o,a),t.restoreDefaultFramebuffer(),f.dispose(),URL.revokeObjectURL(r),h()})}else{if(t._uploadImageToTexture(u,e,o,a),s){var p=c[a];p&&t._uploadImageToTexture(p._texture,e,o,0)}h()}})},e.UploadLevelsAsync=function(e,t){var i=this;if(!Ce.b.IsExponentOfTwo(e.width))throw new Error("Texture size must be a power of two");var n=Math.round(L.a.Log2(e.width))+1,r=e.getEngine(),o=!1,a=!1,s=null,c=null,l=null,u=r.getCaps();if(e.format=g.a.TEXTUREFORMAT_RGBA,e.type=g.a.TEXTURETYPE_UNSIGNED_INT,e.generateMipMaps=!0,e._cachedAnisotropicFilteringLevel=null,r.updateTextureSamplingMode(g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,e),u.textureLOD?r.webGLVersion<2?o=!1:u.textureHalfFloatRender&&u.textureHalfFloatLinearFiltering?(o=!0,e.type=g.a.TEXTURETYPE_HALF_FLOAT):u.textureFloatRender&&u.textureFloatLinearFiltering&&(o=!0,e.type=g.a.TEXTURETYPE_FLOAT):(o=!1,a=!0,l={}),o)s=new ci("rgbdDecode","rgbdDecode",null,null,1,null,g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,r,!1,void 0,e.type,void 0,null,!1),e._isRGBD=!1,e.invertY=!1,c=r.createRenderTargetCubeTexture(e.width,{generateDepthBuffer:!1,generateMipMaps:!0,generateStencilBuffer:!1,samplingMode:g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,type:e.type,format:g.a.TEXTUREFORMAT_RGBA});else if(e._isRGBD=!0,e.invertY=!0,a)for(var h=e._lodGenerationScale,d=e._lodGenerationOffset,f=0;f<3;f++){var p=(n-1)*h+d,_=d+(p-d)*(1-f/2),m=Math.round(Math.min(Math.max(_,0),p)),v=new Qe.a(r,Qe.b.Temp);v.isCube=!0,v.invertY=!0,v.generateMipMaps=!1,r.updateTextureSamplingMode(g.a.TEXTURE_LINEAR_LINEAR,v);var b=new Hn.a(null);switch(b.isCube=!0,b._texture=v,l[m]=b,f){case 0:e._lodTextureLow=b;break;case 1:e._lodTextureMid=b;break;case 2:e._lodTextureHigh=b}}var y=[],T=function(n){for(var u=function(u){var h=t[n][u],d=new Blob([h],{type:"image/png"}),f=URL.createObjectURL(d),p=void 0;if("undefined"==typeof Image)p=createImageBitmap(d).then(function(t){return i._OnImageReadyAsync(t,r,o,s,f,u,n,a,l,c,e)});else{var _=new Image;_.src=f,p=new Promise(function(t,h){_.onload=function(){i._OnImageReadyAsync(_,r,o,s,f,u,n,a,l,c,e).then(function(){return t()}).catch(function(e){h(e)})},_.onerror=function(e){h(e)}})}y.push(p)},h=0;h<6;h++)u(h)};for(f=0;f<t.length;f++)T(f);if(t.length<n){var E=void 0,S=Math.pow(2,n-1-t.length),A=S*S*4;switch(e.type){case g.a.TEXTURETYPE_UNSIGNED_INT:E=new Uint8Array(A);break;case g.a.TEXTURETYPE_HALF_FLOAT:E=new Uint16Array(A);break;case g.a.TEXTURETYPE_FLOAT:E=new Float32Array(A)}for(f=t.length;f<n;f++)for(var P=0;P<6;P++)r._uploadArrayBufferViewToTexture(e,E,P,f)}return Promise.all(y).then(function(){c&&(r._releaseFramebufferObjects(c),r._releaseTexture(e),c._swapAndDie(e)),s&&s.dispose(),a&&(e._lodTextureHigh&&e._lodTextureHigh._texture&&(e._lodTextureHigh._texture.isReady=!0),e._lodTextureMid&&e._lodTextureMid._texture&&(e._lodTextureMid._texture.isReady=!0),e._lodTextureLow&&e._lodTextureLow._texture&&(e._lodTextureLow._texture.isReady=!0))})},e.UploadEnvSpherical=function(e,t){1!==t.version&&m.a.Warn('Unsupported babylon environment map version "'+t.version+'"');var i=t.irradiance;if(i){var n=new Wn;a.e.FromArrayToRef(i.x,0,n.x),a.e.FromArrayToRef(i.y,0,n.y),a.e.FromArrayToRef(i.z,0,n.z),a.e.FromArrayToRef(i.xx,0,n.xx),a.e.FromArrayToRef(i.yy,0,n.yy),a.e.FromArrayToRef(i.zz,0,n.zz),a.e.FromArrayToRef(i.yz,0,n.yz),a.e.FromArrayToRef(i.zx,0,n.zx),a.e.FromArrayToRef(i.xy,0,n.xy),e._sphericalPolynomial=n}},e._UpdateRGBDAsync=function(t,i,n,r,o){return t._source=Qe.b.CubeRawRGBD,t._bufferViewArrayArray=i,t._lodGenerationScale=r,t._lodGenerationOffset=o,t._sphericalPolynomial=n,e.UploadLevelsAsync(t,i).then(function(){t.isReady=!0})},e._MagicBytes=[134,22,135,150,246,214,150,54],e}();Qe.a._UpdateRGBDAsync=Kn._UpdateRGBDAsync;var Qn,qn=function(){function e(e,t){void 0===t&&(t=20),this.debug=!1,this._sourceCode=e,this._numMaxIterations=t,this._functionDescr=[],this.inlineToken="#define inline"}return Object.defineProperty(e.prototype,"code",{get:function(){return this._sourceCode},enumerable:!1,configurable:!0}),e.prototype.processCode=function(){this.debug&&console.log("Start inlining process (code size="+this._sourceCode.length+")..."),this._collectFunctions(),this._processInlining(this._numMaxIterations),this.debug&&console.log("End of inlining process.")},e.prototype._collectFunctions=function(){for(var t=0;t<this._sourceCode.length;){var i=this._sourceCode.indexOf(this.inlineToken,t);if(i<0)break;var n=this._sourceCode.indexOf("(",i+this.inlineToken.length);if(n<0)this.debug&&console.warn("Could not find the opening parenthesis after the token. startIndex="+t),t=i+this.inlineToken.length;else{var r=e._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(i+this.inlineToken.length,n));if(r){var o=[r[3],r[4]],a=o[0],s=o[1],c=this._extractBetweenMarkers("(",")",this._sourceCode,n);if(c<0)this.debug&&console.warn("Could not extract the parameters the function '"+s+"' (type="+a+"). funcParamsStartIndex="+n),t=i+this.inlineToken.length;else{var l=this._sourceCode.substring(n+1,c),u=this._skipWhitespaces(this._sourceCode,c+1);if(u!==this._sourceCode.length){var h=this._extractBetweenMarkers("{","}",this._sourceCode,u);if(h<0)this.debug&&console.warn("Could not extract the body of the function '"+s+"' (type="+a+"). funcBodyStartIndex="+u),t=i+this.inlineToken.length;else{for(var d=this._sourceCode.substring(u,h+1),f=this._removeComments(l).split(","),p=[],_=0;_<f.length;++_){var m=f[_].trim(),g=m.lastIndexOf(" ");g>=0&&p.push(m.substring(g+1))}"void"!==a&&p.push("return"),this._functionDescr.push({name:s,type:a,parameters:p,body:d,callIndex:0}),t=h+1;var v=i>0?this._sourceCode.substring(0,i):"",b=h+1<this._sourceCode.length-1?this._sourceCode.substring(h+1):"";this._sourceCode=v+b,t-=h+1-i}}else this.debug&&console.warn("Could not extract the body of the function '"+s+"' (type="+a+"). funcParamsEndIndex="+c),t=i+this.inlineToken.length}}else this.debug&&console.warn("Could not extract the name/type of the function from: "+this._sourceCode.substring(i+this.inlineToken.length,n)),t=i+this.inlineToken.length}}this.debug&&console.log("Collect functions: "+this._functionDescr.length+" functions found. functionDescr=",this._functionDescr)},e.prototype._processInlining=function(e){for(void 0===e&&(e=20);e-- >=0&&this._replaceFunctionCallsByCode(););return this.debug&&console.log("numMaxIterations is "+e+" after inlining process"),e>=0},e.prototype._extractBetweenMarkers=function(e,t,i,n){for(var r=n,o=0,a="";r<i.length;){var s=i.charAt(r);if(a)s===a?'"'===a||"'"===a?"\\"!==i.charAt(r-1)&&(a=""):a="":"*/"===a&&"*"===s&&r+1<i.length&&("/"===i.charAt(r+1)&&(a=""),""===a&&r++);else switch(s){case e:o++;break;case t:o--;break;case'"':case"'":case"`":a=s;break;case"/":if(r+1<i.length){var c=i.charAt(r+1);"/"===c?a="\n":"*"===c&&(a="*/")}}if(r++,0===o)break}return 0===o?r-1:-1},e.prototype._skipWhitespaces=function(e,t){for(;t<e.length;){var i=e[t];if(" "!==i&&"\n"!==i&&"\r"!==i&&"\t"!==i&&"\n"!==i&&" "!==i)break;t++}return t},e.prototype._removeComments=function(e){for(var t=0,i="",n=!1,r=[];t<e.length;){var o=e.charAt(t);if(i)o===i?'"'===i||"'"===i?("\\"!==e.charAt(t-1)&&(i=""),r.push(o)):(i="",n=!1):"*/"===i&&"*"===o&&t+1<e.length?("/"===e.charAt(t+1)&&(i=""),""===i&&(n=!1,t++)):n||r.push(o);else{switch(o){case'"':case"'":case"`":i=o;break;case"/":if(t+1<e.length){var a=e.charAt(t+1);"/"===a?(i="\n",n=!0):"*"===a&&(i="*/",n=!0)}}n||r.push(o)}t++}return r.join("")},e.prototype._replaceFunctionCallsByCode=function(){for(var e=!1,t=0,i=this._functionDescr;t<i.length;t++)for(var n=i[t],r=n.name,o=n.type,a=n.parameters,s=n.body,c=0;c<this._sourceCode.length;){var l=this._sourceCode.indexOf(r,c);if(l<0)break;var u=this._skipWhitespaces(this._sourceCode,l+r.length);if(u!==this._sourceCode.length&&"("===this._sourceCode.charAt(u)){var h=this._extractBetweenMarkers("(",")",this._sourceCode,u);if(h<0)this.debug&&console.warn("Could not extract the parameters of the function call. Function '"+r+"' (type="+o+"). callParamsStartIndex="+u),c=l+r.length;else{for(var d=this._sourceCode.substring(u+1,h),f=this._removeComments(d).split(","),p=[],_=0;_<f.length;++_){var m=f[_].trim();p.push(m)}var g="void"!==o?r+"_"+n.callIndex++:null;if(g&&p.push(g+" ="),p.length===a.length){c=h+1;var v=this._replaceNames(s,a,p),b=l>0?this._sourceCode.substring(0,l):"",y=h+1<this._sourceCode.length-1?this._sourceCode.substring(h+1):"";if(g){var T=this._findBackward(this._sourceCode,l-1,"\n");b=this._sourceCode.substring(0,T+1);var E=this._sourceCode.substring(T+1,l);this._sourceCode=b+o+" "+g+";\n"+v+"\n"+E+g+y,this.debug&&console.log("Replace function call by code. Function '"+r+"' (type="+o+"). injectDeclarationIndex="+T)}else this._sourceCode=b+v+y,c+=v.length-(h+1-l),this.debug&&console.log("Replace function call by code. Function '"+r+"' (type="+o+"). functionCallIndex="+l);e=!0}else this.debug&&console.warn("Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '"+r+"' (type="+o+"). function parameters="+a+", call parameters="+p),c=l+r.length}}else c=l+r.length}return e},e.prototype._findBackward=function(e,t,i){for(;t>=0&&e.charAt(t)!==i;)t--;return t},e.prototype._escapeRegExp=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},e.prototype._replaceNames=function(e,t,i){for(var n=0;n<t.length;++n){var r=new RegExp(this._escapeRegExp(t[n]),"g"),o=i[n];e=e.replace(r,o)}return e},e._RegexpFindFunctionNameAndType=/((\s+?)(\w+)\s+(\w+)\s*?)$/,e}(),Zn=function(){function e(){this.isAsync=!1,this.isReady=!1}return e.prototype._getVertexShaderCode=function(){return null},e.prototype._getFragmentShaderCode=function(){return null},e.prototype._handlesSpectorRebuildCallback=function(e){throw new Error("Not implemented")},e}(),Jn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t}(Un.a),$n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.getInternalTexture=function(){return this},t.prototype.getViewCount=function(){return 1},t}(Qe.a),er=function(e){function t(){var t=e.call(this,null)||this;return t._native=new _native.Engine,t.INVALID_HANDLE=65535,t._boundBuffersVertexArray=null,t._currentDepthTest=t._native.DEPTH_TEST_LEQUAL,t._webGLVersion=2,t.disableUniformBuffers=!0,t._caps={maxTexturesImageUnits:16,maxVertexTextureImageUnits:16,maxCombinedTexturesImageUnits:32,maxTextureSize:512,maxCubemapTextureSize:512,maxRenderTextureSize:512,maxVertexAttribs:16,maxVaryingVectors:16,maxFragmentUniformVectors:16,maxVertexUniformVectors:16,standardDerivatives:!0,astc:null,pvrtc:null,etc1:null,etc2:null,bptc:null,maxAnisotropy:16,uintIndices:!0,fragmentDepthSupported:!1,highPrecisionShaderSupported:!0,colorBufferFloat:!1,textureFloat:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloat:!1,textureHalfFloatLinearFiltering:!1,textureHalfFloatRender:!1,textureLOD:!0,drawBuffersExtension:!1,depthTextureExtension:!1,vertexArrayObject:!0,instancedArrays:!1,canUseTimestampForTimerQuery:!1,blendMinMax:!1,maxMSAASamples:1},Ce.b.Log("Babylon Native (v"+Se.a.Version+") launched"),Ce.b.LoadScript=function(e,t,i,n){Ce.b.LoadFile(e,function(e){Function(e).apply(null),t&&t()},void 0,void 0,!1,function(e,t){i&&i("LoadScript Error",t)})},"undefined"==typeof URL&&(window.URL={createObjectURL:function(){},revokeObjectURL:function(){}}),"undefined"==typeof Blob&&(window.Blob=function(){}),t._shaderProcessor=new Bn.a,t}return Object(h.d)(t,e),t.prototype.getHardwareScalingLevel=function(){return 1},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._boundBuffersVertexArray&&this._native.deleteVertexArray(this._boundBuffersVertexArray),this._native.dispose()},t.prototype._queueNewFrame=function(e,t){return t.requestAnimationFrame&&t!==window?t.requestAnimationFrame(e):this._native.requestAnimationFrame(e),0},t.prototype._bindUnboundFramebuffer=function(e){this._currentFramebuffer!==e&&(this._currentFramebuffer&&this._native.unbindFramebuffer(this._currentFramebuffer),e&&this._native.bindFramebuffer(e),this._currentFramebuffer=e)},t.prototype.getHostDocument=function(){return null},t.prototype.clear=function(e,t,i,n){void 0===n&&(n=!1);var r=0;t&&e&&(this._native.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),r|=this._native.CLEAR_FLAG_COLOR),i&&(this._native.clearDepth(1),r|=this._native.CLEAR_FLAG_DEPTH),n&&(this._native.clearStencil(0),r|=this._native.CLEAR_FLAG_STENCIL),this._native.clear(r)},t.prototype.createIndexBuffer=function(e,t){var i=this._normalizeIndexData(e),n=new Jn;if(n.references=1,n.is32Bits=4===i.BYTES_PER_ELEMENT,i.length){if(n.nativeIndexBuffer=this._native.createIndexBuffer(i,null!=t&&t),n.nativeVertexBuffer===this.INVALID_HANDLE)throw new Error("Could not create a native index buffer.")}else n.nativeVertexBuffer=this.INVALID_HANDLE;return n},t.prototype.createVertexBuffer=function(e,t){var i=new Jn;if(i.references=1,i.nativeVertexBuffer=this._native.createVertexBuffer(ArrayBuffer.isView(e)?e:new Float32Array(e),null!=t&&t),i.nativeVertexBuffer===this.INVALID_HANDLE)throw new Error("Could not create a native vertex buffer.");return i},t.prototype._recordVertexArrayObject=function(e,t,i,n){i&&this._native.recordIndexBuffer(e,i.nativeIndexBuffer);for(var r=n.getAttributesNames(),o=0;o<r.length;o++){var a=n.getAttributeLocation(o);if(a>=0){var s=t[r[o]];if(s){var c=s.getBuffer();c&&this._native.recordVertexBuffer(e,c.nativeVertexBuffer,a,s.byteOffset,s.byteStride,s.getSize(),this._getNativeAttribType(s.type),s.normalized)}}}},t.prototype.bindBuffers=function(e,t,i){this._boundBuffersVertexArray&&this._native.deleteVertexArray(this._boundBuffersVertexArray),this._boundBuffersVertexArray=this._native.createVertexArray(),this._recordVertexArrayObject(this._boundBuffersVertexArray,e,t,i),this._native.bindVertexArray(this._boundBuffersVertexArray)},t.prototype.recordVertexArrayObject=function(e,t,i){var n=this._native.createVertexArray();return this._recordVertexArrayObject(n,e,t,i),n},t.prototype.bindVertexArrayObject=function(e){this._native.bindVertexArray(e)},t.prototype.releaseVertexArrayObject=function(e){this._native.deleteVertexArray(e)},t.prototype.getAttributes=function(e,t){var i=e;return this._native.getAttributes(i.nativeProgram,t)},t.prototype.drawElementsType=function(e,t,i,n){this._drawCalls.addCount(1,!1),this._native.drawIndexed(e,t,i)},t.prototype.drawArraysType=function(e,t,i,n){this._drawCalls.addCount(1,!1),this._native.draw(e,t,i)},t.prototype.createPipelineContext=function(){return new Zn},t.prototype._preparePipelineContext=function(e,t,i,n,r,o,a){e.nativeProgram=n?this.createRawShaderProgram(e,t,i,void 0,a):this.createShaderProgram(e,t,i,o,void 0,a)},t.prototype._isRenderingStateCompiled=function(e){return!0},t.prototype._executeWhenRenderingStateIsCompiled=function(e,t){t()},t.prototype.createRawShaderProgram=function(e,t,i,n,r){throw void 0===r&&(r=null),new Error("Not Supported")},t.prototype.createShaderProgram=function(e,t,i,n,r,o){void 0===o&&(o=null),this.onBeforeShaderCompilationObservable.notifyObservers(this);var a=new qn(t);a.processCode(),t=a.code;var s=new qn(i);s.processCode(),i=s.code,t=qe.a._ConcatenateShader(t,n),i=qe.a._ConcatenateShader(i,n);var c=this._native.createProgram(t,i);return this.onAfterShaderCompilationObservable.notifyObservers(this),c},t.prototype._setProgram=function(e){this._currentProgram!==e&&(this._native.setProgram(e),this._currentProgram=e)},t.prototype._releaseEffect=function(e){},t.prototype._deletePipelineContext=function(e){},t.prototype.getUniforms=function(e,t){var i=e;return this._native.getUniforms(i.nativeProgram,t)},t.prototype.bindUniformBlock=function(e,t,i){throw new Error("Not Implemented")},t.prototype.bindSamplers=function(e){var t=e.getPipelineContext();this._setProgram(t.nativeProgram);for(var i=e.getSamplers(),n=0;n<i.length;n++){var r=e.getUniform(i[n]);r&&(this._boundUniforms[n]=r)}this._currentEffect=null},t.prototype.setMatrix=function(e,t){e&&this._native.setMatrix(e,t.toArray())},t.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._native.getRenderWidth()},t.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._native.getRenderHeight()},t.prototype.setViewport=function(e,t,i){this._cachedViewport=e,this._native.setViewPort(e.x,e.y,e.width,e.height)},t.prototype.setState=function(e,t,i,n){void 0===t&&(t=0),void 0===n&&(n=!1),this._native.setState(e,t,n)},t.prototype.setZOffset=function(e){this._native.setZOffset(e)},t.prototype.getZOffset=function(){return this._native.getZOffset()},t.prototype.setDepthBuffer=function(e){this._native.setDepthTest(e?this._currentDepthTest:this._native.DEPTH_TEST_ALWAYS)},t.prototype.getDepthWrite=function(){return this._native.getDepthWrite()},t.prototype.setDepthFunctionToGreater=function(){this._currentDepthTest=this._native.DEPTH_TEST_GREATER,this._native.setDepthTest(this._currentDepthTest)},t.prototype.setDepthFunctionToGreaterOrEqual=function(){this._currentDepthTest=this._native.DEPTH_TEST_GEQUAL,this._native.setDepthTest(this._currentDepthTest)},t.prototype.setDepthFunctionToLess=function(){this._currentDepthTest=this._native.DEPTH_TEST_LESS,this._native.setDepthTest(this._currentDepthTest)},t.prototype.setDepthFunctionToLessOrEqual=function(){this._currentDepthTest=this._native.DEPTH_TEST_LEQUAL,this._native.setDepthTest(this._currentDepthTest)},t.prototype.setDepthWrite=function(e){this._native.setDepthWrite(e)},t.prototype.setColorWrite=function(e){this._native.setColorWrite(e),this._colorWrite=e},t.prototype.getColorWrite=function(){return this._colorWrite},t.prototype.setAlphaConstants=function(e,t,i,n){throw new Error("Setting alpha blend constant color not yet implemented.")},t.prototype.setAlphaMode=function(e,t){void 0===t&&(t=!1),this._alphaMode!==e&&(e=this._getNativeAlphaMode(e),this._native.setBlendMode(e),t||this.setDepthWrite(e===g.a.ALPHA_DISABLE),this._alphaMode=e)},t.prototype.getAlphaMode=function(){return this._alphaMode},t.prototype.setInt=function(e,t){return!!e&&(this._native.setInt(e,t),!0)},t.prototype.setIntArray=function(e,t){return!!e&&(this._native.setIntArray(e,t),!0)},t.prototype.setIntArray2=function(e,t){return!!e&&(this._native.setIntArray2(e,t),!0)},t.prototype.setIntArray3=function(e,t){return!!e&&(this._native.setIntArray3(e,t),!0)},t.prototype.setIntArray4=function(e,t){return!!e&&(this._native.setIntArray4(e,t),!0)},t.prototype.setFloatArray=function(e,t){return!!e&&(this._native.setFloatArray(e,t),!0)},t.prototype.setFloatArray2=function(e,t){return!!e&&(this._native.setFloatArray2(e,t),!0)},t.prototype.setFloatArray3=function(e,t){return!!e&&(this._native.setFloatArray3(e,t),!0)},t.prototype.setFloatArray4=function(e,t){return!!e&&(this._native.setFloatArray4(e,t),!0)},t.prototype.setArray=function(e,t){return!!e&&(this._native.setFloatArray(e,t),!0)},t.prototype.setArray2=function(e,t){return!!e&&(this._native.setFloatArray2(e,t),!0)},t.prototype.setArray3=function(e,t){return!!e&&(this._native.setFloatArray3(e,t),!0)},t.prototype.setArray4=function(e,t){return!!e&&(this._native.setFloatArray4(e,t),!0)},t.prototype.setMatrices=function(e,t){return!!e&&(this._native.setMatrices(e,t),!0)},t.prototype.setMatrix3x3=function(e,t){return!!e&&(this._native.setMatrix3x3(e,t),!0)},t.prototype.setMatrix2x2=function(e,t){return!!e&&(this._native.setMatrix2x2(e,t),!0)},t.prototype.setFloat=function(e,t){return!!e&&(this._native.setFloat(e,t),!0)},t.prototype.setFloat2=function(e,t,i){return!!e&&(this._native.setFloat2(e,t,i),!0)},t.prototype.setFloat3=function(e,t,i,n){return!!e&&(this._native.setFloat3(e,t,i,n),!0)},t.prototype.setFloat4=function(e,t,i,n,r){return!!e&&(this._native.setFloat4(e,t,i,n,r),!0)},t.prototype.setColor3=function(e,t){return!!e&&(this._native.setFloat3(e,t.r,t.g,t.b),!0)},t.prototype.setColor4=function(e,t,i){return!!e&&(this._native.setFloat4(e,t.r,t.g,t.b,i),!0)},t.prototype.wipeCaches=function(e){this.preventCacheWipeBetweenFrames||(this.resetTextureCache(),this._currentEffect=null,e&&(this._currentProgram=null,this._stencilState.reset(),this._depthCullingState.reset(),this._alphaState.reset()),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null)},t.prototype._createTexture=function(){return this._native.createTexture()},t.prototype._deleteTexture=function(e){this._native.deleteTexture(e)},t.prototype.updateDynamicTexture=function(e,i,n,r,o){void 0===r&&(r=!1),this.createTexture("data:my_image_name",!0,n,null,Ke.a.BILINEAR_SAMPLINGMODE,void 0,void 0,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYSURBVChTY/z//z8DPsAEpXGC4aCAgQEAGGMDDWwwgqsAAAAASUVORK5CYII=",e,t.TEXTUREFORMAT_RGBA,null,void 0)},t.prototype.createTexture=function(e,t,i,n,r,o,a,s,c,l,u,h,d){var f=this;void 0===r&&(r=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=null),void 0===c&&(c=null),void 0===l&&(l=null),void 0===u&&(u=null);var p="data:"===(e=e||"").substr(0,5),_=p&&-1!==e.indexOf(";base64,"),v=c||new Qe.a(this,Qe.b.Url),b=e;!this._transformTextureUrl||_||c||s||(e=this._transformTextureUrl(e));for(var y=e.lastIndexOf("."),T=u||(y>-1?e.substring(y).toLowerCase():""),E=null,S=0,A=Se.a._TextureLoaders;S<A.length;S++){var P=A[S];if(P.canLoad(T)){E=P;break}}n&&n._addPendingData(v),v.url=e,v.generateMipMaps=!t,v.samplingMode=r,v.invertY=i,this.doNotHandleContextLost||(v._buffer=s);var C=null;if(o&&!c&&(C=v.onLoadedObservable.add(o)),c||this._internalTexturesCache.push(v),E)throw new Error("Loading textures from IInternalTextureLoader not yet implemented.");var R=function(e){var o=v._webGLTexture;o?f._native.loadTexture(o,e,!t,i,function(){v.baseWidth=f._native.getTextureWidth(o),v.baseHeight=f._native.getTextureHeight(o),v.width=v.baseWidth,v.height=v.baseHeight,v.isReady=!0;var e=f._getNativeSamplingMode(r);f._native.setTextureSampling(o,e),n&&n._removePendingData(v),v.onLoadedObservable.notifyObservers(v),v.onLoadedObservable.clear()},function(){throw new Error("Could not load a native texture.")}):n&&n._removePendingData(v)};if(p)if(s instanceof ArrayBuffer)R(new Uint8Array(s));else if(ArrayBuffer.isView(s))R(s);else{if("string"!=typeof s)throw new Error("Unsupported buffer type");R(new Uint8Array(Ce.b.DecodeBase64(s)))}else _?R(new Uint8Array(Ce.b.DecodeBase64(e))):this._loadFile(e,function(e){return R(new Uint8Array(e))},void 0,void 0,!0,function(i,c){!function(i,c){n&&n._removePendingData(v),e===b?(C&&v.onLoadedObservable.remove(C),x.a.UseFallbackTexture&&f.createTexture(x.a.FallbackTexture,t,v.invertY,n,r,null,a,s,v),a&&a((i||"Unknown error")+(x.a.UseFallbackTexture?" - Fallback texture was used":""),void 0)):(m.a.Warn("Failed to load "+e+", falling back to "+b),f.createTexture(b,t,v.invertY,n,r,o,a,s,v,l,u,h,d))}("Unable to load "+(i&&i.responseURL,c))});return v},t.prototype._createDepthStencilTexture=function(e,t){var i=new $n(this,Qe.b.Depth),n=e.width||e,r=e.height||e,o=this._native.createDepthTexture(i._webGLTexture,n,r);return i._framebuffer=o,i},t.prototype._releaseFramebufferObjects=function(e){},t.prototype.createCubeTexture=function(e,t,i,n,r,o,a,s,c,l,u,h){var d=this;void 0===r&&(r=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===c&&(c=!1),void 0===l&&(l=0),void 0===u&&(u=0),void 0===h&&(h=null);var f=h||new Qe.a(this,Qe.b.Cube);f.isCube=!0,f.url=e,f.generateMipMaps=!n,f._lodGenerationScale=l,f._lodGenerationOffset=u,this._doNotHandleContextLost||(f._extension=s,f._files=i);var p=e.lastIndexOf(".");if(".env"===(s||(p>-1?e.substring(p).toLowerCase():""))){if(i&&6===i.length)throw new Error("Multi-file loading not allowed on env files.");this._loadFile(e,function(e){return function(e){var t=Kn.GetEnvInfo(e);if(f.width=t.width,f.height=t.width,Kn.UploadEnvSpherical(f,t),1!==t.version)throw new Error('Unsupported babylon environment map version "'+t.version+'"');var i=t.specular;if(!i)throw new Error("Nothing else parsed so far");f._lodGenerationScale=i.lodGenerationScale;var n=Kn.CreateImageDataArrayBufferViews(e,t);f.format=g.a.TEXTUREFORMAT_RGBA,f.type=g.a.TEXTURETYPE_UNSIGNED_INT,f.generateMipMaps=!0,f.getEngine().updateTextureSamplingMode(Ke.a.TRILINEAR_SAMPLINGMODE,f),f._isRGBD=!0,f.invertY=!0,d._native.loadCubeTextureWithMips(f._webGLTexture,n,function(){f.isReady=!0,r&&r()},function(){throw new Error("Could not load a native cube texture.")})}(new Uint8Array(e))},void 0,void 0,!0,function(e,t){o&&e&&o(e.status+" "+e.statusText,t)})}else{if(!i||6!==i.length)throw new Error("Cannot load cubemap because 6 files were not defined");var _=[i[0],i[3],i[1],i[4],i[2],i[5]];Promise.all(_.map(function(e){return Ce.b.LoadFileAsync(e).then(function(e){return new Uint8Array(e)})})).then(function(e){return new Promise(function(t,i){d._native.loadCubeTexture(f._webGLTexture,e,!n,t,i)})}).then(function(){f.isReady=!0,r&&r()},function(e){o&&o("Failed to load cubemap: "+e.message,e)})}return this._internalTexturesCache.push(f),f},t.prototype.createRenderTargetTexture=function(e,t){var i=new si.a;void 0!==t&&"object"==typeof t?(i.generateMipMaps=t.generateMipMaps,i.generateDepthBuffer=void 0===t.generateDepthBuffer||t.generateDepthBuffer,i.generateStencilBuffer=i.generateDepthBuffer&&t.generateStencilBuffer,i.type=void 0===t.type?g.a.TEXTURETYPE_UNSIGNED_INT:t.type,i.samplingMode=void 0===t.samplingMode?g.a.TEXTURE_TRILINEAR_SAMPLINGMODE:t.samplingMode,i.format=void 0===t.format?g.a.TEXTUREFORMAT_RGBA:t.format):(i.generateMipMaps=t,i.generateDepthBuffer=!0,i.generateStencilBuffer=!1,i.type=g.a.TEXTURETYPE_UNSIGNED_INT,i.samplingMode=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,i.format=g.a.TEXTUREFORMAT_RGBA),(i.type!==g.a.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(i.type!==g.a.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(i.samplingMode=g.a.TEXTURE_NEAREST_SAMPLINGMODE);var n=new $n(this,Qe.b.RenderTarget),r=e.width||e,o=e.height||e;i.type!==g.a.TEXTURETYPE_FLOAT||this._caps.textureFloat||(i.type=g.a.TEXTURETYPE_UNSIGNED_INT,m.a.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var a=this._native.createFramebuffer(n._webGLTexture,r,o,this._getNativeTextureFormat(i.format,i.type),i.samplingMode,!!i.generateStencilBuffer,i.generateDepthBuffer,!!i.generateMipMaps);return n._framebuffer=a,n.baseWidth=r,n.baseHeight=o,n.width=r,n.height=o,n.isReady=!0,n.samples=1,n.generateMipMaps=!!i.generateMipMaps,n.samplingMode=i.samplingMode,n.type=i.type,n.format=i.format,n._generateDepthBuffer=i.generateDepthBuffer,n._generateStencilBuffer=!!i.generateStencilBuffer,this._internalTexturesCache.push(n),n},t.prototype.updateTextureSamplingMode=function(e,t){if(t._webGLTexture){var i=this._getNativeSamplingMode(e);this._native.setTextureSampling(t._webGLTexture,i)}t.samplingMode=e},t.prototype.bindFramebuffer=function(e,t,i,n,r){if(t)throw new Error("Cuboid frame buffers are not yet supported in NativeEngine.");if(i||n)throw new Error("Required width/height for frame buffers not yet supported in NativeEngine.");e._depthStencilTexture?this._bindUnboundFramebuffer(e._depthStencilTexture._framebuffer):this._bindUnboundFramebuffer(e._framebuffer)},t.prototype.unBindFramebuffer=function(e,t,i){void 0===t&&(t=!1),t&&m.a.Warn("Disabling mipmap generation not yet supported in NativeEngine. Ignoring."),i&&i(),this._bindUnboundFramebuffer(null)},t.prototype.createDynamicVertexBuffer=function(e){return this.createVertexBuffer(e,!0)},t.prototype.updateDynamicIndexBuffer=function(e,t,i){void 0===i&&(i=0);var n=e,r=this._normalizeIndexData(t);n.is32Bits=4===r.BYTES_PER_ELEMENT,this._native.updateDynamicIndexBuffer(n.nativeIndexBuffer,r,i)},t.prototype.updateDynamicVertexBuffer=function(e,t,i,n){var r=e,o=ArrayBuffer.isView(t)?t:new Float32Array(t);this._native.updateDynamicVertexBuffer(r.nativeVertexBuffer,o,null!=i?i:0,null!=n?n:o.byteLength)},t.prototype._setTexture=function(e,t,i,n){void 0===i&&(i=!1),void 0===n&&(n=!1);var r,o=this._boundUniforms[e];if(!o)return!1;if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._native.setTexture(o,null)),!1;if(t.video)this._activeChannel=e,t.update();else if(t.delayLoadState===g.a.DELAYLOADSTATE_NOTLOADED)return t.delayLoad(),!1;return r=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,this._activeChannel=e,!(!r||!r._webGLTexture||(this._native.setTextureWrapMode(r._webGLTexture,this._getAddressMode(t.wrapU),this._getAddressMode(t.wrapV),this._getAddressMode(t.wrapR)),this._updateAnisotropicLevel(t),this._native.setTexture(o,r._webGLTexture),0))},t.prototype._updateAnisotropicLevel=function(e){var t=e.getInternalTexture(),i=e.anisotropicFilteringLevel;t&&t._webGLTexture&&t._cachedAnisotropicFilteringLevel!==i&&(this._native.setTextureAnisotropicLevel(t._webGLTexture,i),t._cachedAnisotropicFilteringLevel=i)},t.prototype._getAddressMode=function(e){switch(e){case g.a.TEXTURE_WRAP_ADDRESSMODE:return this._native.ADDRESS_MODE_WRAP;case g.a.TEXTURE_CLAMP_ADDRESSMODE:return this._native.ADDRESS_MODE_CLAMP;case g.a.TEXTURE_MIRROR_ADDRESSMODE:return this._native.ADDRESS_MODE_MIRROR;default:throw new Error("Unexpected wrap mode: "+e+".")}},t.prototype._bindTexture=function(e,t){var i=this._boundUniforms[e];i&&this._native.setTexture(i,t._webGLTexture)},t.prototype._deleteBuffer=function(e){e.nativeIndexBuffer&&(this._native.deleteIndexBuffer(e.nativeIndexBuffer),delete e.nativeIndexBuffer),e.nativeVertexBuffer&&(this._native.deleteVertexBuffer(e.nativeVertexBuffer),delete e.nativeVertexBuffer)},t.prototype.releaseEffects=function(){},t.prototype._uploadCompressedDataToTextureDirectly=function(e,t,i,n,r,o,a){throw void 0===o&&(o=0),void 0===a&&(a=0),new Error("_uploadCompressedDataToTextureDirectly not implemented.")},t.prototype._uploadDataToTextureDirectly=function(e,t,i,n){throw void 0===i&&(i=0),void 0===n&&(n=0),new Error("_uploadDataToTextureDirectly not implemented.")},t.prototype._uploadArrayBufferViewToTexture=function(e,t,i,n){throw void 0===i&&(i=0),void 0===n&&(n=0),new Error("_uploadArrayBufferViewToTexture not implemented.")},t.prototype._uploadImageToTexture=function(e,t,i,n){throw void 0===i&&(i=0),void 0===n&&(n=0),new Error("_uploadArrayBufferViewToTexture not implemented.")},t.prototype._getNativeSamplingMode=function(e){switch(e){case g.a.TEXTURE_NEAREST_NEAREST:return this._native.TEXTURE_NEAREST_NEAREST;case g.a.TEXTURE_LINEAR_LINEAR:return this._native.TEXTURE_LINEAR_LINEAR;case g.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR:return this._native.TEXTURE_LINEAR_LINEAR_MIPLINEAR;case g.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST:return this._native.TEXTURE_NEAREST_NEAREST_MIPNEAREST;case g.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST:return this._native.TEXTURE_NEAREST_LINEAR_MIPNEAREST;case g.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR:return this._native.TEXTURE_NEAREST_LINEAR_MIPLINEAR;case g.a.TEXTURE_NEAREST_LINEAR:return this._native.TEXTURE_NEAREST_LINEAR;case g.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR:return this._native.TEXTURE_NEAREST_NEAREST_MIPLINEAR;case g.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST:return this._native.TEXTURE_LINEAR_NEAREST_MIPNEAREST;case g.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR:return this._native.TEXTURE_LINEAR_NEAREST_MIPLINEAR;case g.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST:return this._native.TEXTURE_LINEAR_LINEAR_MIPNEAREST;case g.a.TEXTURE_LINEAR_NEAREST:return this._native.TEXTURE_LINEAR_NEAREST;default:throw new Error("Unsupported sampling mode: "+e+".")}},t.prototype._getNativeTextureFormat=function(e,t){if(e==g.a.TEXTUREFORMAT_RGBA&&t==g.a.TEXTURETYPE_UNSIGNED_INT)return this._native.TEXTURE_FORMAT_RGBA8;if(e==g.a.TEXTUREFORMAT_RGBA&&t==g.a.TEXTURETYPE_FLOAT)return this._native.TEXTURE_FORMAT_RGBA32F;throw new Error("Unsupported texture format or type: format "+e+", type "+t+".")},t.prototype._getNativeAlphaMode=function(e){switch(e){case g.a.ALPHA_DISABLE:return this._native.ALPHA_DISABLE;case g.a.ALPHA_ADD:return this._native.ALPHA_ADD;case g.a.ALPHA_COMBINE:return this._native.ALPHA_COMBINE;case g.a.ALPHA_SUBTRACT:return this._native.ALPHA_SUBTRACT;case g.a.ALPHA_MULTIPLY:return this._native.ALPHA_MULTIPLY;case g.a.ALPHA_MAXIMIZED:return this._native.ALPHA_MAXIMIZED;case g.a.ALPHA_ONEONE:return this._native.ALPHA_ONEONE;case g.a.ALPHA_PREMULTIPLIED:return this._native.ALPHA_PREMULTIPLIED;case g.a.ALPHA_PREMULTIPLIED_PORTERDUFF:return this._native.ALPHA_PREMULTIPLIED_PORTERDUFF;case g.a.ALPHA_INTERPOLATE:return this._native.ALPHA_INTERPOLATE;case g.a.ALPHA_SCREENMODE:return this._native.ALPHA_SCREENMODE;default:throw new Error("Unsupported alpha mode: "+e+".")}},t.prototype._getNativeAttribType=function(e){switch(e){case ji.b.UNSIGNED_BYTE:return this._native.ATTRIB_TYPE_UINT8;case ji.b.SHORT:return this._native.ATTRIB_TYPE_INT16;case ji.b.FLOAT:return this._native.ATTRIB_TYPE_FLOAT;default:throw new Error("Unsupported attribute type: "+e+".")}},t}(Se.a),tr=i(74),ir=function(){function e(){}return e.COPY=1,e.CUT=2,e.PASTE=3,e}(),nr=function(){function e(e,t){this.type=e,this.event=t}return e.GetTypeFromCharacter=function(e){switch(e){case 67:return ir.COPY;case 86:return ir.PASTE;case 88:return ir.CUT;default:return-1}},e}(),rr=i(83),or=i(69);!function(e){e[e.Clean=0]="Clean",e[e.Stop=1]="Stop",e[e.Sync=2]="Sync",e[e.NoSync=3]="NoSync"}(Qn||(Qn={}));var ar=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return or.a.ForceFullSceneLoadingForIncremental},set:function(e){or.a.ForceFullSceneLoadingForIncremental=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return or.a.ShowLoadingScreen},set:function(e){or.a.ShowLoadingScreen=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return or.a.loggingLevel},set:function(e){or.a.loggingLevel=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return or.a.CleanBoneMatrixWeights},set:function(e){or.a.CleanBoneMatrixWeights=e},enumerable:!1,configurable:!0}),e.GetDefaultPlugin=function(){return e._registeredPlugins[".babylon"]},e._GetPluginForExtension=function(t){return e._registeredPlugins[t]||(m.a.Warn("Unable to find a plugin to load "+t+" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/how_to/load_from_any_file_type"),e.GetDefaultPlugin())},e._GetPluginForDirectLoad=function(t){for(var i in e._registeredPlugins){var n=e._registeredPlugins[i].plugin;if(n.canDirectLoad&&n.canDirectLoad(t))return e._registeredPlugins[i]}return e.GetDefaultPlugin()},e._GetPluginForFilename=function(t){var i=t.indexOf("?");-1!==i&&(t=t.substring(0,i));var n=t.lastIndexOf("."),r=t.substring(n,t.length).toLowerCase();return e._GetPluginForExtension(r)},e._GetDirectLoad=function(e){return"data:"===e.substr(0,5)?e.substr(5):null},e._LoadData=function(t,i,n,r,o,a,s){var c,l=e._GetDirectLoad(t.name),u=s?e._GetPluginForExtension(s):l?e._GetPluginForDirectLoad(t.name):e._GetPluginForFilename(t.name);if(!(c=void 0!==u.plugin.createPlugin?u.plugin.createPlugin():u.plugin))throw"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.";if(e.OnPluginActivatedObservable.notifyObservers(c),l){if(c.directLoad){var h=c.directLoad(i,l);h.then?h.then(function(e){n(c,e)}).catch(function(e){o("Error in directLoad of _loadData: "+e,e)}):n(c,h)}else n(c,l);return c}var d=u.isBinary,f=function(e,t){i.isDisposed?o("Scene has been disposed"):n(c,e,t)},p=null,_=!1,m=c.onDisposeObservable;m&&m.add(function(){_=!0,p&&(p.abort(),p=null),a()});var g=function(){if(!_){var e=function(e,t){f(e,t?t.responseURL:void 0)},n=function(e){o(e.message,e)};p=c.requestFile?c.requestFile(i,t.url,e,r,d,n):i._requestFile(t.url,e,r,!0,d,n)}},v=t.file||rr.a.FilesToLoad[t.name.toLowerCase()];if(-1===t.rootUrl.indexOf("file:")||-1!==t.rootUrl.indexOf("file:")&&!v){var b=i.getEngine(),y=b.enableOfflineSupport;if(y){for(var T=!1,E=0,S=i.disableOfflineSupportExceptionRules;E<S.length;E++)if(S[E].test(t.url)){T=!0;break}y=!T}y&&Se.a.OfflineProviderFactory?i.offlineProvider=Se.a.OfflineProviderFactory(t.url,g,b.disableManifestCheck):g()}else if(v){var A=function(e){o(e.message,e)};p=c.readFile?c.readFile(i,v,f,r,d,A):i._readFile(v,f,r,d,A)}else o("Unable to find file named "+t.name);return c},e._GetFileInfo=function(e,t){var i,n,r=null;if(t)if(t.name){var o=t;i=e+o.name,n=o.name,r=o}else{var a=t;if("/"===a.substr(0,1))return Ce.b.Error("Wrong sceneFilename parameter"),null;i=e+a,n=a}else i=e,n=Ce.b.GetFilename(e),e=Ce.b.GetFolderPath(e);return{url:i,rootUrl:e,name:n,file:r}},e.GetPluginForExtension=function(t){return e._GetPluginForExtension(t).plugin},e.IsPluginForExtensionAvailable=function(t){return!!e._registeredPlugins[t]},e.RegisterPlugin=function(t){if("string"==typeof t.extensions){var i=t.extensions;e._registeredPlugins[i.toLowerCase()]={plugin:t,isBinary:!1}}else{var n=t.extensions;Object.keys(n).forEach(function(i){e._registeredPlugins[i.toLowerCase()]={plugin:t,isBinary:n[i].isBinary}})}},e.ImportMesh=function(t,i,n,r,o,a,s,c){if(void 0===n&&(n=""),void 0===r&&(r=x.a.LastCreatedScene),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=null),void 0===c&&(c=null),!r)return m.a.Error("No scene available to import mesh to"),null;var l=e._GetFileInfo(i,n);if(!l)return null;var u={};r._addPendingData(u);var h=function(){r._removePendingData(u)},d=function(e,t){var i="Unable to import meshes from "+l.url+": "+e;s?s(r,i,t):m.a.Error(i),h()},f=a?function(e){try{a(e)}catch(e){d("Error in onProgress callback: "+e,e)}}:void 0,p=function(e,t,i,n,a,s,c){if(r.importedMeshesFiles.push(l.url),o)try{o(e,t,i,n,a,s,c)}catch(e){d("Error in onSuccess callback: "+e,e)}r._removePendingData(u)};return e._LoadData(l,r,function(e,i,n){if(e.rewriteRootURL&&(l.rootUrl=e.rewriteRootURL(l.rootUrl,n)),e.importMesh){var o=e,a=new Array,s=new Array,c=new Array;if(!o.importMesh(t,r,i,l.rootUrl,a,s,c,d))return;r.loadingPluginName=e.name,p(a,s,c,[],[],[],[])}else e.importMeshAsync(t,r,i,l.rootUrl,f,l.name).then(function(t){r.loadingPluginName=e.name,p(t.meshes,t.particleSystems,t.skeletons,t.animationGroups,t.transformNodes,t.geometries,t.lights)}).catch(function(e){d(e.message,e)})},f,d,h,c)},e.ImportMeshAsync=function(t,i,n,r,o,a){return void 0===n&&(n=""),void 0===r&&(r=x.a.LastCreatedScene),void 0===o&&(o=null),void 0===a&&(a=null),new Promise(function(s,c){e.ImportMesh(t,i,n,r,function(e,t,i,n,r,o,a){s({meshes:e,particleSystems:t,skeletons:i,animationGroups:n,transformNodes:r,geometries:o,lights:a})},o,function(e,t,i){c(i||new Error(t))},a)})},e.Load=function(t,i,n,r,o,a,s){return void 0===i&&(i=""),void 0===n&&(n=x.a.LastCreatedEngine),void 0===r&&(r=null),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=null),n?e.Append(t,i,new Q.a(n),r,o,a,s):(Ce.b.Error("No engine available"),null)},e.LoadAsync=function(t,i,n,r,o){return void 0===i&&(i=""),void 0===n&&(n=x.a.LastCreatedEngine),void 0===r&&(r=null),void 0===o&&(o=null),new Promise(function(a,s){e.Load(t,i,n,function(e){a(e)},r,function(e,t,i){s(i||new Error(t))},o)})},e.Append=function(t,i,n,r,o,a,s){var c=this;if(void 0===i&&(i=""),void 0===n&&(n=x.a.LastCreatedScene),void 0===r&&(r=null),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=null),!n)return m.a.Error("No scene available to append to"),null;var l=e._GetFileInfo(t,i);if(!l)return null;e.ShowLoadingScreen&&!this._showingLoadingScreen&&(this._showingLoadingScreen=!0,n.getEngine().displayLoadingUI(),n.executeWhenReady(function(){n.getEngine().hideLoadingUI(),c._showingLoadingScreen=!1}));var u={};n._addPendingData(u);var h=function(){n._removePendingData(u)},d=function(e,t){var i="Unable to load from "+l.url+(e?": "+e:"");a?a(n,i,t):m.a.Error(i),h()},f=o?function(e){try{o(e)}catch(e){d("Error in onProgress callback",e)}}:void 0,p=function(){if(r)try{r(n)}catch(e){d("Error in onSuccess callback",e)}n._removePendingData(u)};return e._LoadData(l,n,function(e,t){if(e.load){if(!e.load(n,t,l.rootUrl,d))return;n.loadingPluginName=e.name,p()}else e.loadAsync(n,t,l.rootUrl,f,l.name).then(function(){n.loadingPluginName=e.name,p()}).catch(function(e){d(e.message,e)})},f,d,h,s)},e.AppendAsync=function(t,i,n,r,o){return void 0===i&&(i=""),void 0===n&&(n=x.a.LastCreatedScene),void 0===r&&(r=null),void 0===o&&(o=null),new Promise(function(a,s){e.Append(t,i,n,function(e){a(e)},r,function(e,t,i){s(i||new Error(t))},o)})},e.LoadAssetContainer=function(t,i,n,r,o,a,s){if(void 0===i&&(i=""),void 0===n&&(n=x.a.LastCreatedScene),void 0===r&&(r=null),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=null),!n)return m.a.Error("No scene available to load asset container to"),null;var c=e._GetFileInfo(t,i);if(!c)return null;var l={};n._addPendingData(l);var u=function(){n._removePendingData(l)},h=function(e,t){var i="Unable to load assets from "+c.url+(e?": "+e:"");t&&t.message&&(i+=" ("+t.message+")"),a?a(n,i,t):m.a.Error(i),u()},d=o?function(e){try{o(e)}catch(e){h("Error in onProgress callback",e)}}:void 0,f=function(e){if(r)try{r(e)}catch(e){h("Error in onSuccess callback",e)}n._removePendingData(l)};return e._LoadData(c,n,function(e,t){if(e.loadAssetContainer){var i=e.loadAssetContainer(n,t,c.rootUrl,h);if(!i)return;n.loadingPluginName=e.name,f(i)}else e.loadAssetContainerAsync?e.loadAssetContainerAsync(n,t,c.rootUrl,d,c.name).then(function(t){n.loadingPluginName=e.name,f(t)}).catch(function(e){h(e.message,e)}):h("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.")},d,h,u,s)},e.LoadAssetContainerAsync=function(t,i,n,r,o){return void 0===i&&(i=""),void 0===n&&(n=x.a.LastCreatedScene),void 0===r&&(r=null),void 0===o&&(o=null),new Promise(function(a,s){e.LoadAssetContainer(t,i,n,function(e){a(e)},r,function(e,t,i){s(i||new Error(t))},o)})},e.ImportAnimations=function(e,t,i,n,r,o,a,s,c,l){if(void 0===t&&(t=""),void 0===i&&(i=x.a.LastCreatedScene),void 0===n&&(n=!0),void 0===r&&(r=Qn.Clean),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=null),void 0===c&&(c=null),void 0===l&&(l=null),i){if(n){for(var u=0,h=i.animatables;u<h.length;u++)h[u].reset();i.stopAllAnimations(),i.animationGroups.slice().forEach(function(e){e.dispose()}),i.getNodes().forEach(function(e){e.animations&&(e.animations=[])})}else switch(r){case Qn.Clean:i.animationGroups.slice().forEach(function(e){e.dispose()});break;case Qn.Stop:i.animationGroups.forEach(function(e){e.stop()});break;case Qn.Sync:i.animationGroups.forEach(function(e){e.reset(),e.restart()});break;case Qn.NoSync:break;default:return void m.a.Error("Unknown animation group loading mode value '"+r+"'")}var d=i.animatables.length;this.LoadAssetContainer(e,t,i,function(e){e.mergeAnimationsTo(i,i.animatables.slice(d),o),e.dispose(),i.onAnimationFileImportedObservable.notifyObservers(i),a&&a(i)},s,c,l)}else m.a.Error("No scene available to load animations to")},e.ImportAnimationsAsync=function(t,i,n,r,o,a,s,c,l,u){return void 0===i&&(i=""),void 0===n&&(n=x.a.LastCreatedScene),void 0===r&&(r=!0),void 0===o&&(o=Qn.Clean),void 0===a&&(a=null),void 0===s&&(s=null),void 0===c&&(c=null),void 0===l&&(l=null),void 0===u&&(u=null),new Promise(function(s,l){e.ImportAnimations(t,i,n,r,o,a,function(e){s(e)},c,function(e,t,i){l(i||new Error(t))},u)})},e.NO_LOGGING=g.a.SCENELOADER_NO_LOGGING,e.MINIMAL_LOGGING=g.a.SCENELOADER_MINIMAL_LOGGING,e.SUMMARY_LOGGING=g.a.SCENELOADER_SUMMARY_LOGGING,e.DETAILED_LOGGING=g.a.SCENELOADER_DETAILED_LOGGING,e.OnPluginActivatedObservable=new o.c,e._registeredPlugins={},e._showingLoadingScreen=!1,e}(),sr=function(e){function t(t){var i=e.call(this,t)||this;return i.controllerType=zt.DAYDREAM,i}return Object(h.d)(t,e),t.prototype.initControllerMesh=function(e,i){var n=this;ar.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,function(e){n._defaultModel=e[1],n.attachToMesh(n._defaultModel),i&&i(n._defaultModel)})},t.prototype._handleButtonChange=function(e,t,i){if(0===e){var n=this.onTriggerStateChangedObservable;n&&n.notifyObservers(t)}else m.a.Warn("Unrecognized Daydream button index: "+e)},t.MODEL_BASE_URL="https://controllers.babylonjs.com/generic/",t.MODEL_FILENAME="generic.babylon",t.GAMEPAD_ID_PREFIX="Daydream",t}(Fi);Qt._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(sr.GAMEPAD_ID_PREFIX)},create:function(e){return new sr(e)}});var cr=function(e){function t(t){var i=e.call(this,t)||this;return i._buttonIndexToObservableNameMap=["onPadStateChangedObservable","onTriggerStateChangedObservable"],i.controllerType=zt.GEAR_VR,i._calculatedPosition=new a.e("left"==i.hand?-.15:.15,-.5,.25),i._disableTrackPosition(i._calculatedPosition),i}return Object(h.d)(t,e),t.prototype.initControllerMesh=function(e,i){var n=this;ar.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,function(t){var r=new be.a("",e);t[1].parent=r,t[1].position.z=-.15,n._defaultModel=r,n.attachToMesh(n._defaultModel),i&&i(n._defaultModel)})},t.prototype._handleButtonChange=function(e,t,i){if(e<this._buttonIndexToObservableNameMap.length){var n=this[this._buttonIndexToObservableNameMap[e]];n&&n.notifyObservers(t)}},t.MODEL_BASE_URL="https://controllers.babylonjs.com/generic/",t.MODEL_FILENAME="generic.babylon",t.GAMEPAD_ID_PREFIX="Gear VR",t}(Fi);Qt._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(cr.GAMEPAD_ID_PREFIX)||-1!==e.id.indexOf("Oculus Go")||-1!==e.id.indexOf("Vive Focus")},create:function(e){return new cr(e)}});var lr=function(e){function t(t){return e.call(this,t)||this}return Object(h.d)(t,e),t.prototype.initControllerMesh=function(e,i){var n=this;ar.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,function(e){n._defaultModel=e[1],n.attachToMesh(n._defaultModel),i&&i(n._defaultModel)})},t.prototype._handleButtonChange=function(e,t,i){console.log("Button id: "+e+"state: "),console.dir(t)},t.MODEL_BASE_URL="https://controllers.babylonjs.com/generic/",t.MODEL_FILENAME="generic.babylon",t}(Fi);Qt._DefaultControllerFactory=function(e){return new lr(e)};var ur=function(e){function t(t){var i=e.call(this,t)||this;return i.onSecondaryTriggerStateChangedObservable=new o.c,i.onThumbRestChangedObservable=new o.c,i.controllerType=zt.OCULUS,i}return Object(h.d)(t,e),t.prototype.initControllerMesh=function(e,i){var n,r=this;n="left"===this.hand?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,ar.ImportMesh("",t._IsQuest?t.QUEST_MODEL_BASE_URL:t.MODEL_BASE_URL,n,e,function(e){r._defaultModel=t._IsQuest?e[0]:e[1],r.attachToMesh(r._defaultModel),i&&i(r._defaultModel)})},Object.defineProperty(t.prototype,"onAButtonStateChangedObservable",{get:function(){if("right"===this.hand)return this.onMainButtonStateChangedObservable;throw new Error("No A button on left hand")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBButtonStateChangedObservable",{get:function(){if("right"===this.hand)return this.onSecondaryButtonStateChangedObservable;throw new Error("No B button on left hand")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onXButtonStateChangedObservable",{get:function(){if("left"===this.hand)return this.onMainButtonStateChangedObservable;throw new Error("No X button on right hand")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onYButtonStateChangedObservable",{get:function(){if("left"===this.hand)return this.onSecondaryButtonStateChangedObservable;throw new Error("No Y button on right hand")},enumerable:!1,configurable:!0}),t.prototype._handleButtonChange=function(e,i,n){var r=i,o="right"===this.hand?-1:1;switch(e){case 0:return void this.onPadStateChangedObservable.notifyObservers(r);case 1:return!t._IsQuest&&this._defaultModel&&(this._defaultModel.getChildren()[3].rotation.x=.2*-r.value,this._defaultModel.getChildren()[3].position.y=.005*-r.value,this._defaultModel.getChildren()[3].position.z=.005*-r.value),void this.onTriggerStateChangedObservable.notifyObservers(r);case 2:return!t._IsQuest&&this._defaultModel&&(this._defaultModel.getChildren()[4].position.x=o*r.value*.0035),void this.onSecondaryTriggerStateChangedObservable.notifyObservers(r);case 3:return!t._IsQuest&&this._defaultModel&&(r.pressed?this._defaultModel.getChildren()[1].position.y=-.001:this._defaultModel.getChildren()[1].position.y=0),void this.onMainButtonStateChangedObservable.notifyObservers(r);case 4:return!t._IsQuest&&this._defaultModel&&(r.pressed?this._defaultModel.getChildren()[2].position.y=-.001:this._defaultModel.getChildren()[2].position.y=0),void this.onSecondaryButtonStateChangedObservable.notifyObservers(r);case 5:return void this.onThumbRestChangedObservable.notifyObservers(r)}},t.MODEL_BASE_URL="https://controllers.babylonjs.com/oculus/",t.MODEL_LEFT_FILENAME="left.babylon",t.MODEL_RIGHT_FILENAME="right.babylon",t.QUEST_MODEL_BASE_URL="https://controllers.babylonjs.com/oculusQuest/",t._IsQuest=!1,t}(Fi);Qt._ControllerFactories.push({canCreate:function(e){return Se.a.LastCreatedEngine&&Se.a.LastCreatedEngine._vrDisplay&&"Oculus Quest"===Se.a.LastCreatedEngine._vrDisplay.displayName&&(ur._IsQuest=!0),-1!==e.id.indexOf("Oculus Touch")},create:function(e){return new ur(e)}});var hr=function(e){function t(t){var i=e.call(this,t)||this;return i.controllerType=zt.VIVE,i._invertLeftStickY=!0,i}return Object(h.d)(t,e),t.prototype.initControllerMesh=function(e,i){var n=this;ar.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,function(e){n._defaultModel=e[1],n.attachToMesh(n._defaultModel),i&&i(n._defaultModel)})},Object.defineProperty(t.prototype,"onLeftButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRightButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onMenuButtonStateChangedObservable",{get:function(){return this.onSecondaryButtonStateChangedObservable},enumerable:!1,configurable:!0}),t.prototype._handleButtonChange=function(e,t,i){var n=t;switch(e){case 0:return void this.onPadStateChangedObservable.notifyObservers(n);case 1:return this._defaultModel&&(this._defaultModel.getChildren()[6].rotation.x=.15*-n.value),void this.onTriggerStateChangedObservable.notifyObservers(n);case 2:return void this.onMainButtonStateChangedObservable.notifyObservers(n);case 3:return this._defaultModel&&(n.pressed?this._defaultModel.getChildren()[2].position.y=-.001:this._defaultModel.getChildren()[2].position.y=0),void this.onSecondaryButtonStateChangedObservable.notifyObservers(n)}},t.MODEL_BASE_URL="https://controllers.babylonjs.com/vive/",t.MODEL_FILENAME="wand.babylon",t}(Fi);Qt._ControllerFactories.push({canCreate:function(e){return-1!==e.id.toLowerCase().indexOf("openvr")},create:function(e){return new hr(e)}});var dr=function(){this.buttonMeshes={},this.axisMeshes={}},fr=function(e){function t(t){var i=e.call(this,t)||this;return i._mapping={buttons:["thumbstick","trigger","grip","menu","trackpad"],buttonMeshNames:{trigger:"SELECT",menu:"MENU",grip:"GRASP",thumbstick:"THUMBSTICK_PRESS",trackpad:"TOUCHPAD_PRESS"},buttonObservableNames:{trigger:"onTriggerStateChangedObservable",menu:"onSecondaryButtonStateChangedObservable",grip:"onMainButtonStateChangedObservable",thumbstick:"onPadStateChangedObservable",trackpad:"onTrackpadChangedObservable"},axisMeshNames:["THUMBSTICK_X","THUMBSTICK_Y","TOUCHPAD_TOUCH_X","TOUCHPAD_TOUCH_Y"],pointingPoseMeshName:qt.POINTING_POSE},i.onTrackpadChangedObservable=new o.c,i.onTrackpadValuesChangedObservable=new o.c,i.trackpad={x:0,y:0},i.controllerType=zt.WINDOWS,i._loadedMeshInfo=null,i}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"onTriggerButtonStateChangedObservable",{get:function(){return this.onTriggerStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onMenuButtonStateChangedObservable",{get:function(){return this.onSecondaryButtonStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGripButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onThumbstickButtonStateChangedObservable",{get:function(){return this.onPadStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTouchpadButtonStateChangedObservable",{get:function(){return this.onTrackpadChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTouchpadValuesChangedObservable",{get:function(){return this.onTrackpadValuesChangedObservable},enumerable:!1,configurable:!0}),t.prototype._updateTrackpad=function(){!this.browserGamepad.axes||this.browserGamepad.axes[2]==this.trackpad.x&&this.browserGamepad.axes[3]==this.trackpad.y||(this.trackpad.x=this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf("TOUCHPAD_TOUCH_X")],this.trackpad.y=this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf("TOUCHPAD_TOUCH_Y")],this.onTrackpadValuesChangedObservable.notifyObservers(this.trackpad))},t.prototype.update=function(){if(e.prototype.update.call(this),this.browserGamepad.axes&&(this._updateTrackpad(),this._loadedMeshInfo))for(var t=0;t<this._mapping.axisMeshNames.length;t++)this._lerpAxisTransform(t,this.browserGamepad.axes[t])},t.prototype._handleButtonChange=function(e,t,i){var n=this._mapping.buttons[e];if(n){this._updateTrackpad();var r=this[this._mapping.buttonObservableNames[n]];r&&r.notifyObservers(t),this._lerpButtonTransform(n,t.value)}},t.prototype._lerpButtonTransform=function(e,t){if(this._loadedMeshInfo){var i=this._loadedMeshInfo.buttonMeshes[e];i&&i.unpressed.rotationQuaternion&&i.pressed.rotationQuaternion&&i.value.rotationQuaternion&&(a.b.SlerpToRef(i.unpressed.rotationQuaternion,i.pressed.rotationQuaternion,t,i.value.rotationQuaternion),a.e.LerpToRef(i.unpressed.position,i.pressed.position,t,i.value.position))}},t.prototype._lerpAxisTransform=function(e,t){if(this._loadedMeshInfo){var i=this._loadedMeshInfo.axisMeshes[e];if(i&&i.min.rotationQuaternion&&i.max.rotationQuaternion&&i.value.rotationQuaternion){var n=.5*t+.5;a.b.SlerpToRef(i.min.rotationQuaternion,i.max.rotationQuaternion,n,i.value.rotationQuaternion),a.e.LerpToRef(i.min.position,i.max.position,n,i.value.position)}}},t.prototype.initControllerMesh=function(e,i,n){var r,o,a=this;if(void 0===n&&(n=!1),ar.IsPluginForExtensionAvailable(".glb")){var s="default";if(this.id&&!n){var c=this.id.match(t.GAMEPAD_ID_PATTERN);s=c&&c[0]||s}o="left"===this.hand?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,r=t.MODEL_BASE_URL+s+"/"}else m.a.Warn("You need to reference GLTF loader to load Windows Motion Controllers model. Falling back to generic models"),r=lr.MODEL_BASE_URL,o=lr.MODEL_FILENAME;ar.ImportMesh("",r,o,e,function(t){a._loadedMeshInfo=a.processModel(e,t),a._loadedMeshInfo&&(a._defaultModel=a._loadedMeshInfo.rootNode,a.attachToMesh(a._defaultModel),i&&i(a._defaultModel))},null,function(e,t){m.a.Log(t),m.a.Warn("Failed to retrieve controller model from the remote server: "+r+o),n||a.initControllerMesh(e,i,!0)})},t.prototype.processModel=function(e,t){for(var i=null,n=new be.a(this.id+" "+this.hand,e),r=null,o=0;o<t.length;o++){var a=t[o];if(!a.parent){a.isPickable=!1,r=a;break}}return r?(r.setParent(n),i=this.createMeshInfo(n)):m.a.Warn("Could not find root node in model file."),i},t.prototype.createMeshInfo=function(e){var t,i=new dr;for(i.rootNode=e,i.buttonMeshes={},i.axisMeshes={},t=0;t<this._mapping.buttons.length;t++){var n=this._mapping.buttonMeshNames[this._mapping.buttons[t]];if(n){var r=l(e,n);if(r){var o={index:t,value:u(r,"VALUE"),pressed:u(r,"PRESSED"),unpressed:u(r,"UNPRESSED")};o.value&&o.pressed&&o.unpressed?i.buttonMeshes[this._mapping.buttons[t]]=o:m.a.Warn("Missing button submesh under mesh with name: "+n+"(VALUE: "+!!o.value+", PRESSED: "+!!o.pressed+", UNPRESSED:"+!!o.unpressed+")")}else m.a.Warn("Missing button mesh with name: "+n)}else m.a.Log("Skipping unknown button at index: "+t+" with mapped name: "+this._mapping.buttons[t])}for(t=0;t<this._mapping.axisMeshNames.length;t++){var a=this._mapping.axisMeshNames[t];if(a){var s=l(e,a);if(s){var c={index:t,value:u(s,"VALUE"),min:u(s,"MIN"),max:u(s,"MAX")};c.value&&c.min&&c.max?i.axisMeshes[t]=c:m.a.Warn("Missing axis submesh under mesh with name: "+a+"(VALUE: "+!!c.value+", MIN: "+!!c.min+", MAX:"+!!c.max+")")}else m.a.Warn("Missing axis mesh with name: "+a)}else m.a.Log("Skipping unknown axis at index: "+t)}return i.pointingPoseNode=l(e,this._mapping.pointingPoseMeshName),i.pointingPoseNode?this._pointingPoseNode=i.pointingPoseNode:m.a.Warn("Missing pointing pose mesh with name: "+this._mapping.pointingPoseMeshName),i;function l(e,t){return e.getChildren(function(e){return e.name===t},!1)[0]}function u(e,t){return e.getChildren(function(e){return e.name==t},!0)[0]}},t.prototype.getForwardRay=function(t){if(void 0===t&&(t=100),!this._loadedMeshInfo||!this._loadedMeshInfo.pointingPoseNode)return e.prototype.getForwardRay.call(this,t);var i=this._loadedMeshInfo.pointingPoseNode.getWorldMatrix(),n=i.getTranslation(),r=new a.e(0,0,-1),o=a.e.TransformNormal(r,i),s=a.e.Normalize(o);return new Xt.a(n,s,t)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onTrackpadChangedObservable.clear(),this.onTrackpadValuesChangedObservable.clear()},t.MODEL_BASE_URL="https://controllers.babylonjs.com/microsoft/",t.MODEL_LEFT_FILENAME="left.glb",t.MODEL_RIGHT_FILENAME="right.glb",t.GAMEPAD_ID_PREFIX="Spatial Controller (Spatial Interaction Source) ",t.GAMEPAD_ID_PATTERN=/([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/,t}(Fi),pr=function(e){function t(t){var i=e.call(this,t)||this;return i._mapping={buttons:["trigger","grip","trackpad","thumbstick","menu"],buttonMeshNames:{trigger:"SELECT",menu:"MENU",grip:"GRASP",thumbstick:"THUMBSTICK_PRESS",trackpad:"TOUCHPAD_PRESS"},buttonObservableNames:{trigger:"onTriggerStateChangedObservable",menu:"onSecondaryButtonStateChangedObservable",grip:"onMainButtonStateChangedObservable",thumbstick:"onThumbstickStateChangedObservable",trackpad:"onTrackpadChangedObservable"},axisMeshNames:["TOUCHPAD_TOUCH_X","TOUCHPAD_TOUCH_Y","THUMBSTICK_X","THUMBSTICK_Y"],pointingPoseMeshName:qt.POINTING_POSE},i.thumbstickValues={x:0,y:0},i.onThumbstickStateChangedObservable=new o.c,i.onThumbstickValuesChangedObservable=new o.c,i.onTrackpadChangedObservable=i.onPadStateChangedObservable,i.onTrackpadValuesChangedObservable=i.onPadValuesChangedObservable,i}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"onThumbstickButtonStateChangedObservable",{get:function(){return this.onThumbstickStateChangedObservable},enumerable:!1,configurable:!0}),t.prototype._updateTrackpad=function(){!this.browserGamepad.axes||this.browserGamepad.axes[2]==this.thumbstickValues.x&&this.browserGamepad.axes[3]==this.thumbstickValues.y||(this.trackpad.x=this.browserGamepad.axes[2],this.trackpad.y=this.browserGamepad.axes[3],this.onThumbstickValuesChangedObservable.notifyObservers(this.trackpad))},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onThumbstickStateChangedObservable.clear(),this.onThumbstickValuesChangedObservable.clear()},t}(fr);Qt._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(fr.GAMEPAD_ID_PREFIX)},create:function(e){return new fr(e)}});var _r=i(75),mr=i(63),gr=i(51),vr=i(36),br=function(e){function t(t,i,n,r,c){var l,u,h,d,f,p,_;void 0===i&&(i=s.a.Gray()),void 0===n&&(n=vr.a.DefaultUtilityLayer),void 0===r&&(r=null),void 0===c&&(c=1);var m=e.call(this,n)||this;m._pointerObserver=null,m.snapDistance=0,m.onSnapObservable=new o.c,m.uniformScaling=!1,m.sensitivity=1,m._isEnabled=!0,m._parent=null,m._dragging=!1,m._tmpVector=new a.e,m._tmpMatrix=new a.a,m._tmpMatrix2=new a.a,m._parent=r,m._coloredMaterial=new Ui.a("",n.utilityLayerScene),m._coloredMaterial.diffuseColor=i,m._coloredMaterial.specularColor=i.subtract(new s.a(.1,.1,.1)),m._hoverMaterial=new Ui.a("",n.utilityLayerScene),m._hoverMaterial.diffuseColor=s.a.Yellow(),m._disableMaterial=new Ui.a("",n.utilityLayerScene),m._disableMaterial.diffuseColor=s.a.Gray(),m._disableMaterial.alpha=.4,m._gizmoMesh=new be.a("axis",n.utilityLayerScene);var g=m._createGizmoMesh(m._gizmoMesh,c),v=g.arrowMesh,b=g.arrowTail,y=m._createGizmoMesh(m._gizmoMesh,c+4,!0);m._gizmoMesh.lookAt(m._rootMesh.position.add(t)),m._rootMesh.addChild(m._gizmoMesh),m._gizmoMesh.scaling.scaleInPlace(1/3);var T=v.position.clone(),E=b.position.clone(),S=b.scaling.clone(),A=function(e){var t=e*(3/m._rootMesh.scaling.length())*6;v.position.z+=t/3.5,b.scaling.y+=t,b.position.z=v.position.z/2},P=function(){v.position.set(T.x,T.y,T.z),b.position.set(E.x,E.y,E.z),b.scaling.set(S.x,S.y,S.z),m._dragging=!1};m.dragBehavior=new ke.a({dragAxis:t}),m.dragBehavior.moveAttached=!1,m._rootMesh.addBehavior(m.dragBehavior);var C=0,R=new a.e,x={snapDistance:0};m.dragBehavior.onDragObservable.add(function(e){if(m.attachedNode){var i=m.sensitivity*e.dragDistance*(3*m.scaleRatio/m._rootMesh.scaling.length()),n=!1,r=0;m.uniformScaling?(m.attachedNode.getWorldMatrix().decompose(R),R.normalize(),R.y<0&&R.scaleInPlace(-1)):R.copyFrom(t),0==m.snapDistance?R.scaleToRef(i,R):(C+=i,Math.abs(C)>m.snapDistance?(r=Math.floor(Math.abs(C)/m.snapDistance),C<0&&(r*=-1),C%=m.snapDistance,R.scaleToRef(m.snapDistance*r,R),n=!0):R.scaleInPlace(0)),a.a.ScalingToRef(1+R.x,1+R.y,1+R.z,m._tmpMatrix2),m._tmpMatrix2.multiplyToRef(m.attachedNode.getWorldMatrix(),m._tmpMatrix),m._tmpMatrix.decompose(m._tmpVector),Math.abs(m._tmpVector.x)<1e5&&Math.abs(m._tmpVector.y)<1e5&&Math.abs(m._tmpVector.z)<1e5&&m.attachedNode.getWorldMatrix().copyFrom(m._tmpMatrix),n&&(x.snapDistance=m.snapDistance*r,m.onSnapObservable.notifyObservers(x)),m._matrixChanged()}}),m.dragBehavior.onDragStartObservable.add(function(){m._dragging=!0}),m.dragBehavior.onDragObservable.add(function(e){return A(e.dragDistance)}),m.dragBehavior.onDragEndObservable.add(P),null===(h=null===(u=null===(l=null==r?void 0:r.uniformScaleGizmo)||void 0===l?void 0:l.dragBehavior)||void 0===u?void 0:u.onDragObservable)||void 0===h||h.add(function(e){return A(e.delta.y)}),null===(p=null===(f=null===(d=null==r?void 0:r.uniformScaleGizmo)||void 0===d?void 0:d.dragBehavior)||void 0===f?void 0:f.onDragEndObservable)||void 0===p||p.add(P);var O={gizmoMeshes:[v,b],colliderMeshes:[y.arrowMesh,y.arrowTail],material:m._coloredMaterial,hoverMaterial:m._hoverMaterial,disableMaterial:m._disableMaterial,active:!1};null===(_=m._parent)||void 0===_||_.addToAxisCache(m._gizmoMesh,O),m._pointerObserver=n.utilityLayerScene.onPointerObservable.add(function(e){var t;if(!m._customMeshSet&&(m._isHovered=!(-1==O.colliderMeshes.indexOf(null===(t=null==e?void 0:e.pickInfo)||void 0===t?void 0:t.pickedMesh)),!m._parent)){var i=m._isHovered||m._dragging?m._hoverMaterial:m._coloredMaterial;O.gizmoMeshes.forEach(function(e){e.material=i,e.color&&(e.color=i.diffuseColor)})}});var M=n._getSharedGizmoLight();return M.includedOnlyMeshes=M.includedOnlyMeshes.concat(m._rootMesh.getChildMeshes()),m}return Object(h.d)(t,e),t.prototype._createGizmoMesh=function(e,t,i){void 0===i&&(i=!1);var n=mr.a.CreateBox("yPosMesh",{size:.4*(1+(t-1)/4)},this.gizmoLayer.utilityLayerScene),r=qi.a.CreateCylinder("cylinder",{diameterTop:.005*t,height:.275,diameterBottom:.005*t,tessellation:96},this.gizmoLayer.utilityLayerScene);return n.scaling.scaleInPlace(.1),n.material=this._coloredMaterial,n.rotation.x=Math.PI/2,n.position.z+=.3,r.material=this._coloredMaterial,r.position.z+=.1375,r.rotation.x=Math.PI/2,i&&(n.visibility=0,r.visibility=0),e.addChild(n),e.addChild(r),{arrowMesh:n,arrowTail:r}},t.prototype._attachedNodeChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh,this.attachedNode=this._parent.attachedNode):(this.attachedMesh=null,this.attachedNode=null)},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose(),[this._coloredMaterial,this._hoverMaterial,this._disableMaterial].forEach(function(e){e&&e.dispose()}),e.prototype.dispose.call(this)},t.prototype.setCustomMesh=function(t,i){var n=this;void 0===i&&(i=!1),e.prototype.setCustomMesh.call(this,t),i&&(this._rootMesh.getChildMeshes().forEach(function(e){e.material=n._coloredMaterial,e.color&&(e.color=n._coloredMaterial.diffuseColor)}),this._customMeshSet=!1)},t}(gr.a),yr=i(45),Tr=i(40),Er=function(e){function t(t,i){void 0===t&&(t=s.a.Gray()),void 0===i&&(i=vr.a.DefaultKeepDepthUtilityLayer);var n=e.call(this,i)||this;n._boundingDimensions=new a.e(1,1,1),n._renderObserver=null,n._pointerObserver=null,n._scaleDragSpeed=.2,n._tmpQuaternion=new a.b,n._tmpVector=new a.e(0,0,0),n._tmpRotationMatrix=new a.a,n.ignoreChildren=!1,n.includeChildPredicate=null,n.rotationSphereSize=.1,n.scaleBoxSize=.1,n.fixedDragMeshScreenSize=!1,n.fixedDragMeshBoundsSize=!1,n.fixedDragMeshScreenSizeDistanceFactor=10,n.onDragStartObservable=new o.c,n.onScaleBoxDragObservable=new o.c,n.onScaleBoxDragEndObservable=new o.c,n.onRotationSphereDragObservable=new o.c,n.onRotationSphereDragEndObservable=new o.c,n.scalePivot=null,n._existingMeshScale=new a.e,n._dragMesh=null,n.pointerDragBehavior=new ke.a,n.updateScale=!1,n._anchorMesh=new ze.a("anchor",i.utilityLayerScene),n.coloredMaterial=new Ui.a("",i.utilityLayerScene),n.coloredMaterial.disableLighting=!0,n.hoverColoredMaterial=new Ui.a("",i.utilityLayerScene),n.hoverColoredMaterial.disableLighting=!0,n._lineBoundingBox=new ze.a("",i.utilityLayerScene),n._lineBoundingBox.rotationQuaternion=new a.b;var r=[];r.push(Tr.a.CreateLines("lines",{points:[new a.e(0,0,0),new a.e(n._boundingDimensions.x,0,0)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(0,0,0),new a.e(0,n._boundingDimensions.y,0)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(0,0,0),new a.e(0,0,n._boundingDimensions.z)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(n._boundingDimensions.x,0,0),new a.e(n._boundingDimensions.x,n._boundingDimensions.y,0)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(n._boundingDimensions.x,0,0),new a.e(n._boundingDimensions.x,0,n._boundingDimensions.z)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(0,n._boundingDimensions.y,0),new a.e(n._boundingDimensions.x,n._boundingDimensions.y,0)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(0,n._boundingDimensions.y,0),new a.e(0,n._boundingDimensions.y,n._boundingDimensions.z)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(0,0,n._boundingDimensions.z),new a.e(n._boundingDimensions.x,0,n._boundingDimensions.z)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(0,0,n._boundingDimensions.z),new a.e(0,n._boundingDimensions.y,n._boundingDimensions.z)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(n._boundingDimensions.x,n._boundingDimensions.y,n._boundingDimensions.z),new a.e(0,n._boundingDimensions.y,n._boundingDimensions.z)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(n._boundingDimensions.x,n._boundingDimensions.y,n._boundingDimensions.z),new a.e(n._boundingDimensions.x,0,n._boundingDimensions.z)]},i.utilityLayerScene)),r.push(Tr.a.CreateLines("lines",{points:[new a.e(n._boundingDimensions.x,n._boundingDimensions.y,n._boundingDimensions.z),new a.e(n._boundingDimensions.x,n._boundingDimensions.y,0)]},i.utilityLayerScene)),r.forEach(function(e){e.color=t,e.position.addInPlace(new a.e(-n._boundingDimensions.x/2,-n._boundingDimensions.y/2,-n._boundingDimensions.z/2)),e.isPickable=!1,n._lineBoundingBox.addChild(e)}),n._rootMesh.addChild(n._lineBoundingBox),n.setColor(t),n._rotateSpheresParent=new ze.a("",i.utilityLayerScene),n._rotateSpheresParent.rotationQuaternion=new a.b;for(var c=function(e){var t=yr.a.CreateSphere("",{diameter:1},i.utilityLayerScene);t.rotationQuaternion=new a.b,t.material=l.coloredMaterial,(f=new ke.a({})).moveAttached=!1,f.updateDragPlane=!1,t.addBehavior(f);var r=new a.e(1,0,0),o=0;f.onDragStartObservable.add(function(){r.copyFrom(t.forward),o=0}),f.onDragObservable.add(function(t){if(n.onRotationSphereDragObservable.notifyObservers({}),n.attachedMesh){var i=n.attachedMesh.parent;if(i&&i.scaling&&i.scaling.isNonUniformWithinEpsilon(.001))return void m.a.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");We.a._RemoveAndStorePivotPoint(n.attachedMesh);var s=r,c=t.dragPlaneNormal.scale(a.e.Dot(t.dragPlaneNormal,s)),l=s.subtract(c).normalizeToNew(),u=a.e.Dot(l,t.delta)<0?Math.abs(t.delta.length()):-Math.abs(t.delta.length());u=u/n._boundingDimensions.length()*n._anchorMesh.scaling.length(),n.attachedMesh.rotationQuaternion||(n.attachedMesh.rotationQuaternion=a.b.RotationYawPitchRoll(n.attachedMesh.rotation.y,n.attachedMesh.rotation.x,n.attachedMesh.rotation.z)),n._anchorMesh.rotationQuaternion||(n._anchorMesh.rotationQuaternion=a.b.RotationYawPitchRoll(n._anchorMesh.rotation.y,n._anchorMesh.rotation.x,n._anchorMesh.rotation.z)),o+=u,Math.abs(o)<=2*Math.PI&&(e>=8?a.b.RotationYawPitchRollToRef(0,0,u,n._tmpQuaternion):e>=4?a.b.RotationYawPitchRollToRef(u,0,0,n._tmpQuaternion):a.b.RotationYawPitchRollToRef(0,u,0,n._tmpQuaternion),n._anchorMesh.addChild(n.attachedMesh),n._anchorMesh.rotationQuaternion.multiplyToRef(n._tmpQuaternion,n._anchorMesh.rotationQuaternion),n._anchorMesh.removeChild(n.attachedMesh),n.attachedMesh.setParent(i)),n.updateBoundingBox(),We.a._RestorePivotPoint(n.attachedMesh)}n._updateDummy()}),f.onDragStartObservable.add(function(){n.onDragStartObservable.notifyObservers({}),n._selectNode(t)}),f.onDragEndObservable.add(function(){n.onRotationSphereDragEndObservable.notifyObservers({}),n._selectNode(null),n._updateDummy()}),l._rotateSpheresParent.addChild(t)},l=this,u=0;u<12;u++)c(u);n._rootMesh.addChild(n._rotateSpheresParent),n._scaleBoxesParent=new ze.a("",i.utilityLayerScene),n._scaleBoxesParent.rotationQuaternion=new a.b;for(var h=0;h<3;h++)for(var d=0;d<3;d++)for(var f,p=function(){var e=(1===h?1:0)+(1===d?1:0)+(1===g?1:0);if(1===e||3===e)return"continue";var t=mr.a.CreateBox("",{size:1},i.utilityLayerScene);t.material=_.coloredMaterial,t.metadata=2===e;var r=new a.e(h-1,d-1,g-1).normalize();(f=new ke.a({dragAxis:r})).updateDragPlane=!1,f.moveAttached=!1,t.addBehavior(f),f.onDragObservable.add(function(i){if(n.onScaleBoxDragObservable.notifyObservers({}),n.attachedMesh){var o=n.attachedMesh.parent;if(o&&o.scaling&&o.scaling.isNonUniformWithinEpsilon(.001))return void m.a.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");We.a._RemoveAndStorePivotPoint(n.attachedMesh);var s=i.dragDistance/n._boundingDimensions.length()*n._anchorMesh.scaling.length(),c=new a.e(s,s,s);2===e&&(c.x*=Math.abs(r.x),c.y*=Math.abs(r.y),c.z*=Math.abs(r.z)),c.scaleInPlace(n._scaleDragSpeed),n.updateBoundingBox(),n.scalePivot?(n.attachedMesh.getWorldMatrix().getRotationMatrixToRef(n._tmpRotationMatrix),n._boundingDimensions.scaleToRef(.5,n._tmpVector),a.e.TransformCoordinatesToRef(n._tmpVector,n._tmpRotationMatrix,n._tmpVector),n._anchorMesh.position.subtractInPlace(n._tmpVector),n._boundingDimensions.multiplyToRef(n.scalePivot,n._tmpVector),a.e.TransformCoordinatesToRef(n._tmpVector,n._tmpRotationMatrix,n._tmpVector),n._anchorMesh.position.addInPlace(n._tmpVector)):(t.absolutePosition.subtractToRef(n._anchorMesh.position,n._tmpVector),n._anchorMesh.position.subtractInPlace(n._tmpVector)),n._anchorMesh.addChild(n.attachedMesh),n._anchorMesh.scaling.addInPlace(c),(n._anchorMesh.scaling.x<0||n._anchorMesh.scaling.y<0||n._anchorMesh.scaling.z<0)&&n._anchorMesh.scaling.subtractInPlace(c),n._anchorMesh.removeChild(n.attachedMesh),n.attachedMesh.setParent(o),We.a._RestorePivotPoint(n.attachedMesh)}n._updateDummy()}),f.onDragStartObservable.add(function(){n.onDragStartObservable.notifyObservers({}),n._selectNode(t)}),f.onDragEndObservable.add(function(){n.onScaleBoxDragEndObservable.notifyObservers({}),n._selectNode(null),n._updateDummy()}),_._scaleBoxesParent.addChild(t)},_=this,g=0;g<3;g++)p();n._rootMesh.addChild(n._scaleBoxesParent);var v=new Array;return n._pointerObserver=i.utilityLayerScene.onPointerObservable.add(function(e){v[e.event.pointerId]?e.pickInfo&&e.pickInfo.pickedMesh!=v[e.event.pointerId]&&(v[e.event.pointerId].material=n.coloredMaterial,delete v[e.event.pointerId]):n._rotateSpheresParent.getChildMeshes().concat(n._scaleBoxesParent.getChildMeshes()).forEach(function(t){e.pickInfo&&e.pickInfo.pickedMesh==t&&(v[e.event.pointerId]=t,t.material=n.hoverColoredMaterial)})}),n._renderObserver=n.gizmoLayer.originalScene.onBeforeRenderObservable.add(function(){n.attachedMesh&&!n._existingMeshScale.equals(n.attachedMesh.scaling)?n.updateBoundingBox():(n.fixedDragMeshScreenSize||n.fixedDragMeshBoundsSize)&&(n._updateRotationSpheres(),n._updateScaleBoxes()),n._dragMesh&&n.attachedMesh&&n.pointerDragBehavior.dragging&&(n._lineBoundingBox.position.rotateByQuaternionToRef(n._rootMesh.rotationQuaternion,n._tmpVector),n.attachedMesh.setAbsolutePosition(n._dragMesh.position.add(n._tmpVector.scale(-1))))}),n.updateBoundingBox(),n}return Object(h.d)(t,e),t.prototype.setColor=function(e){this.coloredMaterial.emissiveColor=e,this.hoverColoredMaterial.emissiveColor=e.clone().add(new s.a(.3,.3,.3)),this._lineBoundingBox.getChildren().forEach(function(t){t.color&&(t.color=e)})},t.prototype._attachedNodeChanged=function(e){var t=this;if(e){We.a._RemoveAndStorePivotPoint(e);var i=e.parent;this._anchorMesh.addChild(e),this._anchorMesh.removeChild(e),e.setParent(i),We.a._RestorePivotPoint(e),this.updateBoundingBox(),e.getChildMeshes(!1).forEach(function(e){e.markAsDirty("scaling")}),this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(function(){t._updateDummy()})}},t.prototype._selectNode=function(e){this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach(function(t){t.isVisible=!e||t==e})},t.prototype.updateBoundingBox=function(){if(this.attachedMesh){We.a._RemoveAndStorePivotPoint(this.attachedMesh);var e=this.attachedMesh.parent;this.attachedMesh.setParent(null);var t=null;this.attachedMesh.skeleton&&(t=this.attachedMesh.skeleton.overrideMesh,this.attachedMesh.skeleton.overrideMesh=null),this._update(),this.attachedMesh.rotationQuaternion||(this.attachedMesh.rotationQuaternion=a.b.RotationYawPitchRoll(this.attachedMesh.rotation.y,this.attachedMesh.rotation.x,this.attachedMesh.rotation.z)),this._anchorMesh.rotationQuaternion||(this._anchorMesh.rotationQuaternion=a.b.RotationYawPitchRoll(this._anchorMesh.rotation.y,this._anchorMesh.rotation.x,this._anchorMesh.rotation.z)),this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpVector.copyFrom(this.attachedMesh.position),this.attachedMesh.rotationQuaternion.set(0,0,0,1),this.attachedMesh.position.set(0,0,0);var i=this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren,this.includeChildPredicate);i.max.subtractToRef(i.min,this._boundingDimensions),this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions),this._lineBoundingBox.position.set((i.max.x+i.min.x)/2,(i.max.y+i.min.y)/2,(i.max.z+i.min.z)/2),this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position),this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position),this._lineBoundingBox.computeWorldMatrix(),this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition),this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion),this.attachedMesh.position.copyFrom(this._tmpVector),this.attachedMesh.setParent(e),this.attachedMesh.skeleton&&(this.attachedMesh.skeleton.overrideMesh=t)}this._updateRotationSpheres(),this._updateScaleBoxes(),this.attachedMesh&&(this._existingMeshScale.copyFrom(this.attachedMesh.scaling),We.a._RestorePivotPoint(this.attachedMesh))},t.prototype._updateRotationSpheres=function(){for(var e=this._rotateSpheresParent.getChildMeshes(),t=0;t<3;t++)for(var i=0;i<2;i++)for(var n=0;n<2;n++){var r=4*t+2*i+n;if(0==t&&(e[r].position.set(this._boundingDimensions.x/2,this._boundingDimensions.y*i,this._boundingDimensions.z*n),e[r].position.addInPlace(new a.e(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[r].lookAt(a.e.Cross(e[r].position.normalizeToNew(),a.e.Right()).normalizeToNew().add(e[r].position))),1==t&&(e[r].position.set(this._boundingDimensions.x*i,this._boundingDimensions.y/2,this._boundingDimensions.z*n),e[r].position.addInPlace(new a.e(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[r].lookAt(a.e.Cross(e[r].position.normalizeToNew(),a.e.Up()).normalizeToNew().add(e[r].position))),2==t&&(e[r].position.set(this._boundingDimensions.x*i,this._boundingDimensions.y*n,this._boundingDimensions.z/2),e[r].position.addInPlace(new a.e(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[r].lookAt(a.e.Cross(e[r].position.normalizeToNew(),a.e.Forward()).normalizeToNew().add(e[r].position))),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[r].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var o=this.rotationSphereSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[r].scaling.set(o,o,o)}else this.fixedDragMeshBoundsSize?e[r].scaling.set(this.rotationSphereSize*this._boundingDimensions.x,this.rotationSphereSize*this._boundingDimensions.y,this.rotationSphereSize*this._boundingDimensions.z):e[r].scaling.set(this.rotationSphereSize,this.rotationSphereSize,this.rotationSphereSize)}},t.prototype._updateScaleBoxes=function(){for(var e=this._scaleBoxesParent.getChildMeshes(),t=0,i=0;i<3;i++)for(var n=0;n<3;n++)for(var r=0;r<3;r++){var o=(1===i?1:0)+(1===n?1:0)+(1===r?1:0);if(1!==o&&3!==o){if(e[t])if(e[t].position.set(this._boundingDimensions.x*(i/2),this._boundingDimensions.y*(n/2),this._boundingDimensions.z*(r/2)),e[t].position.addInPlace(new a.e(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[t].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var s=this.scaleBoxSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[t].scaling.set(s,s,s)}else this.fixedDragMeshBoundsSize?e[t].scaling.set(this.scaleBoxSize*this._boundingDimensions.x,this.scaleBoxSize*this._boundingDimensions.y,this.scaleBoxSize*this._boundingDimensions.z):e[t].scaling.set(this.scaleBoxSize,this.scaleBoxSize,this.scaleBoxSize);t++}}},t.prototype.setEnabledRotationAxis=function(e){this._rotateSpheresParent.getChildMeshes().forEach(function(t,i){i<4?t.setEnabled(-1!=e.indexOf("x")):i<8?t.setEnabled(-1!=e.indexOf("y")):t.setEnabled(-1!=e.indexOf("z"))})},t.prototype.setEnabledScaling=function(e,t){void 0===t&&(t=!1),this._scaleBoxesParent.getChildMeshes().forEach(function(i,n){var r=e;t&&!0===i.metadata&&(r=!1),i.setEnabled(r)})},t.prototype._updateDummy=function(){this._dragMesh&&(this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition()),this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling),this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion))},t.prototype.enableDragBehavior=function(){this._dragMesh=be.a.CreateBox("dummy",1,this.gizmoLayer.utilityLayerScene),this._dragMesh.visibility=0,this._dragMesh.rotationQuaternion=new a.b,this.pointerDragBehavior.useObjectOrientationForDragging=!1,this._dragMesh.addBehavior(this.pointerDragBehavior)},t.prototype.dispose=function(){this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver),this._lineBoundingBox.dispose(),this._rotateSpheresParent.dispose(),this._scaleBoxesParent.dispose(),this._dragMesh&&this._dragMesh.dispose(),e.prototype.dispose.call(this)},t.MakeNotPickableAndWrapInBoundingBox=function(e){var t=function(e){e.isPickable=!1,e.getChildMeshes().forEach(function(e){t(e)})};t(e),e.rotationQuaternion||(e.rotationQuaternion=a.b.RotationYawPitchRoll(e.rotation.y,e.rotation.x,e.rotation.z));var i=e.position.clone(),n=e.rotationQuaternion.clone();e.rotationQuaternion.set(0,0,0,1),e.position.set(0,0,0);var r=mr.a.CreateBox("box",{size:1},e.getScene()),o=e.getHierarchyBoundingVectors();return o.max.subtractToRef(o.min,r.scaling),0===r.scaling.y&&(r.scaling.y=Nt.a),0===r.scaling.x&&(r.scaling.x=Nt.a),0===r.scaling.z&&(r.scaling.z=Nt.a),r.position.set((o.max.x+o.min.x)/2,(o.max.y+o.min.y)/2,(o.max.z+o.min.z)/2),e.addChild(r),e.rotationQuaternion.copyFrom(n),e.position.copyFrom(i),e.removeChild(r),r.addChild(e),r.visibility=0,r},t.prototype.setCustomMesh=function(e){m.a.Error("Custom meshes are not supported on this gizmo")},t}(gr.a),Sr=function(e){function t(t,i,n,r,c,l,u){var h;void 0===i&&(i=s.a.Gray()),void 0===n&&(n=vr.a.DefaultUtilityLayer),void 0===r&&(r=32),void 0===c&&(c=null),void 0===l&&(l=!1),void 0===u&&(u=1);var d=e.call(this,n)||this;d._pointerObserver=null,d.snapDistance=0,d.onSnapObservable=new o.c,d._isEnabled=!0,d._parent=null,d._dragging=!1,d._parent=c,d._coloredMaterial=new Ui.a("",n.utilityLayerScene),d._coloredMaterial.diffuseColor=i,d._coloredMaterial.specularColor=i.subtract(new s.a(.1,.1,.1)),d._hoverMaterial=new Ui.a("",n.utilityLayerScene),d._hoverMaterial.diffuseColor=s.a.Yellow(),d._disableMaterial=new Ui.a("",n.utilityLayerScene),d._disableMaterial.diffuseColor=s.a.Gray(),d._disableMaterial.alpha=.4,d._gizmoMesh=new be.a("",n.utilityLayerScene);var f=d._createGizmoMesh(d._gizmoMesh,u,r),p=f.rotationMesh,_=f.collider,m=[];d._rotationCircle=d.setupRotationCircle(m,d._gizmoMesh),d._gizmoMesh.lookAt(d._rootMesh.position.add(t)),d._rootMesh.addChild(d._gizmoMesh),d._gizmoMesh.scaling.scaleInPlace(1/3),d.dragBehavior=new ke.a({dragPlaneNormal:t}),d.dragBehavior.moveAttached=!1,d.dragBehavior.maxDragAngle=9*Math.PI/20,d.dragBehavior._useAlternatePickedPointAboveMaxDragAngle=!0,d._rootMesh.addBehavior(d.dragBehavior);var g=0,v=new a.e,b=new a.e,y=new a.a,T=new a.e,E=new a.e;d.dragBehavior.onDragStartObservable.add(function(e){if(d.attachedNode){v.copyFrom(e.dragPlanePoint);var t=new a.e(0,0,1),i=d._rotationCircle.getDirection(t);i.normalize(),d._gizmoMesh.removeChild(d._rotationCircle),v.copyFrom(e.dragPlanePoint),b=e.dragPlanePoint;var n=d._rotationCircle.getAbsolutePosition().clone(),r=d._rotationCircle.getAbsolutePosition().clone().addInPlace(i),o=e.dragPlanePoint,s=a.e.GetAngleBetweenVectors(r.subtract(n),o.subtract(n),d._rotationCircle.up);d._rotationCircle.addRotation(0,s,0),d._dragging=!0}}),d.dragBehavior.onDragEndObservable.add(function(){g=0,d.updateRotationCircle(d._rotationCircle,m,g,b),d._gizmoMesh.addChild(d._rotationCircle),d._dragging=!1});var S={snapDistance:0},A=0,P=new a.a,C=new a.b;d.dragBehavior.onDragObservable.add(function(e){if(d.attachedNode){var i=new a.e(1,1,1),r=new a.b(0,0,0,1),o=new a.e(0,0,0);d.attachedNode.getWorldMatrix().decompose(i,r,o);var s=e.dragPlanePoint.subtract(o).normalize(),c=v.subtract(o).normalize(),l=a.e.Cross(s,c),u=a.e.Dot(s,c),h=Math.atan2(l.length(),u);T.copyFrom(t),E.copyFrom(t),d.updateGizmoRotationToMatchAttachedMesh&&(r.toRotationMatrix(y),E=a.e.TransformCoordinates(T,y));var f=!1;if(n.utilityLayerScene.activeCamera){var p=n.utilityLayerScene.activeCamera.position.subtract(o);a.e.Dot(p,E)>0&&(T.scaleInPlace(-1),E.scaleInPlace(-1),f=!0)}a.e.Dot(E,l)>0&&(h=-h);var _=!1;if(0!=d.snapDistance)if(A+=h,Math.abs(A)>d.snapDistance){var R=Math.floor(Math.abs(A)/d.snapDistance);A<0&&(R*=-1),A%=d.snapDistance,h=d.snapDistance*R,_=!0}else h=0;g+=f?-h:h,d.updateRotationCircle(d._rotationCircle,m,g,b);var x=Math.sin(h/2);if(C.set(T.x*x,T.y*x,T.z*x,Math.cos(h/2)),P.determinant()>0){var O=new a.e;C.toEulerAnglesToRef(O),a.b.RotationYawPitchRollToRef(O.y,-O.x,-O.z,C)}d.updateGizmoRotationToMatchAttachedMesh?r.multiplyToRef(C,r):C.multiplyToRef(r,r),d.attachedNode.getWorldMatrix().copyFrom(a.a.Compose(i,r,o)),v.copyFrom(e.dragPlanePoint),_&&(S.snapDistance=h,d.onSnapObservable.notifyObservers(S)),d._matrixChanged()}});var R=n._getSharedGizmoLight();R.includedOnlyMeshes=R.includedOnlyMeshes.concat(d._rootMesh.getChildMeshes(!1));var x={colliderMeshes:[_],gizmoMeshes:[p],material:d._coloredMaterial,hoverMaterial:d._hoverMaterial,disableMaterial:d._disableMaterial,active:!1};return null===(h=d._parent)||void 0===h||h.addToAxisCache(d._gizmoMesh,x),d._pointerObserver=n.utilityLayerScene.onPointerObservable.add(function(e){var t;if(!d._customMeshSet&&(d._isHovered=!(-1==x.colliderMeshes.indexOf(null===(t=null==e?void 0:e.pickInfo)||void 0===t?void 0:t.pickedMesh)),!d._parent)){var i=d._isHovered||d._dragging?d._hoverMaterial:d._coloredMaterial;x.gizmoMeshes.forEach(function(e){e.material=i,e.color&&(e.color=i.diffuseColor)})}}),d}return Object(h.d)(t,e),t.prototype._createGizmoMesh=function(e,t,i){var n=be.a.CreateTorus("ignore",.6,.03*t,i,this.gizmoLayer.utilityLayerScene);n.visibility=0;var r=be.a.CreateTorus("",.6,.005*t,i,this.gizmoLayer.utilityLayerScene);return r.material=this._coloredMaterial,r.rotation.x=Math.PI/2,n.rotation.x=Math.PI/2,e.addChild(r),e.addChild(n),{rotationMesh:r,collider:n}},t.prototype._attachedNodeChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},t.prototype.setupRotationCircle=function(e,i){for(var n=t._CircleConstants.pi2/t._CircleConstants.tessellation,r=-Math.PI/2;r<Math.PI/2-1.5;r+=n/2){for(var o=[],c=0;c<t._CircleConstants.pi2*t._CircleConstants.rotationCircleRange+.01;c+=n)if(c<0){var l=t._CircleConstants.radius*Math.sin(c)*Math.cos(r),u=t._CircleConstants.radius*Math.cos(c)*Math.cos(r);o.push(new a.e(l,0,u))}else o.push(new a.e(0,0,0));e.push(o)}var h=new Ui.a("",this.gizmoLayer.utilityLayerScene);h.diffuseColor=s.a.Yellow(),h.backFaceCulling=!1;var d=be.a.CreateRibbon("rotationCircle",e,!1,!1,0,this.gizmoLayer.utilityLayerScene,!0);return d.material=h,d.material.alpha=.25,d.rotation.x=Math.PI/2,i.addChild(d),d},t.prototype.updateRotationPath=function(e,i){for(var n=t._CircleConstants.pi2/t._CircleConstants.tessellation,r=0,o=-Math.PI/2;o<Math.PI/2-1.5;o+=n/2){var a=e[r];if(a)for(var s=0,c=0;c<t._CircleConstants.pi2*t._CircleConstants.rotationCircleRange+.01;c+=n){if(a[s])if(c<Math.abs(i)){var l=i>0?c:-1*c,u=i>0?o:-1*o;a[s].set(t._CircleConstants.radius*Math.sin(l)*Math.cos(u),0,t._CircleConstants.radius*Math.cos(l)*Math.cos(u))}else a[s].set(0,0,0);s++}r++}},t.prototype.updateRotationCircle=function(e,t,i,n){this.updateRotationPath(t,i),be.a.CreateRibbon("rotationCircle",t,!1,!1,0,this.gizmoLayer.utilityLayerScene,void 0,void 0,e.geometry?e:void 0)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh):this.attachedMesh=null},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose(),this._rotationCircle&&this._rotationCircle.dispose(),[this._coloredMaterial,this._hoverMaterial,this._disableMaterial].forEach(function(e){e&&e.dispose()}),e.prototype.dispose.call(this)},t._CircleConstants={radius:.3,pi2:2*Math.PI,tessellation:70,rotationCircleRange:4},t}(gr.a),Ar=function(e){function t(t,i,n,r,c){void 0===t&&(t=vr.a.DefaultUtilityLayer),void 0===i&&(i=32),void 0===n&&(n=!1),void 0===r&&(r=1);var l=e.call(this,t)||this;return l.onDragStartObservable=new o.c,l.onDragEndObservable=new o.c,l._observables=[],l._gizmoAxisCache=new Map,l.xGizmo=new Sr(new a.e(1,0,0),s.a.Red().scale(.5),t,i,l,n,r),l.yGizmo=new Sr(new a.e(0,1,0),s.a.Green().scale(.5),t,i,l,n,r),l.zGizmo=new Sr(new a.e(0,0,1),s.a.Blue().scale(.5),t,i,l,n,r),[l.xGizmo,l.yGizmo,l.zGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){l.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){l.onDragEndObservable.notifyObservers({})})}),l.attachedMesh=null,l.attachedNode=null,c?c.addToAxisCache(l._gizmoAxisCache):gr.a.GizmoAxisPointerObserver(t,l._gizmoAxisCache),l}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,this._nodeAttached=e,this._checkBillboardTransform(),[this.xGizmo,this.yGizmo,this.zGizmo].forEach(function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attachedNode",{get:function(){return this._nodeAttached},set:function(e){this._meshAttached=null,this._nodeAttached=e,this._checkBillboardTransform(),[this.xGizmo,this.yGizmo,this.zGizmo].forEach(function(t){t.isEnabled?t.attachedNode=e:t.attachedNode=null})},enumerable:!1,configurable:!0}),t.prototype._checkBillboardTransform=function(){this._nodeAttached&&this._nodeAttached.billboardMode&&console.log("Rotation Gizmo will not work with transforms in billboard mode.")},Object.defineProperty(t.prototype,"isHovered",{get:function(){var e=!1;return[this.xGizmo,this.yGizmo,this.zGizmo].forEach(function(t){e=e||t.isHovered}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this.xGizmo.updateGizmoRotationToMatchAttachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.yGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.zGizmo.updateGizmoRotationToMatchAttachedMesh=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this.xGizmo.snapDistance},set:function(e){this.xGizmo&&(this.xGizmo.snapDistance=e,this.yGizmo.snapDistance=e,this.zGizmo.snapDistance=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this.xGizmo.scaleRatio},set:function(e){this.xGizmo&&(this.xGizmo.scaleRatio=e,this.yGizmo.scaleRatio=e,this.zGizmo.scaleRatio=e)},enumerable:!1,configurable:!0}),t.prototype.addToAxisCache=function(e,t){this._gizmoAxisCache.set(e,t)},t.prototype.dispose=function(){var e=this;this.xGizmo.dispose(),this.yGizmo.dispose(),this.zGizmo.dispose(),this.onDragStartObservable.clear(),this.onDragEndObservable.clear(),this._observables.forEach(function(t){e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(t)})},t.prototype.setCustomMesh=function(e){m.a.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)")},t}(gr.a),Pr=i(46),Cr=i(84),Rr=function(e){function t(i,n,r,c){var l;void 0===n&&(n=s.a.Gray()),void 0===r&&(r=vr.a.DefaultUtilityLayer),void 0===c&&(c=null);var u=e.call(this,r)||this;u._pointerObserver=null,u.snapDistance=0,u.onSnapObservable=new o.c,u._isEnabled=!1,u._parent=null,u._dragging=!1,u._parent=c,u._coloredMaterial=new Ui.a("",r.utilityLayerScene),u._coloredMaterial.diffuseColor=n,u._coloredMaterial.specularColor=n.subtract(new s.a(.1,.1,.1)),u._hoverMaterial=new Ui.a("",r.utilityLayerScene),u._hoverMaterial.diffuseColor=s.a.Yellow(),u._disableMaterial=new Ui.a("",r.utilityLayerScene),u._disableMaterial.diffuseColor=s.a.Gray(),u._disableMaterial.alpha=.4,u._gizmoMesh=t._CreatePlane(r.utilityLayerScene,u._coloredMaterial),u._gizmoMesh.lookAt(u._rootMesh.position.add(i)),u._gizmoMesh.scaling.scaleInPlace(1/3),u._gizmoMesh.parent=u._rootMesh;var h=0,d=new a.e,f={snapDistance:0};u.dragBehavior=new ke.a({dragPlaneNormal:i}),u.dragBehavior.moveAttached=!1,u._rootMesh.addBehavior(u.dragBehavior),u.dragBehavior.onDragObservable.add(function(e){if(u.attachedNode){if(0==u.snapDistance)u.attachedNode.getWorldMatrix().addTranslationFromFloats(e.delta.x,e.delta.y,e.delta.z);else if(h+=e.dragDistance,Math.abs(h)>u.snapDistance){var t=Math.floor(Math.abs(h)/u.snapDistance);h%=u.snapDistance,e.delta.normalizeToRef(d),d.scaleInPlace(u.snapDistance*t),u.attachedNode.getWorldMatrix().addTranslationFromFloats(d.x,d.y,d.z),f.snapDistance=u.snapDistance*t,u.onSnapObservable.notifyObservers(f)}u._matrixChanged()}}),u.dragBehavior.onDragStartObservable.add(function(){u._dragging=!0}),u.dragBehavior.onDragEndObservable.add(function(){u._dragging=!1});var p=r._getSharedGizmoLight();p.includedOnlyMeshes=p.includedOnlyMeshes.concat(u._rootMesh.getChildMeshes(!1));var _={gizmoMeshes:u._gizmoMesh.getChildMeshes(),colliderMeshes:u._gizmoMesh.getChildMeshes(),material:u._coloredMaterial,hoverMaterial:u._hoverMaterial,disableMaterial:u._disableMaterial,active:!1};return null===(l=u._parent)||void 0===l||l.addToAxisCache(u._gizmoMesh,_),u._pointerObserver=r.utilityLayerScene.onPointerObservable.add(function(e){var t;if(!u._customMeshSet&&(u._isHovered=!(-1==_.colliderMeshes.indexOf(null===(t=null==e?void 0:e.pickInfo)||void 0===t?void 0:t.pickedMesh)),!u._parent)){var i=u._isHovered||u._dragging?u._hoverMaterial:u._coloredMaterial;_.gizmoMeshes.forEach(function(e){e.material=i})}}),u}return Object(h.d)(t,e),t._CreatePlane=function(e,t){var i=new Pr.a("plane",e),n=Cr.a.CreatePlane("dragPlane",{width:.1375,height:.1375,sideOrientation:2},e);return n.material=t,n.parent=i,i},t.prototype._attachedNodeChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedNode=this._parent.attachedNode):this.attachedNode=null},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this),this._gizmoMesh&&this._gizmoMesh.dispose(),[this._coloredMaterial,this._hoverMaterial,this._disableMaterial].forEach(function(e){e&&e.dispose()})},t}(gr.a),xr=function(e){function t(t,i,n){void 0===t&&(t=vr.a.DefaultUtilityLayer),void 0===i&&(i=1);var r=e.call(this,t)||this;return r._meshAttached=null,r._nodeAttached=null,r._observables=[],r._gizmoAxisCache=new Map,r.onDragStartObservable=new o.c,r.onDragEndObservable=new o.c,r._planarGizmoEnabled=!1,r.xGizmo=new _r.a(new a.e(1,0,0),s.a.Red().scale(.5),t,r,i),r.yGizmo=new _r.a(new a.e(0,1,0),s.a.Green().scale(.5),t,r,i),r.zGizmo=new _r.a(new a.e(0,0,1),s.a.Blue().scale(.5),t,r,i),r.xPlaneGizmo=new Rr(new a.e(1,0,0),s.a.Red().scale(.5),r.gizmoLayer,r),r.yPlaneGizmo=new Rr(new a.e(0,1,0),s.a.Green().scale(.5),r.gizmoLayer,r),r.zPlaneGizmo=new Rr(new a.e(0,0,1),s.a.Blue().scale(.5),r.gizmoLayer,r),[r.xGizmo,r.yGizmo,r.zGizmo,r.xPlaneGizmo,r.yPlaneGizmo,r.zPlaneGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){r.onDragEndObservable.notifyObservers({})})}),r.attachedMesh=null,n?n.addToAxisCache(r._gizmoAxisCache):gr.a.GizmoAxisPointerObserver(t,r._gizmoAxisCache),r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,this._nodeAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attachedNode",{get:function(){return this._nodeAttached},set:function(e){this._meshAttached=null,this._nodeAttached=null,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t.isEnabled?t.attachedNode=e:t.attachedNode=null})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isHovered",{get:function(){var e=!1;return[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){e=e||t.isHovered}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"planarGizmoEnabled",{get:function(){return this._planarGizmoEnabled},set:function(e){var t=this;this._planarGizmoEnabled=e,[this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(i){i&&(i.isEnabled=e,e&&(i.attachedMesh?i.attachedMesh=t.attachedMesh:i.attachedNode=t.attachedNode))},this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this._updateGizmoRotationToMatchAttachedMesh},set:function(e){this._updateGizmoRotationToMatchAttachedMesh=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t&&(t.updateGizmoRotationToMatchAttachedMesh=e)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this._snapDistance},set:function(e){this._snapDistance=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t&&(t.snapDistance=e)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this._scaleRatio},set:function(e){this._scaleRatio=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t&&(t.scaleRatio=e)})},enumerable:!1,configurable:!0}),t.prototype.addToAxisCache=function(e,t){this._gizmoAxisCache.set(e,t)},t.prototype.dispose=function(){var e=this;[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(e){e&&e.dispose()}),this._observables.forEach(function(t){e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(t)}),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},t.prototype.setCustomMesh=function(e){m.a.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)")},t}(gr.a);zi.a.CreatePolyhedron=function(e){var t=[];t[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},t[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},t[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},t[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},t[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},t[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},t[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},t[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},t[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},t[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},t[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},t[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},t[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},t[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},t[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};var i,n,r,o,c,l,u=e.type&&(e.type<0||e.type>=t.length)?0:e.type||0,h=e.size,d=e.sizeX||h||1,f=e.sizeY||h||1,p=e.sizeZ||h||1,_=e.custom||t[u],m=_.face.length,g=e.faceUV||new Array(m),v=e.faceColors,b=void 0===e.flat||e.flat,y=0===e.sideOrientation?0:e.sideOrientation||zi.a.DEFAULTSIDE,T=new Array,E=new Array,S=new Array,A=new Array,P=new Array,C=0,R=0,x=new Array,O=0,M=0;if(b)for(M=0;M<m;M++)v&&void 0===v[M]&&(v[M]=new s.b(1,1,1,1)),g&&void 0===g[M]&&(g[M]=new a.f(0,0,1,1));if(b)for(M=0;M<m;M++){var I=_.face[M].length;for(r=2*Math.PI/I,o=.5*Math.tan(r/2),c=.5,O=0;O<I;O++)T.push(_.vertex[_.face[M][O]][0]*d,_.vertex[_.face[M][O]][1]*f,_.vertex[_.face[M][O]][2]*p),x.push(C),C++,i=g[M].x+(g[M].z-g[M].x)*(.5+o),n=g[M].y+(g[M].w-g[M].y)*(c-.5),A.push(i,n),l=o*Math.cos(r)-c*Math.sin(r),c=o*Math.sin(r)+c*Math.cos(r),o=l,v&&P.push(v[M].r,v[M].g,v[M].b,v[M].a);for(O=0;O<I-2;O++)E.push(x[0+R],x[O+2+R],x[O+1+R]);R+=I}else{for(O=0;O<_.vertex.length;O++)T.push(_.vertex[O][0]*d,_.vertex[O][1]*f,_.vertex[O][2]*p),A.push(0,0);for(M=0;M<m;M++)for(O=0;O<_.face[M].length-2;O++)E.push(_.face[M][0],_.face[M][O+2],_.face[M][O+1])}zi.a.ComputeNormals(T,E,S),zi.a._ComputeSides(y,T,E,S,A,e.frontUVs,e.backUVs);var D=new zi.a;return D.positions=T,D.indices=E,D.normals=S,D.uvs=A,v&&b&&(D.colors=P),D},be.a.CreatePolyhedron=function(e,t,i){return Or.CreatePolyhedron(e,t,i)};var Or=function(){function e(){}return e.CreatePolyhedron=function(e,t,i){void 0===i&&(i=null);var n=new be.a(e,i);return t.sideOrientation=be.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,zi.a.CreatePolyhedron(t).applyToMesh(n,t.updatable),n},e}(),Mr=function(e){function t(t,i,n){void 0===t&&(t=vr.a.DefaultUtilityLayer),void 0===i&&(i=1);var r=e.call(this,t)||this;return r._meshAttached=null,r._nodeAttached=null,r._sensitivity=1,r._observables=[],r._gizmoAxisCache=new Map,r.onDragStartObservable=new o.c,r.onDragEndObservable=new o.c,r.uniformScaleGizmo=r._createUniformScaleMesh(),r.xGizmo=new br(new a.e(1,0,0),s.a.Red().scale(.5),t,r,i),r.yGizmo=new br(new a.e(0,1,0),s.a.Green().scale(.5),t,r,i),r.zGizmo=new br(new a.e(0,0,1),s.a.Blue().scale(.5),t,r,i),[r.xGizmo,r.yGizmo,r.zGizmo,r.uniformScaleGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){r.onDragEndObservable.notifyObservers({})})}),r.attachedMesh=null,r.attachedNode=null,n?n.addToAxisCache(r._gizmoAxisCache):gr.a.GizmoAxisPointerObserver(t,r._gizmoAxisCache),r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,this._nodeAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attachedNode",{get:function(){return this._nodeAttached},set:function(e){this._meshAttached=null,this._nodeAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t.isEnabled?t.attachedNode=e:t.attachedNode=null})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isHovered",{get:function(){var e=!1;return[this.xGizmo,this.yGizmo,this.zGizmo].forEach(function(t){e=e||t.isHovered}),e},enumerable:!1,configurable:!0}),t.prototype._createUniformScaleMesh=function(){this._coloredMaterial=new Ui.a("",this.gizmoLayer.utilityLayerScene),this._coloredMaterial.diffuseColor=s.a.Gray(),this._hoverMaterial=new Ui.a("",this.gizmoLayer.utilityLayerScene),this._hoverMaterial.diffuseColor=s.a.Yellow(),this._disableMaterial=new Ui.a("",this.gizmoLayer.utilityLayerScene),this._disableMaterial.diffuseColor=s.a.Gray(),this._disableMaterial.alpha=.4;var e=new br(new a.e(0,1,0),s.a.Gray().scale(.5),this.gizmoLayer,this);e.updateGizmoRotationToMatchAttachedMesh=!1,e.uniformScaling=!0,this._uniformScalingMesh=Or.CreatePolyhedron("uniform",{type:1},e.gizmoLayer.utilityLayerScene),this._uniformScalingMesh.scaling.scaleInPlace(.01),this._uniformScalingMesh.visibility=0,this._octahedron=Or.CreatePolyhedron("",{type:1},e.gizmoLayer.utilityLayerScene),this._octahedron.scaling.scaleInPlace(.007),this._uniformScalingMesh.addChild(this._octahedron),e.setCustomMesh(this._uniformScalingMesh,!0);var t=this.gizmoLayer._getSharedGizmoLight();t.includedOnlyMeshes=t.includedOnlyMeshes.concat(this._octahedron);var i={gizmoMeshes:[this._octahedron,this._uniformScalingMesh],colliderMeshes:[this._uniformScalingMesh],material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1};return this.addToAxisCache(e._rootMesh,i),e},Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this._updateGizmoRotationToMatchAttachedMesh},set:function(e){e?(this._updateGizmoRotationToMatchAttachedMesh=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t&&(t.updateGizmoRotationToMatchAttachedMesh=e)})):m.a.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this._snapDistance},set:function(e){this._snapDistance=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t&&(t.snapDistance=e)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this._scaleRatio},set:function(e){this._scaleRatio=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t&&(t.scaleRatio=e)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sensitivity",{get:function(){return this._sensitivity},set:function(e){this._sensitivity=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t&&(t.sensitivity=e)})},enumerable:!1,configurable:!0}),t.prototype.addToAxisCache=function(e,t){this._gizmoAxisCache.set(e,t)},t.prototype.dispose=function(){var e=this;[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(e){e&&e.dispose()}),this._observables.forEach(function(t){e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(t)}),this.onDragStartObservable.clear(),this.onDragEndObservable.clear(),[this._uniformScalingMesh,this._octahedron].forEach(function(e){e&&e.dispose()}),[this._coloredMaterial,this._hoverMaterial,this._disableMaterial].forEach(function(e){e&&e.dispose()})},t}(gr.a),Ir=function(){function e(e,t,i,n){void 0===t&&(t=1),void 0===i&&(i=vr.a.DefaultUtilityLayer),void 0===n&&(n=vr.a.DefaultKeepDepthUtilityLayer),this.scene=e,this.clearGizmoOnEmptyPointerEvent=!1,this.onAttachedToMeshObservable=new o.c,this.onAttachedToNodeObservable=new o.c,this._gizmosEnabled={positionGizmo:!1,rotationGizmo:!1,scaleGizmo:!1,boundingBoxGizmo:!1},this._pointerObservers=[],this._attachedMesh=null,this._attachedNode=null,this._boundingBoxColor=s.a.FromHexString("#0984e3"),this._thickness=1,this._gizmoAxisCache=new Map,this.boundingBoxDragBehavior=new He,this.attachableMeshes=null,this.attachableNodes=null,this.usePointerToAttachGizmos=!0,this._defaultUtilityLayer=i,this._defaultKeepDepthUtilityLayer=n,this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil=!1,this._thickness=t,this.gizmos={positionGizmo:null,rotationGizmo:null,scaleGizmo:null,boundingBoxGizmo:null};var r=this._attachToMeshPointerObserver(e),a=gr.a.GizmoAxisPointerObserver(this._defaultUtilityLayer,this._gizmoAxisCache);this._pointerObservers=[r,a]}return Object.defineProperty(e.prototype,"keepDepthUtilityLayer",{get:function(){return this._defaultKeepDepthUtilityLayer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"utilityLayer",{get:function(){return this._defaultUtilityLayer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHovered",{get:function(){var e=!1;for(var t in this.gizmos){var i=this.gizmos[t];if(i&&i.isHovered){e=!0;break}}return e},enumerable:!1,configurable:!0}),e.prototype._attachToMeshPointerObserver=function(e){var t=this;return e.onPointerObservable.add(function(e){if(t.usePointerToAttachGizmos&&e.type==Ne.a.POINTERDOWN)if(e.pickInfo&&e.pickInfo.pickedMesh){var i=e.pickInfo.pickedMesh;if(null==t.attachableMeshes)for(;i&&null!=i.parent;)i=i.parent;else{var n=!1;t.attachableMeshes.forEach(function(e){i&&(i==e||i.isDescendantOf(e))&&(i=e,n=!0)}),n||(i=null)}i instanceof ze.a?t._attachedMesh!=i&&t.attachToMesh(i):t.clearGizmoOnEmptyPointerEvent&&t.attachToMesh(null)}else t.clearGizmoOnEmptyPointerEvent&&t.attachToMesh(null)})},e.prototype.attachToMesh=function(e){for(var t in this._attachedMesh&&this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedNode&&this._attachedNode.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh=e,this._attachedNode=null,this.gizmos){var i=this.gizmos[t];i&&this._gizmosEnabled[t]&&(i.attachedMesh=e)}this.boundingBoxGizmoEnabled&&this._attachedMesh&&this._attachedMesh.addBehavior(this.boundingBoxDragBehavior),this.onAttachedToMeshObservable.notifyObservers(e)},e.prototype.attachToNode=function(e){for(var t in this._attachedMesh&&this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedNode&&this._attachedNode.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh=null,this._attachedNode=e,this.gizmos){var i=this.gizmos[t];i&&this._gizmosEnabled[t]&&(i.attachedNode=e)}this.boundingBoxGizmoEnabled&&this._attachedNode&&this._attachedNode.addBehavior(this.boundingBoxDragBehavior),this.onAttachedToNodeObservable.notifyObservers(e)},Object.defineProperty(e.prototype,"positionGizmoEnabled",{get:function(){return this._gizmosEnabled.positionGizmo},set:function(e){e?(this.gizmos.positionGizmo||(this.gizmos.positionGizmo=new xr(this._defaultUtilityLayer,this._thickness,this)),this._attachedNode?this.gizmos.positionGizmo.attachedNode=this._attachedNode:this.gizmos.positionGizmo.attachedMesh=this._attachedMesh):this.gizmos.positionGizmo&&(this.gizmos.positionGizmo.attachedNode=null),this._gizmosEnabled.positionGizmo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotationGizmoEnabled",{get:function(){return this._gizmosEnabled.rotationGizmo},set:function(e){e?(this.gizmos.rotationGizmo||(this.gizmos.rotationGizmo=new Ar(this._defaultUtilityLayer,32,!1,this._thickness,this)),this._attachedNode?this.gizmos.rotationGizmo.attachedNode=this._attachedNode:this.gizmos.rotationGizmo.attachedMesh=this._attachedMesh):this.gizmos.rotationGizmo&&(this.gizmos.rotationGizmo.attachedNode=null),this._gizmosEnabled.rotationGizmo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleGizmoEnabled",{get:function(){return this._gizmosEnabled.scaleGizmo},set:function(e){e?(this.gizmos.scaleGizmo=this.gizmos.scaleGizmo||new Mr(this._defaultUtilityLayer,this._thickness,this),this._attachedNode?this.gizmos.scaleGizmo.attachedNode=this._attachedNode:this.gizmos.scaleGizmo.attachedMesh=this._attachedMesh):this.gizmos.scaleGizmo&&(this.gizmos.scaleGizmo.attachedNode=null),this._gizmosEnabled.scaleGizmo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"boundingBoxGizmoEnabled",{get:function(){return this._gizmosEnabled.boundingBoxGizmo},set:function(e){e?(this.gizmos.boundingBoxGizmo=this.gizmos.boundingBoxGizmo||new Er(this._boundingBoxColor,this._defaultKeepDepthUtilityLayer),this._attachedMesh?this.gizmos.boundingBoxGizmo.attachedMesh=this._attachedMesh:this.gizmos.boundingBoxGizmo.attachedNode=this._attachedNode,this._attachedMesh?(this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh.addBehavior(this.boundingBoxDragBehavior)):this._attachedNode&&(this._attachedNode.removeBehavior(this.boundingBoxDragBehavior),this._attachedNode.addBehavior(this.boundingBoxDragBehavior))):this.gizmos.boundingBoxGizmo&&(this._attachedMesh?this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior):this._attachedNode&&this._attachedNode.removeBehavior(this.boundingBoxDragBehavior),this.gizmos.boundingBoxGizmo.attachedNode=null),this._gizmosEnabled.boundingBoxGizmo=e},enumerable:!1,configurable:!0}),e.prototype.addToAxisCache=function(e){var t=this;e.size>0&&e.forEach(function(e,i){t._gizmoAxisCache.set(i,e)})},e.prototype.dispose=function(){var e=this;for(var t in this._pointerObservers.forEach(function(t){e.scene.onPointerObservable.remove(t)}),this.gizmos){var i=this.gizmos[t];i&&i.dispose()}this._defaultKeepDepthUtilityLayer.dispose(),this._defaultUtilityLayer.dispose(),this.boundingBoxDragBehavior.detach(),this.onAttachedToMeshObservable.clear()},e}(),Dr=i(48),Nr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._needProjectionMatrixCompute=!0,t}return Object(h.d)(t,e),t.prototype._setPosition=function(e){this._position=e},Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._setPosition(e)},enumerable:!1,configurable:!0}),t.prototype._setDirection=function(e){this._direction=e},Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},set:function(e){this._setDirection(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowMinZ",{get:function(){return this._shadowMinZ},set:function(e){this._shadowMinZ=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowMaxZ",{get:function(){return this._shadowMaxZ},set:function(e){this._shadowMaxZ=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),t.prototype.computeTransformedInformation=function(){return!(!this.parent||!this.parent.getWorldMatrix||(this.transformedPosition||(this.transformedPosition=a.e.Zero()),a.e.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this.transformedPosition),this.direction&&(this.transformedDirection||(this.transformedDirection=a.e.Zero()),a.e.TransformNormalToRef(this.direction,this.parent.getWorldMatrix(),this.transformedDirection)),0))},t.prototype.getDepthScale=function(){return 50},t.prototype.getShadowDirection=function(e){return this.transformedDirection?this.transformedDirection:this.direction},t.prototype.getAbsolutePosition=function(){return this.transformedPosition?this.transformedPosition:this.position},t.prototype.setDirectionToTarget=function(e){return this.direction=a.e.Normalize(e.subtract(this.position)),this.direction},t.prototype.getRotation=function(){this.direction.normalize();var e=a.e.Cross(this.direction,J.a.Y),t=a.e.Cross(e,this.direction);return a.e.RotationFromAxis(e,t,this.direction)},t.prototype.needCube=function(){return!1},t.prototype.needProjectionMatrixCompute=function(){return this._needProjectionMatrixCompute},t.prototype.forceProjectionMatrixCompute=function(){this._needProjectionMatrixCompute=!0},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.position=a.e.Zero()},t.prototype._isSynchronized=function(){return!!this._cache.position.equals(this.position)},t.prototype.computeWorldMatrix=function(e){return!e&&this.isSynchronized()?(this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix):(this._updateCache(),this._cache.position.copyFrom(this.position),this._worldMatrix||(this._worldMatrix=a.a.Identity()),a.a.TranslationToRef(this.position.x,this.position.y,this.position.z,this._worldMatrix),this.parent&&this.parent.getWorldMatrix&&(this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix)},t.prototype.getDepthMinZ=function(e){return void 0!==this.shadowMinZ?this.shadowMinZ:e.minZ},t.prototype.getDepthMaxZ=function(e){return void 0!==this.shadowMaxZ?this.shadowMaxZ:e.maxZ},t.prototype.setShadowProjectionMatrix=function(e,t,i){return this.customProjectionMatrixBuilder?this.customProjectionMatrixBuilder(t,i,e):this._setDefaultShadowProjectionMatrix(e,t,i),this},Object(h.c)([Object(w.o)()],t.prototype,"position",null),Object(h.c)([Object(w.o)()],t.prototype,"direction",null),Object(h.c)([Object(w.c)()],t.prototype,"shadowMinZ",null),Object(h.c)([Object(w.c)()],t.prototype,"shadowMaxZ",null),t}(Dr.a);B.a.AddNodeConstructor("Light_Type_1",function(e,t){return function(){return new Lr(e,a.e.Zero(),t)}});var Lr=function(e){function t(t,i,n){var r=e.call(this,t,n)||this;return r._shadowFrustumSize=0,r._shadowOrthoScale=.1,r.autoUpdateExtends=!0,r.autoCalcShadowZBounds=!1,r._orthoLeft=Number.MAX_VALUE,r._orthoRight=Number.MIN_VALUE,r._orthoTop=Number.MIN_VALUE,r._orthoBottom=Number.MAX_VALUE,r.position=i.scale(-1),r.direction=i,r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"shadowFrustumSize",{get:function(){return this._shadowFrustumSize},set:function(e){this._shadowFrustumSize=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowOrthoScale",{get:function(){return this._shadowOrthoScale},set:function(e){this._shadowOrthoScale=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"DirectionalLight"},t.prototype.getTypeID=function(){return Dr.a.LIGHTTYPEID_DIRECTIONALLIGHT},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,i){this.shadowFrustumSize>0?this._setDefaultFixedFrustumShadowProjectionMatrix(e):this._setDefaultAutoExtendShadowProjectionMatrix(e,t,i)},t.prototype._setDefaultFixedFrustumShadowProjectionMatrix=function(e){var t=this.getScene().activeCamera;t&&a.a.OrthoLHToRef(this.shadowFrustumSize,this.shadowFrustumSize,void 0!==this.shadowMinZ?this.shadowMinZ:t.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:t.maxZ,e)},t.prototype._setDefaultAutoExtendShadowProjectionMatrix=function(e,t,i){var n=this.getScene().activeCamera;if(n){if(this.autoUpdateExtends||this._orthoLeft===Number.MAX_VALUE){var r=a.e.Zero();this._orthoLeft=Number.MAX_VALUE,this._orthoRight=Number.MIN_VALUE,this._orthoTop=Number.MIN_VALUE,this._orthoBottom=Number.MAX_VALUE;for(var o=Number.MAX_VALUE,s=Number.MIN_VALUE,c=0;c<i.length;c++){var l=i[c];if(l)for(var u=l.getBoundingInfo().boundingBox,h=0;h<u.vectorsWorld.length;h++)a.e.TransformCoordinatesToRef(u.vectorsWorld[h],t,r),r.x<this._orthoLeft&&(this._orthoLeft=r.x),r.y<this._orthoBottom&&(this._orthoBottom=r.y),r.x>this._orthoRight&&(this._orthoRight=r.x),r.y>this._orthoTop&&(this._orthoTop=r.y),this.autoCalcShadowZBounds&&(r.z<o&&(o=r.z),r.z>s&&(s=r.z))}this.autoCalcShadowZBounds&&(this._shadowMinZ=o,this._shadowMaxZ=s)}var d=this._orthoRight-this._orthoLeft,f=this._orthoTop-this._orthoBottom;a.a.OrthoOffCenterLHToRef(this._orthoLeft-d*this.shadowOrthoScale,this._orthoRight+d*this.shadowOrthoScale,this._orthoBottom-f*this.shadowOrthoScale,this._orthoTop+f*this.shadowOrthoScale,void 0!==this.shadowMinZ?this.shadowMinZ:n.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:n.maxZ,e)}},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z,1,t),this):(this._uniformBuffer.updateFloat4("vLightData",this.direction.x,this.direction.y,this.direction.z,1,t),this)},t.prototype.transferToNodeMaterialEffect=function(e,t){return this.computeTransformedInformation()?(e.setFloat3(t,this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z),this):(e.setFloat3(t,this.direction.x,this.direction.y,this.direction.z),this)},t.prototype.getDepthMinZ=function(e){return 1},t.prototype.getDepthMaxZ=function(e){return 1},t.prototype.prepareLightSpecificDefines=function(e,t){e["DIRLIGHT"+t]=!0},Object(h.c)([Object(w.c)()],t.prototype,"shadowFrustumSize",null),Object(h.c)([Object(w.c)()],t.prototype,"shadowOrthoScale",null),Object(h.c)([Object(w.c)()],t.prototype,"autoUpdateExtends",void 0),Object(h.c)([Object(w.c)()],t.prototype,"autoCalcShadowZBounds",void 0),t}(Nr);be.a.CreateHemisphere=function(e,t,i,n){var r={segments:t,diameter:i};return wr.CreateHemisphere(e,r,n)};var wr=function(){function e(){}return e.CreateHemisphere=function(e,t,i){t.diameter||(t.diameter=1),t.segments||(t.segments=16);var n=yr.a.CreateSphere("",{slice:.5,diameter:t.diameter,segments:t.segments},i),r=be.a.CreateDisc("",t.diameter/2,3*t.segments+(4-t.segments),i);r.rotation.x=-Math.PI/2,r.parent=n;var o=be.a.MergeMeshes([r,n],!0);return o.name=e,o},e}();B.a.AddNodeConstructor("Light_Type_2",function(e,t){return function(){return new Fr(e,a.e.Zero(),a.e.Zero(),0,0,t)}});var Fr=function(e){function t(t,i,n,r,o,s){var c=e.call(this,t,s)||this;return c._innerAngle=0,c._projectionTextureMatrix=a.a.Zero(),c._projectionTextureLightNear=1e-6,c._projectionTextureLightFar=1e3,c._projectionTextureUpDirection=a.e.Up(),c._projectionTextureViewLightDirty=!0,c._projectionTextureProjectionLightDirty=!0,c._projectionTextureDirty=!0,c._projectionTextureViewTargetVector=a.e.Zero(),c._projectionTextureViewLightMatrix=a.a.Zero(),c._projectionTextureProjectionLightMatrix=a.a.Zero(),c._projectionTextureScalingMatrix=a.a.FromValues(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),c.position=i,c.direction=n,c.angle=r,c.exponent=o,c}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._cosHalfAngle=Math.cos(.5*e),this._projectionTextureProjectionLightDirty=!0,this.forceProjectionMatrixCompute(),this._computeAngleValues()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"innerAngle",{get:function(){return this._innerAngle},set:function(e){this._innerAngle=e,this._computeAngleValues()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowAngleScale",{get:function(){return this._shadowAngleScale},set:function(e){this._shadowAngleScale=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureMatrix",{get:function(){return this._projectionTextureMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightNear",{get:function(){return this._projectionTextureLightNear},set:function(e){this._projectionTextureLightNear=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightFar",{get:function(){return this._projectionTextureLightFar},set:function(e){this._projectionTextureLightFar=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureUpDirection",{get:function(){return this._projectionTextureUpDirection},set:function(e){this._projectionTextureUpDirection=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTexture",{get:function(){return this._projectionTexture},set:function(e){var i=this;this._projectionTexture!==e&&(this._projectionTexture=e,this._projectionTextureDirty=!0,this._projectionTexture&&!this._projectionTexture.isReady()&&(t._IsProceduralTexture(this._projectionTexture)?this._projectionTexture.getEffect().executeWhenCompiled(function(){i._markMeshesAsLightDirty()}):t._IsTexture(this._projectionTexture)&&this._projectionTexture.onLoadObservable.addOnce(function(){i._markMeshesAsLightDirty()})))},enumerable:!1,configurable:!0}),t._IsProceduralTexture=function(e){return void 0!==e.onGeneratedObservable},t._IsTexture=function(e){return void 0!==e.onLoadObservable},t.prototype.getClassName=function(){return"SpotLight"},t.prototype.getTypeID=function(){return Dr.a.LIGHTTYPEID_SPOTLIGHT},t.prototype._setDirection=function(t){e.prototype._setDirection.call(this,t),this._projectionTextureViewLightDirty=!0},t.prototype._setPosition=function(t){e.prototype._setPosition.call(this,t),this._projectionTextureViewLightDirty=!0},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,i){var n=this.getScene().activeCamera;if(n){this._shadowAngleScale=this._shadowAngleScale||1;var r=this._shadowAngleScale*this._angle;a.a.PerspectiveFovLHToRef(r,1,this.getDepthMinZ(n),this.getDepthMaxZ(n),e)}},t.prototype._computeProjectionTextureViewLightMatrix=function(){this._projectionTextureViewLightDirty=!1,this._projectionTextureDirty=!0,this.position.addToRef(this.direction,this._projectionTextureViewTargetVector),a.a.LookAtLHToRef(this.position,this._projectionTextureViewTargetVector,this._projectionTextureUpDirection,this._projectionTextureViewLightMatrix)},t.prototype._computeProjectionTextureProjectionLightMatrix=function(){this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0;var e=this.projectionTextureLightFar,t=this.projectionTextureLightNear,i=e/(e-t),n=-i*t,r=1/Math.tan(this._angle/2);a.a.FromValuesToRef(r/1,0,0,0,0,r,0,0,0,0,i,1,0,0,n,0,this._projectionTextureProjectionLightMatrix)},t.prototype._computeProjectionTextureMatrix=function(){if(this._projectionTextureDirty=!1,this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix,this._projectionTextureMatrix),this._projectionTexture instanceof Ke.a){var e=this._projectionTexture.uScale/2,t=this._projectionTexture.vScale/2;a.a.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,.5,0,.5,.5,.5,1,this._projectionTextureScalingMatrix)}this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix,this._projectionTextureMatrix)},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightDirection",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype._computeAngleValues=function(){this._lightAngleScale=1/Math.max(.001,Math.cos(.5*this._innerAngle)-this._cosHalfAngle),this._lightAngleOffset=-this._cosHalfAngle*this._lightAngleScale},t.prototype.transferTexturesToEffect=function(e,t){return this.projectionTexture&&this.projectionTexture.isReady()&&(this._projectionTextureViewLightDirty&&this._computeProjectionTextureViewLightMatrix(),this._projectionTextureProjectionLightDirty&&this._computeProjectionTextureProjectionLightMatrix(),this._projectionTextureDirty&&this._computeProjectionTextureMatrix(),e.setMatrix("textureProjectionMatrix"+t,this._projectionTextureMatrix),e.setTexture("projectionLightSampler"+t,this.projectionTexture)),this},t.prototype.transferToEffect=function(e,t){var i;return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,this.exponent,t),i=a.e.Normalize(this.transformedDirection)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,this.exponent,t),i=a.e.Normalize(this.direction)),this._uniformBuffer.updateFloat4("vLightDirection",i.x,i.y,i.z,this._cosHalfAngle,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,this._lightAngleScale,this._lightAngleOffset,t),this},t.prototype.transferToNodeMaterialEffect=function(e,t){var i;return i=this.computeTransformedInformation()?a.e.Normalize(this.transformedDirection):a.e.Normalize(this.direction),this.getScene().useRightHandedSystem?e.setFloat3(t,-i.x,-i.y,-i.z):e.setFloat3(t,i.x,i.y,i.z),this},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._projectionTexture&&this._projectionTexture.dispose()},t.prototype.prepareLightSpecificDefines=function(e,t){e["SPOTLIGHT"+t]=!0,e["PROJECTEDLIGHTTEXTURE"+t]=!(!this.projectionTexture||!this.projectionTexture.isReady())},Object(h.c)([Object(w.c)()],t.prototype,"angle",null),Object(h.c)([Object(w.c)()],t.prototype,"innerAngle",null),Object(h.c)([Object(w.c)()],t.prototype,"shadowAngleScale",null),Object(h.c)([Object(w.c)()],t.prototype,"exponent",void 0),Object(h.c)([Object(w.c)()],t.prototype,"projectionTextureLightNear",null),Object(h.c)([Object(w.c)()],t.prototype,"projectionTextureLightFar",null),Object(h.c)([Object(w.c)()],t.prototype,"projectionTextureUpDirection",null),Object(h.c)([Object(w.m)("projectedLightTexture")],t.prototype,"_projectionTexture",void 0),t}(Nr),Br=function(e){function t(t){void 0===t&&(t=vr.a.DefaultUtilityLayer);var i=e.call(this,t)||this;return i._cachedPosition=new a.e,i._cachedForward=new a.e(0,0,1),i._pointerObserver=null,i.onClickedObservable=new o.c,i._light=null,i.attachedMesh=new ze.a("",i.gizmoLayer.utilityLayerScene),i._attachedMeshParent=new Pr.a("parent",i.gizmoLayer.utilityLayerScene),i.attachedMesh.parent=i._attachedMeshParent,i._material=new Ui.a("light",i.gizmoLayer.utilityLayerScene),i._material.diffuseColor=new s.a(.5,.5,.5),i._material.specularColor=new s.a(.1,.1,.1),i._pointerObserver=t.utilityLayerScene.onPointerObservable.add(function(e){i._light&&(i._isHovered=!(!e.pickInfo||-1==i._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)),i._isHovered&&0===e.event.button&&i.onClickedObservable.notifyObservers(i._light))},Ne.a.POINTERDOWN),i}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"light",{get:function(){return this._light},set:function(e){var i=this;if(this._light=e,e){this._lightMesh&&this._lightMesh.dispose(),e instanceof Li.a?this._lightMesh=t._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene):this._lightMesh=e instanceof Lr?t._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene):e instanceof Fr?t._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene):t._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene),this._lightMesh.getChildMeshes(!1).forEach(function(e){e.material=i._material}),this._lightMesh.parent=this._rootMesh;var n=this.gizmoLayer._getSharedGizmoLight();n.includedOnlyMeshes=n.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(!1)),this._lightMesh.rotationQuaternion=new a.b,this.attachedMesh.reservedDataStore||(this.attachedMesh.reservedDataStore={}),this.attachedMesh.reservedDataStore.lightGizmo=this,e.parent&&this._attachedMeshParent.freezeWorldMatrix(e.parent.getWorldMatrix()),e.position&&(this.attachedMesh.position.copyFrom(e.position),this.attachedMesh.computeWorldMatrix(!0),this._cachedPosition.copyFrom(this.attachedMesh.position)),e.direction&&(this.attachedMesh.setDirection(e.direction),this.attachedMesh.computeWorldMatrix(!0),this._cachedForward.copyFrom(this.attachedMesh.forward)),this._update()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),t.prototype._update=function(){e.prototype._update.call(this),this._light&&(this._light.parent&&this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix()),this._light.position&&(this.attachedMesh.position.equals(this._cachedPosition)?(this.attachedMesh.position.copyFrom(this._light.position),this.attachedMesh.computeWorldMatrix(!0),this._cachedPosition.copyFrom(this.attachedMesh.position)):(this._light.position.copyFrom(this.attachedMesh.position),this._cachedPosition.copyFrom(this.attachedMesh.position))),this._light.direction&&(a.e.DistanceSquared(this.attachedMesh.forward,this._cachedForward)>1e-4?(this._light.direction.copyFrom(this.attachedMesh.forward),this._cachedForward.copyFrom(this.attachedMesh.forward)):a.e.DistanceSquared(this.attachedMesh.forward,this._light.direction)>1e-4&&(this.attachedMesh.setDirection(this._light.direction),this.attachedMesh.computeWorldMatrix(!0),this._cachedForward.copyFrom(this.attachedMesh.forward))))},t.prototype.dispose=function(){this.onClickedObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this._material.dispose(),e.prototype.dispose.call(this),this._attachedMeshParent.dispose()},t._CreateHemisphericLightMesh=function(e){var i=new be.a("hemisphereLight",e),n=wr.CreateHemisphere(i.name,{segments:10,diameter:1},e);n.position.z=-.15,n.rotation.x=Math.PI/2,n.parent=i;var r=this._CreateLightLines(3,e);return r.parent=i,r.position.z,i.scaling.scaleInPlace(t._Scale),i.rotation.x=Math.PI/2,i},t._CreatePointLightMesh=function(e){var i=new be.a("pointLight",e),n=yr.a.CreateSphere(i.name,{segments:10,diameter:1},e);return n.rotation.x=Math.PI/2,n.parent=i,this._CreateLightLines(5,e).parent=i,i.scaling.scaleInPlace(t._Scale),i.rotation.x=Math.PI/2,i},t._CreateSpotLightMesh=function(e){var i=new be.a("spotLight",e);yr.a.CreateSphere(i.name,{segments:10,diameter:1},e).parent=i;var n=wr.CreateHemisphere(i.name,{segments:10,diameter:2},e);return n.parent=i,n.rotation.x=-Math.PI/2,this._CreateLightLines(2,e).parent=i,i.scaling.scaleInPlace(t._Scale),i.rotation.x=Math.PI/2,i},t._CreateDirectionalLightMesh=function(e){var i=new be.a("directionalLight",e),n=new be.a(i.name,e);n.parent=i,yr.a.CreateSphere(i.name,{diameter:1.2,segments:10},e).parent=n;var r=be.a.CreateCylinder(i.name,6,.3,.3,6,1,e);r.parent=n,(o=r.clone(i.name)).scaling.y=.5,o.position.x+=1.25,(a=r.clone(i.name)).scaling.y=.5,a.position.x+=-1.25;var o,a,s=be.a.CreateCylinder(i.name,1,0,.6,6,1,e);return s.position.y+=3,s.parent=n,(o=s.clone(i.name)).position.y=1.5,o.position.x+=1.25,(a=s.clone(i.name)).position.y=1.5,a.position.x+=-1.25,n.scaling.scaleInPlace(t._Scale),n.rotation.z=Math.PI/2,n.rotation.y=Math.PI/2,i},t._Scale=.007,t._CreateLightLines=function(e,t){var i=new be.a("root",t);i.rotation.x=Math.PI/2;var n=new be.a("linePivot",t);n.parent=i;var r=be.a.CreateCylinder("line",2,.2,.3,6,1,t);if(r.position.y=r.scaling.y/2+1.2,r.parent=n,e<2)return n;for(var o=0;o<4;o++)(a=n.clone("lineParentClone")).rotation.z=Math.PI/4,a.rotation.y=Math.PI/2+Math.PI/2*o,a.getChildMeshes()[0].scaling.y=.5,a.getChildMeshes()[0].scaling.x=a.getChildMeshes()[0].scaling.z=.8,a.getChildMeshes()[0].position.y=a.getChildMeshes()[0].scaling.y/2+1.2;if(e<3)return i;for(o=0;o<4;o++)(a=n.clone("linePivotClone")).rotation.z=Math.PI/2,a.rotation.y=Math.PI/2*o;if(e<4)return i;for(o=0;o<4;o++){var a;(a=n.clone("linePivotClone")).rotation.z=Math.PI+Math.PI/4,a.rotation.y=Math.PI/2+Math.PI/2*o,a.getChildMeshes()[0].scaling.y=.5,a.getChildMeshes()[0].scaling.x=a.getChildMeshes()[0].scaling.z=.8,a.getChildMeshes()[0].position.y=a.getChildMeshes()[0].scaling.y/2+1.2}return e<5||((a=n.clone("linePivotClone")).rotation.z=Math.PI),i},t}(gr.a),Ur=function(){function e(e,t){void 0===e&&(e=a.e.Zero()),void 0===t&&(t=a.e.Up()),this.position=e,this.normal=t}return e.prototype.clone=function(){return new e(this.position.clone(),this.normal.clone())},e}(),Vr=function(){function e(e,t,i){void 0===e&&(e=a.e.Zero()),void 0===t&&(t=a.e.Up()),void 0===i&&(i=a.d.Zero()),this.position=e,this.normal=t,this.uv=i}return e.prototype.clone=function(){return new e(this.position.clone(),this.normal.clone(),this.uv.clone())},e}(),kr=function(e){function t(t){void 0===t&&(t=vr.a.DefaultUtilityLayer);var i=e.call(this,t)||this;return i._pointerObserver=null,i.onClickedObservable=new o.c,i._camera=null,i._invProjection=new a.a,i._material=new Ui.a("cameraGizmoMaterial",i.gizmoLayer.utilityLayerScene),i._material.diffuseColor=new s.a(.5,.5,.5),i._material.specularColor=new s.a(.1,.1,.1),i._pointerObserver=t.utilityLayerScene.onPointerObservable.add(function(e){i._camera&&(i._isHovered=!(!e.pickInfo||-1==i._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)),i._isHovered&&0===e.event.button&&i.onClickedObservable.notifyObservers(i._camera))},Ne.a.POINTERDOWN),i}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"displayFrustum",{get:function(){return this._cameraLinesMesh.isEnabled()},set:function(e){this._cameraLinesMesh.setEnabled(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"camera",{get:function(){return this._camera},set:function(e){var i=this;if(this._camera=e,this.attachedNode=e,e){this._cameraMesh&&this._cameraMesh.dispose(),this._cameraLinesMesh&&this._cameraLinesMesh.dispose(),this._cameraMesh=t._CreateCameraMesh(this.gizmoLayer.utilityLayerScene),this._cameraLinesMesh=t._CreateCameraFrustum(this.gizmoLayer.utilityLayerScene),this._cameraMesh.getChildMeshes(!1).forEach(function(e){e.material=i._material}),this._cameraMesh.parent=this._rootMesh,this._cameraLinesMesh.parent=this._rootMesh,this.gizmoLayer.utilityLayerScene.activeCamera&&this.gizmoLayer.utilityLayerScene.activeCamera.maxZ<1.5*e.maxZ&&(this.gizmoLayer.utilityLayerScene.activeCamera.maxZ=1.5*e.maxZ),this.attachedNode.reservedDataStore||(this.attachedNode.reservedDataStore={}),this.attachedNode.reservedDataStore.cameraGizmo=this;var n=this.gizmoLayer._getSharedGizmoLight();n.includedOnlyMeshes=n.includedOnlyMeshes.concat(this._cameraMesh.getChildMeshes(!1)),this._update()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),t.prototype._update=function(){e.prototype._update.call(this),this._camera&&(this._camera.getProjectionMatrix().invertToRef(this._invProjection),this._cameraLinesMesh.setPivotMatrix(this._invProjection,!1),this._cameraLinesMesh.scaling.x=1/this._rootMesh.scaling.x,this._cameraLinesMesh.scaling.y=1/this._rootMesh.scaling.y,this._cameraLinesMesh.scaling.z=1/this._rootMesh.scaling.z,this._cameraMesh.parent=null,this._cameraMesh.rotation.y=.5*Math.PI*(this._camera.getScene().useRightHandedSystem?1:-1),this._cameraMesh.parent=this._rootMesh)},t.prototype.dispose=function(){this.onClickedObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this._cameraMesh&&this._cameraMesh.dispose(),this._cameraLinesMesh&&this._cameraLinesMesh.dispose(),this._material.dispose(),e.prototype.dispose.call(this)},t._CreateCameraMesh=function(e){var i=new be.a("rootCameraGizmo",e),n=new be.a(i.name,e);n.parent=i,mr.a.CreateBox(i.name,{width:1,height:.8,depth:.5},e).parent=n;var r=qi.a.CreateCylinder(i.name,{height:.5,diameterTop:.8,diameterBottom:.8},e);r.parent=n,r.position.y=.3,r.position.x=-.6,r.rotation.x=.5*Math.PI;var o=qi.a.CreateCylinder(i.name,{height:.5,diameterTop:.6,diameterBottom:.6},e);o.parent=n,o.position.y=.5,o.position.x=.4,o.rotation.x=.5*Math.PI;var a=qi.a.CreateCylinder(i.name,{height:.5,diameterTop:.5,diameterBottom:.5},e);return a.parent=n,a.position.y=0,a.position.x=.6,a.rotation.z=.5*Math.PI,i.scaling.scaleInPlace(t._Scale),n.position.x=-.9,i},t._CreateCameraFrustum=function(e){var t=new be.a("rootCameraGizmo",e),i=new be.a(t.name,e);i.parent=t;for(var n=0;n<4;n+=2)for(var r=0;r<4;r+=2){var o;(o=Tr.a.CreateLines("lines",{points:[new a.e(-1+r,-1+n,-1),new a.e(-1+r,-1+n,1)]},e)).parent=i,o.alwaysSelectAsActiveMesh=!0,o.isPickable=!1,(o=Tr.a.CreateLines("lines",{points:[new a.e(-1,-1+r,-1+n),new a.e(1,-1+r,-1+n)]},e)).parent=i,o.alwaysSelectAsActiveMesh=!0,o.isPickable=!1,(o=Tr.a.CreateLines("lines",{points:[new a.e(-1+r,-1,-1+n),new a.e(-1+r,1,-1+n)]},e)).parent=i,o.alwaysSelectAsActiveMesh=!0,o.isPickable=!1}return t},t._Scale=.05,t}(gr.a);ai.a.IncludesShadersStore.kernelBlurVaryingDeclaration="varying vec2 sampleCoord{X};";ai.a.IncludesShadersStore.packingFunctions="vec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}";ai.a.IncludesShadersStore.kernelBlurFragment="#ifdef DOF\nfactor=sampleCoC(sampleCoord{X});\ncomputedWeight=KERNEL_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;\n#endif";ai.a.IncludesShadersStore.kernelBlurFragment2="#ifdef DOF\nfactor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});\ncomputedWeight=KERNEL_DEP_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_DEP_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;\n#endif";ai.a.ShadersStore.kernelBlurPixelShader="\nuniform sampler2D textureSampler;\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#ifdef DOF\nuniform sampler2D circleOfConfusionSampler;\nuniform vec2 cameraMinMaxZ;\nfloat sampleDistance(const in vec2 offset) {\nfloat depth=texture2D(circleOfConfusionSampler,offset).g;\nreturn cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth;\n}\nfloat sampleCoC(const in vec2 offset) {\nfloat coc=texture2D(circleOfConfusionSampler,offset).r;\nreturn coc;\n}\n#endif\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#ifdef PACKEDFLOAT\n#include<packingFunctions>\n#endif\nvoid main(void)\n{\nfloat computedWeight=0.0;\n#ifdef PACKEDFLOAT\nfloat blend=0.;\n#else\nvec4 blend=vec4(0.);\n#endif\n#ifdef DOF\nfloat sumOfWeights=CENTER_WEIGHT;\nfloat factor=0.0;\n\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;\n#else\nblend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;\n#endif\n#endif\n#include<kernelBlurFragment>[0..varyingCount]\n#include<kernelBlurFragment2>[0..depCount]\n#ifdef PACKEDFLOAT\ngl_FragColor=pack(blend);\n#else\ngl_FragColor=blend;\n#endif\n#ifdef DOF\ngl_FragColor/=sumOfWeights;\n#endif\n}",ai.a.IncludesShadersStore.kernelBlurVertex="sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};";ai.a.ShadersStore.kernelBlurVertexShader="\nattribute vec2 position;\n\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nsampleCenter=(position*madd+madd);\n#include<kernelBlurVertex>[0..varyingCount]\ngl_Position=vec4(position,0.0,1.0);\n}";var Gr=function(e){function t(t,i,n,r,o,a,s,c,l,u,h){void 0===a&&(a=Ke.a.BILINEAR_SAMPLINGMODE),void 0===l&&(l=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===u&&(u=""),void 0===h&&(h=!1);var d=e.call(this,t,"kernelBlur",["delta","direction","cameraMinMaxZ"],["circleOfConfusionSampler"],r,o,a,s,c,null,l,"kernelBlur",{varyingCount:0,depCount:0},!0)||this;return d.blockCompilation=h,d._packedFloat=!1,d._staticDefines="",d._staticDefines=u,d.direction=i,d.onApplyObservable.add(function(e){d._outputTexture?e.setFloat2("delta",1/d._outputTexture.width*d.direction.x,1/d._outputTexture.height*d.direction.y):e.setFloat2("delta",1/d.width*d.direction.x,1/d.height*d.direction.y)}),d.kernel=n,d}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"kernel",{get:function(){return this._idealKernel},set:function(e){this._idealKernel!==e&&(e=Math.max(e,1),this._idealKernel=e,this._kernel=this._nearestBestKernel(e),this.blockCompilation||this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"packedFloat",{get:function(){return this._packedFloat},set:function(e){this._packedFloat!==e&&(this._packedFloat=e,this.blockCompilation||this._updateParameters())},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"BlurPostProcess"},t.prototype.updateEffect=function(e,t,i,n,r,o){void 0===e&&(e=null),void 0===t&&(t=null),void 0===i&&(i=null),this._updateParameters(r,o)},t.prototype._updateParameters=function(t,i){for(var n=this._kernel,r=(n-1)/2,o=[],a=[],s=0,c=0;c<n;c++){var l=c/(n-1),u=this._gaussianWeight(2*l-1);o[c]=c-r,a[c]=u,s+=u}for(c=0;c<a.length;c++)a[c]/=s;var h=[],d=[],f=[];for(c=0;c<=r;c+=2){var p=Math.min(c+1,Math.floor(r));if(c===p)f.push({o:o[c],w:a[c]});else{var _=p===r,m=a[c]+a[p]*(_?.5:1),g=o[c]+1/(1+a[c]/a[p]);0===g?(f.push({o:o[c],w:a[c]}),f.push({o:o[c+1],w:a[c+1]})):(f.push({o:g,w:m}),f.push({o:-g,w:m}))}}for(c=0;c<f.length;c++)d[c]=f[c].o,h[c]=f[c].w;o=d,a=h;var v=this.getEngine().getCaps().maxVaryingVectors,b=Math.max(v,0)-1,y=Math.min(o.length,b),T="";for(T+=this._staticDefines,-1!=this._staticDefines.indexOf("DOF")&&(T+="#define CENTER_WEIGHT "+this._glslFloat(a[y-1])+"\r\n",y--),c=0;c<y;c++)T+="#define KERNEL_OFFSET"+c+" "+this._glslFloat(o[c])+"\r\n",T+="#define KERNEL_WEIGHT"+c+" "+this._glslFloat(a[c])+"\r\n";var E=0;for(c=b;c<o.length;c++)T+="#define KERNEL_DEP_OFFSET"+E+" "+this._glslFloat(o[c])+"\r\n",T+="#define KERNEL_DEP_WEIGHT"+E+" "+this._glslFloat(a[c])+"\r\n",E++;this.packedFloat&&(T+="#define PACKEDFLOAT 1"),this.blockCompilation=!1,e.prototype.updateEffect.call(this,T,null,null,{varyingCount:y,depCount:E},t,i)},t.prototype._nearestBestKernel=function(e){for(var t=Math.round(e),i=0,n=[t,t-1,t+1,t-2,t+2];i<n.length;i++){var r=n[i];if(r%2!=0&&Math.floor(r/2)%2==0&&r>0)return Math.max(r,3)}return Math.max(t,3)},t.prototype._gaussianWeight=function(e){var t=-e*e/(1/3*2*(1/3));return 1/(Math.sqrt(2*Math.PI)*(1/3))*Math.exp(t)},t.prototype._glslFloat=function(e,t){return void 0===t&&(t=8),e.toFixed(t).replace(/0+$/,"")},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.direction,e.kernel,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable,e.textureType,void 0,!1)},e,n,r)},Object(h.c)([Object(w.c)("kernel")],t.prototype,"_kernel",void 0),Object(h.c)([Object(w.c)("packedFloat")],t.prototype,"_packedFloat",void 0),Object(h.c)([Object(w.n)()],t.prototype,"direction",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.BlurPostProcess"]=Gr;var zr=function(e){function t(t,i,n,r,o,s,c){void 0===o&&(o=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===s&&(s=Ke.a.BILINEAR_SAMPLINGMODE),void 0===c&&(c=!0);var l=e.call(this,t,i,n,r,!0,o,!1,s,c)||this;return l.scene=n,l.mirrorPlane=new sn.a(0,1,0,1),l._transformMatrix=a.a.Zero(),l._mirrorMatrix=a.a.Zero(),l._adaptiveBlurKernel=0,l._blurKernelX=0,l._blurKernelY=0,l._blurRatio=1,l.ignoreCameraViewport=!0,l._updateGammaSpace(),l._imageProcessingConfigChangeObserver=n.imageProcessingConfiguration.onUpdateParameters.add(function(){l._updateGammaSpace}),l.onBeforeRenderObservable.add(function(){a.a.ReflectionToRef(l.mirrorPlane,l._mirrorMatrix),l._savedViewMatrix=n.getViewMatrix(),l._mirrorMatrix.multiplyToRef(l._savedViewMatrix,l._transformMatrix),n.setTransformMatrix(l._transformMatrix,n.getProjectionMatrix()),n.clipPlane=l.mirrorPlane,n.getEngine().cullBackFaces=!1,n._mirroredCameraPosition=a.e.TransformCoordinates(n.activeCamera.globalPosition,l._mirrorMatrix)}),l.onAfterRenderObservable.add(function(){n.setTransformMatrix(l._savedViewMatrix,n.getProjectionMatrix()),n.getEngine().cullBackFaces=!0,n._mirroredCameraPosition=null,n.clipPlane=null}),l}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"blurRatio",{get:function(){return this._blurRatio},set:function(e){this._blurRatio!==e&&(this._blurRatio=e,this._preparePostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"adaptiveBlurKernel",{set:function(e){this._adaptiveBlurKernel=e,this._autoComputeBlurKernel()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurKernel",{set:function(e){this.blurKernelX=e,this.blurKernelY=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelX",{get:function(){return this._blurKernelX},set:function(e){this._blurKernelX!==e&&(this._blurKernelX=e,this._preparePostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelY",{get:function(){return this._blurKernelY},set:function(e){this._blurKernelY!==e&&(this._blurKernelY=e,this._preparePostProcesses())},enumerable:!1,configurable:!0}),t.prototype._autoComputeBlurKernel=function(){var e=this.getScene().getEngine(),t=this.getRenderWidth()/e.getRenderWidth(),i=this.getRenderHeight()/e.getRenderHeight();this.blurKernelX=this._adaptiveBlurKernel*t,this.blurKernelY=this._adaptiveBlurKernel*i},t.prototype._onRatioRescale=function(){this._sizeRatio&&(this.resize(this._initialSizeParameter),this._adaptiveBlurKernel||this._preparePostProcesses()),this._adaptiveBlurKernel&&this._autoComputeBlurKernel()},t.prototype._updateGammaSpace=function(){this.gammaSpace=!this.scene.imageProcessingConfiguration.isEnabled||!this.scene.imageProcessingConfiguration.applyByPostProcess},t.prototype._preparePostProcesses=function(){if(this.clearPostProcesses(!0),this._blurKernelX&&this._blurKernelY){var e=this.getScene().getEngine(),t=e.getCaps().textureFloatRender?g.a.TEXTURETYPE_FLOAT:g.a.TEXTURETYPE_HALF_FLOAT;this._blurX=new Gr("horizontal blur",new a.d(1,0),this._blurKernelX,this._blurRatio,null,Ke.a.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurX.autoClear=!1,1===this._blurRatio&&this.samples<2&&this._texture?this._blurX.inputTexture=this._texture:this._blurX.alwaysForcePOT=!0,this._blurY=new Gr("vertical blur",new a.d(0,1),this._blurKernelY,this._blurRatio,null,Ke.a.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurY.autoClear=!1,this._blurY.alwaysForcePOT=1!==this._blurRatio,this.addPostProcess(this._blurX),this.addPostProcess(this._blurY)}else this._blurY&&(this.removePostProcess(this._blurY),this._blurY.dispose(),this._blurY=null),this._blurX&&(this.removePostProcess(this._blurX),this._blurX.dispose(),this._blurX=null)},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var i=this.getSize(),n=new t(this.name,i.width,e,this._renderTargetOptions.generateMipMaps,this._renderTargetOptions.type,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer);return n.hasAlpha=this.hasAlpha,n.level=this.level,n.mirrorPlane=this.mirrorPlane.clone(),this.renderList&&(n.renderList=this.renderList.slice(0)),n},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);return t.mirrorPlane=this.mirrorPlane.asArray(),t},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver)},t}(Ri);Ke.a._CreateMirror=function(e,t,i,n){return new zr(e,t,i,n)};var jr=i(34),Wr=function(e){function t(t,i,n,r,s,c,l,u,h,d,f,p,_,m){var v;void 0===n&&(n=null),void 0===r&&(r=!1),void 0===s&&(s=null),void 0===c&&(c=null),void 0===l&&(l=null),void 0===u&&(u=g.a.TEXTUREFORMAT_RGBA),void 0===h&&(h=!1),void 0===d&&(d=null),void 0===f&&(f=!1),void 0===p&&(p=.8),void 0===_&&(_=0);var b=e.call(this,i)||this;if(b.onLoadObservable=new o.c,b.boundingBoxPosition=a.e.Zero(),b._rotationY=0,b._files=null,b._forcedExtension=null,b._extensions=null,b.name=t,b.url=t,b._noMipmap=r,b.hasAlpha=!1,b._format=u,b.isCube=!0,b._textureMatrix=a.a.Identity(),b._createPolynomials=f,b.coordinatesMode=Ke.a.CUBIC_MODE,b._extensions=n,b._files=s,b._forcedExtension=d,b._loaderOptions=m,!t&&!s)return b;var y=t.lastIndexOf("."),T=d||(y>-1?t.substring(y).toLowerCase():""),E=".dds"===T,S=".env"===T;if(S?(b.gammaSpace=!1,b._prefiltered=!1,b.anisotropicFilteringLevel=1):(b._prefiltered=h,h&&(b.gammaSpace=!1,b.anisotropicFilteringLevel=1)),b._texture=b._getFromCache(t,r),!s&&(S||E||n||(n=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),s=[],n))for(var A=0;A<n.length;A++)s.push(t+n[A]);b._files=s;var P=function(){b.onLoadObservable.notifyObservers(b),c&&c()};if(b._texture)b._texture.isReady?Ce.b.SetImmediate(function(){return P()}):b._texture.onLoadedObservable.add(function(){return P()});else{var C=b.getScene();(null==C?void 0:C.useDelayedTextureLoading)?b.delayLoadState=g.a.DELAYLOADSTATE_NOTLOADED:(b._texture=h?b._getEngine().createPrefilteredCubeTexture(t,C,p,_,c,l,u,d,b._createPolynomials):b._getEngine().createCubeTexture(t,C,s,r,c,l,b._format,d,!1,p,_,null,m),null===(v=b._texture)||void 0===v||v.onLoadedObservable.add(function(){return b.onLoadObservable.notifyObservers(b)}))}return b}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"boundingBoxSize",{get:function(){return this._boundingBoxSize},set:function(e){if(!this._boundingBoxSize||!this._boundingBoxSize.equals(e)){this._boundingBoxSize=e;var t=this.getScene();t&&t.markAllMaterialsAsDirty(g.a.MATERIAL_TextureDirtyFlag)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationY",{get:function(){return this._rotationY},set:function(e){this._rotationY=e,this.setReflectionTextureMatrix(a.a.RotationY(this._rotationY))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noMipmap",{get:function(){return this._noMipmap},enumerable:!1,configurable:!0}),t.CreateFromImages=function(e,i,n){var r="";return e.forEach(function(e){return r+=e}),new t(r,i,null,n,e)},t.CreateFromPrefilteredData=function(e,i,n,r){void 0===n&&(n=null),void 0===r&&(r=!0);var o=i.useDelayedTextureLoading;i.useDelayedTextureLoading=!1;var a=new t(e,i,null,!1,null,null,null,void 0,!0,n,r);return i.useDelayedTextureLoading=o,a},t.prototype.getClassName=function(){return"CubeTexture"},t.prototype.updateURL=function(e,t,i,n){var r;void 0===n&&(n=!1),this.url&&(this.releaseInternalTexture(),null===(r=this.getScene())||void 0===r||r.markAllMaterialsAsDirty(g.a.MATERIAL_TextureDirtyFlag)),this.name&&!jr.a.StartsWith(this.name,"data:")||(this.name=e),this.url=e,this.delayLoadState=g.a.DELAYLOADSTATE_NOTLOADED,this._prefiltered=n,this._prefiltered&&(this.gammaSpace=!1,this.anisotropicFilteringLevel=1),this._forcedExtension=t||null,i&&(this._delayedOnLoad=i),this.delayLoad(t)},t.prototype.delayLoad=function(e){var t,i=this;if(this.delayLoadState===g.a.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=g.a.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap),!this._texture)){var n=this.getScene();this._prefiltered?this._texture=this._getEngine().createPrefilteredCubeTexture(this.url,n,.8,0,this._delayedOnLoad,void 0,this._format,e,this._createPolynomials):this._texture=this._getEngine().createCubeTexture(this.url,n,this._files,this._noMipmap,this._delayedOnLoad,null,this._format,e,!1,0,0,null,this._loaderOptions),null===(t=this._texture)||void 0===t||t.onLoadedObservable.add(function(){return i.onLoadObservable.notifyObservers(i)})}},t.prototype.getReflectionTextureMatrix=function(){return this._textureMatrix},t.prototype.setReflectionTextureMatrix=function(e){var t,i=this;e.updateFlag!==this._textureMatrix.updateFlag&&(e.isIdentity()!==this._textureMatrix.isIdentity()&&(null===(t=this.getScene())||void 0===t||t.markAllMaterialsAsDirty(g.a.MATERIAL_TextureDirtyFlag,function(e){return-1!==e.getActiveTextures().indexOf(i)})),this._textureMatrix=e)},t.Parse=function(e,i,n){var r=w.a.Parse(function(){var r=!1;return e.prefiltered&&(r=e.prefiltered),new t(n+e.name,i,e.extensions,!1,e.files||null,null,null,void 0,r,e.forcedExtension)},e,i);if(e.boundingBoxPosition&&(r.boundingBoxPosition=a.e.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(r.boundingBoxSize=a.e.FromArray(e.boundingBoxSize)),e.animations)for(var o=0;o<e.animations.length;o++){var s=e.animations[o],l=c.a.GetClass("BABYLON.Animation");l&&r.animations.push(l.Parse(s))}return r},t.prototype.clone=function(){var e=this,i=0,n=w.a.Clone(function(){var n=new t(e.url,e.getScene()||e._getEngine(),e._extensions,e._noMipmap,e._files);return i=n.uniqueId,n},this);return n.uniqueId=i,n},Object(h.c)([Object(w.c)()],t.prototype,"url",void 0),Object(h.c)([Object(w.c)("rotationY")],t.prototype,"rotationY",null),Object(h.c)([Object(w.c)("files")],t.prototype,"_files",void 0),Object(h.c)([Object(w.c)("forcedExtension")],t.prototype,"_forcedExtension",void 0),Object(h.c)([Object(w.c)("extensions")],t.prototype,"_extensions",void 0),Object(h.c)([Object(w.j)("textureMatrix")],t.prototype,"_textureMatrix",void 0),t}(Hn.a);Ke.a._CubeTextureParser=Wr.Parse,c.a.RegisteredTypes["BABYLON.CubeTexture"]=Wr;var Hr=i(15),Xr=i(76),Yr=i(87),Kr=i(19);ai.a.IncludesShadersStore.backgroundFragmentDeclaration=" uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;\nuniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif";ai.a.IncludesShadersStore.backgroundUboDeclaration="layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec4 vPrimaryColor;\nuniform vec4 vPrimaryColorShadow;\nuniform vec2 vDiffuseInfos;\nuniform vec2 vReflectionInfos;\nuniform mat4 diffuseMatrix;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\nuniform float pointSize;\nuniform float shadowLevel;\nuniform float alpha;\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};",i(131),i(106),i(107),i(154),i(130),i(115),i(125),i(110),i(135),i(136);ai.a.ShadersStore.backgroundPixelShader="#ifdef TEXTURELODSUPPORT\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nprecision highp float;\n#include<__decl__backgroundFragment>\n#define RECIPROCAL_PI2 0.15915494\n\nuniform vec3 vEyePosition;\n\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<helperFunctions>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));\n}\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(0.0,1.0,0.0);\n#endif\n\nfloat shadow=1.;\nfloat globalShadow=0.;\nfloat shadowLightCount=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n#ifndef BACKMAT_SHADOWONLY\n\nvec4 reflectionColor=vec4(1.,1.,1.,1.);\n#ifdef REFLECTION\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nfloat reflectionLOD=vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\n\nreflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\nreflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD);\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodReflectionNormalizedDoubled<1.0){\nreflectionColor=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nreflectionColor=mix(\nreflectionSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#else\nvec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);\nreflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor.rgb=toLinearSpace(reflectionColor.rgb);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor.rgb=reflectionColor.bgr;\n#endif\n\nreflectionColor.rgb*=vReflectionInfos.x;\n#endif\n\nvec3 diffuseColor=vec3(1.,1.,1.);\nfloat finalAlpha=alpha;\n#ifdef DIFFUSE\nvec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap.rgb=toLinearSpace(diffuseMap.rgb);\n#endif\n\ndiffuseMap.rgb*=vDiffuseInfos.y;\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 colorBase=diffuseColor;\n#else\nvec3 colorBase=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,0.0);\n\n#ifdef USERGBCOLOR\nvec3 finalColor=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);\n#else\nvec3 mainColor=vPrimaryColor.rgb;\n#endif\nvec3 finalColor=colorBase*mainColor;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 reflectionAmount=vReflectionControl.xxx;\nvec3 reflectionReflectance0=vReflectionControl.yyy;\nvec3 reflectionReflectance90=vReflectionControl.zzz;\nfloat VdotN=dot(normalize(vEyePosition),normalW);\nvec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);\nreflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nfloat reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);\nreflectionDistanceFalloff*=reflectionDistanceFalloff;\nreflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));\n#endif\n#ifdef OPACITYFRESNEL\nfloat viewAngleToFloor=dot(normalW,normalize(vEyePosition-vBackgroundCenter));\n\nconst float startAngle=0.1;\nfloat fadeFactor=saturate(viewAngleToFloor/startAngle);\nfinalAlpha*=fadeFactor*fadeFactor;\n#endif\n\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);\n#endif\n\nvec4 color=vec4(finalColor,finalAlpha);\n#else\nvec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);\n#endif\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\ncolor.rgb=clamp(color.rgb,0.,30.0);\n#else\n\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#ifdef NOISE\ncolor.rgb+=dither(vPositionW.xy,0.5);\ncolor=max(color,0.0);\n#endif\ngl_FragColor=color;\n}\n";ai.a.IncludesShadersStore.backgroundVertexDeclaration="uniform mat4 view;\nuniform mat4 viewProjection;\nuniform float shadowLevel;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif",i(78),i(79),i(117),i(137),i(80),i(81),i(111),i(157),i(138);ai.a.ShadersStore.backgroundVertexShader="precision highp float;\n#include<__decl__backgroundVertex>\n#include<helperFunctions>\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\nvoid main(void) {\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=position;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n} else {\ngl_Position=viewProjectionR*finalWorld*vec4(position,1.0);\n}\n#else\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#endif\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normal);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#ifdef EQUIRECTANGULAR_RELFECTION_FOV\nmat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));\nvec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));\nif (fFovMultiplier<=1.0) {\nvDirectionW=normalize(segment);\n} else {\nvDirectionW=normalize(vDirectionW+(vDirectionW-segment));\n}\n#endif\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";var Qr=i(67),qr=function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.DIFFUSEDIRECTUV=0,t.GAMMADIFFUSE=!1,t.DIFFUSEHASALPHA=!1,t.OPACITYFRESNEL=!1,t.REFLECTIONBLUR=!1,t.REFLECTIONFRESNEL=!1,t.REFLECTIONFALLOFF=!1,t.TEXTURELODSUPPORT=!1,t.PREMULTIPLYALPHA=!1,t.USERGBCOLOR=!1,t.USEHIGHLIGHTANDSHADOWCOLORS=!1,t.BACKMAT_SHADOWONLY=!1,t.NOISE=!1,t.REFLECTIONBGR=!1,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.EXPOSURE=!1,t.MULTIVIEW=!1,t.REFLECTION=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.REFLECTIONMAP_OPPOSITEZ=!1,t.LODINREFLECTIONALPHA=!1,t.GAMMAREFLECTION=!1,t.RGBDREFLECTION=!1,t.EQUIRECTANGULAR_RELFECTION_FOV=!1,t.MAINUV1=!1,t.MAINUV2=!1,t.UV1=!1,t.UV2=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.POINTSIZE=!1,t.FOG=!1,t.NORMAL=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.SHADOWFLOAT=!1,t.rebuild(),t}return Object(h.d)(t,e),t}(Xr.a),Zr=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.primaryColor=s.a.White(),n._primaryColorShadowLevel=0,n._primaryColorHighlightLevel=0,n.reflectionTexture=null,n.reflectionBlur=0,n.diffuseTexture=null,n._shadowLights=null,n.shadowLights=null,n.shadowLevel=0,n.sceneCenter=a.e.Zero(),n.opacityFresnel=!0,n.reflectionFresnel=!1,n.reflectionFalloffDistance=0,n.reflectionAmount=1,n.reflectionReflectance0=.05,n.reflectionReflectance90=.5,n.useRGBColor=!0,n.enableNoise=!1,n._fovMultiplier=1,n.useEquirectangularFOV=!1,n._maxSimultaneousLights=4,n.maxSimultaneousLights=4,n._shadowOnly=!1,n.shadowOnly=!1,n._imageProcessingObserver=null,n.switchToBGR=!1,n._renderTargets=new oi.a(16),n._reflectionControls=a.f.Zero(),n._white=s.a.White(),n._primaryShadowColor=s.a.Black(),n._primaryHighlightColor=s.a.Black(),n._attachImageProcessingConfiguration(null),n.getRenderTargetTextures=function(){return n._renderTargets.reset(),n._diffuseTexture&&n._diffuseTexture.isRenderTarget&&n._renderTargets.push(n._diffuseTexture),n._reflectionTexture&&n._reflectionTexture.isRenderTarget&&n._renderTargets.push(n._reflectionTexture),n._renderTargets},n}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"_perceptualColor",{get:function(){return this.__perceptualColor},set:function(e){this.__perceptualColor=e,this._computePrimaryColorFromPerceptualColor(),this._markAllSubMeshesAsLightsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"primaryColorShadowLevel",{get:function(){return this._primaryColorShadowLevel},set:function(e){this._primaryColorShadowLevel=e,this._computePrimaryColors(),this._markAllSubMeshesAsLightsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"primaryColorHighlightLevel",{get:function(){return this._primaryColorHighlightLevel},set:function(e){this._primaryColorHighlightLevel=e,this._computePrimaryColors(),this._markAllSubMeshesAsLightsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionStandardFresnelWeight",{set:function(e){var i=e;i<.5?(i*=2,this.reflectionReflectance0=t.StandardReflectance0*i,this.reflectionReflectance90=t.StandardReflectance90*i):(i=2*i-1,this.reflectionReflectance0=t.StandardReflectance0+(1-t.StandardReflectance0)*i,this.reflectionReflectance90=t.StandardReflectance90+(1-t.StandardReflectance90)*i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._fovMultiplier},set:function(e){isNaN(e)&&(e=1),this._fovMultiplier=Math.max(0,Math.min(2,e))},enumerable:!1,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e){var t=this;e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(function(){t._computePrimaryColorFromPerceptualColor(),t._markAllSubMeshesAsImageProcessingDirty()})))},Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this.imageProcessingConfiguration.colorGradingTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this.imageProcessingConfiguration.colorCurves},set:function(e){this.imageProcessingConfiguration.colorCurves=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!(!this._diffuseTexture||!this._diffuseTexture.isRenderTarget)||!(!this._reflectionTexture||!this._reflectionTexture.isRenderTarget)},enumerable:!1,configurable:!0}),t.prototype.needAlphaTesting=function(){return!0},t.prototype.needAlphaBlending=function(){return this.alpha<1||null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha||this._shadowOnly},t.prototype.isReadyForSubMesh=function(e,t,i){var n=this;if(void 0===i&&(i=!1),t.effect&&this.isFrozen&&t.effect._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new qr);var r=this.getScene(),o=t._materialDefines;if(this._isReadyForSubMesh(t))return!0;var a=r.getEngine();if(Hr.a.PrepareDefinesForLights(r,e,o,!1,this._maxSimultaneousLights),o._needNormals=!0,Hr.a.PrepareDefinesForMultiview(r,o),o._areTexturesDirty){if(o._needUVs=!1,r.texturesEnabled){if(r.getEngine().getCaps().textureLOD&&(o.TEXTURELODSUPPORT=!0),this._diffuseTexture&&Kr.a.DiffuseTextureEnabled){if(!this._diffuseTexture.isReadyOrNotBlocking())return!1;Hr.a.PrepareDefinesForMergedUV(this._diffuseTexture,o,"DIFFUSE"),o.DIFFUSEHASALPHA=this._diffuseTexture.hasAlpha,o.GAMMADIFFUSE=this._diffuseTexture.gammaSpace,o.OPACITYFRESNEL=this._opacityFresnel}else o.DIFFUSE=!1,o.DIFFUSEHASALPHA=!1,o.GAMMADIFFUSE=!1,o.OPACITYFRESNEL=!1;var s=this._reflectionTexture;if(s&&Kr.a.ReflectionTextureEnabled){if(!s.isReadyOrNotBlocking())return!1;switch(o.REFLECTION=!0,o.GAMMAREFLECTION=s.gammaSpace,o.RGBDREFLECTION=s.isRGBD,o.REFLECTIONBLUR=this._reflectionBlur>0,o.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!s.invertZ:s.invertZ,o.LODINREFLECTIONALPHA=s.lodLevelInAlpha,o.EQUIRECTANGULAR_RELFECTION_FOV=this.useEquirectangularFOV,o.REFLECTIONBGR=this.switchToBGR,s.coordinatesMode===Ke.a.INVCUBIC_MODE&&(o.INVERTCUBICMAP=!0),o.REFLECTIONMAP_3D=s.isCube,s.coordinatesMode){case Ke.a.EXPLICIT_MODE:o.REFLECTIONMAP_EXPLICIT=!0;break;case Ke.a.PLANAR_MODE:o.REFLECTIONMAP_PLANAR=!0;break;case Ke.a.PROJECTION_MODE:o.REFLECTIONMAP_PROJECTION=!0;break;case Ke.a.SKYBOX_MODE:o.REFLECTIONMAP_SKYBOX=!0;break;case Ke.a.SPHERICAL_MODE:o.REFLECTIONMAP_SPHERICAL=!0;break;case Ke.a.EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case Ke.a.FIXED_EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case Ke.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case Ke.a.CUBIC_MODE:case Ke.a.INVCUBIC_MODE:default:o.REFLECTIONMAP_CUBIC=!0}this.reflectionFresnel?(o.REFLECTIONFRESNEL=!0,o.REFLECTIONFALLOFF=this.reflectionFalloffDistance>0,this._reflectionControls.x=this.reflectionAmount,this._reflectionControls.y=this.reflectionReflectance0,this._reflectionControls.z=this.reflectionReflectance90,this._reflectionControls.w=1/this.reflectionFalloffDistance):(o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1)}else o.REFLECTION=!1,o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1,o.REFLECTIONBLUR=!1,o.REFLECTIONMAP_3D=!1,o.REFLECTIONMAP_SPHERICAL=!1,o.REFLECTIONMAP_PLANAR=!1,o.REFLECTIONMAP_CUBIC=!1,o.REFLECTIONMAP_PROJECTION=!1,o.REFLECTIONMAP_SKYBOX=!1,o.REFLECTIONMAP_EXPLICIT=!1,o.REFLECTIONMAP_EQUIRECTANGULAR=!1,o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,o.INVERTCUBICMAP=!1,o.REFLECTIONMAP_OPPOSITEZ=!1,o.LODINREFLECTIONALPHA=!1,o.GAMMAREFLECTION=!1,o.RGBDREFLECTION=!1}o.PREMULTIPLYALPHA=this.alphaMode===g.a.ALPHA_PREMULTIPLIED||this.alphaMode===g.a.ALPHA_PREMULTIPLIED_PORTERDUFF,o.USERGBCOLOR=this._useRGBColor,o.NOISE=this._enableNoise}if(o._areLightsDirty&&(o.USEHIGHLIGHTANDSHADOWCOLORS=!this._useRGBColor&&(0!==this._primaryColorShadowLevel||0!==this._primaryColorHighlightLevel),o.BACKMAT_SHADOWONLY=this._shadowOnly),o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o)}if(Hr.a.PrepareDefinesForMisc(e,r,!1,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),Hr.a.PrepareDefinesForFrameBoundValues(r,a,o,i,null,t.getRenderingMesh().hasThinInstances),Hr.a.PrepareDefinesForAttributes(e,o,!1,!0,!1)&&e&&(r.getEngine().getCaps().standardDerivatives||e.isVerticesDataPresent(ji.b.NormalKind)||(e.createNormals(!0),m.a.Warn("BackgroundMaterial: Normals have been created for the mesh: "+e.name))),o.isDirty){o.markAsProcessed(),r.resetCachedMaterial();var c=new Qr.a;o.FOG&&c.addFallback(0,"FOG"),o.POINTSIZE&&c.addFallback(1,"POINTSIZE"),o.MULTIVIEW&&c.addFallback(0,"MULTIVIEW"),Hr.a.HandleFallbacksForShadows(o,c,this._maxSimultaneousLights);var l=[ji.b.PositionKind];o.NORMAL&&l.push(ji.b.NormalKind),o.UV1&&l.push(ji.b.UVKind),o.UV2&&l.push(ji.b.UV2Kind),Hr.a.PrepareAttributesForBones(l,e,o,c),Hr.a.PrepareAttributesForInstances(l,o);var u=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","mBones","vPrimaryColor","vPrimaryColorShadow","vReflectionInfos","reflectionMatrix","vReflectionMicrosurfaceInfos","fFovMultiplier","shadowLevel","alpha","vBackgroundCenter","vReflectionControl","vDiffuseInfos","diffuseMatrix"],h=["diffuseSampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh"],d=["Material","Scene"];Bi.a&&(Bi.a.PrepareUniforms(u,o),Bi.a.PrepareSamplers(h,o)),Hr.a.PrepareUniformsAndSamplersList({uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});var f=o.toString();t.setEffect(r.getEngine().createEffect("background",{attributes:l,uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:f,fallbacks:c,onCompiled:function(e){n.onCompiled&&n.onCompiled(e),n.bindSceneUniformBuffer(e,r.getSceneUniformBuffer())},onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},a),o),this.buildUniformLayout()}return!(!t.effect||!t.effect.isReady()||(o._renderId=r.getRenderId(),t.effect._wasPreviouslyReady=!0,0))},t.prototype._computePrimaryColorFromPerceptualColor=function(){this.__perceptualColor&&(this._primaryColor.copyFrom(this.__perceptualColor),this._primaryColor.toLinearSpaceToRef(this._primaryColor),this._imageProcessingConfiguration&&this._primaryColor.scaleToRef(1/this._imageProcessingConfiguration.exposure,this._primaryColor),this._computePrimaryColors())},t.prototype._computePrimaryColors=function(){0===this._primaryColorShadowLevel&&0===this._primaryColorHighlightLevel||(this._primaryColor.scaleToRef(this._primaryColorShadowLevel,this._primaryShadowColor),this._primaryColor.subtractToRef(this._primaryShadowColor,this._primaryShadowColor),this._white.subtractToRef(this._primaryColor,this._primaryHighlightColor),this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel,this._primaryHighlightColor),this._primaryColor.addToRef(this._primaryHighlightColor,this._primaryHighlightColor))},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("vPrimaryColor",4),this._uniformBuffer.addUniform("vPrimaryColorShadow",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("fFovMultiplier",1),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.addUniform("shadowLevel",1),this._uniformBuffer.addUniform("alpha",1),this._uniformBuffer.addUniform("vBackgroundCenter",3),this._uniformBuffer.addUniform("vReflectionControl",4),this._uniformBuffer.create()},t.prototype.unbind=function(){this._diffuseTexture&&this._diffuseTexture.isRenderTarget&&this._uniformBuffer.setTexture("diffuseSampler",null),this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),e.prototype.unbind.call(this)},t.prototype.bindOnlyWorldMatrix=function(e){this._activeEffect.setMatrix("world",e)},t.prototype.bindForSubMesh=function(e,t,i){var n=this.getScene(),r=i._materialDefines;if(r){var o=i.effect;if(o){this._activeEffect=o,this.bindOnlyWorldMatrix(e),Hr.a.BindBonesParameters(t,this._activeEffect);var a=this._mustRebind(n,o,t.visibility);if(a){this._uniformBuffer.bindToEffect(o,"Material"),this.bindViewProjection(o);var s=this._reflectionTexture;this._uniformBuffer.useUbo&&this.isFrozen&&this._uniformBuffer.isSync||(n.texturesEnabled&&(this._diffuseTexture&&Kr.a.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),Hr.a.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse")),s&&Kr.a.ReflectionTextureEnabled&&(this._uniformBuffer.updateMatrix("reflectionMatrix",s.getReflectionTextureMatrix()),this._uniformBuffer.updateFloat2("vReflectionInfos",s.level,this._reflectionBlur),this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos",s.getSize().width,s.lodGenerationScale,s.lodGenerationOffset))),this.shadowLevel>0&&this._uniformBuffer.updateFloat("shadowLevel",this.shadowLevel),this._uniformBuffer.updateFloat("alpha",this.alpha),this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),r.USEHIGHLIGHTANDSHADOWCOLORS?(this._uniformBuffer.updateColor4("vPrimaryColor",this._primaryHighlightColor,1),this._uniformBuffer.updateColor4("vPrimaryColorShadow",this._primaryShadowColor,1)):this._uniformBuffer.updateColor4("vPrimaryColor",this._primaryColor,1)),this._uniformBuffer.updateFloat("fFovMultiplier",this._fovMultiplier),n.texturesEnabled&&(this._diffuseTexture&&Kr.a.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("diffuseSampler",this._diffuseTexture),s&&Kr.a.ReflectionTextureEnabled&&(r.REFLECTIONBLUR&&r.TEXTURELODSUPPORT?this._uniformBuffer.setTexture("reflectionSampler",s):r.REFLECTIONBLUR?(this._uniformBuffer.setTexture("reflectionSampler",s._lodTextureMid||s),this._uniformBuffer.setTexture("reflectionSamplerLow",s._lodTextureLow||s),this._uniformBuffer.setTexture("reflectionSamplerHigh",s._lodTextureHigh||s)):this._uniformBuffer.setTexture("reflectionSampler",s),r.REFLECTIONFRESNEL&&(this._uniformBuffer.updateFloat3("vBackgroundCenter",this.sceneCenter.x,this.sceneCenter.y,this.sceneCenter.z),this._uniformBuffer.updateFloat4("vReflectionControl",this._reflectionControls.x,this._reflectionControls.y,this._reflectionControls.z,this._reflectionControls.w)))),Hr.a.BindClipPlane(this._activeEffect,n),Hr.a.BindEyePosition(o,n)}!a&&this.isFrozen||(n.lightsEnabled&&Hr.a.BindLights(n,t,this._activeEffect,r,this._maxSimultaneousLights,!1),this.bindView(o),Hr.a.BindFogParameters(n,t,this._activeEffect,!0),this._imageProcessingConfiguration&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.update(),this._afterBind(t,this._activeEffect)}}},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._reflectionTexture===t||this._diffuseTexture===t},t.prototype.dispose=function(t,i){void 0===t&&(t=!1),void 0===i&&(i=!1),i&&(this.diffuseTexture&&this.diffuseTexture.dispose(),this.reflectionTexture&&this.reflectionTexture.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return w.a.Clone(function(){return new t(e,i.getScene())},this)},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON.BackgroundMaterial",e},t.prototype.getClassName=function(){return"BackgroundMaterial"},t.Parse=function(e,i,n){return w.a.Parse(function(){return new t(e.name,i)},e,i,n)},t.StandardReflectance0=.05,t.StandardReflectance90=.5,Object(h.c)([Object(w.e)()],t.prototype,"_primaryColor",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColor",void 0),Object(h.c)([Object(w.e)()],t.prototype,"__perceptualColor",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_primaryColorShadowLevel",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_primaryColorHighlightLevel",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColorHighlightLevel",null),Object(h.c)([Object(w.m)()],t.prototype,"_reflectionTexture",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_reflectionBlur",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionBlur",void 0),Object(h.c)([Object(w.m)()],t.prototype,"_diffuseTexture",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLights",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_shadowLevel",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLevel",void 0),Object(h.c)([Object(w.o)()],t.prototype,"_sceneCenter",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"sceneCenter",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_opacityFresnel",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"opacityFresnel",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_reflectionFresnel",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFresnel",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_reflectionFalloffDistance",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFalloffDistance",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_reflectionAmount",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionAmount",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_reflectionReflectance0",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance0",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_reflectionReflectance90",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance90",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_useRGBColor",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRGBColor",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_enableNoise",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableNoise",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_maxSimultaneousLights",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_shadowOnly",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"shadowOnly",void 0),Object(h.c)([Object(w.i)()],t.prototype,"_imageProcessingConfiguration",void 0),t}(Yr.a);c.a.RegisteredTypes["BABYLON.BackgroundMaterial"]=Zr;var Jr=function(){function e(t,i){var n=this;this._errorHandler=function(e,t){n.onErrorObservable.notifyObservers({message:e,exception:t})},this._options=Object(h.a)(Object(h.a)({},e._getDefaultOptions()),t),this._scene=i,this.onErrorObservable=new o.c,this._setupBackground(),this._setupImageProcessing()}return e._getDefaultOptions=function(){return{createGround:!0,groundSize:15,groundTexture:this._groundTextureCDNUrl,groundColor:new s.a(.2,.2,.3).toLinearSpace().scale(3),groundOpacity:.9,enableGroundShadow:!0,groundShadowLevel:.5,enableGroundMirror:!1,groundMirrorSizeRatio:.3,groundMirrorBlurKernel:64,groundMirrorAmount:1,groundMirrorFresnelWeight:1,groundMirrorFallOffDistance:0,groundMirrorTextureType:g.a.TEXTURETYPE_UNSIGNED_INT,groundYBias:1e-5,createSkybox:!0,skyboxSize:20,skyboxTexture:this._skyboxTextureCDNUrl,skyboxColor:new s.a(.2,.2,.3).toLinearSpace().scale(3),backgroundYRotation:0,sizeAuto:!0,rootPosition:a.e.Zero(),setupImageProcessing:!0,environmentTexture:this._environmentTextureCDNUrl,cameraExposure:.8,cameraContrast:1.2,toneMappingEnabled:!0}},Object.defineProperty(e.prototype,"rootMesh",{get:function(){return this._rootMesh},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skybox",{get:function(){return this._skybox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skyboxTexture",{get:function(){return this._skyboxTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skyboxMaterial",{get:function(){return this._skyboxMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ground",{get:function(){return this._ground},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundTexture",{get:function(){return this._groundTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundMirror",{get:function(){return this._groundMirror},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundMirrorRenderList",{get:function(){return this._groundMirror?this._groundMirror.renderList:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundMaterial",{get:function(){return this._groundMaterial},enumerable:!1,configurable:!0}),e.prototype.updateOptions=function(e){var t=Object(h.a)(Object(h.a)({},this._options),e);this._ground&&!t.createGround&&(this._ground.dispose(),this._ground=null),this._groundMaterial&&!t.createGround&&(this._groundMaterial.dispose(),this._groundMaterial=null),this._groundTexture&&this._options.groundTexture!=t.groundTexture&&(this._groundTexture.dispose(),this._groundTexture=null),this._skybox&&!t.createSkybox&&(this._skybox.dispose(),this._skybox=null),this._skyboxMaterial&&!t.createSkybox&&(this._skyboxMaterial.dispose(),this._skyboxMaterial=null),this._skyboxTexture&&this._options.skyboxTexture!=t.skyboxTexture&&(this._skyboxTexture.dispose(),this._skyboxTexture=null),this._groundMirror&&!t.enableGroundMirror&&(this._groundMirror.dispose(),this._groundMirror=null),this._scene.environmentTexture&&this._options.environmentTexture!=t.environmentTexture&&this._scene.environmentTexture.dispose(),this._options=t,this._setupBackground(),this._setupImageProcessing()},e.prototype.setMainColor=function(e){this.groundMaterial&&(this.groundMaterial.primaryColor=e),this.skyboxMaterial&&(this.skyboxMaterial.primaryColor=e),this.groundMirror&&(this.groundMirror.clearColor=new s.b(e.r,e.g,e.b,1))},e.prototype._setupImageProcessing=function(){this._options.setupImageProcessing&&(this._scene.imageProcessingConfiguration.contrast=this._options.cameraContrast,this._scene.imageProcessingConfiguration.exposure=this._options.cameraExposure,this._scene.imageProcessingConfiguration.toneMappingEnabled=this._options.toneMappingEnabled,this._setupEnvironmentTexture())},e.prototype._setupEnvironmentTexture=function(){if(!this._scene.environmentTexture)if(this._options.environmentTexture instanceof Hn.a)this._scene.environmentTexture=this._options.environmentTexture;else{var e=Wr.CreateFromPrefilteredData(this._options.environmentTexture,this._scene);this._scene.environmentTexture=e}},e.prototype._setupBackground=function(){this._rootMesh||(this._rootMesh=new be.a("BackgroundHelper",this._scene)),this._rootMesh.rotation.y=this._options.backgroundYRotation;var e=this._getSceneSize();this._options.createGround&&(this._setupGround(e),this._setupGroundMaterial(),this._setupGroundDiffuseTexture(),this._options.enableGroundMirror&&this._setupGroundMirrorTexture(e),this._setupMirrorInGroundMaterial()),this._options.createSkybox&&(this._setupSkybox(e),this._setupSkyboxMaterial(),this._setupSkyboxReflectionTexture()),this._rootMesh.position.x=e.rootPosition.x,this._rootMesh.position.z=e.rootPosition.z,this._rootMesh.position.y=e.rootPosition.y},e.prototype._getSceneSize=function(){var e=this,t=this._options.groundSize,i=this._options.skyboxSize,n=this._options.rootPosition;if(!this._scene.meshes||1===this._scene.meshes.length)return{groundSize:t,skyboxSize:i,rootPosition:n};var r=this._scene.getWorldExtends(function(t){return t!==e._ground&&t!==e._rootMesh&&t!==e._skybox}),o=r.max.subtract(r.min);if(this._options.sizeAuto){this._scene.activeCamera instanceof Bt&&this._scene.activeCamera.upperRadiusLimit&&(i=t=2*this._scene.activeCamera.upperRadiusLimit);var a=o.length();a>t&&(i=t=2*a),t*=1.1,i*=1.5,(n=r.min.add(o.scale(.5))).y=r.min.y-this._options.groundYBias}return{groundSize:t,skyboxSize:i,rootPosition:n}},e.prototype._setupGround=function(e){var t=this;this._ground&&!this._ground.isDisposed()||(this._ground=be.a.CreatePlane("BackgroundPlane",e.groundSize,this._scene),this._ground.rotation.x=Math.PI/2,this._ground.parent=this._rootMesh,this._ground.onDisposeObservable.add(function(){t._ground=null})),this._ground.receiveShadows=this._options.enableGroundShadow},e.prototype._setupGroundMaterial=function(){this._groundMaterial||(this._groundMaterial=new Zr("BackgroundPlaneMaterial",this._scene)),this._groundMaterial.alpha=this._options.groundOpacity,this._groundMaterial.alphaMode=g.a.ALPHA_PREMULTIPLIED_PORTERDUFF,this._groundMaterial.shadowLevel=this._options.groundShadowLevel,this._groundMaterial.primaryColor=this._options.groundColor,this._groundMaterial.useRGBColor=!1,this._groundMaterial.enableNoise=!0,this._ground&&(this._ground.material=this._groundMaterial)},e.prototype._setupGroundDiffuseTexture=function(){this._groundMaterial&&(this._groundTexture||(this._options.groundTexture instanceof Hn.a?this._groundMaterial.diffuseTexture=this._options.groundTexture:(this._groundTexture=new Ke.a(this._options.groundTexture,this._scene,void 0,void 0,void 0,void 0,this._errorHandler),this._groundTexture.gammaSpace=!1,this._groundTexture.hasAlpha=!0,this._groundMaterial.diffuseTexture=this._groundTexture)))},e.prototype._setupGroundMirrorTexture=function(e){var t=Ke.a.CLAMP_ADDRESSMODE;if(!this._groundMirror&&(this._groundMirror=new zr("BackgroundPlaneMirrorTexture",{ratio:this._options.groundMirrorSizeRatio},this._scene,!1,this._options.groundMirrorTextureType,Ke.a.BILINEAR_SAMPLINGMODE,!0),this._groundMirror.mirrorPlane=new sn.a(0,-1,0,e.rootPosition.y),this._groundMirror.anisotropicFilteringLevel=1,this._groundMirror.wrapU=t,this._groundMirror.wrapV=t,this._groundMirror.gammaSpace=!1,this._groundMirror.renderList))for(var i=0;i<this._scene.meshes.length;i++){var n=this._scene.meshes[i];n!==this._ground&&n!==this._skybox&&n!==this._rootMesh&&this._groundMirror.renderList.push(n)}this._groundMirror.clearColor=new s.b(this._options.groundColor.r,this._options.groundColor.g,this._options.groundColor.b,1),this._groundMirror.adaptiveBlurKernel=this._options.groundMirrorBlurKernel},e.prototype._setupMirrorInGroundMaterial=function(){this._groundMaterial&&(this._groundMaterial.reflectionTexture=this._groundMirror,this._groundMaterial.reflectionFresnel=!0,this._groundMaterial.reflectionAmount=this._options.groundMirrorAmount,this._groundMaterial.reflectionStandardFresnelWeight=this._options.groundMirrorFresnelWeight,this._groundMaterial.reflectionFalloffDistance=this._options.groundMirrorFallOffDistance)},e.prototype._setupSkybox=function(e){var t=this;this._skybox&&!this._skybox.isDisposed()||(this._skybox=be.a.CreateBox("BackgroundSkybox",e.skyboxSize,this._scene,void 0,be.a.BACKSIDE),this._skybox.onDisposeObservable.add(function(){t._skybox=null})),this._skybox.parent=this._rootMesh},e.prototype._setupSkyboxMaterial=function(){this._skybox&&(this._skyboxMaterial||(this._skyboxMaterial=new Zr("BackgroundSkyboxMaterial",this._scene)),this._skyboxMaterial.useRGBColor=!1,this._skyboxMaterial.primaryColor=this._options.skyboxColor,this._skyboxMaterial.enableNoise=!0,this._skybox.material=this._skyboxMaterial)},e.prototype._setupSkyboxReflectionTexture=function(){this._skyboxMaterial&&(this._skyboxTexture||(this._options.skyboxTexture instanceof Hn.a?this._skyboxMaterial.reflectionTexture=this._options.skyboxTexture:(this._skyboxTexture=new Wr(this._options.skyboxTexture,this._scene,void 0,void 0,void 0,void 0,this._errorHandler),this._skyboxTexture.coordinatesMode=Ke.a.SKYBOX_MODE,this._skyboxTexture.gammaSpace=!1,this._skyboxMaterial.reflectionTexture=this._skyboxTexture)))},e.prototype.dispose=function(){this._groundMaterial&&this._groundMaterial.dispose(!0,!0),this._skyboxMaterial&&this._skyboxMaterial.dispose(!0,!0),this._rootMesh.dispose(!1)},e._groundTextureCDNUrl="https://assets.babylonjs.com/environments/backgroundGround.png",e._skyboxTextureCDNUrl="https://assets.babylonjs.com/environments/backgroundSkybox.dds",e._environmentTextureCDNUrl="https://assets.babylonjs.com/environments/environmentSpecular.env",e}(),$r=function(e){function t(i,n,r,s,c){void 0===c&&(c=null);var l=e.call(this,i,s)||this;l.onError=c,l._halfDome=!1,l._crossEye=!1,l._useDirectMapping=!1,l._textureMode=t.MODE_MONOSCOPIC,l._onBeforeCameraRenderObserver=null,l.onLoadErrorObservable=new o.c,s=l.getScene(),i=i||"textureDome",r.resolution=0|Math.abs(r.resolution)||32,r.clickToPlay=Boolean(r.clickToPlay),r.autoPlay=void 0===r.autoPlay||Boolean(r.autoPlay),r.loop=void 0===r.loop||Boolean(r.loop),r.size=Math.abs(r.size)||(s.activeCamera?.48*s.activeCamera.maxZ:1e3),void 0===r.useDirectMapping?l._useDirectMapping=!0:l._useDirectMapping=r.useDirectMapping,void 0===r.faceForward&&(r.faceForward=!0),l._setReady(!1),l._mesh=be.a.CreateSphere(i+"_mesh",r.resolution,r.size,s,!1,be.a.BACKSIDE);var u=l._material=new Zr(i+"_material",s);u.useEquirectangularFOV=!0,u.fovMultiplier=1,u.opacityFresnel=!1;var h=l._initTexture(n,s,r);if(l.texture=h,l._mesh.material=u,l._mesh.parent=l,l._halfDomeMask=yr.a.CreateSphere("",{slice:.5,diameter:.98*r.size,segments:2*r.resolution,sideOrientation:be.a.BACKSIDE},s),l._halfDomeMask.rotate(J.a.X,-Math.PI/2),l._halfDomeMask.parent=l._mesh,l._halfDome=!!r.halfDomeMode,l._halfDomeMask.setEnabled(l._halfDome),l._crossEye=!!r.crossEyeMode,l._texture.anisotropicFilteringLevel=1,l._texture.onLoadObservable.addOnce(function(){l._setReady(!0)}),r.faceForward&&s.activeCamera){var d=s.activeCamera,f=a.e.Forward(),p=a.e.TransformNormal(f,d.getViewMatrix());p.normalize(),l.rotation.y=Math.acos(a.e.Dot(f,p))}return l._changeTextureMode(l._textureMode),l}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e,this._useDirectMapping?(this._texture.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._texture.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._material.diffuseTexture=this._texture):(this._texture.coordinatesMode=Ke.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE,this._texture.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._material.reflectionTexture=this._texture),this._changeTextureMode(this._textureMode))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mesh",{get:function(){return this._mesh},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._material.fovMultiplier},set:function(e){this._material.fovMultiplier=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textureMode",{get:function(){return this._textureMode},set:function(e){this._textureMode!==e&&this._changeTextureMode(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"halfDome",{get:function(){return this._halfDome},set:function(e){this._halfDome=e,this._halfDomeMask.setEnabled(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"crossEye",{get:function(){return this._crossEye},set:function(e){this._crossEye=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),t.prototype._changeTextureMode=function(e){var i=this;switch(this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._textureMode=e,this._texture.uScale=1,this._texture.vScale=1,this._texture.uOffset=0,this._texture.vOffset=0,this._texture.vAng=0,e){case t.MODE_MONOSCOPIC:this._halfDome&&(this._texture.uScale=2,this._texture.uOffset=-1);break;case t.MODE_SIDEBYSIDE:this._texture.uScale=this._halfDome?.99999:.5;var n=this._halfDome?0:.5,r=this._halfDome?-.5:0;this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add(function(e){var t=e.isRightCamera;i._crossEye&&(t=!t),i._texture.uOffset=t?n:r});break;case t.MODE_TOPBOTTOM:this._texture.vScale=this._halfDome?.99999:.5,this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add(function(e){var t=e.isRightCamera;i._crossEye&&(t=!t),i._texture.vOffset=t?.5:0})}},t.prototype.dispose=function(t,i){void 0===i&&(i=!1),this._texture.dispose(),this._mesh.dispose(),this._material.dispose(),this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this.onLoadErrorObservable.clear(),e.prototype.dispose.call(this,t,i)},t.MODE_MONOSCOPIC=0,t.MODE_TOPBOTTOM=1,t.MODE_SIDEBYSIDE=2,t}(Pr.a),eo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"photoTexture",{get:function(){return this.texture},set:function(e){this.texture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageMode",{get:function(){return this.textureMode},set:function(e){this.textureMode=e},enumerable:!1,configurable:!0}),t.prototype._initTexture=function(e,t,i){var n=this;return new Ke.a(e,t,!i.generateMipMaps,!this._useDirectMapping,void 0,void 0,function(e,t){n.onLoadErrorObservable.notifyObservers(e||"Unknown error occured"),n.onError&&n.onError(e,t)})},t.MODE_MONOSCOPIC=$r.MODE_MONOSCOPIC,t.MODE_TOPBOTTOM=$r.MODE_TOPBOTTOM,t.MODE_SIDEBYSIDE=$r.MODE_SIDEBYSIDE,t}($r),to=function(){function e(){}return e.ExpandRGBDTexture=function(e){var t=e._texture;if(t&&e.isRGBD){var i=t.getEngine(),n=i.getCaps(),r=!1;n.textureHalfFloatRender&&n.textureHalfFloatLinearFiltering?(r=!0,t.type=g.a.TEXTURETYPE_HALF_FLOAT):n.textureFloatRender&&n.textureFloatLinearFiltering&&(r=!0,t.type=g.a.TEXTURETYPE_FLOAT),r&&(t.isReady=!1,t._isRGBD=!1,t.invertY=!1),e.onLoadObservable.addOnce(function(){if(r){var n=new ci("rgbdDecode","rgbdDecode",null,null,1,null,g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,i,!1,void 0,t.type,void 0,null,!1),o=i.createRenderTargetTexture(t.width,{generateDepthBuffer:!1,generateMipMaps:!1,generateStencilBuffer:!1,samplingMode:t.samplingMode,type:t.type,format:g.a.TEXTUREFORMAT_RGBA});n.getEffect().executeWhenCompiled(function(){n.onApply=function(e){e._bindTexture("textureSampler",t),e.setFloat2("scale",1,1)},e.getScene().postProcessManager.directRender([n],o,!0),i.restoreDefaultFramebuffer(),i._releaseTexture(t),i._releaseFramebufferObjects(o),n&&n.dispose(),o._swapAndDie(t),t.isReady=!0})}})}},e}(),io=function(){function e(){}return e.GetEnvironmentBRDFTexture=function(e){if(!e.environmentBRDFTexture){var t=e.useDelayedTextureLoading;e.useDelayedTextureLoading=!1;var i=e._blockEntityCollection;e._blockEntityCollection=!1;var n=Ke.a.CreateFromBase64String(this._environmentBRDFBase64Texture,"EnvironmentBRDFTexture"+this._instanceNumber++,e,!0,!1,Ke.a.BILINEAR_SAMPLINGMODE);e._blockEntityCollection=i;var r=e.getEngine().getLoadedTexturesCache(),o=r.indexOf(n.getInternalTexture());-1!==o&&r.splice(o,1),n.isRGBD=!0,n.wrapU=Ke.a.CLAMP_ADDRESSMODE,n.wrapV=Ke.a.CLAMP_ADDRESSMODE,e.environmentBRDFTexture=n,e.useDelayedTextureLoading=t,to.ExpandRGBDTexture(n)}return e.environmentBRDFTexture},e._instanceNumber=0,e._environmentBRDFBase64Texture="data:image/png;base64, ",e}(),no=function(){function e(t){this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.roughness=0,this._indexOfRefraction=e._DefaultIndexOfRefraction,this.indexOfRefraction=e._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._useRoughnessFromMainTexture=!0,this.useRoughnessFromMainTexture=!0,this._textureRoughness=null,this.textureRoughness=null,this._remapF0OnInterfaceChange=!0,this.remapF0OnInterfaceChange=!0,this._bumpTexture=null,this.bumpTexture=null,this._isTintEnabled=!1,this.isTintEnabled=!1,this.tintColor=s.a.White(),this.tintColorAtDistance=1,this.tintThickness=1,this._tintTexture=null,this.tintTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=t}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t,i,n){if(e._areTexturesDirty&&t.texturesEnabled){if(this._texture&&Kr.a.ClearCoatTextureEnabled&&!this._texture.isReadyOrNotBlocking())return!1;if(this._textureRoughness&&Kr.a.ClearCoatTextureEnabled&&!this._textureRoughness.isReadyOrNotBlocking())return!1;if(i.getCaps().standardDerivatives&&this._bumpTexture&&Kr.a.ClearCoatBumpTextureEnabled&&!n&&!this._bumpTexture.isReady())return!1;if(this._isTintEnabled&&this._tintTexture&&Kr.a.ClearCoatTintTextureEnabled&&!this._tintTexture.isReadyOrNotBlocking())return!1}return!0},e.prototype.prepareDefines=function(t,i){var n;this._isEnabled?(t.CLEARCOAT=!0,t.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=this._useRoughnessFromMainTexture,t.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL=null!==this._texture&&this._texture._texture===(null===(n=this._textureRoughness)||void 0===n?void 0:n._texture)&&this._texture.checkTransformsAreIdentical(this._textureRoughness),t.CLEARCOAT_REMAP_F0=this._remapF0OnInterfaceChange,t._areTexturesDirty&&i.texturesEnabled&&(this._texture&&Kr.a.ClearCoatTextureEnabled?Hr.a.PrepareDefinesForMergedUV(this._texture,t,"CLEARCOAT_TEXTURE"):t.CLEARCOAT_TEXTURE=!1,this._textureRoughness&&Kr.a.ClearCoatTextureEnabled?Hr.a.PrepareDefinesForMergedUV(this._textureRoughness,t,"CLEARCOAT_TEXTURE_ROUGHNESS"):t.CLEARCOAT_TEXTURE_ROUGHNESS=!1,this._bumpTexture&&Kr.a.ClearCoatBumpTextureEnabled?Hr.a.PrepareDefinesForMergedUV(this._bumpTexture,t,"CLEARCOAT_BUMP"):t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_DEFAULTIOR=this._indexOfRefraction===e._DefaultIndexOfRefraction,this._isTintEnabled?(t.CLEARCOAT_TINT=!0,this._tintTexture&&Kr.a.ClearCoatTintTextureEnabled?Hr.a.PrepareDefinesForMergedUV(this._tintTexture,t,"CLEARCOAT_TINT_TEXTURE"):t.CLEARCOAT_TINT_TEXTURE=!1):(t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1))):(t.CLEARCOAT=!1,t.CLEARCOAT_TEXTURE=!1,t.CLEARCOAT_TEXTURE_ROUGHNESS=!1,t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1,t.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,t.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL=!1)},e.prototype.bindForSubMesh=function(e,t,i,n,r,o,a,s){var c,l,u,h,d,f,p,_,m=s._materialDefines,g=m.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL;if(!e.useUbo||!r||!e.isSync){g&&Kr.a.ClearCoatTextureEnabled?(e.updateFloat4("vClearCoatInfos",this._texture.coordinatesIndex,this._texture.level,-1,-1),Hr.a.BindTextureMatrix(this._texture,e,"clearCoat")):(this._texture||this._textureRoughness)&&Kr.a.ClearCoatTextureEnabled&&(e.updateFloat4("vClearCoatInfos",null!==(l=null===(c=this._texture)||void 0===c?void 0:c.coordinatesIndex)&&void 0!==l?l:0,null!==(h=null===(u=this._texture)||void 0===u?void 0:u.level)&&void 0!==h?h:0,null!==(f=null===(d=this._textureRoughness)||void 0===d?void 0:d.coordinatesIndex)&&void 0!==f?f:0,null!==(_=null===(p=this._textureRoughness)||void 0===p?void 0:p.level)&&void 0!==_?_:0),this._texture&&Hr.a.BindTextureMatrix(this._texture,e,"clearCoat"),!this._textureRoughness||g||m.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE||Hr.a.BindTextureMatrix(this._textureRoughness,e,"clearCoatRoughness")),this._bumpTexture&&i.getCaps().standardDerivatives&&Kr.a.ClearCoatTextureEnabled&&!n&&(e.updateFloat2("vClearCoatBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level),Hr.a.BindTextureMatrix(this._bumpTexture,e,"clearCoatBump"),t._mirroredCameraPosition?e.updateFloat2("vClearCoatTangentSpaceParams",o?1:-1,a?1:-1):e.updateFloat2("vClearCoatTangentSpaceParams",o?-1:1,a?-1:1)),this._tintTexture&&Kr.a.ClearCoatTintTextureEnabled&&(e.updateFloat2("vClearCoatTintInfos",this._tintTexture.coordinatesIndex,this._tintTexture.level),Hr.a.BindTextureMatrix(this._tintTexture,e,"clearCoatTint")),e.updateFloat2("vClearCoatParams",this.intensity,this.roughness);var v=1-this._indexOfRefraction,b=1+this._indexOfRefraction,y=Math.pow(-v/b,2),T=1/this._indexOfRefraction;e.updateFloat4("vClearCoatRefractionParams",y,T,v,b),this._isTintEnabled&&(e.updateFloat4("vClearCoatTintParams",this.tintColor.r,this.tintColor.g,this.tintColor.b,Math.max(1e-5,this.tintThickness)),e.updateFloat("clearCoatColorAtDistance",Math.max(1e-5,this.tintColorAtDistance)))}t.texturesEnabled&&(this._texture&&Kr.a.ClearCoatTextureEnabled&&e.setTexture("clearCoatSampler",this._texture),this._textureRoughness&&!g&&!m.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE&&Kr.a.ClearCoatTextureEnabled&&e.setTexture("clearCoatRoughnessSampler",this._textureRoughness),this._bumpTexture&&i.getCaps().standardDerivatives&&Kr.a.ClearCoatBumpTextureEnabled&&!n&&e.setTexture("clearCoatBumpSampler",this._bumpTexture),this._isTintEnabled&&this._tintTexture&&Kr.a.ClearCoatTintTextureEnabled&&e.setTexture("clearCoatTintSampler",this._tintTexture))},e.prototype.hasTexture=function(e){return this._texture===e||this._textureRoughness===e||this._bumpTexture===e||this._tintTexture===e},e.prototype.getActiveTextures=function(e){this._texture&&e.push(this._texture),this._textureRoughness&&e.push(this._textureRoughness),this._bumpTexture&&e.push(this._bumpTexture),this._tintTexture&&e.push(this._tintTexture)},e.prototype.getAnimatables=function(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._textureRoughness&&this._textureRoughness.animations&&this._textureRoughness.animations.length>0&&e.push(this._textureRoughness),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._tintTexture&&this._tintTexture.animations&&this._tintTexture.animations.length>0&&e.push(this._tintTexture)},e.prototype.dispose=function(e){var t,i,n,r;e&&(null===(t=this._texture)||void 0===t||t.dispose(),null===(i=this._textureRoughness)||void 0===i||i.dispose(),null===(n=this._bumpTexture)||void 0===n||n.dispose(),null===(r=this._tintTexture)||void 0===r||r.dispose())},e.prototype.getClassName=function(){return"PBRClearCoatConfiguration"},e.AddFallbacks=function(e,t,i){return e.CLEARCOAT_BUMP&&t.addFallback(i++,"CLEARCOAT_BUMP"),e.CLEARCOAT_TINT&&t.addFallback(i++,"CLEARCOAT_TINT"),e.CLEARCOAT&&t.addFallback(i++,"CLEARCOAT"),i},e.AddUniforms=function(e){e.push("vClearCoatTangentSpaceParams","vClearCoatParams","vClearCoatRefractionParams","vClearCoatTintParams","clearCoatColorAtDistance","clearCoatMatrix","clearCoatRoughnessMatrix","clearCoatBumpMatrix","clearCoatTintMatrix","vClearCoatInfos","vClearCoatBumpInfos","vClearCoatTintInfos")},e.AddSamplers=function(e){e.push("clearCoatSampler","clearCoatRoughnessSampler","clearCoatBumpSampler","clearCoatTintSampler")},e.PrepareUniformBuffer=function(e){e.addUniform("vClearCoatParams",2),e.addUniform("vClearCoatRefractionParams",4),e.addUniform("vClearCoatInfos",4),e.addUniform("clearCoatMatrix",16),e.addUniform("clearCoatRoughnessMatrix",16),e.addUniform("vClearCoatBumpInfos",2),e.addUniform("vClearCoatTangentSpaceParams",2),e.addUniform("clearCoatBumpMatrix",16),e.addUniform("vClearCoatTintParams",4),e.addUniform("clearCoatColorAtDistance",1),e.addUniform("vClearCoatTintInfos",2),e.addUniform("clearCoatTintMatrix",16)},e.prototype.copyTo=function(e){w.a.Clone(function(){return e},this)},e.prototype.serialize=function(){return w.a.Serialize(this)},e.prototype.parse=function(e,t,i){var n=this;w.a.Parse(function(){return n},e,t,i)},e._DefaultIndexOfRefraction=1.5,Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(h.c)([Object(w.c)()],e.prototype,"intensity",void 0),Object(h.c)([Object(w.c)()],e.prototype,"roughness",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"indexOfRefraction",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"useRoughnessFromMainTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"textureRoughness",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"remapF0OnInterfaceChange",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"bumpTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isTintEnabled",void 0),Object(h.c)([Object(w.e)()],e.prototype,"tintColor",void 0),Object(h.c)([Object(w.c)()],e.prototype,"tintColorAtDistance",void 0),Object(h.c)([Object(w.c)()],e.prototype,"tintThickness",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"tintTexture",void 0),e}(),ro=function(){function e(e){this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.direction=new a.d(1,0),this._texture=null,this.texture=null,this._internalMarkAllSubMeshesAsTexturesDirty=e}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t){return!(e._areTexturesDirty&&t.texturesEnabled&&this._texture&&Kr.a.AnisotropicTextureEnabled&&!this._texture.isReadyOrNotBlocking())},e.prototype.prepareDefines=function(e,t,i){this._isEnabled?(e.ANISOTROPIC=this._isEnabled,this._isEnabled&&!t.isVerticesDataPresent(ji.b.TangentKind)&&(e._needUVs=!0,e.MAINUV1=!0),e._areTexturesDirty&&i.texturesEnabled&&(this._texture&&Kr.a.AnisotropicTextureEnabled?Hr.a.PrepareDefinesForMergedUV(this._texture,e,"ANISOTROPIC_TEXTURE"):e.ANISOTROPIC_TEXTURE=!1)):(e.ANISOTROPIC=!1,e.ANISOTROPIC_TEXTURE=!1)},e.prototype.bindForSubMesh=function(e,t,i){e.useUbo&&i&&e.isSync||(this._texture&&Kr.a.AnisotropicTextureEnabled&&(e.updateFloat2("vAnisotropyInfos",this._texture.coordinatesIndex,this._texture.level),Hr.a.BindTextureMatrix(this._texture,e,"anisotropy")),e.updateFloat3("vAnisotropy",this.direction.x,this.direction.y,this.intensity)),t.texturesEnabled&&this._texture&&Kr.a.AnisotropicTextureEnabled&&e.setTexture("anisotropySampler",this._texture)},e.prototype.hasTexture=function(e){return this._texture===e},e.prototype.getActiveTextures=function(e){this._texture&&e.push(this._texture)},e.prototype.getAnimatables=function(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)},e.prototype.dispose=function(e){e&&this._texture&&this._texture.dispose()},e.prototype.getClassName=function(){return"PBRAnisotropicConfiguration"},e.AddFallbacks=function(e,t,i){return e.ANISOTROPIC&&t.addFallback(i++,"ANISOTROPIC"),i},e.AddUniforms=function(e){e.push("vAnisotropy","vAnisotropyInfos","anisotropyMatrix")},e.PrepareUniformBuffer=function(e){e.addUniform("vAnisotropy",3),e.addUniform("vAnisotropyInfos",2),e.addUniform("anisotropyMatrix",16)},e.AddSamplers=function(e){e.push("anisotropySampler")},e.prototype.copyTo=function(e){w.a.Clone(function(){return e},this)},e.prototype.serialize=function(){return w.a.Serialize(this)},e.prototype.parse=function(e,t,i){var n=this;w.a.Parse(function(){return n},e,t,i)},Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(h.c)([Object(w.c)()],e.prototype,"intensity",void 0),Object(h.c)([Object(w.n)()],e.prototype,"direction",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),e}(),oo=function(){function e(t){this._useEnergyConservation=e.DEFAULT_USE_ENERGY_CONSERVATION,this.useEnergyConservation=e.DEFAULT_USE_ENERGY_CONSERVATION,this._useSmithVisibilityHeightCorrelated=e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this.useSmithVisibilityHeightCorrelated=e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this._useSphericalHarmonics=e.DEFAULT_USE_SPHERICAL_HARMONICS,this.useSphericalHarmonics=e.DEFAULT_USE_SPHERICAL_HARMONICS,this._useSpecularGlossinessInputEnergyConservation=e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this.useSpecularGlossinessInputEnergyConservation=e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this._internalMarkAllSubMeshesAsMiscDirty=t}return e.prototype._markAllSubMeshesAsMiscDirty=function(){this._internalMarkAllSubMeshesAsMiscDirty()},e.prototype.prepareDefines=function(e){e.BRDF_V_HEIGHT_CORRELATED=this._useSmithVisibilityHeightCorrelated,e.MS_BRDF_ENERGY_CONSERVATION=this._useEnergyConservation&&this._useSmithVisibilityHeightCorrelated,e.SPHERICAL_HARMONICS=this._useSphericalHarmonics,e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=this._useSpecularGlossinessInputEnergyConservation},e.prototype.getClassName=function(){return"PBRBRDFConfiguration"},e.prototype.copyTo=function(e){w.a.Clone(function(){return e},this)},e.prototype.serialize=function(){return w.a.Serialize(this)},e.prototype.parse=function(e,t,i){var n=this;w.a.Parse(function(){return n},e,t,i)},e.DEFAULT_USE_ENERGY_CONSERVATION=!0,e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED=!0,e.DEFAULT_USE_SPHERICAL_HARMONICS=!0,e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION=!0,Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useEnergyConservation",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSmithVisibilityHeightCorrelated",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSphericalHarmonics",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSpecularGlossinessInputEnergyConservation",void 0),e}(),ao=function(){function e(e){this._isEnabled=!1,this.isEnabled=!1,this._linkSheenWithAlbedo=!1,this.linkSheenWithAlbedo=!1,this.intensity=1,this.color=s.a.White(),this._texture=null,this.texture=null,this._useRoughnessFromMainTexture=!0,this.useRoughnessFromMainTexture=!0,this._roughness=null,this.roughness=null,this._textureRoughness=null,this.textureRoughness=null,this._albedoScaling=!1,this.albedoScaling=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t){if(e._areTexturesDirty&&t.texturesEnabled){if(this._texture&&Kr.a.SheenTextureEnabled&&!this._texture.isReadyOrNotBlocking())return!1;if(this._textureRoughness&&Kr.a.SheenTextureEnabled&&!this._textureRoughness.isReadyOrNotBlocking())return!1}return!0},e.prototype.prepareDefines=function(e,t){var i;this._isEnabled?(e.SHEEN=this._isEnabled,e.SHEEN_LINKWITHALBEDO=this._linkSheenWithAlbedo,e.SHEEN_ROUGHNESS=null!==this._roughness,e.SHEEN_ALBEDOSCALING=this._albedoScaling,e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=this._useRoughnessFromMainTexture,e.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL=null!==this._texture&&this._texture._texture===(null===(i=this._textureRoughness)||void 0===i?void 0:i._texture)&&this._texture.checkTransformsAreIdentical(this._textureRoughness),e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&Kr.a.SheenTextureEnabled?Hr.a.PrepareDefinesForMergedUV(this._texture,e,"SHEEN_TEXTURE"):e.SHEEN_TEXTURE=!1,this._textureRoughness&&Kr.a.SheenTextureEnabled?Hr.a.PrepareDefinesForMergedUV(this._textureRoughness,e,"SHEEN_TEXTURE_ROUGHNESS"):e.SHEEN_TEXTURE_ROUGHNESS=!1)):(e.SHEEN=!1,e.SHEEN_TEXTURE=!1,e.SHEEN_TEXTURE_ROUGHNESS=!1,e.SHEEN_LINKWITHALBEDO=!1,e.SHEEN_ROUGHNESS=!1,e.SHEEN_ALBEDOSCALING=!1,e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,e.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL=!1)},e.prototype.bindForSubMesh=function(e,t,i,n){var r,o,a,s,c,l,u,h,d=n._materialDefines,f=d.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL;e.useUbo&&i&&e.isSync||(f&&Kr.a.SheenTextureEnabled?(e.updateFloat4("vSheenInfos",this._texture.coordinatesIndex,this._texture.level,-1,-1),Hr.a.BindTextureMatrix(this._texture,e,"sheen")):(this._texture||this._textureRoughness)&&Kr.a.SheenTextureEnabled&&(e.updateFloat4("vSheenInfos",null!==(o=null===(r=this._texture)||void 0===r?void 0:r.coordinatesIndex)&&void 0!==o?o:0,null!==(s=null===(a=this._texture)||void 0===a?void 0:a.level)&&void 0!==s?s:0,null!==(l=null===(c=this._textureRoughness)||void 0===c?void 0:c.coordinatesIndex)&&void 0!==l?l:0,null!==(h=null===(u=this._textureRoughness)||void 0===u?void 0:u.level)&&void 0!==h?h:0),this._texture&&Hr.a.BindTextureMatrix(this._texture,e,"sheen"),!this._textureRoughness||f||d.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE||Hr.a.BindTextureMatrix(this._textureRoughness,e,"sheenRoughness")),e.updateFloat4("vSheenColor",this.color.r,this.color.g,this.color.b,this.intensity),null!==this._roughness&&e.updateFloat("vSheenRoughness",this._roughness)),t.texturesEnabled&&(this._texture&&Kr.a.SheenTextureEnabled&&e.setTexture("sheenSampler",this._texture),this._textureRoughness&&!f&&!d.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE&&Kr.a.SheenTextureEnabled&&e.setTexture("sheenRoughnessSampler",this._textureRoughness))},e.prototype.hasTexture=function(e){return this._texture===e||this._textureRoughness===e},e.prototype.getActiveTextures=function(e){this._texture&&e.push(this._texture),this._textureRoughness&&e.push(this._textureRoughness)},e.prototype.getAnimatables=function(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._textureRoughness&&this._textureRoughness.animations&&this._textureRoughness.animations.length>0&&e.push(this._textureRoughness)},e.prototype.dispose=function(e){var t,i;e&&(null===(t=this._texture)||void 0===t||t.dispose(),null===(i=this._textureRoughness)||void 0===i||i.dispose())},e.prototype.getClassName=function(){return"PBRSheenConfiguration"},e.AddFallbacks=function(e,t,i){return e.SHEEN&&t.addFallback(i++,"SHEEN"),i},e.AddUniforms=function(e){e.push("vSheenColor","vSheenRoughness","vSheenInfos","sheenMatrix","sheenRoughnessMatrix")},e.PrepareUniformBuffer=function(e){e.addUniform("vSheenColor",4),e.addUniform("vSheenRoughness",1),e.addUniform("vSheenInfos",4),e.addUniform("sheenMatrix",16),e.addUniform("sheenRoughnessMatrix",16)},e.AddSamplers=function(e){e.push("sheenSampler"),e.push("sheenRoughnessSampler")},e.prototype.copyTo=function(e){w.a.Clone(function(){return e},this)},e.prototype.serialize=function(){return w.a.Serialize(this)},e.prototype.parse=function(e,t,i){var n=this;w.a.Parse(function(){return n},e,t,i)},Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"linkSheenWithAlbedo",void 0),Object(h.c)([Object(w.c)()],e.prototype,"intensity",void 0),Object(h.c)([Object(w.e)()],e.prototype,"color",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"useRoughnessFromMainTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"roughness",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"textureRoughness",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"albedoScaling",void 0),e}(),so=function(){function e(e,t,i){this._isRefractionEnabled=!1,this.isRefractionEnabled=!1,this._isTranslucencyEnabled=!1,this.isTranslucencyEnabled=!1,this._isScatteringEnabled=!1,this.isScatteringEnabled=!1,this._scatteringDiffusionProfileIndex=0,this.refractionIntensity=1,this.translucencyIntensity=1,this.useAlbedoToTintRefraction=!1,this._thicknessTexture=null,this.thicknessTexture=null,this._refractionTexture=null,this.refractionTexture=null,this._indexOfRefraction=1.5,this.indexOfRefraction=1.5,this._volumeIndexOfRefraction=-1,this._invertRefractionY=!1,this.invertRefractionY=!1,this._linkRefractionWithTransparency=!1,this.linkRefractionWithTransparency=!1,this.minimumThickness=0,this.maximumThickness=1,this.tintColor=s.a.White(),this.tintColorAtDistance=1,this.diffusionDistance=s.a.White(),this._useMaskFromThicknessTexture=!1,this.useMaskFromThicknessTexture=!1,this._useMaskFromThicknessTextureGltf=!1,this.useMaskFromThicknessTextureGltf=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e,this._internalMarkScenePrePassDirty=t,this._scene=i}return Object.defineProperty(e.prototype,"scatteringDiffusionProfile",{get:function(){return this._scene.subSurfaceConfiguration?this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex]:null},set:function(e){this._scene.enableSubSurfaceForPrePass()&&e&&(this._scatteringDiffusionProfileIndex=this._scene.subSurfaceConfiguration.addDiffusionProfile(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volumeIndexOfRefraction",{get:function(){return this._volumeIndexOfRefraction>=1?this._volumeIndexOfRefraction:this._indexOfRefraction},set:function(e){this._volumeIndexOfRefraction=e>=1?e:-1},enumerable:!1,configurable:!0}),e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype._markScenePrePassDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty(),this._internalMarkScenePrePassDirty()},e.prototype.isReadyForSubMesh=function(e,t){if(e._areTexturesDirty&&t.texturesEnabled){if(this._thicknessTexture&&Kr.a.ThicknessTextureEnabled&&!this._thicknessTexture.isReadyOrNotBlocking())return!1;var i=this._getRefractionTexture(t);if(i&&Kr.a.RefractionTextureEnabled&&!i.isReadyOrNotBlocking())return!1}return!0},e.prototype.prepareDefines=function(e,t){if(e._areTexturesDirty&&(e.SUBSURFACE=!1,e.SS_TRANSLUCENCY=this._isTranslucencyEnabled,e.SS_SCATTERING=this._isScatteringEnabled,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_MASK_FROM_THICKNESS_TEXTURE=!1,e.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF=!1,e.SS_REFRACTION=!1,e.SS_REFRACTIONMAP_3D=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,e.SS_ALBEDOFORREFRACTIONTINT=!1,(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled)&&(e.SUBSURFACE=!0,e._areTexturesDirty&&t.texturesEnabled&&this._thicknessTexture&&Kr.a.ThicknessTextureEnabled&&Hr.a.PrepareDefinesForMergedUV(this._thicknessTexture,e,"SS_THICKNESSANDMASK_TEXTURE"),e.SS_MASK_FROM_THICKNESS_TEXTURE=this._useMaskFromThicknessTexture,e.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF=this._useMaskFromThicknessTextureGltf),this._isRefractionEnabled&&t.texturesEnabled)){var i=this._getRefractionTexture(t);i&&Kr.a.RefractionTextureEnabled&&(e.SS_REFRACTION=!0,e.SS_REFRACTIONMAP_3D=i.isCube,e.SS_GAMMAREFRACTION=i.gammaSpace,e.SS_RGBDREFRACTION=i.isRGBD,e.SS_LINEARSPECULARREFRACTION=i.linearSpecularLOD,e.SS_REFRACTIONMAP_OPPOSITEZ=i.invertZ,e.SS_LODINREFRACTIONALPHA=i.lodLevelInAlpha,e.SS_LINKREFRACTIONTOTRANSPARENCY=this._linkRefractionWithTransparency,e.SS_ALBEDOFORREFRACTIONTINT=this.useAlbedoToTintRefraction)}},e.prototype.bindForSubMesh=function(e,t,i,n,r,o){var a=this._getRefractionTexture(t);if(!e.useUbo||!n||!e.isSync){if(this._thicknessTexture&&Kr.a.ThicknessTextureEnabled&&(e.updateFloat2("vThicknessInfos",this._thicknessTexture.coordinatesIndex,this._thicknessTexture.level),Hr.a.BindTextureMatrix(this._thicknessTexture,e,"thickness")),e.updateFloat2("vThicknessParam",this.minimumThickness,this.maximumThickness-this.minimumThickness),a&&Kr.a.RefractionTextureEnabled){e.updateMatrix("refractionMatrix",a.getReflectionTextureMatrix());var s=1;a.isCube||a.depth&&(s=a.depth);var c=a.getSize().width,l=this.volumeIndexOfRefraction;e.updateFloat4("vRefractionInfos",a.level,1/l,s,this._invertRefractionY?-1:1),e.updateFloat3("vRefractionMicrosurfaceInfos",c,a.lodGenerationScale,a.lodGenerationOffset),o&&e.updateFloat2("vRefractionFilteringInfo",c,L.a.Log2(c))}this.isScatteringEnabled&&e.updateFloat("scatteringDiffusionProfile",this._scatteringDiffusionProfileIndex),e.updateColor3("vDiffusionDistance",this.diffusionDistance),e.updateFloat4("vTintColor",this.tintColor.r,this.tintColor.g,this.tintColor.b,this.tintColorAtDistance),e.updateFloat3("vSubSurfaceIntensity",this.refractionIntensity,this.translucencyIntensity,0)}t.texturesEnabled&&(this._thicknessTexture&&Kr.a.ThicknessTextureEnabled&&e.setTexture("thicknessSampler",this._thicknessTexture),a&&Kr.a.RefractionTextureEnabled&&(r?e.setTexture("refractionSampler",a):(e.setTexture("refractionSampler",a._lodTextureMid||a),e.setTexture("refractionSamplerLow",a._lodTextureLow||a),e.setTexture("refractionSamplerHigh",a._lodTextureHigh||a))))},e.prototype.unbind=function(e){return!(!this._refractionTexture||!this._refractionTexture.isRenderTarget||(e.setTexture("refractionSampler",null),0))},e.prototype._getRefractionTexture=function(e){return this._refractionTexture?this._refractionTexture:this._isRefractionEnabled?e.environmentTexture:null},Object.defineProperty(e.prototype,"disableAlphaBlending",{get:function(){return this.isRefractionEnabled&&this._linkRefractionWithTransparency},enumerable:!1,configurable:!0}),e.prototype.fillRenderTargetTextures=function(e){Kr.a.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&e.push(this._refractionTexture)},e.prototype.hasTexture=function(e){return this._thicknessTexture===e||this._refractionTexture===e},e.prototype.hasRenderTargetTextures=function(){return!!(Kr.a.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)},e.prototype.getActiveTextures=function(e){this._thicknessTexture&&e.push(this._thicknessTexture),this._refractionTexture&&e.push(this._refractionTexture)},e.prototype.getAnimatables=function(e){this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture)},e.prototype.dispose=function(e){e&&(this._thicknessTexture&&this._thicknessTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose())},e.prototype.getClassName=function(){return"PBRSubSurfaceConfiguration"},e.AddFallbacks=function(e,t,i){return e.SS_SCATTERING&&t.addFallback(i++,"SS_SCATTERING"),e.SS_TRANSLUCENCY&&t.addFallback(i++,"SS_TRANSLUCENCY"),i},e.AddUniforms=function(e){e.push("vDiffusionDistance","vTintColor","vSubSurfaceIntensity","vRefractionMicrosurfaceInfos","vRefractionFilteringInfo","vRefractionInfos","vThicknessInfos","vThicknessParam","refractionMatrix","thicknessMatrix","scatteringDiffusionProfile")},e.AddSamplers=function(e){e.push("thicknessSampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh")},e.PrepareUniformBuffer=function(e){e.addUniform("vRefractionMicrosurfaceInfos",3),e.addUniform("vRefractionFilteringInfo",2),e.addUniform("vRefractionInfos",4),e.addUniform("refractionMatrix",16),e.addUniform("vThicknessInfos",2),e.addUniform("thicknessMatrix",16),e.addUniform("vThicknessParam",2),e.addUniform("vDiffusionDistance",3),e.addUniform("vTintColor",4),e.addUniform("vSubSurfaceIntensity",3),e.addUniform("scatteringDiffusionProfile",1)},e.prototype.copyTo=function(e){w.a.Clone(function(){return e},this)},e.prototype.serialize=function(){return w.a.Serialize(this)},e.prototype.parse=function(e,t,i){var n=this;w.a.Parse(function(){return n},e,t,i)},Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isRefractionEnabled",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isTranslucencyEnabled",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markScenePrePassDirty")],e.prototype,"isScatteringEnabled",void 0),Object(h.c)([Object(w.c)()],e.prototype,"_scatteringDiffusionProfileIndex",void 0),Object(h.c)([Object(w.c)()],e.prototype,"refractionIntensity",void 0),Object(h.c)([Object(w.c)()],e.prototype,"translucencyIntensity",void 0),Object(h.c)([Object(w.c)()],e.prototype,"useAlbedoToTintRefraction",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"thicknessTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"refractionTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"indexOfRefraction",void 0),Object(h.c)([Object(w.c)()],e.prototype,"_volumeIndexOfRefraction",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"volumeIndexOfRefraction",null),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"invertRefractionY",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"linkRefractionWithTransparency",void 0),Object(h.c)([Object(w.c)()],e.prototype,"minimumThickness",void 0),Object(h.c)([Object(w.c)()],e.prototype,"maximumThickness",void 0),Object(h.c)([Object(w.e)()],e.prototype,"tintColor",void 0),Object(h.c)([Object(w.c)()],e.prototype,"tintColorAtDistance",void 0),Object(h.c)([Object(w.e)()],e.prototype,"diffusionDistance",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"useMaskFromThicknessTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"useMaskFromThicknessTextureGltf",void 0),e}(),co=i(105),lo=i(25),uo=(i(160),"uniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\n\nuniform vec4 vLightingIntensity;\nuniform vec4 vReflectivityColor;\nuniform vec4 vMetallicReflectanceFactors;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef ALBEDO\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\n#endif\n\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION)\nuniform mat4 view;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REALTIME_FILTERING\nuniform vec2 vReflectionFilteringInfo;\n#endif\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n\n#ifdef CLEARCOAT\nuniform vec2 vClearCoatParams;\nuniform vec4 vClearCoatRefractionParams;\n#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform vec4 vClearCoatInfos;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS\nuniform mat4 clearCoatRoughnessMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;\nuniform vec2 vClearCoatTangentSpaceParams;\nuniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT\nuniform vec4 vClearCoatTintParams;\nuniform float clearCoatColorAtDistance;\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n#endif\n\n#ifdef ANISOTROPIC\nuniform vec3 vAnisotropy;\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\n#endif\n#endif\n\n#ifdef SHEEN\nuniform vec4 vSheenColor;\n#ifdef SHEEN_ROUGHNESS\nuniform float vSheenRoughness;\n#endif\n#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform vec4 vSheenInfos;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform mat4 sheenMatrix;\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\nuniform mat4 sheenRoughnessMatrix;\n#endif\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\n#ifdef REALTIME_FILTERING\nuniform vec2 vRefractionFilteringInfo;\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\n#endif\nuniform vec2 vThicknessParam;\nuniform vec3 vDiffusionDistance;\nuniform vec4 vTintColor;\nuniform vec3 vSubSurfaceIntensity;\n#endif\n#ifdef PREPASS\n#ifdef PREPASS_IRRADIANCE\nuniform float scatteringDiffusionProfile;\n#endif\n#endif");ai.a.IncludesShadersStore.pbrFragmentDeclaration=uo;ai.a.IncludesShadersStore.pbrUboDeclaration="layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec2 vAlbedoInfos;\nuniform vec4 vAmbientInfos;\nuniform vec2 vOpacityInfos;\nuniform vec2 vEmissiveInfos;\nuniform vec2 vLightmapInfos;\nuniform vec3 vReflectivityInfos;\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform vec2 vReflectionInfos;\nuniform vec2 vReflectionFilteringInfo;\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\nuniform vec3 vBumpInfos;\nuniform mat4 albedoMatrix;\nuniform mat4 ambientMatrix;\nuniform mat4 opacityMatrix;\nuniform mat4 emissiveMatrix;\nuniform mat4 lightmapMatrix;\nuniform mat4 reflectivityMatrix;\nuniform mat4 microSurfaceSamplerMatrix;\nuniform mat4 bumpMatrix;\nuniform vec2 vTangentSpaceParams;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\nuniform vec4 vLightingIntensity;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float pointSize;\nuniform vec4 vReflectivityColor;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\nuniform vec4 vMetallicReflectanceFactors;\nuniform vec2 vMetallicReflectanceInfos;\nuniform mat4 metallicReflectanceMatrix;\nuniform vec2 vClearCoatParams;\nuniform vec4 vClearCoatRefractionParams;\nuniform vec4 vClearCoatInfos;\nuniform mat4 clearCoatMatrix;\nuniform mat4 clearCoatRoughnessMatrix;\nuniform vec2 vClearCoatBumpInfos;\nuniform vec2 vClearCoatTangentSpaceParams;\nuniform mat4 clearCoatBumpMatrix;\nuniform vec4 vClearCoatTintParams;\nuniform float clearCoatColorAtDistance;\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\nuniform vec3 vAnisotropy;\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\nuniform vec4 vSheenColor;\nuniform float vSheenRoughness;\nuniform vec4 vSheenInfos;\nuniform mat4 sheenMatrix;\nuniform mat4 sheenRoughnessMatrix;\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec2 vRefractionFilteringInfo;\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\nuniform vec2 vThicknessParam;\nuniform vec3 vDiffusionDistance;\nuniform vec4 vTintColor;\nuniform vec3 vSubSurfaceIntensity;\nuniform float scatteringDiffusionProfile;\nuniform vec4 vDetailInfos;\nuniform mat4 detailMatrix;\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};";ai.a.IncludesShadersStore.pbrFragmentExtraDeclaration="uniform vec4 vEyePosition;\nuniform vec3 vAmbientColor;\nuniform vec4 vCameraInfos;\n\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nuniform vec2 vDebugMode;\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif";ai.a.IncludesShadersStore.pbrFragmentSamplersDeclaration="#ifdef ALBEDO\n#if ALBEDODIRECTUV == 1\n#define vAlbedoUV vMainUV1\n#elif ALBEDODIRECTUV == 2\n#define vAlbedoUV vMainUV2\n#else\nvarying vec2 vAlbedoUV;\n#endif\nuniform sampler2D albedoSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFLECTIVITY\n#if REFLECTIVITYDIRECTUV == 1\n#define vReflectivityUV vMainUV1\n#elif REFLECTIVITYDIRECTUV == 2\n#define vReflectivityUV vMainUV2\n#else\nvarying vec2 vReflectivityUV;\n#endif\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef MICROSURFACEMAP\n#if MICROSURFACEMAPDIRECTUV == 1\n#define vMicroSurfaceSamplerUV vMainUV1\n#elif MICROSURFACEMAPDIRECTUV == 2\n#define vMicroSurfaceSamplerUV vMainUV2\n#else\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\nuniform sampler2D microSurfaceSampler;\n#endif\n#ifdef METALLIC_REFLECTANCE\n#if METALLIC_REFLECTANCEDIRECTUV == 1\n#define vMetallicReflectanceUV vMainUV1\n#elif METALLIC_REFLECTANCEDIRECTUV == 2\n#define vMetallicReflectanceUV vMainUV2\n#else\nvarying vec2 vMetallicReflectanceUV;\n#endif\nuniform sampler2D metallicReflectanceSampler;\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE)\n#if CLEARCOAT_TEXTUREDIRECTUV == 1\n#define vClearCoatUV vMainUV1\n#elif CLEARCOAT_TEXTUREDIRECTUV == 2\n#define vClearCoatUV vMainUV2\n#else\nvarying vec2 vClearCoatUV;\n#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS)\n#if CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 1\n#define vClearCoatRoughnessUV vMainUV1\n#elif CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 2\n#define vClearCoatRoughnessUV vMainUV2\n#else\nvarying vec2 vClearCoatRoughnessUV;\n#endif\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform sampler2D clearCoatSampler;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL)\nuniform sampler2D clearCoatRoughnessSampler;\n#endif\n#ifdef CLEARCOAT_BUMP\n#if CLEARCOAT_BUMPDIRECTUV == 1\n#define vClearCoatBumpUV vMainUV1\n#elif CLEARCOAT_BUMPDIRECTUV == 2\n#define vClearCoatBumpUV vMainUV2\n#else\nvarying vec2 vClearCoatBumpUV;\n#endif\nuniform sampler2D clearCoatBumpSampler;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\n#if CLEARCOAT_TINT_TEXTUREDIRECTUV == 1\n#define vClearCoatTintUV vMainUV1\n#elif CLEARCOAT_TINT_TEXTUREDIRECTUV == 2\n#define vClearCoatTintUV vMainUV2\n#else\nvarying vec2 vClearCoatTintUV;\n#endif\nuniform sampler2D clearCoatTintSampler;\n#endif\n#endif\n#ifdef SHEEN\n#ifdef SHEEN_TEXTURE\n#if SHEEN_TEXTUREDIRECTUV == 1\n#define vSheenUV vMainUV1\n#elif SHEEN_TEXTUREDIRECTUV == 2\n#define vSheenUV vMainUV2\n#else\nvarying vec2 vSheenUV;\n#endif\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\n#if SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 1\n#define vSheenRoughnessUV vMainUV1\n#elif SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 2\n#define vSheenRoughnessUV vMainUV2\n#else\nvarying vec2 vSheenRoughnessUV;\n#endif\n#endif\n#ifdef SHEEN_TEXTURE\nuniform sampler2D sheenSampler;\n#endif\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL)\nuniform sampler2D sheenRoughnessSampler;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\n#if ANISOTROPIC_TEXTUREDIRECTUV == 1\n#define vAnisotropyUV vMainUV1\n#elif ANISOTROPIC_TEXTUREDIRECTUV == 2\n#define vAnisotropyUV vMainUV2\n#else\nvarying vec2 vAnisotropyUV;\n#endif\nuniform sampler2D anisotropySampler;\n#endif\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform samplerCube irradianceSampler;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D reflectionSamplerLow;\nuniform sampler2D reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform sampler2D irradianceSampler;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#endif\n#ifdef ENVIRONMENTBRDF\nuniform sampler2D environmentBrdfSampler;\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#ifdef SS_REFRACTIONMAP_3D\n#define sampleRefraction(s,c) textureCube(s,c)\nuniform samplerCube refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube refractionSamplerLow;\nuniform samplerCube refractionSamplerHigh;\n#endif\n#else\n#define sampleRefraction(s,c) texture2D(s,c)\nuniform sampler2D refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D refractionSamplerLow;\nuniform sampler2D refractionSamplerHigh;\n#endif\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n#if SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 1\n#define vThicknessUV vMainUV1\n#elif SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 2\n#define vThicknessUV vMainUV2\n#else\nvarying vec2 vThicknessUV;\n#endif\nuniform sampler2D thicknessSampler;\n#endif\n#endif",i(116),ai.a.IncludesShadersStore.subSurfaceScatteringFunctions="bool testLightingForSSS(float diffusionProfile)\n{\nreturn diffusionProfile<1.;\n}";ai.a.IncludesShadersStore.importanceSampling="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereCosSample(vec2 u) {\n\nfloat phi=2.*PI*u.x;\nfloat cosTheta2=1.-u.y;\nfloat cosTheta=sqrt(cosTheta2);\nfloat sinTheta=sqrt(1.-cosTheta2);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereImportanceSampleDggx(vec2 u,float a) {\n\nfloat phi=2.*PI*u.x;\n\nfloat cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));\nfloat cosTheta=sqrt(cosTheta2);\nfloat sinTheta=sqrt(1.-cosTheta2);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) {\n\nfloat phi=2.*PI*u.x;\nfloat sinTheta=pow(u.y,a/(2.*a+1.));\nfloat cosTheta=sqrt(1.-sinTheta*sinTheta);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}";ai.a.IncludesShadersStore.pbrHelperFunctions="\n#define RECIPROCAL_PI2 0.15915494\n#define RECIPROCAL_PI 0.31830988618\n\n#define MINIMUMVARIANCE 0.0005\nfloat convertRoughnessToAverageSlope(float roughness)\n{\n\nreturn square(roughness)+MINIMUMVARIANCE;\n}\nfloat fresnelGrazingReflectance(float reflectance0) {\n\n\nfloat reflectance90=saturate(reflectance0*25.0);\nreturn reflectance90;\n}\nvec2 getAARoughnessFactors(vec3 normalVector) {\n#ifdef SPECULARAA\nvec3 nDfdx=dFdx(normalVector.xyz);\nvec3 nDfdy=dFdy(normalVector.xyz);\nfloat slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));\n\nfloat geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);\n\nfloat geometricAlphaGFactor=sqrt(slopeSquare);\n\ngeometricAlphaGFactor*=0.75;\nreturn vec2(geometricRoughnessFactor,geometricAlphaGFactor);\n#else\nreturn vec2(0.);\n#endif\n}\n#ifdef ANISOTROPIC\n\n\nvec2 getAnisotropicRoughness(float alphaG,float anisotropy) {\nfloat alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);\nfloat alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);\nreturn vec2(alphaT,alphaB);\n}\n\n\nvec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy) {\nvec3 anisotropicFrameDirection=anisotropy>=0.0 ? B : T;\nvec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);\nvec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);\nvec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));\nreturn anisotropicNormal;\n\n}\n#endif\n#if defined(CLEARCOAT) || defined(SS_REFRACTION)\n\n\n\nvec3 cocaLambert(vec3 alpha,float distance) {\nreturn exp(-alpha*distance);\n}\n\nvec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {\nreturn cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));\n}\n\nvec3 computeColorAtDistanceInMedia(vec3 color,float distance) {\nreturn -log(color)/distance;\n}\nvec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {\nvec3 clearCoatAbsorption=mix(vec3(1.0),\ncocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),\nclearCoatIntensity);\nreturn clearCoatAbsorption;\n}\n#endif\n\n\n\n\n#ifdef MICROSURFACEAUTOMATIC\nfloat computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)\n{\nconst float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;\nfloat reflectivityLuminance=getLuminance(reflectivityColor);\nfloat reflectivityLuma=sqrt(reflectivityLuminance);\nmicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;\nreturn microSurface;\n}\n#endif";ai.a.IncludesShadersStore.harmonicsFunctions="#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nuniform vec3 vSphericalL00;\nuniform vec3 vSphericalL1_1;\nuniform vec3 vSphericalL10;\nuniform vec3 vSphericalL11;\nuniform vec3 vSphericalL2_2;\nuniform vec3 vSphericalL2_1;\nuniform vec3 vSphericalL20;\nuniform vec3 vSphericalL21;\nuniform vec3 vSphericalL22;\n\n\n\n\n\n\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\nreturn vSphericalL00\n+vSphericalL1_1*(normal.y)\n+vSphericalL10*(normal.z)\n+vSphericalL11*(normal.x)\n+vSphericalL2_2*(normal.y*normal.x)\n+vSphericalL2_1*(normal.y*normal.z)\n+vSphericalL20*((3.0*normal.z*normal.z)-1.0)\n+vSphericalL21*(normal.z*normal.x)\n+vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));\n}\n#else\nuniform vec3 vSphericalX;\nuniform vec3 vSphericalY;\nuniform vec3 vSphericalZ;\nuniform vec3 vSphericalXX_ZZ;\nuniform vec3 vSphericalYY_ZZ;\nuniform vec3 vSphericalZZ;\nuniform vec3 vSphericalXY;\nuniform vec3 vSphericalYZ;\nuniform vec3 vSphericalZX;\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\n\n\n\n\n\n\n\n\n\nfloat Nx=normal.x;\nfloat Ny=normal.y;\nfloat Nz=normal.z;\nvec3 C1=vSphericalZZ.rgb;\nvec3 Cx=vSphericalX.rgb;\nvec3 Cy=vSphericalY.rgb;\nvec3 Cz=vSphericalZ.rgb;\nvec3 Cxx_zz=vSphericalXX_ZZ.rgb;\nvec3 Cyy_zz=vSphericalYY_ZZ.rgb;\nvec3 Cxy=vSphericalXY.rgb;\nvec3 Cyz=vSphericalYZ.rgb;\nvec3 Czx=vSphericalZX.rgb;\nvec3 a1=Cyy_zz*Ny+Cy;\nvec3 a2=Cyz*Nz+a1;\nvec3 b1=Czx*Nz+Cx;\nvec3 b2=Cxy*Ny+b1;\nvec3 b3=Cxx_zz*Nx+b2;\nvec3 t1=Cz*Nz+C1;\nvec3 t2=a2*Ny+t1;\nvec3 t3=b3*Nx+t2;\nreturn t3;\n}\n#endif\n#endif";ai.a.IncludesShadersStore.pbrDirectLightingSetupFunctions="\nstruct preLightingInfo\n{\n\nvec3 lightOffset;\nfloat lightDistanceSquared;\nfloat lightDistance;\n\nfloat attenuation;\n\nvec3 L;\nvec3 H;\nfloat NdotV;\nfloat NdotLUnclamped;\nfloat NdotL;\nfloat VdotH;\nfloat roughness;\n};\npreLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.lightOffset=lightData.xyz-vPositionW;\nresult.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);\n\nresult.lightDistance=sqrt(result.lightDistanceSquared);\n\nresult.L=normalize(result.lightOffset);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\nresult.NdotLUnclamped=dot(N,result.L);\nresult.NdotL=saturateEps(result.NdotLUnclamped);\nreturn result;\n}\npreLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.lightDistance=length(-lightData.xyz);\n\nresult.L=normalize(-lightData.xyz);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\nresult.NdotLUnclamped=dot(N,result.L);\nresult.NdotL=saturateEps(result.NdotLUnclamped);\nreturn result;\n}\npreLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\n\nresult.NdotL=dot(N,lightData.xyz)*0.5+0.5;\nresult.NdotL=saturateEps(result.NdotL);\nresult.NdotLUnclamped=result.NdotL;\n#ifdef SPECULARTERM\nresult.L=normalize(lightData.xyz);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\n#endif\nreturn result;\n}";ai.a.IncludesShadersStore.pbrDirectLightingFalloffFunctions="float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)\n{\nreturn max(0.,1.0-length(lightOffset)/range);\n}\nfloat computeDistanceLightFalloff_Physical(float lightDistanceSquared)\n{\nreturn 1.0/maxEps(lightDistanceSquared);\n}\nfloat computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)\n{\nfloat lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);\nfloat factor=lightDistanceSquared*inverseSquaredRange;\nfloat attenuation=saturate(1.0-factor*factor);\nattenuation*=attenuation;\n\nlightDistanceFalloff*=attenuation;\nreturn lightDistanceFalloff;\n}\nfloat computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDistanceLightFalloff_Physical(lightDistanceSquared);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);\n#else\nreturn computeDistanceLightFalloff_Standard(lightOffset,range);\n#endif\n}\nfloat computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)\n{\nfloat falloff=0.0;\nfloat cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));\nif (cosAngle>=cosHalfAngle)\n{\nfalloff=max(0.,pow(cosAngle,exponent));\n}\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)\n{\nconst float kMinusLog2ConeAngleIntensityRatio=6.64385618977;\n\n\n\n\n\nfloat concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);\n\n\nvec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);\nfloat falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)\n{\n\n\n\nfloat cd=dot(-lightDirection,directionToLightCenterW);\nfloat falloff=saturate(cd*lightAngleScale+lightAngleOffset);\n\nfalloff*=falloff;\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);\n#else\nreturn computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);\n#endif\n}";ai.a.IncludesShadersStore.pbrBRDFFunctions="\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n\n\n\n\n#ifdef MS_BRDF_ENERGY_CONSERVATION\n\n\nvec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\nreturn 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);\n}\n#endif\n#ifdef ENVIRONMENTBRDF\nvec3 getBRDFLookup(float NdotV,float perceptualRoughness) {\n\nvec2 UV=vec2(NdotV,perceptualRoughness);\n\nvec4 brdfLookup=texture2D(environmentBrdfSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup.rgb=fromRGBD(brdfLookup.rgba);\n#endif\nreturn brdfLookup.rgb;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;\n\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;\n#endif\nreturn reflectance;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;\n#endif\nreturn reflectance;\n}\n#endif\n\n#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)\nvec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));\n}\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\n\nvec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {\nvec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;\nreturn sheenEnvironmentReflectance;\n}\n#endif\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);\n}\nfloat fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);\n}\n#ifdef CLEARCOAT\n\n\n\n\n\nvec3 getR0RemappedForClearCoat(vec3 f0) {\n#ifdef CLEARCOAT_DEFAULTIOR\n#ifdef MOBILE\nreturn saturate(f0*(f0*0.526868+0.529324)-0.0482256);\n#else\nreturn saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);\n#endif\n#else\nvec3 s=sqrt(f0);\nvec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);\nreturn t*t;\n#endif\n}\n#endif\n\n\n\n\n\n\nfloat normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)\n{\n\n\n\nfloat a2=square(alphaG);\nfloat d=NdotH*NdotH*(a2-1.0)+1.0;\nreturn a2/(PI*d*d);\n}\n#ifdef SHEEN\n\n\nfloat normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)\n{\nfloat invR=1./alphaG;\nfloat cos2h=NdotH*NdotH;\nfloat sin2h=1.-cos2h;\nreturn (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);\n}\n#endif\n#ifdef ANISOTROPIC\n\n\nfloat normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {\nfloat a2=alphaTB.x*alphaTB.y;\nvec3 v=vec3(alphaTB.y*TdotH,alphaTB.x*BdotH,a2*NdotH);\nfloat v2=dot(v,v);\nfloat w2=a2/v2;\nreturn a2*w2*w2*RECIPROCAL_PI;\n}\n#endif\n\n\n\n\n#ifdef BRDF_V_HEIGHT_CORRELATED\n\n\n\nfloat smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {\n#ifdef MOBILE\n\nfloat GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);\nfloat GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);\nreturn 0.5/(GGXV+GGXL);\n#else\nfloat a2=alphaG*alphaG;\nfloat GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);\nfloat GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);\nreturn 0.5/(GGXV+GGXL);\n#endif\n}\n#else\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfloat smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)\n{\n#ifdef MOBILE\n\nreturn 1.0/(dot+alphaG+(1.0-alphaG)*dot ));\n#else\nfloat alphaSquared=alphaG*alphaG;\nreturn 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));\n#endif\n}\nfloat smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)\n{\nfloat visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);\n\nreturn visibility;\n}\n#endif\n#ifdef ANISOTROPIC\n\n\nfloat smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {\nfloat lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));\nfloat lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));\nfloat v=0.5/(lambdaV+lambdaL);\nreturn v;\n}\n#endif\n#ifdef CLEARCOAT\nfloat visibility_Kelemen(float VdotH) {\n\n\n\nreturn 0.25/(VdotH*VdotH);\n}\n#endif\n#ifdef SHEEN\n\n\n\nfloat visibility_Ashikhmin(float NdotL,float NdotV)\n{\nreturn 1./(4.*(NdotL+NdotV-NdotL*NdotV));\n}\n\n#endif\n\n\n\n\n\n\n\nfloat diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {\n\n\nfloat diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));\nfloat diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));\nfloat diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;\nfloat fresnel =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);\nreturn fresnel/PI;\n}\n#ifdef SS_TRANSLUCENCY\n\n\nvec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {\nvec3 S=1./maxEps(diffusionDistance);\nvec3 temp=exp((-0.333333333*thickness)*S);\nreturn tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);\n}\n\n\nfloat computeWrappedDiffuseNdotL(float NdotL,float w) {\nfloat t=1.0+w;\nfloat invt2=1.0/square(t);\nreturn saturate((NdotL+w)*invt2);\n}\n#endif\n";ai.a.IncludesShadersStore.hdrFilteringFunctions="#ifdef NUM_SAMPLES\n#if NUM_SAMPLES>0\n#ifdef WEBGL2\n\n\nfloat radicalInverse_VdC(uint bits)\n{\nbits=(bits << 16u) | (bits >> 16u);\nbits=((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\nbits=((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\nbits=((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\nbits=((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\nreturn float(bits)*2.3283064365386963e-10;\n}\nvec2 hammersley(uint i,uint N)\n{\nreturn vec2(float(i)/float(N),radicalInverse_VdC(i));\n}\n#else\nfloat vanDerCorpus(int n,int base)\n{\nfloat invBase=1.0/float(base);\nfloat denom=1.0;\nfloat result=0.0;\nfor(int i=0; i<32; ++i)\n{\nif(n>0)\n{\ndenom=mod(float(n),2.0);\nresult+=denom*invBase;\ninvBase=invBase/2.0;\nn=int(float(n)/2.0);\n}\n}\nreturn result;\n}\nvec2 hammersley(int i,int N)\n{\nreturn vec2(float(i)/float(N),vanDerCorpus(i,2));\n}\n#endif\nfloat log4(float x) {\nreturn log2(x)/2.;\n}\nconst float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);\nconst float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;\nconst float K=4.;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#define inline\nvec3 irradiance(samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{\nvec3 n=normalize(inputN);\nvec3 result=vec3(0.0);\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);\ntangent=normalize(cross(tangent,n));\nvec3 bitangent=cross(n,tangent);\nmat3 tbn=mat3(tangent,bitangent,n);\nfloat maxLevel=filteringInfo.y;\nfloat dim0=filteringInfo.x;\nfloat omegaP=(4.*PI)/(6.*dim0*dim0);\n#ifdef WEBGL2\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{\nvec2 Xi=hammersley(i,NUM_SAMPLES);\nvec3 Ls=hemisphereCosSample(Xi);\nLs=normalize(Ls);\nvec3 Ns=vec3(0.,0.,1.);\nfloat NoL=dot(Ns,Ls);\nif (NoL>0.) {\nfloat pdf_inversed=PI/NoL;\nfloat omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;\nfloat l=log4(omegaS)-log4(omegaP)+log4(K);\nfloat mipLevel=clamp(l,0.0,maxLevel);\nvec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c;\n}\n}\nresult=result*NUM_SAMPLES_FLOAT_INVERSED;\nreturn result;\n}\n#define inline\nvec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{\nvec3 n=normalize(inputN);\nif (alphaG == 0.) {\nvec3 c=textureCube(inputTexture,n).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nreturn c;\n}\nvec3 result=vec3(0.);\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);\ntangent=normalize(cross(tangent,n));\nvec3 bitangent=cross(n,tangent);\nmat3 tbn=mat3(tangent,bitangent,n);\nfloat maxLevel=filteringInfo.y;\nfloat dim0=filteringInfo.x;\nfloat omegaP=(4.*PI)/(6.*dim0*dim0);\nfloat weight=0.;\n#ifdef WEBGL2\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{\nvec2 Xi=hammersley(i,NUM_SAMPLES);\nvec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);\nfloat NoV=1.;\nfloat NoH=H.z;\nfloat NoH2=H.z*H.z;\nfloat NoL=2.*NoH2-1.;\nvec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);\nL=normalize(L);\nif (NoL>0.) {\nfloat pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);\nfloat omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;\nfloat l=log4(omegaS)-log4(omegaP)+log4(K);\nfloat mipLevel=clamp(float(l),0.0,maxLevel);\nweight+=NoL;\nvec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c*NoL;\n}\n}\nresult=result/weight;\nreturn result;\n}\n#endif\n#endif";ai.a.IncludesShadersStore.pbrDirectLightingFunctions="#define CLEARCOATREFLECTANCE90 1.0\n\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef CLEARCOAT\n\n\nvec4 clearCoat;\n#endif\n#ifdef SHEEN\nvec3 sheen;\n#endif\n};\n\nfloat adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {\n#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)\n\nfloat lightRoughness=lightRadius/lightDistance;\n\nfloat totalRoughness=saturate(lightRoughness+roughness);\nreturn totalRoughness;\n#else\nreturn roughness;\n#endif\n}\nvec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {\nreturn mix(groundColor,lightColor,info.NdotL);\n}\nvec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {\nfloat diffuseTerm=diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness);\nreturn diffuseTerm*info.attenuation*info.NdotL*lightColor;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn toLinearSpace(textureColor);\n}\n#ifdef SS_TRANSLUCENCY\nvec3 computeDiffuseAndTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {\nfloat NdotL=absEps(info.NdotLUnclamped);\n\nfloat wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);\n\nfloat trAdapt=step(0.,info.NdotLUnclamped);\nvec3 transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);\nfloat diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);\nreturn diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;\n}\n#endif\n#ifdef SPECULARTERM\nvec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat roughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nvec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);\n#ifdef BRDF_V_HEIGHT_CORRELATED\nfloat smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);\n#else\nfloat smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);\n#endif\nvec3 specTerm=fresnel*distribution*smithVisibility;\nreturn specTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n#ifdef ANISOTROPIC\nvec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat TdotH=dot(T,info.H);\nfloat BdotH=dot(B,info.H);\nfloat TdotV=dot(T,V);\nfloat BdotV=dot(B,V);\nfloat TdotL=dot(T,info.L);\nfloat BdotL=dot(B,info.L);\nfloat alphaG=convertRoughnessToAverageSlope(info.roughness);\nvec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);\nalphaTB=max(alphaTB,square(geometricRoughnessFactor));\nvec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\nfloat distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);\nfloat smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);\nvec3 specTerm=fresnel*distribution*smithVisibility;\nreturn specTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n#ifdef CLEARCOAT\nvec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {\nfloat NccdotL=saturateEps(dot(Ncc,info.L));\nfloat NccdotH=saturateEps(dot(Ncc,info.H));\nfloat clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\nfloat fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnel*=clearCoatIntensity;\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);\nfloat kelemenVisibility=visibility_Kelemen(info.VdotH);\nfloat clearCoatTerm=fresnel*distribution*kelemenVisibility;\nreturn vec4(\nclearCoatTerm*info.attenuation*NccdotL*lightColor,\n1.0-fresnel\n);\n}\nvec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {\nvec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);\nfloat NdotLRefract=saturateEps(dot(Ncc,LRefract));\nvec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);\nreturn absorption;\n}\n#endif\n#ifdef SHEEN\nvec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat roughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\n\n\nfloat fresnel=1.;\nfloat distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);\n\nfloat visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);\n\nfloat sheenTerm=fresnel*distribution*visibility;\nreturn sheenTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n";ai.a.IncludesShadersStore.pbrIBLFunctions="#if defined(REFLECTION) || defined(SS_REFRACTION)\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {\nfloat microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;\nfloat lod=log2(microsurfaceAverageSlopeTexels);\nreturn lod;\n}\nfloat getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {\nfloat lod=log2(cubeMapDimensionPixels)*roughness;\nreturn lod;\n}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)\nfloat environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {\n\n\nfloat temp=NdotVUnclamped+ambientOcclusion;\nreturn saturate(square(temp)-1.0+ambientOcclusion);\n}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)\nfloat environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {\n\nvec3 reflection=reflect(view,normal);\nfloat temp=saturate(1.0+1.1*dot(reflection,geometricNormal));\nreturn square(temp);\n}\n#endif\n\n\n\n\n#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)\n\n\n#define UNPACK_LOD(x) (1.0-x)*255.0\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {\nfloat microsurfaceAverageSlope=alphaG;\n\n\n\n\n\n\nmicrosurfaceAverageSlope*=sqrt(abs(NdotV));\nreturn getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);\n}\n#endif",i(132),i(133);ai.a.IncludesShadersStore.pbrBlockAlbedoOpacity="struct albedoOpacityOutParams\n{\nvec3 surfaceAlbedo;\nfloat alpha;\n};\n#define pbr_inline\nvoid albedoOpacityBlock(\nconst in vec4 vAlbedoColor,\n#ifdef ALBEDO\nconst in vec4 albedoTexture,\nconst in vec2 albedoInfos,\n#endif\n#ifdef OPACITY\nconst in vec4 opacityMap,\nconst in vec2 vOpacityInfos,\n#endif\n#ifdef DETAIL\nconst in vec4 detailColor,\nconst in vec4 vDetailInfos,\n#endif\nout albedoOpacityOutParams outParams\n)\n{\n\nvec3 surfaceAlbedo=vAlbedoColor.rgb;\nfloat alpha=vAlbedoColor.a;\n#ifdef ALBEDO\n#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)\nalpha*=albedoTexture.a;\n#endif\n#ifdef GAMMAALBEDO\nsurfaceAlbedo*=toLinearSpace(albedoTexture.rgb);\n#else\nsurfaceAlbedo*=albedoTexture.rgb;\n#endif\nsurfaceAlbedo*=albedoInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nsurfaceAlbedo*=vColor.rgb;\n#endif\n#ifdef DETAIL\nfloat detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);\nsurfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALBEDO\n\n#ifdef OPACITY\n#ifdef OPACITYRGB\nalpha=getLuminance(opacityMap.rgb);\n#else\nalpha*=opacityMap.a;\n#endif\nalpha*=vOpacityInfos.y;\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)\n#ifdef ALPHATEST\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n#endif\noutParams.surfaceAlbedo=surfaceAlbedo;\noutParams.alpha=alpha;\n}\n";ai.a.IncludesShadersStore.pbrBlockReflectivity="struct reflectivityOutParams\n{\nfloat microSurface;\nfloat roughness;\nvec3 surfaceReflectivityColor;\n#ifdef METALLICWORKFLOW\nvec3 surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nvec3 ambientOcclusionColor;\n#endif\n#if DEBUGMODE>0\nvec4 surfaceMetallicColorMap;\nvec4 surfaceReflectivityColorMap;\nvec2 metallicRoughness;\nvec3 metallicF0;\n#endif\n};\n#define pbr_inline\nvoid reflectivityBlock(\nconst in vec4 vReflectivityColor,\n#ifdef METALLICWORKFLOW\nconst in vec3 surfaceAlbedo,\nconst in vec4 metallicReflectanceFactors,\n#endif\n#ifdef REFLECTIVITY\nconst in vec3 reflectivityInfos,\nconst in vec4 surfaceMetallicOrReflectivityColorMap,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nconst in vec3 ambientOcclusionColorIn,\n#endif\n#ifdef MICROSURFACEMAP\nconst in vec4 microSurfaceTexel,\n#endif\n#ifdef DETAIL\nconst in vec4 detailColor,\nconst in vec4 vDetailInfos,\n#endif\nout reflectivityOutParams outParams\n)\n{\nfloat microSurface=vReflectivityColor.a;\nvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;\n#ifdef REFLECTIVITY\n#if DEBUGMODE>0\noutParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);\noutParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);\n#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;\n#else\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;\n#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;\n#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;\n#endif\n#endif\n#endif\n#ifdef DETAIL\nfloat detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);\nfloat loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);\nfloat hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);\nmetallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));\n#endif\n#ifdef MICROSURFACEMAP\nmetallicRoughness.g*=microSurfaceTexel.r;\n#endif\n#if DEBUGMODE>0\noutParams.metallicRoughness=metallicRoughness;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS\n\nmicroSurface=1.0-metallicRoughness.g;\n\nvec3 baseColor=surfaceAlbedo;\n#ifdef FROSTBITE_REFLECTANCE\n\n\n\n\n\n\noutParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);\n#else\nvec3 metallicF0=metallicReflectanceFactors.rgb;\n#if DEBUGMODE>0\noutParams.metallicF0=metallicF0;\n#endif\n\noutParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);\n#endif\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;\n#if DEBUGMODE>0\noutParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceMetallicOrReflectivityColorMap.a;\nmicroSurface*=reflectivityInfos.z;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurface*=microSurfaceTexel.r;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE\n#endif\n#endif\n#endif\n\nmicroSurface=saturate(microSurface);\n\nfloat roughness=1.-microSurface;\noutParams.microSurface=microSurface;\noutParams.roughness=roughness;\noutParams.surfaceReflectivityColor=surfaceReflectivityColor;\n}\n";ai.a.IncludesShadersStore.pbrBlockAmbientOcclusion="struct ambientOcclusionOutParams\n{\nvec3 ambientOcclusionColor;\n#if DEBUGMODE>0\nvec3 ambientOcclusionColorMap;\n#endif\n};\n#define pbr_inline\nvoid ambientOcclusionBlock(\n#ifdef AMBIENT\nconst in vec3 ambientOcclusionColorMap_,\nconst in vec4 vAmbientInfos,\n#endif\nout ambientOcclusionOutParams outParams\n)\n{\nvec3 ambientOcclusionColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y;\n#ifdef AMBIENTINGRAYSCALE\nambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);\n#endif\nambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);\n#if DEBUGMODE>0\noutParams.ambientOcclusionColorMap=ambientOcclusionColorMap;\n#endif\n#endif\noutParams.ambientOcclusionColor=ambientOcclusionColor;\n}\n";ai.a.IncludesShadersStore.pbrBlockAlphaFresnel="#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nstruct alphaFresnelOutParams\n{\nfloat alpha;\n};\n#define pbr_inline\nvoid alphaFresnelBlock(\nconst in vec3 normalW,\nconst in vec3 viewDirectionW,\nconst in float alpha,\nconst in float microSurface,\nout alphaFresnelOutParams outParams\n)\n{\n\n\n\nfloat opacityPerceptual=alpha;\n#ifdef LINEARALPHAFRESNEL\nfloat opacity0=opacityPerceptual;\n#else\nfloat opacity0=opacityPerceptual*opacityPerceptual;\n#endif\nfloat opacity90=fresnelGrazingReflectance(opacity0);\nvec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);\n\noutParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;\n#ifdef ALPHATEST\nif (outParams.alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\noutParams.alpha=1.0;\n#endif\n#endif\n}\n#endif\n#endif\n";ai.a.IncludesShadersStore.pbrBlockAnisotropic="#ifdef ANISOTROPIC\nstruct anisotropicOutParams\n{\nfloat anisotropy;\nvec3 anisotropicTangent;\nvec3 anisotropicBitangent;\nvec3 anisotropicNormal;\n#if DEBUGMODE>0\nvec3 anisotropyMapData;\n#endif\n};\n#define pbr_inline\nvoid anisotropicBlock(\nconst in vec3 vAnisotropy,\n#ifdef ANISOTROPIC_TEXTURE\nconst in vec3 anisotropyMapData,\n#endif\nconst in mat3 TBN,\nconst in vec3 normalW,\nconst in vec3 viewDirectionW,\nout anisotropicOutParams outParams\n)\n{\nfloat anisotropy=vAnisotropy.b;\nvec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);\n#ifdef ANISOTROPIC_TEXTURE\nanisotropy*=anisotropyMapData.b;\nanisotropyDirection.rg*=anisotropyMapData.rg*2.0-1.0;\n#if DEBUGMODE>0\noutParams.anisotropyMapData=anisotropyMapData;\n#endif\n#endif\nmat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));\nvec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);\nvec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));\noutParams.anisotropy=anisotropy;\noutParams.anisotropicTangent=anisotropicTangent;\noutParams.anisotropicBitangent=anisotropicBitangent;\noutParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy);\n}\n#endif\n";ai.a.IncludesShadersStore.pbrBlockReflection="#ifdef REFLECTION\nstruct reflectionOutParams\n{\nvec4 environmentRadiance;\nvec3 environmentIrradiance;\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords;\n#else\nvec2 reflectionCoords;\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nvec3 irradianceVector;\n#endif\n#endif\n#endif\n};\n#define pbr_inline\nvoid createReflectionCoords(\nconst in vec3 vPositionW,\nconst in vec3 normalW,\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REFLECTIONMAP_3D\nout vec3 reflectionCoords\n#else\nout vec2 reflectionCoords\n#endif\n)\n{\n#ifdef ANISOTROPIC\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n}\n#define pbr_inline\n#define inline\nvoid sampleReflectionTexture(\nconst in float alphaG,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nconst in float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nconst in float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\nconst vec3 reflectionCoords,\n#else\nconst in sampler2D reflectionSampler,\nconst vec2 reflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\nout vec4 environmentRadiance\n)\n{\n\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);\nfloat requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);\n#else\nfloat requestedReflectionLOD=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);\nif (lodReflectionNormalizedDoubled<1.0){\nenvironmentRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nenvironmentRadiance=mix(\nenvironmentMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\n\nenvironmentRadiance.rgb*=vReflectionInfos.x;\nenvironmentRadiance.rgb*=vReflectionColor.rgb;\n}\n#define pbr_inline\n#define inline\nvoid reflectionBlock(\nconst in vec3 vPositionW,\nconst in vec3 normalW,\nconst in float alphaG,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nconst in float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nconst in float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\n#else\nconst in sampler2D reflectionSampler,\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nconst in vec3 vEnvironmentIrradiance,\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nconst in mat4 reflectionMatrix,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube irradianceSampler,\n#else\nconst in sampler2D irradianceSampler,\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\nout reflectionOutParams outParams\n)\n{\n\nvec4 environmentRadiance=vec4(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=vec3(0.);\n#else\nvec2 reflectionCoords=vec2(0.);\n#endif\ncreateReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\nreflectionCoords\n);\nsampleReflectionTexture(\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionSampler,\nreflectionCoords,\n#else\nreflectionSampler,\nreflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentRadiance\n);\n\nvec3 environmentIrradiance=vec3(0.,0.,0.);\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#ifdef ANISOTROPIC\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\nvec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance.rgb=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb;\noutParams.environmentRadiance=environmentRadiance;\noutParams.environmentIrradiance=environmentIrradiance;\noutParams.reflectionCoords=reflectionCoords;\n}\n#endif\n";ai.a.IncludesShadersStore.pbrBlockSheen="#ifdef SHEEN\nstruct sheenOutParams\n{\nfloat sheenIntensity;\nvec3 sheenColor;\nfloat sheenRoughness;\n#ifdef SHEEN_LINKWITHALBEDO\nvec3 surfaceAlbedo;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfloat sheenAlbedoScaling;\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 finalSheenRadianceScaled;\n#endif\n#if DEBUGMODE>0\nvec4 sheenMapData;\nvec3 sheenEnvironmentReflectance;\n#endif\n};\n#define pbr_inline\n#define inline\nvoid sheenBlock(\nconst in vec4 vSheenColor,\n#ifdef SHEEN_ROUGHNESS\nconst in float vSheenRoughness,\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nconst in vec4 sheenMapRoughnessData,\n#endif\n#endif\nconst in float roughness,\n#ifdef SHEEN_TEXTURE\nconst in vec4 sheenMapData,\n#endif\nconst in float reflectance,\n#ifdef SHEEN_LINKWITHALBEDO\nconst in vec3 baseColor,\nconst in vec3 surfaceAlbedo,\n#endif\n#ifdef ENVIRONMENTBRDF\nconst in float NdotV,\nconst in vec3 environmentBrdf,\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nconst in vec2 AARoughnessFactors,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\nconst in vec4 vLightingIntensity,\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\nconst in vec3 reflectionCoords,\n#else\nconst in sampler2D reflectionSampler,\nconst in vec2 reflectionCoords,\n#endif\nconst in float NdotVUnclamped,\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nconst in float seo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nconst in float eho,\n#endif\n#endif\nout sheenOutParams outParams\n)\n{\nfloat sheenIntensity=vSheenColor.a;\n#ifdef SHEEN_TEXTURE\n#if DEBUGMODE>0\noutParams.sheenMapData=sheenMapData;\n#endif\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nfloat sheenFactor=pow5(1.0-sheenIntensity);\nvec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);\nfloat sheenRoughness=sheenIntensity;\noutParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#else\nvec3 sheenColor=vSheenColor.rgb;\n#ifdef SHEEN_TEXTURE\nsheenColor.rgb*=sheenMapData.rgb;\n#endif\n#ifdef SHEEN_ROUGHNESS\nfloat sheenRoughness=vSheenRoughness;\n#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\n#if defined(SHEEN_TEXTURE)\nsheenRoughness*=sheenMapData.a;\n#endif\n#elif defined(SHEEN_TEXTURE_ROUGHNESS)\n#ifdef SHEEN_TEXTURE_ROUGHNESS_IDENTICAL\nsheenRoughness*=sheenMapData.a;\n#else\nsheenRoughness*=sheenMapRoughnessData.a;\n#endif\n#endif\n#else\nfloat sheenRoughness=roughness;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#endif\n\n#if !defined(SHEEN_ALBEDOSCALING)\nsheenIntensity*=(1.-reflectance);\n#endif\n\nsheenColor*=sheenIntensity;\n#endif\n\n#ifdef ENVIRONMENTBRDF\n\n#ifdef SHEEN_ROUGHNESS\nvec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);\n#else\nvec3 environmentSheenBrdf=environmentBrdf;\n#endif\n\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nfloat sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);\n#ifdef SPECULARAA\n\nsheenAlphaG+=AARoughnessFactors.y;\n#endif\nvec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);\nsampleReflectionTexture(\nsheenAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nsheenRoughness,\n#endif\nreflectionSampler,\nreflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentSheenRadiance\n);\nvec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nsheenEnvironmentReflectance*=seo;\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nsheenEnvironmentReflectance*=eho;\n#endif\n#if DEBUGMODE>0\noutParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;\n#endif\noutParams.finalSheenRadianceScaled=\nenvironmentSheenRadiance.rgb *\nsheenEnvironmentReflectance *\nvLightingIntensity.z;\n\n\n\n\n\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\n\n\n\noutParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;\n#endif\n\noutParams.sheenIntensity=sheenIntensity;\noutParams.sheenColor=sheenColor;\noutParams.sheenRoughness=sheenRoughness;\n}\n#endif\n";ai.a.IncludesShadersStore.pbrBlockClearcoat="struct clearcoatOutParams\n{\nvec3 specularEnvironmentR0;\nfloat conservationFactor;\nvec3 clearCoatNormalW;\nvec2 clearCoatAARoughnessFactors;\nfloat clearCoatIntensity;\nfloat clearCoatRoughness;\n#ifdef REFLECTION\nvec3 finalClearCoatRadianceScaled;\n#endif\n#ifdef CLEARCOAT_TINT\nvec3 absorption;\nfloat clearCoatNdotVRefract;\nvec3 clearCoatColor;\nfloat clearCoatThickness;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nvec3 energyConservationFactorClearCoat;\n#endif\n#if DEBUGMODE>0\nmat3 TBNClearCoat;\nvec2 clearCoatMapData;\nvec4 clearCoatTintMapData;\nvec4 environmentClearCoatRadiance;\nfloat clearCoatNdotV;\nvec3 clearCoatEnvironmentReflectance;\n#endif\n};\n#ifdef CLEARCOAT\n#define pbr_inline\n#define inline\nvoid clearcoatBlock(\nconst in vec3 vPositionW,\nconst in vec3 geometricNormalW,\nconst in vec3 viewDirectionW,\nconst in vec2 vClearCoatParams,\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nconst in vec4 clearCoatMapRoughnessData,\n#endif\nconst in vec3 specularEnvironmentR0,\n#ifdef CLEARCOAT_TEXTURE\nconst in vec2 clearCoatMapData,\n#endif\n#ifdef CLEARCOAT_TINT\nconst in vec4 vClearCoatTintParams,\nconst in float clearCoatColorAtDistance,\nconst in vec4 vClearCoatRefractionParams,\n#ifdef CLEARCOAT_TINT_TEXTURE\nconst in vec4 clearCoatTintMapData,\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nconst in vec2 vClearCoatBumpInfos,\nconst in vec4 clearCoatBumpMapData,\nconst in vec2 vClearCoatBumpUV,\n#if defined(TANGENT) && defined(NORMAL)\nconst in mat3 vTBN,\n#else\nconst in vec2 vClearCoatTangentSpaceParams,\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nconst in mat4 normalMatrix,\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nconst in vec3 faceNormal,\n#endif\n#ifdef REFLECTION\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\nconst in vec4 vLightingIntensity,\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\n#else\nconst in sampler2D reflectionSampler,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nconst in float ambientMonochrome,\n#endif\n#endif\nout clearcoatOutParams outParams\n)\n{\n\nfloat clearCoatIntensity=vClearCoatParams.x;\nfloat clearCoatRoughness=vClearCoatParams.y;\n#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\n#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\nclearCoatRoughness*=clearCoatMapData.y;\n#endif\n#if DEBUGMODE>0\noutParams.clearCoatMapData=clearCoatMapData;\n#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL\nclearCoatRoughness*=clearCoatMapData.y;\n#else\nclearCoatRoughness*=clearCoatMapRoughnessData.y;\n#endif\n#endif\noutParams.clearCoatIntensity=clearCoatIntensity;\noutParams.clearCoatRoughness=clearCoatRoughness;\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatColor=vClearCoatTintParams.rgb;\nfloat clearCoatThickness=vClearCoatTintParams.a;\n#ifdef CLEARCOAT_TINT_TEXTURE\nclearCoatColor*=clearCoatTintMapData.rgb;\nclearCoatThickness*=clearCoatTintMapData.a;\n#if DEBUGMODE>0\noutParams.clearCoatTintMapData=clearCoatTintMapData;\n#endif\n#endif\noutParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);\noutParams.clearCoatThickness=clearCoatThickness;\n#endif\n\n\n\n\n#ifdef CLEARCOAT_REMAP_F0\nvec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);\n#else\nvec3 specularEnvironmentR0Updated=specularEnvironmentR0;\n#endif\noutParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);\n\nvec3 clearCoatNormalW=geometricNormalW;\n#ifdef CLEARCOAT_BUMP\n#ifdef NORMALXYSCALE\nfloat clearCoatNormalScale=1.0;\n#else\nfloat clearCoatNormalScale=vClearCoatBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBNClearCoat=vTBN;\n#else\nmat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,vClearCoatBumpUV,vClearCoatTangentSpaceParams);\n#endif\n#if DEBUGMODE>0\noutParams.TBNClearCoat=TBNClearCoat;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(clearCoatBumpMapData.xyz*2.0-1.0);\nclearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);\n#else\nclearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nclearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nclearCoatNormalW=gl_FrontFacing ? clearCoatNormalW : -clearCoatNormalW;\n#endif\noutParams.clearCoatNormalW=clearCoatNormalW;\n\noutParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);\n\nfloat clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);\n\nfloat clearCoatNdotV=absEps(clearCoatNdotVUnclamped);\n#if DEBUGMODE>0\noutParams.clearCoatNdotV=clearCoatNdotV;\n#endif\n#ifdef CLEARCOAT_TINT\n\nvec3 clearCoatVRefract=-refract(vPositionW,clearCoatNormalW,vClearCoatRefractionParams.y);\n\noutParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n\nvec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);\n#endif\n\n#if defined(REFLECTION)\nfloat clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\n#ifdef SPECULARAA\n\nclearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;\n#endif\nvec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);\nvec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nclearCoatReflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 clearCoatReflectionCoords=clearCoatReflectionVector;\n#else\nvec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nclearCoatReflectionCoords/=clearCoatReflectionVector.z;\n#endif\nclearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;\n#endif\nsampleReflectionTexture(\nclearCoatAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nclearCoatNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nclearCoatRoughness,\n#endif\nreflectionSampler,\nclearCoatReflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentClearCoatRadiance\n);\n#if DEBUGMODE>0\noutParams.environmentClearCoatRadiance=environmentClearCoatRadiance;\n#endif\n\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);\n#ifdef RADIANCEOCCLUSION\nfloat clearCoatSeo=environmentRadianceOcclusion(ambientMonochrome,clearCoatNdotVUnclamped);\nclearCoatEnvironmentReflectance*=clearCoatSeo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);\nclearCoatEnvironmentReflectance*=clearCoatEho;\n#endif\n#endif\n#endif\n#else\n\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));\n#endif\nclearCoatEnvironmentReflectance*=clearCoatIntensity;\n#if DEBUGMODE>0\noutParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;\n#endif\noutParams.finalClearCoatRadianceScaled=\nenvironmentClearCoatRadiance.rgb *\nclearCoatEnvironmentReflectance *\nvLightingIntensity.z;\n#endif\n#if defined(CLEARCOAT_TINT)\n\noutParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);\n#endif\n\nfloat fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnelIBLClearCoat*=clearCoatIntensity;\noutParams.conservationFactor=(1.-fresnelIBLClearCoat);\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\noutParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);\n#endif\n}\n#endif\n";ai.a.IncludesShadersStore.pbrBlockSubSurface="struct subSurfaceOutParams\n{\nvec3 specularEnvironmentReflectance;\n#ifdef SS_REFRACTION\nvec3 finalRefraction;\nvec3 surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nfloat alpha;\n#endif\n#ifdef REFLECTION\nfloat refractionFactorForIrradiance;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvec3 transmittance;\nfloat translucencyIntensity;\n#ifdef REFLECTION\nvec3 refractionIrradiance;\n#endif\n#endif\n#if DEBUGMODE>0\nvec4 thicknessMap;\nvec4 environmentRefraction;\nvec3 refractionTransmittance;\n#endif\n};\n#ifdef SUBSURFACE\n#define pbr_inline\n#define inline\nvoid subSurfaceBlock(\nconst in vec3 vSubSurfaceIntensity,\nconst in vec2 vThicknessParam,\nconst in vec4 vTintColor,\nconst in vec3 normalW,\nconst in vec3 specularEnvironmentReflectance,\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nconst in vec4 thicknessMap,\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nconst in mat4 reflectionMatrix,\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nconst in vec3 irradianceVector_,\n#endif\n#if defined(REALTIME_FILTERING)\nconst in samplerCube reflectionSampler,\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube irradianceSampler,\n#else\nconst in sampler2D irradianceSampler,\n#endif\n#endif\n#endif\n#endif\n#ifdef SS_REFRACTION\nconst in vec3 vPositionW,\nconst in vec3 viewDirectionW,\nconst in mat4 view,\nconst in vec3 surfaceAlbedo,\nconst in vec4 vRefractionInfos,\nconst in mat4 refractionMatrix,\nconst in vec3 vRefractionMicrosurfaceInfos,\nconst in vec4 vLightingIntensity,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nconst in float alpha,\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nconst in float NdotVUnclamped,\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nconst in float roughness,\n#else\nconst in float alphaG,\n#endif\n#ifdef SS_REFRACTIONMAP_3D\nconst in samplerCube refractionSampler,\n#ifndef LODBASEDMICROSFURACE\nconst in samplerCube refractionSamplerLow,\nconst in samplerCube refractionSamplerHigh,\n#endif\n#else\nconst in sampler2D refractionSampler,\n#ifndef LODBASEDMICROSFURACE\nconst in sampler2D refractionSamplerLow,\nconst in sampler2D refractionSamplerHigh,\n#endif\n#endif\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vRefractionFilteringInfo,\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nconst in vec3 vDiffusionDistance,\n#endif\nout subSurfaceOutParams outParams\n)\n{\noutParams.specularEnvironmentReflectance=specularEnvironmentReflectance;\n\n\n\n#ifdef SS_REFRACTION\nfloat refractionIntensity=vSubSurfaceIntensity.x;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nrefractionIntensity*=(1.0-alpha);\n\noutParams.alpha=1.0;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nfloat translucencyIntensity=vSubSurfaceIntensity.y;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nfloat thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;\n#if DEBUGMODE>0\noutParams.thicknessMap=thicknessMap;\n#endif\n#ifdef SS_MASK_FROM_THICKNESS_TEXTURE\n#ifdef SS_REFRACTION\nrefractionIntensity*=thicknessMap.g;\n#endif\n#ifdef SS_TRANSLUCENCY\ntranslucencyIntensity*=thicknessMap.b;\n#endif\n#elif defined(SS_MASK_FROM_THICKNESS_TEXTURE_GLTF)\n#ifdef SS_REFRACTION\nrefractionIntensity*=thicknessMap.r;\n#elif defined(SS_TRANSLUCENCY)\ntranslucencyIntensity*=thicknessMap.r;\n#endif\nthickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;\n#endif\n#else\nfloat thickness=vThicknessParam.y;\n#endif\n\n\n\n#ifdef SS_TRANSLUCENCY\nthickness=maxEps(thickness);\nvec3 transmittance=transmittanceBRDF_Burley(vTintColor.rgb,vDiffusionDistance,thickness);\ntransmittance*=translucencyIntensity;\noutParams.transmittance=transmittance;\noutParams.translucencyIntensity=translucencyIntensity;\n#endif\n\n\n\n#ifdef SS_REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\n#ifdef ANISOTROPIC\nvec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,vRefractionInfos.y);\n#else\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\n#endif\n#ifdef SS_REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\n#endif\n\n#ifdef SS_REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nvec3 refractionCoords=refractionVector;\nrefractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(SS_LINEARSPECULARREFRACTION)\nfloat refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,roughness);\n#else\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\n#ifdef SS_LODINREFRACTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);\nfloat requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);\n#else\nfloat requestedRefractionLOD=refractionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);\n#else\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\n#endif\n#else\nfloat lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));\nfloat lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;\nvec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);\nif (lodRefractionNormalizedDoubled<1.0){\nenvironmentRefraction=mix(\nsampleRefraction(refractionSamplerHigh,refractionCoords),\nenvironmentRefractionMid,\nlodRefractionNormalizedDoubled\n);\n} else {\nenvironmentRefraction=mix(\nenvironmentRefractionMid,\nsampleRefraction(refractionSamplerLow,refractionCoords),\nlodRefractionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef SS_RGBDREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\n#endif\n#ifdef SS_GAMMAREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\n#endif\n\nenvironmentRefraction.rgb*=vRefractionInfos.x;\n#endif\n\n\n\n#ifdef SS_REFRACTION\nvec3 refractionTransmittance=vec3(refractionIntensity);\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\n\n\n\n\n\nrefractionTransmittance*=cocaLambert(volumeAlbedo,thickness);\n#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)\n\nfloat maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);\nvec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);\n\nenvironmentRefraction.rgb*=volumeAlbedo;\n#else\n\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\nrefractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);\n#endif\n#ifdef SS_ALBEDOFORREFRACTIONTINT\n\nenvironmentRefraction.rgb*=surfaceAlbedo.rgb;\n#endif\n\noutParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);\n#ifdef REFLECTION\n\noutParams.refractionFactorForIrradiance=(1.-refractionIntensity);\n\n#endif\n\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\noutParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);\n\nrefractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;\n#if DEBUGMODE>0\noutParams.refractionTransmittance=refractionTransmittance;\n#endif\noutParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;\n#if DEBUGMODE>0\noutParams.environmentRefraction=environmentRefraction;\n#endif\n#endif\n\n\n\n#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#else\nvec3 irradianceVector=irradianceVector_;\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP)\n#if defined(REALTIME_FILTERING)\nvec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);\n#else\nvec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec3 irradianceCoords=irradianceVector;\n#else\nvec2 irradianceCoords=irradianceVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nirradianceCoords/=irradianceVector.z;\n#endif\nirradianceCoords.y=1.0-irradianceCoords.y;\n#endif\nvec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);\n#ifdef RGBDREFLECTION\nrefractionIrradiance.rgb=fromRGBD(refractionIrradiance);\n#endif\n#ifdef GAMMAREFLECTION\nrefractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);\n#endif\n#else\nvec4 refractionIrradiance=vec4(0.);\n#endif\nrefractionIrradiance.rgb*=transmittance;\noutParams.refractionIrradiance=refractionIrradiance.rgb;\n#endif\n}\n#endif\n";ai.a.IncludesShadersStore.pbrBlockNormalGeometric="vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#endif\nvec3 geometricNormalW=normalW;\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\ngeometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;\n#endif\n",i(134);ai.a.IncludesShadersStore.pbrBlockNormalFinal="#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nvec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#if defined(TWOSIDEDLIGHTING)\nfaceNormal=gl_FrontFacing ? faceNormal : -faceNormal;\n#endif\nnormalW*=sign(dot(normalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n",i(162);ai.a.IncludesShadersStore.pbrBlockLightmapInit="#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\n#ifdef GAMMALIGHTMAP\nlightmapColor.rgb=toLinearSpace(lightmapColor.rgb);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n";ai.a.IncludesShadersStore.pbrBlockGeometryInfo="float NdotVUnclamped=dot(normalW,viewDirectionW);\n\nfloat NdotV=absEps(NdotVUnclamped);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nvec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz);\n#ifdef SPECULARAA\n\nalphaG+=AARoughnessFactors.y;\n#endif\n#if defined(ENVIRONMENTBRDF)\n\nvec3 environmentBrdf=getBRDFLookup(NdotV,roughness);\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\n#ifdef AMBIENTINGRAYSCALE\nfloat ambientMonochrome=aoOut.ambientOcclusionColor.r;\n#else\nfloat ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor);\n#endif\nfloat seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);\n#endif\n#endif\n#endif\n#endif\n";ai.a.IncludesShadersStore.pbrBlockReflectance0="float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);\nvec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec3 specularEnvironmentR90=vec3(metallicReflectanceFactors.a);\n#else\nvec3 specularEnvironmentR90=vec3(1.0,1.0,1.0);\n#endif\n\n#ifdef ALPHAFRESNEL\nfloat reflectance90=fresnelGrazingReflectance(reflectance);\nspecularEnvironmentR90=specularEnvironmentR90*reflectance90;\n#endif\n";ai.a.IncludesShadersStore.pbrBlockReflectance="#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf);\n#ifdef RADIANCEOCCLUSION\nspecularEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nspecularEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#else\n\nvec3 specularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));\n#endif\n#ifdef CLEARCOAT\nspecularEnvironmentReflectance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nspecularEnvironmentReflectance*=clearcoatOut.absorption;\n#endif\n#endif\n";ai.a.IncludesShadersStore.pbrBlockDirectLighting="vec3 diffuseBase=vec3(0.,0.,0.);\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#ifdef CLEARCOAT\nvec3 clearCoatBase=vec3(0.,0.,0.);\n#endif\n#ifdef SHEEN\nvec3 sheenBase=vec3(0.,0.,0.);\n#endif\n\npreLightingInfo preInfo;\nlightingInfo info;\nfloat shadow=1.;\n#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\nvec3 absorption=vec3(0.);\n#endif\n";ai.a.IncludesShadersStore.pbrBlockFinalLitComponents="\n\n\n\n#if defined(ENVIRONMENTBRDF)\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvec3 energyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);\n#endif\n#endif\n#ifndef METALLICWORKFLOW\n#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION\nsurfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;\n#endif\n#endif\n#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)\nsurfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;\n#endif\n\n#ifdef REFLECTION\nvec3 finalIrradiance=reflectionOut.environmentIrradiance;\n#if defined(CLEARCOAT)\nfinalIrradiance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nfinalIrradiance*=clearcoatOut.absorption;\n#endif\n#endif\n#if defined(SS_REFRACTION)\nfinalIrradiance*=subSurfaceOut.refractionFactorForIrradiance;\n#endif\n#if defined(SS_TRANSLUCENCY)\nfinalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);\nfinalIrradiance+=subSurfaceOut.refractionIrradiance;\n#endif\nfinalIrradiance*=surfaceAlbedo.rgb;\nfinalIrradiance*=vLightingIntensity.z;\nfinalIrradiance*=aoOut.ambientOcclusionColor;\n#endif\n\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase;\nfinalSpecular=max(finalSpecular,0.0);\nvec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalSpecularScaled*=energyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalSpecularScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n\n#ifdef REFLECTION\nvec3 finalRadiance=reflectionOut.environmentRadiance.rgb;\nfinalRadiance*=subSurfaceOut.specularEnvironmentReflectance;\nvec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalRadianceScaled*=energyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalRadianceScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n\n#ifdef SHEEN\nvec3 finalSheen=sheenBase*sheenOut.sheenColor;\nfinalSheen=max(finalSheen,0.0);\nvec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n\n#ifdef CLEARCOAT\nvec3 finalClearCoat=clearCoatBase;\nfinalClearCoat=max(finalClearCoat,0.0);\nvec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;\n#ifdef CLEARCOAT_TINT\nsubSurfaceOut.finalRefraction*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n\n#ifdef ALPHABLEND\nfloat luminanceOverAlpha=0.0;\n#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalRadianceScaled);\n#if defined(CLEARCOAT)\nluminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);\n#endif\n#endif\n#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)\nluminanceOverAlpha+=getLuminance(finalSpecularScaled);\n#endif\n#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalClearCoatScaled);\n#endif\n#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)\nalpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);\n#endif\n#endif\n";ai.a.IncludesShadersStore.pbrBlockFinalUnlitComponents="\nvec3 finalDiffuse=diffuseBase;\nfinalDiffuse*=surfaceAlbedo.rgb;\nfinalDiffuse=max(finalDiffuse,0.0);\nfinalDiffuse*=vLightingIntensity.x;\n\nvec3 finalAmbient=vAmbientColor;\nfinalAmbient*=surfaceAlbedo.rgb;\n\nvec3 finalEmissive=vEmissiveColor;\n#ifdef EMISSIVE\nvec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;\nfinalEmissive*=toLinearSpace(emissiveColorTex.rgb);\nfinalEmissive*=vEmissiveInfos.y;\n#endif\nfinalEmissive*=vLightingIntensity.y;\n\n#ifdef AMBIENT\nvec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w);\n#else\nvec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor;\n#endif\nfinalAmbient*=aoOut.ambientOcclusionColor;\nfinalDiffuse*=ambientOcclusionForDirectDiffuse;\n";ai.a.IncludesShadersStore.pbrBlockFinalColorComposition="vec4 finalColor=vec4(\nfinalAmbient +\nfinalDiffuse +\n#ifndef UNLIT\n#ifdef REFLECTION\nfinalIrradiance +\n#endif\n#ifdef SPECULARTERM\nfinalSpecularScaled +\n#endif\n#ifdef SHEEN\nfinalSheenScaled +\n#endif\n#ifdef CLEARCOAT\nfinalClearCoatScaled +\n#endif\n#ifdef REFLECTION\nfinalRadianceScaled +\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled +\n#endif\n#ifdef CLEARCOAT\nclearcoatOut.finalClearCoatRadianceScaled +\n#endif\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction +\n#endif\n#endif\nfinalEmissive,\nalpha);\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor.rgb*=lightmapColor.rgb;\n#else\nfinalColor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\n\nfinalColor=max(finalColor,0.0);\n",i(155);ai.a.IncludesShadersStore.pbrBlockImageProcessing="#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\nfinalColor.rgb=clamp(finalColor.rgb,0.,30.0);\n#else\n\nfinalColor=applyImageProcessing(finalColor);\n#endif\nfinalColor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\n\nfinalColor.rgb*=finalColor.a;\n#endif\n";ai.a.IncludesShadersStore.pbrDebug="#if DEBUGMODE>0\nif (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {\n\n#if DEBUGMODE == 1\ngl_FragColor.rgb=vPositionW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 2 && defined(NORMAL)\ngl_FragColor.rgb=vNormalW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 3 && defined(BUMP) || DEBUGMODE == 3 && defined(PARALLAX) || DEBUGMODE == 3 && defined(ANISOTROPIC)\n\ngl_FragColor.rgb=TBN[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 4 && defined(BUMP) || DEBUGMODE == 4 && defined(PARALLAX) || DEBUGMODE == 4 && defined(ANISOTROPIC)\n\ngl_FragColor.rgb=TBN[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 5\n\ngl_FragColor.rgb=normalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 6 && defined(MAINUV1)\ngl_FragColor.rgb=vec3(vMainUV1,0.0);\n#elif DEBUGMODE == 7 && defined(MAINUV2)\ngl_FragColor.rgb=vec3(vMainUV2,0.0);\n#elif DEBUGMODE == 8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 10 && defined(CLEARCOAT)\n\ngl_FragColor.rgb=clearcoatOut.clearCoatNormalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 11 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicNormal;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 12 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicTangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 13 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicBitangent;\n#define DEBUGMODE_NORMALIZE\n\n#elif DEBUGMODE == 20 && defined(ALBEDO)\ngl_FragColor.rgb=albedoTexture.rgb;\n#elif DEBUGMODE == 21 && defined(AMBIENT)\ngl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;\n#elif DEBUGMODE == 22 && defined(OPACITY)\ngl_FragColor.rgb=opacityMap.rgb;\n#elif DEBUGMODE == 23 && defined(EMISSIVE)\ngl_FragColor.rgb=emissiveColorTex.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 24 && defined(LIGHTMAP)\ngl_FragColor.rgb=lightmapColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;\n#elif DEBUGMODE == 26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);\n#elif DEBUGMODE == 28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\ngl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;\n#elif DEBUGMODE == 29 && defined(SHEEN) && defined(SHEEN_TEXTURE)\ngl_FragColor.rgb=sheenOut.sheenMapData.rgb;\n#elif DEBUGMODE == 30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)\ngl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;\n#elif DEBUGMODE == 31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)\ngl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;\n\n#elif DEBUGMODE == 40 && defined(SS_REFRACTION)\n\ngl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 41 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 42 && defined(CLEARCOAT) && defined(REFLECTION)\ngl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;\n#define DEBUGMODE_GAMMA\n\n#elif DEBUGMODE == 50\ngl_FragColor.rgb=diffuseBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 51 && defined(SPECULARTERM)\ngl_FragColor.rgb=specularBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 52 && defined(CLEARCOAT)\ngl_FragColor.rgb=clearCoatBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 53 && defined(SHEEN)\ngl_FragColor.rgb=sheenBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 54 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;\n#define DEBUGMODE_GAMMA\n\n#elif DEBUGMODE == 60\ngl_FragColor.rgb=surfaceAlbedo.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 61\ngl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 62 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=vec3(reflectivityOut.metallicRoughness.r);\n#elif DEBUGMODE == 71 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.metallicF0;\n#elif DEBUGMODE == 63\ngl_FragColor.rgb=vec3(roughness);\n#elif DEBUGMODE == 64\ngl_FragColor.rgb=vec3(alphaG);\n#elif DEBUGMODE == 65\ngl_FragColor.rgb=vec3(NdotV);\n#elif DEBUGMODE == 66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\ngl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 67 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);\n#elif DEBUGMODE == 68 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);\n#elif DEBUGMODE == 69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)\ngl_FragColor.rgb=subSurfaceOut.transmittance;\n#elif DEBUGMODE == 70 && defined(SUBSURFACE) && defined(SS_REFRACTION)\ngl_FragColor.rgb=subSurfaceOut.refractionTransmittance;\n\n#elif DEBUGMODE == 80 && defined(RADIANCEOCCLUSION)\ngl_FragColor.rgb=vec3(seo);\n#elif DEBUGMODE == 81 && defined(HORIZONOCCLUSION)\ngl_FragColor.rgb=vec3(eho);\n#elif DEBUGMODE == 82 && defined(MS_BRDF_ENERGY_CONSERVATION)\ngl_FragColor.rgb=vec3(energyConservationFactor);\n#elif DEBUGMODE == 83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=specularEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 85 && defined(SHEEN) && defined(REFLECTION)\ngl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 86 && defined(ALPHABLEND)\ngl_FragColor.rgb=vec3(luminanceOverAlpha);\n#elif DEBUGMODE == 87\ngl_FragColor.rgb=vec3(alpha);\n#endif\ngl_FragColor.rgb*=vDebugMode.y;\n#ifdef DEBUGMODE_NORMALIZE\ngl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;\n#endif\n#ifdef DEBUGMODE_GAMMA\ngl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);\n#endif\ngl_FragColor.a=1.0;\n#ifdef PREPASS\ngl_FragData[0]=toLinearSpace(gl_FragColor);\ngl_FragData[1]=vec4(0.,0.,0.,0.);\n#endif\nreturn;\n}\n#endif";ai.a.ShadersStore.pbrPixelShader="#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LODBASEDMICROSFURACE\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\nprecision highp float;\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE\n#endif\n\n#include<__decl__pbrFragment>\n#include<pbrFragmentExtraDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<pbrFragmentSamplersDeclaration>\n#include<imageProcessingDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<importanceSampling>\n#include<pbrHelperFunctions>\n#include<imageProcessingFunctions>\n#include<shadowsFragmentFunctions>\n#include<harmonicsFunctions>\n#include<pbrDirectLightingSetupFunctions>\n#include<pbrDirectLightingFalloffFunctions>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\n#include<pbrDirectLightingFunctions>\n#include<pbrIBLFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#ifdef REFLECTION\n#include<reflectionFunction>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#include<pbrBlockAlbedoOpacity>\n#include<pbrBlockReflectivity>\n#include<pbrBlockAmbientOcclusion>\n#include<pbrBlockAlphaFresnel>\n#include<pbrBlockAnisotropic>\n#include<pbrBlockReflection>\n#include<pbrBlockSheen>\n#include<pbrBlockClearcoat>\n#include<pbrBlockSubSurface>\n\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n\n#include<pbrBlockNormalGeometric>\n#include<bumpFragment>\n#include<pbrBlockNormalFinal>\n\nalbedoOpacityOutParams albedoOpacityOut;\n#ifdef ALBEDO\nvec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#endif\nalbedoOpacityBlock(\nvAlbedoColor,\n#ifdef ALBEDO\nalbedoTexture,\nvAlbedoInfos,\n#endif\n#ifdef OPACITY\nopacityMap,\nvOpacityInfos,\n#endif\n#ifdef DETAIL\ndetailColor,\nvDetailInfos,\n#endif\nalbedoOpacityOut\n);\nvec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;\nfloat alpha=albedoOpacityOut.alpha;\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\n#include<depthPrePass>\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\nambientOcclusionOutParams aoOut;\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb;\n#endif\nambientOcclusionBlock(\n#ifdef AMBIENT\nambientOcclusionColorMap,\nvAmbientInfos,\n#endif\naoOut\n);\n#include<pbrBlockLightmapInit>\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\n\nvec3 baseColor=surfaceAlbedo;\nreflectivityOutParams reflectivityOut;\n#if defined(REFLECTIVITY)\nvec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\nvec4 baseReflectivity=surfaceMetallicOrReflectivityColorMap;\n#ifndef METALLICWORKFLOW\nsurfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap);\nsurfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y;\n#endif\n#endif\n#if defined(MICROSURFACEMAP)\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\n#endif\n#ifdef METALLICWORKFLOW\nvec4 metallicReflectanceFactors=vMetallicReflectanceFactors;\n#ifdef METALLIC_REFLECTANCE\nvec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset);\nmetallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap);\nmetallicReflectanceFactors*=metallicReflectanceFactorsMap;\n#endif\n#endif\nreflectivityBlock(\nvReflectivityColor,\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo,\nmetallicReflectanceFactors,\n#endif\n#ifdef REFLECTIVITY\nvReflectivityInfos,\nsurfaceMetallicOrReflectivityColorMap,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor,\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurfaceTexel,\n#endif\n#ifdef DETAIL\ndetailColor,\nvDetailInfos,\n#endif\nreflectivityOut\n);\nfloat microSurface=reflectivityOut.microSurface;\nfloat roughness=reflectivityOut.roughness;\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo=reflectivityOut.surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;\n#endif\n\n#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nalphaFresnelOutParams alphaFresnelOut;\nalphaFresnelBlock(\nnormalW,\nviewDirectionW,\nalpha,\nmicroSurface,\nalphaFresnelOut\n);\nalpha=alphaFresnelOut.alpha;\n#endif\n#endif\n\n#include<pbrBlockGeometryInfo>\n\n#ifdef ANISOTROPIC\nanisotropicOutParams anisotropicOut;\n#ifdef ANISOTROPIC_TEXTURE\nvec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;\n#endif\nanisotropicBlock(\nvAnisotropy,\n#ifdef ANISOTROPIC_TEXTURE\nanisotropyMapData,\n#endif\nTBN,\nnormalW,\nviewDirectionW,\nanisotropicOut\n);\n#endif\n\n#ifdef REFLECTION\nreflectionOutParams reflectionOut;\nreflectionBlock(\nvPositionW,\nnormalW,\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\nreflectionSampler,\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nvEnvironmentIrradiance,\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nreflectionMatrix,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\nirradianceSampler,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nreflectionOut\n);\n#endif\n\n#include<pbrBlockReflectance0>\n\n#ifdef SHEEN\nsheenOutParams sheenOut;\n#ifdef SHEEN_TEXTURE\nvec4 sheenMapData=toLinearSpace(texture2D(sheenSampler,vSheenUV+uvOffset))*vSheenInfos.y;\n#endif\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvec4 sheenMapRoughnessData=texture2D(sheenRoughnessSampler,vSheenRoughnessUV+uvOffset)*vSheenInfos.w;\n#endif\nsheenBlock(\nvSheenColor,\n#ifdef SHEEN_ROUGHNESS\nvSheenRoughness,\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nsheenMapRoughnessData,\n#endif\n#endif\nroughness,\n#ifdef SHEEN_TEXTURE\nsheenMapData,\n#endif\nreflectance,\n#ifdef SHEEN_LINKWITHALBEDO\nbaseColor,\nsurfaceAlbedo,\n#endif\n#ifdef ENVIRONMENTBRDF\nNdotV,\nenvironmentBrdf,\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nAARoughnessFactors,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\nvLightingIntensity,\nreflectionSampler,\nreflectionOut.reflectionCoords,\nNdotVUnclamped,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nseo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\neho,\n#endif\n#endif\nsheenOut\n);\n#ifdef SHEEN_LINKWITHALBEDO\nsurfaceAlbedo=sheenOut.surfaceAlbedo;\n#endif\n#endif\n\nclearcoatOutParams clearcoatOut;\n#ifdef CLEARCOAT\n#ifdef CLEARCOAT_TEXTURE\nvec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvec4 clearCoatMapRoughnessData=texture2D(clearCoatRoughnessSampler,vClearCoatRoughnessUV+uvOffset)*vClearCoatInfos.w;\n#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nvec4 clearCoatTintMapData=toLinearSpace(texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset));\n#endif\n#ifdef CLEARCOAT_BUMP\nvec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset);\n#endif\nclearcoatBlock(\nvPositionW,\ngeometricNormalW,\nviewDirectionW,\nvClearCoatParams,\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nclearCoatMapRoughnessData,\n#endif\nspecularEnvironmentR0,\n#ifdef CLEARCOAT_TEXTURE\nclearCoatMapData,\n#endif\n#ifdef CLEARCOAT_TINT\nvClearCoatTintParams,\nclearCoatColorAtDistance,\nvClearCoatRefractionParams,\n#ifdef CLEARCOAT_TINT_TEXTURE\nclearCoatTintMapData,\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nvClearCoatBumpInfos,\nclearCoatBumpMapData,\nvClearCoatBumpUV,\n#if defined(TANGENT) && defined(NORMAL)\nvTBN,\n#else\nvClearCoatTangentSpaceParams,\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nnormalMatrix,\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nfaceNormal,\n#endif\n#ifdef REFLECTION\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\nvLightingIntensity,\nreflectionSampler,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nambientMonochrome,\n#endif\n#endif\nclearcoatOut\n);\n#else\nclearcoatOut.specularEnvironmentR0=specularEnvironmentR0;\n#endif\n\n#include<pbrBlockReflectance>\n\nsubSurfaceOutParams subSurfaceOut;\n#ifdef SUBSURFACE\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset);\n#endif\nsubSurfaceBlock(\nvSubSurfaceIntensity,\nvThicknessParam,\nvTintColor,\nnormalW,\nspecularEnvironmentReflectance,\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nthicknessMap,\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nreflectionMatrix,\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nreflectionOut.irradianceVector,\n#endif\n#if defined(REALTIME_FILTERING)\nreflectionSampler,\nvReflectionFilteringInfo,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\nirradianceSampler,\n#endif\n#endif\n#endif\n#ifdef SS_REFRACTION\nvPositionW,\nviewDirectionW,\nview,\nsurfaceAlbedo,\nvRefractionInfos,\nrefractionMatrix,\nvRefractionMicrosurfaceInfos,\nvLightingIntensity,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha,\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nNdotVUnclamped,\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nroughness,\n#else\nalphaG,\n#endif\nrefractionSampler,\n#ifndef LODBASEDMICROSFURACE\nrefractionSamplerLow,\nrefractionSamplerHigh,\n#endif\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\n#ifdef REALTIME_FILTERING\nvRefractionFilteringInfo,\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvDiffusionDistance,\n#endif\nsubSurfaceOut\n);\n#ifdef SS_REFRACTION\nsurfaceAlbedo=subSurfaceOut.surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha=subSurfaceOut.alpha;\n#endif\n#endif\n#else\nsubSurfaceOut.specularEnvironmentReflectance=specularEnvironmentReflectance;\n#endif\n\n#include<pbrBlockDirectLighting>\n#include<lightFragment>[0..maxSimultaneousLights]\n\n#include<pbrBlockFinalLitComponents>\n#endif\n#include<pbrBlockFinalUnlitComponents>\n#include<pbrBlockFinalColorComposition>\n#include<logDepthFragment>\n#include<fogFragment>(color,finalColor)\n#include<pbrBlockImageProcessing>\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef PREPASS_VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef PREPASS_IRRADIANCE\nvec3 irradiance=finalDiffuse;\n#ifndef UNLIT\n#ifdef REFLECTION\nirradiance+=finalIrradiance;\n#endif\n#endif\nvec3 sqAlbedo=sqrt(surfaceAlbedo);\n#ifdef SS_SCATTERING\ngl_FragData[0]=vec4(finalColor.rgb-irradiance,finalColor.a);\nirradiance/=sqAlbedo;\n#else\ngl_FragData[0]=finalColor;\nfloat scatteringDiffusionProfile=255.;\n#endif\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(irradiance,scatteringDiffusionProfile/255.);\n#else\ngl_FragData[0]=vec4(finalColor.rgb,finalColor.a);\n#endif\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[PREPASS_DEPTHNORMAL_INDEX]=vec4(vViewPos.z,(view*vec4(normalW,0.0)).rgb);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(sqAlbedo,1.0);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(REFLECTIVITY)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(baseReflectivity.rgb,1.0);\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=finalColor;\n#endif\n#include<pbrDebug>\n}\n";ai.a.IncludesShadersStore.pbrVertexDeclaration="uniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef ALBEDO\nuniform mat4 albedoMatrix;\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\nuniform mat4 reflectivityMatrix;\n#endif\n#ifdef METALLIC_REFLECTANCE\nuniform vec2 vMetallicReflectanceInfos;\nuniform mat4 metallicReflectanceMatrix;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform mat4 microSurfaceSamplerMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\n#endif\n\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform vec4 vClearCoatInfos;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS\nuniform mat4 clearCoatRoughnessMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;\nuniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\n#endif\n#endif\n\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform vec4 vSheenInfos;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform mat4 sheenMatrix;\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\nuniform mat4 sheenRoughnessMatrix;\n#endif\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\n#endif\n#endif\n",i(163),i(164),i(93),i(94),i(100),i(165),i(156),i(158);ai.a.ShadersStore.pbrVertexShader="precision highp float;\n#include<__decl__pbrVertex>\n#define CUSTOM_VERTEX_BEGIN\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nvarying vec2 vAlbedoUV;\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nvarying vec2 vDetailUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nvarying vec2 vReflectivityUV;\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\n#if defined(METALLIC_REFLECTANCE) && METALLIC_REFLECTANCEDIRECTUV == 0\nvarying vec2 vMetallicReflectanceUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) && CLEARCOAT_TEXTUREDIRECTUV == 0\nvarying vec2 vClearCoatUV;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 0\nvarying vec2 vClearCoatRoughnessUV;\n#endif\n#if defined(CLEARCOAT_BUMP) && CLEARCOAT_BUMPDIRECTUV == 0\nvarying vec2 vClearCoatBumpUV;\n#endif\n#if defined(CLEARCOAT_TINT_TEXTURE) && CLEARCOAT_TINT_TEXTUREDIRECTUV == 0\nvarying vec2 vClearCoatTintUV;\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) && SHEEN_TEXTUREDIRECTUV == 0\nvarying vec2 vSheenUV;\n#endif\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 0\nvarying vec2 vSheenRoughnessUV;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#if defined(ANISOTROPIC_TEXTURE) && ANISOTROPIC_TEXTUREDIRECTUV == 0\nvarying vec2 vAnisotropyUV;\n#endif\n#endif\n#ifdef SUBSURFACE\n#if defined(SS_THICKNESSANDMASK_TEXTURE) && SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 0\nvarying vec2 vThicknessUV;\n#endif\n#endif\n\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#include<harmonicsFunctions>\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#include<prePassVertex>\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));\nvNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\nvEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#if DEBUGMODE>0\nvClipSpacePosition=gl_Position;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nif (vAlbedoInfos.x == 0.)\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nif (vDetailInfos.x == 0.)\n{\nvDetailUV=vec2(detailMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDetailUV=vec2(detailMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nif (vReflectivityInfos.x == 0.)\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nif (vMicroSurfaceSamplerInfos.x == 0.)\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(METALLIC_REFLECTANCE) && METALLIC_REFLECTANCEDIRECTUV == 0\nif (vMetallicReflectanceInfos.x == 0.)\n{\nvMetallicReflectanceUV=vec2(metallicReflectanceMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvMetallicReflectanceUV=vec2(metallicReflectanceMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) && CLEARCOAT_TEXTUREDIRECTUV == 0\nif (vClearCoatInfos.x == 0.)\n{\nvClearCoatUV=vec2(clearCoatMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatUV=vec2(clearCoatMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 0\nif (vClearCoatInfos.z == 0.)\n{\nvClearCoatRoughnessUV=vec2(clearCoatRoughnessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatRoughnessUV=vec2(clearCoatRoughnessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_BUMP) && CLEARCOAT_BUMPDIRECTUV == 0\nif (vClearCoatBumpInfos.x == 0.)\n{\nvClearCoatBumpUV=vec2(clearCoatBumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatBumpUV=vec2(clearCoatBumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_TINT_TEXTURE) && CLEARCOAT_TINT_TEXTUREDIRECTUV == 0\nif (vClearCoatTintInfos.x == 0.)\n{\nvClearCoatTintUV=vec2(clearCoatTintMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatTintUV=vec2(clearCoatTintMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) && SHEEN_TEXTUREDIRECTUV == 0\nif (vSheenInfos.x == 0.)\n{\nvSheenUV=vec2(sheenMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSheenUV=vec2(sheenMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 0\nif (vSheenInfos.z == 0.)\n{\nvSheenRoughnessUV=vec2(sheenRoughnessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSheenRoughnessUV=vec2(sheenRoughnessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef ANISOTROPIC\n#if defined(ANISOTROPIC_TEXTURE) && ANISOTROPIC_TEXTUREDIRECTUV == 0\nif (vAnisotropyInfos.x == 0.)\n{\nvAnisotropyUV=vec2(anisotropyMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAnisotropyUV=vec2(anisotropyMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef SUBSURFACE\n#if defined(SS_THICKNESSANDMASK_TEXTURE) && SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 0\nif (vThicknessInfos.x == 0.)\n{\nvThicknessUV=vec2(thicknessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvThicknessUV=vec2(thicknessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n\n#include<bumpVertex>\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";var ho=i(92),fo={effect:null,subMesh:null},po=function(e){function t(){var t=e.call(this)||this;return t.PBR=!0,t.NUM_SAMPLES="0",t.REALTIME_FILTERING=!1,t.MAINUV1=!1,t.MAINUV2=!1,t.UV1=!1,t.UV2=!1,t.ALBEDO=!1,t.GAMMAALBEDO=!1,t.ALBEDODIRECTUV=0,t.VERTEXCOLOR=!1,t.DETAIL=!1,t.DETAILDIRECTUV=0,t.DETAIL_NORMALBLENDMETHOD=0,t.AMBIENT=!1,t.AMBIENTDIRECTUV=0,t.AMBIENTINGRAYSCALE=!1,t.OPACITY=!1,t.VERTEXALPHA=!1,t.OPACITYDIRECTUV=0,t.OPACITYRGB=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.ALPHABLEND=!1,t.ALPHAFROMALBEDO=!1,t.ALPHATESTVALUE="0.5",t.SPECULAROVERALPHA=!1,t.RADIANCEOVERALPHA=!1,t.ALPHAFRESNEL=!1,t.LINEARALPHAFRESNEL=!1,t.PREMULTIPLYALPHA=!1,t.EMISSIVE=!1,t.EMISSIVEDIRECTUV=0,t.REFLECTIVITY=!1,t.REFLECTIVITYDIRECTUV=0,t.SPECULARTERM=!1,t.MICROSURFACEFROMREFLECTIVITYMAP=!1,t.MICROSURFACEAUTOMATIC=!1,t.LODBASEDMICROSFURACE=!1,t.MICROSURFACEMAP=!1,t.MICROSURFACEMAPDIRECTUV=0,t.METALLICWORKFLOW=!1,t.ROUGHNESSSTOREINMETALMAPALPHA=!1,t.ROUGHNESSSTOREINMETALMAPGREEN=!1,t.METALLNESSSTOREINMETALMAPBLUE=!1,t.AOSTOREINMETALMAPRED=!1,t.METALLIC_REFLECTANCE=!1,t.METALLIC_REFLECTANCEDIRECTUV=0,t.ENVIRONMENTBRDF=!1,t.ENVIRONMENTBRDF_RGBD=!1,t.NORMAL=!1,t.TANGENT=!1,t.BUMP=!1,t.BUMPDIRECTUV=0,t.OBJECTSPACE_NORMALMAP=!1,t.PARALLAX=!1,t.PARALLAXOCCLUSION=!1,t.NORMALXYSCALE=!0,t.LIGHTMAP=!1,t.LIGHTMAPDIRECTUV=0,t.USELIGHTMAPASSHADOWMAP=!1,t.GAMMALIGHTMAP=!1,t.RGBDLIGHTMAP=!1,t.REFLECTION=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.USESPHERICALFROMREFLECTIONMAP=!1,t.USEIRRADIANCEMAP=!1,t.SPHERICAL_HARMONICS=!1,t.USESPHERICALINVERTEX=!1,t.REFLECTIONMAP_OPPOSITEZ=!1,t.LODINREFLECTIONALPHA=!1,t.GAMMAREFLECTION=!1,t.RGBDREFLECTION=!1,t.LINEARSPECULARREFLECTION=!1,t.RADIANCEOCCLUSION=!1,t.HORIZONOCCLUSION=!1,t.INSTANCES=!1,t.THIN_INSTANCES=!1,t.PREPASS=!1,t.PREPASS_IRRADIANCE=!1,t.PREPASS_IRRADIANCE_INDEX=-1,t.PREPASS_ALBEDO=!1,t.PREPASS_ALBEDO_INDEX=-1,t.PREPASS_DEPTHNORMAL=!1,t.PREPASS_DEPTHNORMAL_INDEX=-1,t.PREPASS_POSITION=!1,t.PREPASS_POSITION_INDEX=-1,t.PREPASS_VELOCITY=!1,t.PREPASS_VELOCITY_INDEX=-1,t.PREPASS_REFLECTIVITY=!1,t.PREPASS_REFLECTIVITY_INDEX=-1,t.SCENE_MRT_COUNT=0,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.BONETEXTURE=!1,t.BONES_VELOCITY_ENABLED=!1,t.NONUNIFORMSCALING=!1,t.MORPHTARGETS=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_UV=!1,t.NUM_MORPH_INFLUENCERS=0,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.EXPOSURE=!1,t.MULTIVIEW=!1,t.USEPHYSICALLIGHTFALLOFF=!1,t.USEGLTFLIGHTFALLOFF=!1,t.TWOSIDEDLIGHTING=!1,t.SHADOWFLOAT=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.POINTSIZE=!1,t.FOG=!1,t.LOGARITHMICDEPTH=!1,t.FORCENORMALFORWARD=!1,t.SPECULARAA=!1,t.CLEARCOAT=!1,t.CLEARCOAT_DEFAULTIOR=!1,t.CLEARCOAT_TEXTURE=!1,t.CLEARCOAT_TEXTURE_ROUGHNESS=!1,t.CLEARCOAT_TEXTUREDIRECTUV=0,t.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV=0,t.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,t.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL=!1,t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_BUMPDIRECTUV=0,t.CLEARCOAT_REMAP_F0=!0,t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1,t.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,t.ANISOTROPIC=!1,t.ANISOTROPIC_TEXTURE=!1,t.ANISOTROPIC_TEXTUREDIRECTUV=0,t.BRDF_V_HEIGHT_CORRELATED=!1,t.MS_BRDF_ENERGY_CONSERVATION=!1,t.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=!1,t.SHEEN=!1,t.SHEEN_TEXTURE=!1,t.SHEEN_TEXTURE_ROUGHNESS=!1,t.SHEEN_TEXTUREDIRECTUV=0,t.SHEEN_TEXTURE_ROUGHNESSDIRECTUV=0,t.SHEEN_LINKWITHALBEDO=!1,t.SHEEN_ROUGHNESS=!1,t.SHEEN_ALBEDOSCALING=!1,t.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,t.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL=!1,t.SUBSURFACE=!1,t.SS_REFRACTION=!1,t.SS_TRANSLUCENCY=!1,t.SS_SCATTERING=!1,t.SS_THICKNESSANDMASK_TEXTURE=!1,t.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,t.SS_REFRACTIONMAP_3D=!1,t.SS_REFRACTIONMAP_OPPOSITEZ=!1,t.SS_LODINREFRACTIONALPHA=!1,t.SS_GAMMAREFRACTION=!1,t.SS_RGBDREFRACTION=!1,t.SS_LINEARSPECULARREFRACTION=!1,t.SS_LINKREFRACTIONTOTRANSPARENCY=!1,t.SS_ALBEDOFORREFRACTIONTINT=!1,t.SS_MASK_FROM_THICKNESS_TEXTURE=!1,t.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF=!1,t.UNLIT=!1,t.DEBUGMODE=0,t.rebuild(),t}return Object(h.d)(t,e),t.prototype.reset=function(){e.prototype.reset.call(this),this.ALPHATESTVALUE="0.5",this.PBR=!0},t}(Xr.a),_o=function(e){function t(i,n){var r=e.call(this,i,n)||this;return r._directIntensity=1,r._emissiveIntensity=1,r._environmentIntensity=1,r._specularIntensity=1,r._lightingInfos=new a.f(r._directIntensity,r._emissiveIntensity,r._environmentIntensity,r._specularIntensity),r._disableBumpMap=!1,r._albedoTexture=null,r._ambientTexture=null,r._ambientTextureStrength=1,r._ambientTextureImpactOnAnalyticalLights=t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,r._opacityTexture=null,r._reflectionTexture=null,r._emissiveTexture=null,r._reflectivityTexture=null,r._metallicTexture=null,r._metallic=null,r._roughness=null,r._metallicF0Factor=1,r._metallicReflectanceColor=s.a.White(),r._metallicReflectanceTexture=null,r._microSurfaceTexture=null,r._bumpTexture=null,r._lightmapTexture=null,r._ambientColor=new s.a(0,0,0),r._albedoColor=new s.a(1,1,1),r._reflectivityColor=new s.a(1,1,1),r._reflectionColor=new s.a(1,1,1),r._emissiveColor=new s.a(0,0,0),r._microSurface=.9,r._useLightmapAsShadowmap=!1,r._useHorizonOcclusion=!0,r._useRadianceOcclusion=!0,r._useAlphaFromAlbedoTexture=!1,r._useSpecularOverAlpha=!0,r._useMicroSurfaceFromReflectivityMapAlpha=!1,r._useRoughnessFromMetallicTextureAlpha=!0,r._useRoughnessFromMetallicTextureGreen=!1,r._useMetallnessFromMetallicTextureBlue=!1,r._useAmbientOcclusionFromMetallicTextureRed=!1,r._useAmbientInGrayScale=!1,r._useAutoMicroSurfaceFromReflectivityMap=!1,r._lightFalloff=t.LIGHTFALLOFF_PHYSICAL,r._useRadianceOverAlpha=!0,r._useObjectSpaceNormalMap=!1,r._useParallax=!1,r._useParallaxOcclusion=!1,r._parallaxScaleBias=.05,r._disableLighting=!1,r._maxSimultaneousLights=4,r._invertNormalMapX=!1,r._invertNormalMapY=!1,r._twoSidedLighting=!1,r._alphaCutOff=.4,r._forceAlphaTest=!1,r._useAlphaFresnel=!1,r._useLinearAlphaFresnel=!1,r._environmentBRDFTexture=null,r._forceIrradianceInFragment=!1,r._realTimeFiltering=!1,r._realTimeFilteringQuality=g.a.TEXTURE_FILTERING_QUALITY_LOW,r._forceNormalForward=!1,r._enableSpecularAntiAliasing=!1,r._imageProcessingObserver=null,r._renderTargets=new oi.a(16),r._globalAmbientColor=new s.a(0,0,0),r._useLogarithmicDepth=!1,r._unlit=!1,r._debugMode=0,r.debugMode=0,r.debugLimit=-1,r.debugFactor=1,r.clearCoat=new no(r._markAllSubMeshesAsTexturesDirty.bind(r)),r.anisotropy=new ro(r._markAllSubMeshesAsTexturesDirty.bind(r)),r.brdf=new oo(r._markAllSubMeshesAsMiscDirty.bind(r)),r.sheen=new ao(r._markAllSubMeshesAsTexturesDirty.bind(r)),r.detailMap=new ho.a(r._markAllSubMeshesAsTexturesDirty.bind(r)),r._rebuildInParallel=!1,r._attachImageProcessingConfiguration(null),r.getRenderTargetTextures=function(){return r._renderTargets.reset(),Kr.a.ReflectionTextureEnabled&&r._reflectionTexture&&r._reflectionTexture.isRenderTarget&&r._renderTargets.push(r._reflectionTexture),r.subSurface.fillRenderTargetTextures(r._renderTargets),r._renderTargets},r._environmentBRDFTexture=io.GetEnvironmentBRDFTexture(n),r.subSurface=new so(r._markAllSubMeshesAsTexturesDirty.bind(r),r._markScenePrePassDirty.bind(r),n),r.prePassConfiguration=new co.a,r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"realTimeFiltering",{get:function(){return this._realTimeFiltering},set:function(e){this._realTimeFiltering=e,this.markAsDirty(g.a.MATERIAL_TextureDirtyFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realTimeFilteringQuality",{get:function(){return this._realTimeFilteringQuality},set:function(e){this._realTimeFilteringQuality=e,this.markAsDirty(g.a.MATERIAL_TextureDirtyFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canRenderToMRT",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e){var t=this;e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(function(){t._markAllSubMeshesAsImageProcessingDirty()})))},Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!!(Kr.a.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget)||this.subSurface.hasRenderTargetTextures()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PBRBaseMaterial"},Object.defineProperty(t.prototype,"useLogarithmicDepth",{get:function(){return this._useLogarithmicDepth},set:function(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_disableAlphaBlending",{get:function(){return this.subSurface.disableAlphaBlending||this._transparencyMode===t.PBRMATERIAL_OPAQUE||this._transparencyMode===t.PBRMATERIAL_ALPHATEST},enumerable:!1,configurable:!0}),t.prototype.needAlphaBlending=function(){return!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromAlbedoTexture())},t.prototype.needAlphaTesting=function(){return!!this._forceAlphaTest||!this.subSurface.disableAlphaBlending&&this._hasAlphaChannel()&&(null==this._transparencyMode||this._transparencyMode===t.PBRMATERIAL_ALPHATEST)},t.prototype._shouldUseAlphaFromAlbedoTexture=function(){return null!=this._albedoTexture&&this._albedoTexture.hasAlpha&&this._useAlphaFromAlbedoTexture&&this._transparencyMode!==t.PBRMATERIAL_OPAQUE},t.prototype._hasAlphaChannel=function(){return null!=this._albedoTexture&&this._albedoTexture.hasAlpha||null!=this._opacityTexture},t.prototype.getAlphaTestTexture=function(){return this._albedoTexture},t.prototype.isReadyForSubMesh=function(e,t,i){if(t.effect&&this.isFrozen&&t.effect._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new po);var n=t._materialDefines;if(this._isReadyForSubMesh(t))return!0;var r=this.getScene(),o=r.getEngine();if(n._areTexturesDirty&&r.texturesEnabled){if(this._albedoTexture&&Kr.a.DiffuseTextureEnabled&&!this._albedoTexture.isReadyOrNotBlocking())return!1;if(this._ambientTexture&&Kr.a.AmbientTextureEnabled&&!this._ambientTexture.isReadyOrNotBlocking())return!1;if(this._opacityTexture&&Kr.a.OpacityTextureEnabled&&!this._opacityTexture.isReadyOrNotBlocking())return!1;var a=this._getReflectionTexture();if(a&&Kr.a.ReflectionTextureEnabled){if(!a.isReadyOrNotBlocking())return!1;if(a.irradianceTexture&&!a.irradianceTexture.isReadyOrNotBlocking())return!1}if(this._lightmapTexture&&Kr.a.LightmapTextureEnabled&&!this._lightmapTexture.isReadyOrNotBlocking())return!1;if(this._emissiveTexture&&Kr.a.EmissiveTextureEnabled&&!this._emissiveTexture.isReadyOrNotBlocking())return!1;if(Kr.a.SpecularTextureEnabled){if(this._metallicTexture){if(!this._metallicTexture.isReadyOrNotBlocking())return!1}else if(this._reflectivityTexture&&!this._reflectivityTexture.isReadyOrNotBlocking())return!1;if(this._metallicReflectanceTexture&&!this._metallicReflectanceTexture.isReadyOrNotBlocking())return!1;if(this._microSurfaceTexture&&!this._microSurfaceTexture.isReadyOrNotBlocking())return!1}if(o.getCaps().standardDerivatives&&this._bumpTexture&&Kr.a.BumpTextureEnabled&&!this._disableBumpMap&&!this._bumpTexture.isReady())return!1;if(this._environmentBRDFTexture&&Kr.a.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady())return!1}if(!(this.subSurface.isReadyForSubMesh(n,r)&&this.clearCoat.isReadyForSubMesh(n,r,o,this._disableBumpMap)&&this.sheen.isReadyForSubMesh(n,r)&&this.anisotropy.isReadyForSubMesh(n,r)&&this.detailMap.isReadyForSubMesh(n,r)))return!1;if(n._areImageProcessingDirty&&this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady())return!1;o.getCaps().standardDerivatives||e.isVerticesDataPresent(ji.b.NormalKind)||(e.createNormals(!0),m.a.Warn("PBRMaterial: Normals have been created for the mesh: "+e.name));var s=t.effect,c=n._areLightsDisposed,l=this._prepareEffect(e,n,this.onCompiled,this.onError,i,null,t.getRenderingMesh().hasThinInstances);if(l)if(this._onEffectCreatedObservable&&(fo.effect=l,fo.subMesh=t,this._onEffectCreatedObservable.notifyObservers(fo)),this.allowShaderHotSwapping&&s&&!l.isReady()){if(l=s,this._rebuildInParallel=!0,n.markAsUnprocessed(),c)return n._areLightsDisposed=!0,!1}else this._rebuildInParallel=!1,r.resetCachedMaterial(),t.setEffect(l,n),this.buildUniformLayout();return!(!t.effect||!t.effect.isReady()||(n._renderId=r.getRenderId(),t.effect._wasPreviouslyReady=!0,0))},t.prototype.isMetallicWorkflow=function(){return!(null==this._metallic&&null==this._roughness&&!this._metallicTexture)},t.prototype._prepareEffect=function(e,t,i,n,r,o,a){if(void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=null),this._prepareDefines(e,t,r,o,a),!t.isDirty)return null;t.markAsProcessed();var s=this.getScene().getEngine(),c=new Qr.a,l=0;t.USESPHERICALINVERTEX&&c.addFallback(l++,"USESPHERICALINVERTEX"),t.FOG&&c.addFallback(l,"FOG"),t.SPECULARAA&&c.addFallback(l,"SPECULARAA"),t.POINTSIZE&&c.addFallback(l,"POINTSIZE"),t.LOGARITHMICDEPTH&&c.addFallback(l,"LOGARITHMICDEPTH"),t.PARALLAX&&c.addFallback(l,"PARALLAX"),t.PARALLAXOCCLUSION&&c.addFallback(l++,"PARALLAXOCCLUSION"),l=ro.AddFallbacks(t,c,l),l=ro.AddFallbacks(t,c,l),l=so.AddFallbacks(t,c,l),l=ao.AddFallbacks(t,c,l),t.ENVIRONMENTBRDF&&c.addFallback(l++,"ENVIRONMENTBRDF"),t.TANGENT&&c.addFallback(l++,"TANGENT"),t.BUMP&&c.addFallback(l++,"BUMP"),l=Hr.a.HandleFallbacksForShadows(t,c,this._maxSimultaneousLights,l++),t.SPECULARTERM&&c.addFallback(l++,"SPECULARTERM"),t.USESPHERICALFROMREFLECTIONMAP&&c.addFallback(l++,"USESPHERICALFROMREFLECTIONMAP"),t.USEIRRADIANCEMAP&&c.addFallback(l++,"USEIRRADIANCEMAP"),t.LIGHTMAP&&c.addFallback(l++,"LIGHTMAP"),t.NORMAL&&c.addFallback(l++,"NORMAL"),t.AMBIENT&&c.addFallback(l++,"AMBIENT"),t.EMISSIVE&&c.addFallback(l++,"EMISSIVE"),t.VERTEXCOLOR&&c.addFallback(l++,"VERTEXCOLOR"),t.MORPHTARGETS&&c.addFallback(l++,"MORPHTARGETS"),t.MULTIVIEW&&c.addFallback(0,"MULTIVIEW");var u=[ji.b.PositionKind];t.NORMAL&&u.push(ji.b.NormalKind),t.TANGENT&&u.push(ji.b.TangentKind),t.UV1&&u.push(ji.b.UVKind),t.UV2&&u.push(ji.b.UV2Kind),t.VERTEXCOLOR&&u.push(ji.b.ColorKind),Hr.a.PrepareAttributesForBones(u,e,t,c),Hr.a.PrepareAttributesForInstances(u,t),Hr.a.PrepareAttributesForMorphTargets(u,e,t);var h="pbr",d=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vAlbedoColor","vReflectivityColor","vMetallicReflectanceFactors","vEmissiveColor","visibility","vReflectionColor","vFogInfos","vFogColor","pointSize","vAlbedoInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vReflectionPosition","vReflectionSize","vEmissiveInfos","vReflectivityInfos","vReflectionFilteringInfo","vMetallicReflectanceInfos","vMicroSurfaceSamplerInfos","vBumpInfos","vLightmapInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","albedoMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","metallicReflectanceMatrix","vLightingIntensity","logarithmicDepthConstant","vSphericalX","vSphericalY","vSphericalZ","vSphericalXX_ZZ","vSphericalYY_ZZ","vSphericalZZ","vSphericalXY","vSphericalYZ","vSphericalZX","vSphericalL00","vSphericalL1_1","vSphericalL10","vSphericalL11","vSphericalL2_2","vSphericalL2_1","vSphericalL20","vSphericalL21","vSphericalL22","vReflectionMicrosurfaceInfos","vTangentSpaceParams","boneTextureWidth","vDebugMode"],f=["albedoSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","irradianceSampler","microSurfaceSampler","environmentBrdfSampler","boneSampler","metallicReflectanceSampler"],p=["Material","Scene"];ho.a.AddUniforms(d),ho.a.AddSamplers(f),so.AddUniforms(d),so.AddSamplers(f),no.AddUniforms(d),no.AddSamplers(f),ro.AddUniforms(d),ro.AddSamplers(f),ao.AddUniforms(d),ao.AddSamplers(f),co.a.AddUniforms(d),co.a.AddSamplers(d),Bi.a&&(Bi.a.PrepareUniforms(d,t),Bi.a.PrepareSamplers(f,t)),Hr.a.PrepareUniformsAndSamplersList({uniformsNames:d,uniformBuffersNames:p,samplers:f,defines:t,maxSimultaneousLights:this._maxSimultaneousLights});var _={};this.customShaderNameResolve&&(h=this.customShaderNameResolve(h,d,p,f,t,u,_));var m=t.toString();return s.createEffect(h,{attributes:u,uniformsNames:d,uniformBuffersNames:p,samplers:f,defines:m,fallbacks:c,onCompiled:i,onError:n,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:t.NUM_MORPH_INFLUENCERS},processFinalCode:_.processFinalCode,multiTarget:t.PREPASS},s)},t.prototype._prepareDefines=function(e,i,n,r,o){void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=!1);var a=this.getScene(),s=a.getEngine();if(Hr.a.PrepareDefinesForLights(a,e,i,!0,this._maxSimultaneousLights,this._disableLighting),i._needNormals=!0,Hr.a.PrepareDefinesForMultiview(a,i),Hr.a.PrepareDefinesForPrePass(a,i,this.canRenderToMRT),i.METALLICWORKFLOW=this.isMetallicWorkflow(),i._areTexturesDirty){if(i._needUVs=!1,a.texturesEnabled){a.getEngine().getCaps().textureLOD&&(i.LODBASEDMICROSFURACE=!0),this._albedoTexture&&Kr.a.DiffuseTextureEnabled?(Hr.a.PrepareDefinesForMergedUV(this._albedoTexture,i,"ALBEDO"),i.GAMMAALBEDO=this._albedoTexture.gammaSpace):i.ALBEDO=!1,this._ambientTexture&&Kr.a.AmbientTextureEnabled?(Hr.a.PrepareDefinesForMergedUV(this._ambientTexture,i,"AMBIENT"),i.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):i.AMBIENT=!1,this._opacityTexture&&Kr.a.OpacityTextureEnabled?(Hr.a.PrepareDefinesForMergedUV(this._opacityTexture,i,"OPACITY"),i.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):i.OPACITY=!1;var c=this._getReflectionTexture();if(c&&Kr.a.ReflectionTextureEnabled){switch(i.REFLECTION=!0,i.GAMMAREFLECTION=c.gammaSpace,i.RGBDREFLECTION=c.isRGBD,i.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!c.invertZ:c.invertZ,i.LODINREFLECTIONALPHA=c.lodLevelInAlpha,i.LINEARSPECULARREFLECTION=c.linearSpecularLOD,this.realTimeFiltering&&this.realTimeFilteringQuality>0?(i.NUM_SAMPLES=""+this.realTimeFilteringQuality,s.webGLVersion>1&&(i.NUM_SAMPLES=i.NUM_SAMPLES+"u"),i.REALTIME_FILTERING=!0):i.REALTIME_FILTERING=!1,c.coordinatesMode===Ke.a.INVCUBIC_MODE&&(i.INVERTCUBICMAP=!0),i.REFLECTIONMAP_3D=c.isCube,i.REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,c.coordinatesMode){case Ke.a.EXPLICIT_MODE:i.REFLECTIONMAP_EXPLICIT=!0;break;case Ke.a.PLANAR_MODE:i.REFLECTIONMAP_PLANAR=!0;break;case Ke.a.PROJECTION_MODE:i.REFLECTIONMAP_PROJECTION=!0;break;case Ke.a.SKYBOX_MODE:i.REFLECTIONMAP_SKYBOX=!0;break;case Ke.a.SPHERICAL_MODE:i.REFLECTIONMAP_SPHERICAL=!0;break;case Ke.a.EQUIRECTANGULAR_MODE:i.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case Ke.a.FIXED_EQUIRECTANGULAR_MODE:i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case Ke.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case Ke.a.CUBIC_MODE:case Ke.a.INVCUBIC_MODE:default:i.REFLECTIONMAP_CUBIC=!0,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!!c.boundingBoxSize}c.coordinatesMode!==Ke.a.SKYBOX_MODE&&(c.irradianceTexture?(i.USEIRRADIANCEMAP=!0,i.USESPHERICALFROMREFLECTIONMAP=!1):c.isCube&&(i.USESPHERICALFROMREFLECTIONMAP=!0,i.USEIRRADIANCEMAP=!1,this._forceIrradianceInFragment||this.realTimeFiltering||a.getEngine().getCaps().maxVaryingVectors<=8?i.USESPHERICALINVERTEX=!1:i.USESPHERICALINVERTEX=!0))}else i.REFLECTION=!1,i.REFLECTIONMAP_3D=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_CUBIC=!1,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,i.INVERTCUBICMAP=!1,i.USESPHERICALFROMREFLECTIONMAP=!1,i.USEIRRADIANCEMAP=!1,i.USESPHERICALINVERTEX=!1,i.REFLECTIONMAP_OPPOSITEZ=!1,i.LODINREFLECTIONALPHA=!1,i.GAMMAREFLECTION=!1,i.RGBDREFLECTION=!1,i.LINEARSPECULARREFLECTION=!1;this._lightmapTexture&&Kr.a.LightmapTextureEnabled?(Hr.a.PrepareDefinesForMergedUV(this._lightmapTexture,i,"LIGHTMAP"),i.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,i.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace,i.RGBDLIGHTMAP=this._lightmapTexture.isRGBD):i.LIGHTMAP=!1,this._emissiveTexture&&Kr.a.EmissiveTextureEnabled?Hr.a.PrepareDefinesForMergedUV(this._emissiveTexture,i,"EMISSIVE"):i.EMISSIVE=!1,Kr.a.SpecularTextureEnabled?(this._metallicTexture?(Hr.a.PrepareDefinesForMergedUV(this._metallicTexture,i,"REFLECTIVITY"),i.ROUGHNESSSTOREINMETALMAPALPHA=this._useRoughnessFromMetallicTextureAlpha,i.ROUGHNESSSTOREINMETALMAPGREEN=!this._useRoughnessFromMetallicTextureAlpha&&this._useRoughnessFromMetallicTextureGreen,i.METALLNESSSTOREINMETALMAPBLUE=this._useMetallnessFromMetallicTextureBlue,i.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed):this._reflectivityTexture?(Hr.a.PrepareDefinesForMergedUV(this._reflectivityTexture,i,"REFLECTIVITY"),i.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,i.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap):i.REFLECTIVITY=!1,this._metallicReflectanceTexture?Hr.a.PrepareDefinesForMergedUV(this._metallicReflectanceTexture,i,"METALLIC_REFLECTANCE"):i.METALLIC_REFLECTANCE=!1,this._microSurfaceTexture?Hr.a.PrepareDefinesForMergedUV(this._microSurfaceTexture,i,"MICROSURFACEMAP"):i.MICROSURFACEMAP=!1):(i.REFLECTIVITY=!1,i.MICROSURFACEMAP=!1),a.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&Kr.a.BumpTextureEnabled&&!this._disableBumpMap?(Hr.a.PrepareDefinesForMergedUV(this._bumpTexture,i,"BUMP"),this._useParallax&&this._albedoTexture&&Kr.a.DiffuseTextureEnabled?(i.PARALLAX=!0,i.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):i.PARALLAX=!1,i.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):i.BUMP=!1,this._environmentBRDFTexture&&Kr.a.ReflectionTextureEnabled?(i.ENVIRONMENTBRDF=!0,i.ENVIRONMENTBRDF_RGBD=this._environmentBRDFTexture.isRGBD):(i.ENVIRONMENTBRDF=!1,i.ENVIRONMENTBRDF_RGBD=!1),this._shouldUseAlphaFromAlbedoTexture()?i.ALPHAFROMALBEDO=!0:i.ALPHAFROMALBEDO=!1}i.SPECULAROVERALPHA=this._useSpecularOverAlpha,this._lightFalloff===t.LIGHTFALLOFF_STANDARD?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===t.LIGHTFALLOFF_GLTF?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!0):(i.USEPHYSICALLIGHTFALLOFF=!0,i.USEGLTFLIGHTFALLOFF=!1),i.RADIANCEOVERALPHA=this._useRadianceOverAlpha,!this.backFaceCulling&&this._twoSidedLighting?i.TWOSIDEDLIGHTING=!0:i.TWOSIDEDLIGHTING=!1,i.SPECULARAA=a.getEngine().getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}(i._areTexturesDirty||i._areMiscDirty)&&(i.ALPHATESTVALUE=this._alphaCutOff+(this._alphaCutOff%1==0?".":""),i.PREMULTIPLYALPHA=this.alphaMode===g.a.ALPHA_PREMULTIPLIED||this.alphaMode===g.a.ALPHA_PREMULTIPLIED_PORTERDUFF,i.ALPHABLEND=this.needAlphaBlendingForMesh(e),i.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,i.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel),i._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(i),i.FORCENORMALFORWARD=this._forceNormalForward,i.RADIANCEOCCLUSION=this._useRadianceOcclusion,i.HORIZONOCCLUSION=this._useHorizonOcclusion,i._areMiscDirty&&(Hr.a.PrepareDefinesForMisc(e,a,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,i),i.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!e.isVerticesDataPresent(ji.b.NormalKind),i.DEBUGMODE=this._debugMode),this.detailMap.prepareDefines(i,a),this.subSurface.prepareDefines(i,a),this.clearCoat.prepareDefines(i,a),this.anisotropy.prepareDefines(i,e,a),this.brdf.prepareDefines(i),this.sheen.prepareDefines(i,a),Hr.a.PrepareDefinesForFrameBoundValues(a,s,i,!!n,r,o),Hr.a.PrepareDefinesForAttributes(e,i,!0,!0,!0,this._transparencyMode!==t.PBRMATERIAL_OPAQUE)},t.prototype.forceCompilation=function(e,t,i){var n=this,r=Object(h.a)({clipPlane:!1,useInstances:!1},i),o=new po,a=this._prepareEffect(e,o,void 0,void 0,r.useInstances,r.clipPlane,e.hasThinInstances);this._onEffectCreatedObservable&&(fo.effect=a,fo.subMesh=null,this._onEffectCreatedObservable.notifyObservers(fo)),a.isReady()?t&&t(this):a.onCompileObservable.add(function(){t&&t(n)})},t.prototype.buildUniformLayout=function(){var e=this._uniformBuffer;e.addUniform("vAlbedoInfos",2),e.addUniform("vAmbientInfos",4),e.addUniform("vOpacityInfos",2),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vReflectivityInfos",3),e.addUniform("vMicroSurfaceSamplerInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionFilteringInfo",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vBumpInfos",3),e.addUniform("albedoMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("reflectivityMatrix",16),e.addUniform("microSurfaceSamplerMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("reflectionMatrix",16),e.addUniform("vReflectionColor",3),e.addUniform("vAlbedoColor",4),e.addUniform("vLightingIntensity",4),e.addUniform("vReflectionMicrosurfaceInfos",3),e.addUniform("pointSize",1),e.addUniform("vReflectivityColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("visibility",1),e.addUniform("vMetallicReflectanceFactors",4),e.addUniform("vMetallicReflectanceInfos",2),e.addUniform("metallicReflectanceMatrix",16),no.PrepareUniformBuffer(e),ro.PrepareUniformBuffer(e),ao.PrepareUniformBuffer(e),so.PrepareUniformBuffer(e),ho.a.PrepareUniformBuffer(e),e.create()},t.prototype.unbind=function(){if(this._activeEffect){var t=!1;this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&(this._activeEffect.setTexture("reflection2DSampler",null),t=!0),this.subSurface.unbind(this._activeEffect)&&(t=!0),t&&this._markAllSubMeshesAsTexturesDirty()}e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,t,i){var n=this.getScene(),r=i._materialDefines;if(r){var o=i.effect;if(o){this._activeEffect=o,r.INSTANCES&&!r.THIN_INSTANCES||this.bindOnlyWorldMatrix(e),this.prePassConfiguration.bindForSubMesh(this._activeEffect,n,t,e,this.isFrozen),r.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var a=this._mustRebind(n,o,t.visibility);Hr.a.BindBonesParameters(t,this._activeEffect,this.prePassConfiguration);var c=null,l=this._uniformBuffer;if(a){var u=n.getEngine();if(l.bindToEffect(o,"Material"),this.bindViewProjection(o),c=this._getReflectionTexture(),!l.useUbo||!this.isFrozen||!l.isSync){if(n.texturesEnabled){if(this._albedoTexture&&Kr.a.DiffuseTextureEnabled&&(l.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),Hr.a.BindTextureMatrix(this._albedoTexture,l,"albedo")),this._ambientTexture&&Kr.a.AmbientTextureEnabled&&(l.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),Hr.a.BindTextureMatrix(this._ambientTexture,l,"ambient")),this._opacityTexture&&Kr.a.OpacityTextureEnabled&&(l.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),Hr.a.BindTextureMatrix(this._opacityTexture,l,"opacity")),c&&Kr.a.ReflectionTextureEnabled){if(l.updateMatrix("reflectionMatrix",c.getReflectionTextureMatrix()),l.updateFloat2("vReflectionInfos",c.level,0),c.boundingBoxSize){var h=c;l.updateVector3("vReflectionPosition",h.boundingBoxPosition),l.updateVector3("vReflectionSize",h.boundingBoxSize)}if(this.realTimeFiltering){var d=c.getSize().width;l.updateFloat2("vReflectionFilteringInfo",d,L.a.Log2(d))}if(!r.USEIRRADIANCEMAP){var f=c.sphericalPolynomial;if(r.USESPHERICALFROMREFLECTIONMAP&&f)if(r.SPHERICAL_HARMONICS){var p=f.preScaledHarmonics;this._activeEffect.setVector3("vSphericalL00",p.l00),this._activeEffect.setVector3("vSphericalL1_1",p.l1_1),this._activeEffect.setVector3("vSphericalL10",p.l10),this._activeEffect.setVector3("vSphericalL11",p.l11),this._activeEffect.setVector3("vSphericalL2_2",p.l2_2),this._activeEffect.setVector3("vSphericalL2_1",p.l2_1),this._activeEffect.setVector3("vSphericalL20",p.l20),this._activeEffect.setVector3("vSphericalL21",p.l21),this._activeEffect.setVector3("vSphericalL22",p.l22)}else this._activeEffect.setFloat3("vSphericalX",f.x.x,f.x.y,f.x.z),this._activeEffect.setFloat3("vSphericalY",f.y.x,f.y.y,f.y.z),this._activeEffect.setFloat3("vSphericalZ",f.z.x,f.z.y,f.z.z),this._activeEffect.setFloat3("vSphericalXX_ZZ",f.xx.x-f.zz.x,f.xx.y-f.zz.y,f.xx.z-f.zz.z),this._activeEffect.setFloat3("vSphericalYY_ZZ",f.yy.x-f.zz.x,f.yy.y-f.zz.y,f.yy.z-f.zz.z),this._activeEffect.setFloat3("vSphericalZZ",f.zz.x,f.zz.y,f.zz.z),this._activeEffect.setFloat3("vSphericalXY",f.xy.x,f.xy.y,f.xy.z),this._activeEffect.setFloat3("vSphericalYZ",f.yz.x,f.yz.y,f.yz.z),this._activeEffect.setFloat3("vSphericalZX",f.zx.x,f.zx.y,f.zx.z)}l.updateFloat3("vReflectionMicrosurfaceInfos",c.getSize().width,c.lodGenerationScale,c.lodGenerationOffset)}this._emissiveTexture&&Kr.a.EmissiveTextureEnabled&&(l.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),Hr.a.BindTextureMatrix(this._emissiveTexture,l,"emissive")),this._lightmapTexture&&Kr.a.LightmapTextureEnabled&&(l.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),Hr.a.BindTextureMatrix(this._lightmapTexture,l,"lightmap")),Kr.a.SpecularTextureEnabled&&(this._metallicTexture?(l.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),Hr.a.BindTextureMatrix(this._metallicTexture,l,"reflectivity")):this._reflectivityTexture&&(l.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),Hr.a.BindTextureMatrix(this._reflectivityTexture,l,"reflectivity")),this._metallicReflectanceTexture&&(l.updateFloat2("vMetallicReflectanceInfos",this._metallicReflectanceTexture.coordinatesIndex,this._metallicReflectanceTexture.level),Hr.a.BindTextureMatrix(this._metallicReflectanceTexture,l,"metallicReflectance")),this._microSurfaceTexture&&(l.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),Hr.a.BindTextureMatrix(this._microSurfaceTexture,l,"microSurfaceSampler"))),this._bumpTexture&&u.getCaps().standardDerivatives&&Kr.a.BumpTextureEnabled&&!this._disableBumpMap&&(l.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),Hr.a.BindTextureMatrix(this._bumpTexture,l,"bump"),n._mirroredCameraPosition?l.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):l.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1))}if(this.pointsCloud&&l.updateFloat("pointSize",this.pointSize),r.METALLICWORKFLOW){s.c.Color3[0].r=void 0===this._metallic||null===this._metallic?1:this._metallic,s.c.Color3[0].g=void 0===this._roughness||null===this._roughness?1:this._roughness,l.updateColor4("vReflectivityColor",s.c.Color3[0],1);var _=this.subSurface.indexOfRefraction,m=Math.pow((_-1)/(_+1),2);this._metallicReflectanceColor.scaleToRef(m*this._metallicF0Factor,s.c.Color3[0]);var g=this._metallicF0Factor;l.updateColor4("vMetallicReflectanceFactors",s.c.Color3[0],g)}else l.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface);l.updateColor3("vEmissiveColor",Kr.a.EmissiveTextureEnabled?this._emissiveColor:s.a.BlackReadOnly),l.updateColor3("vReflectionColor",this._reflectionColor),!r.SS_REFRACTION&&this.subSurface.linkRefractionWithTransparency?l.updateColor4("vAlbedoColor",this._albedoColor,1):l.updateColor4("vAlbedoColor",this._albedoColor,this.alpha),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity*n.environmentIntensity,this._lightingInfos.w=this._specularIntensity,l.updateVector4("vLightingIntensity",this._lightingInfos)}l.updateFloat("visibility",t.visibility),n.texturesEnabled&&(this._albedoTexture&&Kr.a.DiffuseTextureEnabled&&l.setTexture("albedoSampler",this._albedoTexture),this._ambientTexture&&Kr.a.AmbientTextureEnabled&&l.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&Kr.a.OpacityTextureEnabled&&l.setTexture("opacitySampler",this._opacityTexture),c&&Kr.a.ReflectionTextureEnabled&&(r.LODBASEDMICROSFURACE?l.setTexture("reflectionSampler",c):(l.setTexture("reflectionSampler",c._lodTextureMid||c),l.setTexture("reflectionSamplerLow",c._lodTextureLow||c),l.setTexture("reflectionSamplerHigh",c._lodTextureHigh||c)),r.USEIRRADIANCEMAP&&l.setTexture("irradianceSampler",c.irradianceTexture)),r.ENVIRONMENTBRDF&&l.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),this._emissiveTexture&&Kr.a.EmissiveTextureEnabled&&l.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&Kr.a.LightmapTextureEnabled&&l.setTexture("lightmapSampler",this._lightmapTexture),Kr.a.SpecularTextureEnabled&&(this._metallicTexture?l.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&l.setTexture("reflectivitySampler",this._reflectivityTexture),this._metallicReflectanceTexture&&l.setTexture("metallicReflectanceSampler",this._metallicReflectanceTexture),this._microSurfaceTexture&&l.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&u.getCaps().standardDerivatives&&Kr.a.BumpTextureEnabled&&!this._disableBumpMap&&l.setTexture("bumpSampler",this._bumpTexture)),this.detailMap.bindForSubMesh(l,n,this.isFrozen),this.subSurface.bindForSubMesh(l,n,u,this.isFrozen,r.LODBASEDMICROSFURACE,this.realTimeFiltering),this.clearCoat.bindForSubMesh(l,n,u,this._disableBumpMap,this.isFrozen,this._invertNormalMapX,this._invertNormalMapY,i),this.anisotropy.bindForSubMesh(l,n,this.isFrozen),this.sheen.bindForSubMesh(l,n,this.isFrozen,i),Hr.a.BindClipPlane(this._activeEffect,n),n.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor);var v=n._forcedViewPosition?n._forcedViewPosition:n._mirroredCameraPosition?n._mirroredCameraPosition:n.activeCamera.globalPosition,b=n.useRightHandedSystem===(null!=n._mirroredCameraPosition);o.setFloat4("vEyePosition",v.x,v.y,v.z,b?-1:1),o.setColor3("vAmbientColor",this._globalAmbientColor),o.setFloat2("vDebugMode",this.debugLimit,this.debugFactor)}!a&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&Hr.a.BindLights(n,t,this._activeEffect,r,this._maxSimultaneousLights,this._rebuildInParallel),(n.fogEnabled&&t.applyFog&&n.fogMode!==Q.a.FOGMODE_NONE||c)&&this.bindView(o),Hr.a.BindFogParameters(n,t,this._activeEffect,!0),r.NUM_MORPH_INFLUENCERS&&Hr.a.BindMorphTargetParameters(t,this._activeEffect),this._imageProcessingConfiguration.bind(this._activeEffect),Hr.a.BindLogDepth(r,this._activeEffect,n)),l.update(),this._afterBind(t,this._activeEffect)}}},t.prototype.getAnimatables=function(){var e=[];return this._albedoTexture&&this._albedoTexture.animations&&this._albedoTexture.animations.length>0&&e.push(this._albedoTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._metallicTexture&&this._metallicTexture.animations&&this._metallicTexture.animations.length>0?e.push(this._metallicTexture):this._reflectivityTexture&&this._reflectivityTexture.animations&&this._reflectivityTexture.animations.length>0&&e.push(this._reflectivityTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this.detailMap.getAnimatables(e),this.subSurface.getAnimatables(e),this.clearCoat.getAnimatables(e),this.sheen.getAnimatables(e),this.anisotropy.getAnimatables(e),e},t.prototype._getReflectionTexture=function(){return this._reflectionTexture?this._reflectionTexture:this.getScene().environmentTexture},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._albedoTexture&&t.push(this._albedoTexture),this._ambientTexture&&t.push(this._ambientTexture),this._opacityTexture&&t.push(this._opacityTexture),this._reflectionTexture&&t.push(this._reflectionTexture),this._emissiveTexture&&t.push(this._emissiveTexture),this._reflectivityTexture&&t.push(this._reflectivityTexture),this._metallicTexture&&t.push(this._metallicTexture),this._metallicReflectanceTexture&&t.push(this._metallicReflectanceTexture),this._microSurfaceTexture&&t.push(this._microSurfaceTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this.detailMap.getActiveTextures(t),this.subSurface.getActiveTextures(t),this.clearCoat.getActiveTextures(t),this.sheen.getActiveTextures(t),this.anisotropy.getActiveTextures(t),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._albedoTexture===t||this._ambientTexture===t||this._opacityTexture===t||this._reflectionTexture===t||this._reflectivityTexture===t||this._metallicTexture===t||this._metallicReflectanceTexture===t||this._microSurfaceTexture===t||this._bumpTexture===t||this._lightmapTexture===t||this.detailMap.hasTexture(t)||this.subSurface.hasTexture(t)||this.clearCoat.hasTexture(t)||this.sheen.hasTexture(t)||this.anisotropy.hasTexture(t)},t.prototype.setPrePassRenderer=function(e){if(this.subSurface.isScatteringEnabled){var t=this.getScene().enableSubSurfaceForPrePass();return t&&(t.enabled=!0),!0}return!1},t.prototype.dispose=function(t,i){var n,r,o,a,s,c,l,u,h,d,f;i&&(this._environmentBRDFTexture&&this.getScene().environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),null===(n=this._albedoTexture)||void 0===n||n.dispose(),null===(r=this._ambientTexture)||void 0===r||r.dispose(),null===(o=this._opacityTexture)||void 0===o||o.dispose(),null===(a=this._reflectionTexture)||void 0===a||a.dispose(),null===(s=this._emissiveTexture)||void 0===s||s.dispose(),null===(c=this._metallicTexture)||void 0===c||c.dispose(),null===(l=this._reflectivityTexture)||void 0===l||l.dispose(),null===(u=this._bumpTexture)||void 0===u||u.dispose(),null===(h=this._lightmapTexture)||void 0===h||h.dispose(),null===(d=this._metallicReflectanceTexture)||void 0===d||d.dispose(),null===(f=this._microSurfaceTexture)||void 0===f||f.dispose()),this.detailMap.dispose(i),this.subSurface.dispose(i),this.clearCoat.dispose(i),this.sheen.dispose(i),this.anisotropy.dispose(i),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t,i)},t.PBRMATERIAL_OPAQUE=lo.a.MATERIAL_OPAQUE,t.PBRMATERIAL_ALPHATEST=lo.a.MATERIAL_ALPHATEST,t.PBRMATERIAL_ALPHABLEND=lo.a.MATERIAL_ALPHABLEND,t.PBRMATERIAL_ALPHATESTANDBLEND=lo.a.MATERIAL_ALPHATESTANDBLEND,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=0,t.LIGHTFALLOFF_PHYSICAL=0,t.LIGHTFALLOFF_GLTF=1,t.LIGHTFALLOFF_STANDARD=2,Object(h.c)([Object(w.i)()],t.prototype,"_imageProcessingConfiguration",void 0),Object(h.c)([Object(w.b)("_markAllSubMeshesAsMiscDirty")],t.prototype,"debugMode",void 0),Object(h.c)([Object(w.c)()],t.prototype,"useLogarithmicDepth",null),t}(Yr.a),mo=function(e){function t(i,n){var r=e.call(this,i,n)||this;return r.directIntensity=1,r.emissiveIntensity=1,r.environmentIntensity=1,r.specularIntensity=1,r.disableBumpMap=!1,r.ambientTextureStrength=1,r.ambientTextureImpactOnAnalyticalLights=t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,r.metallicF0Factor=1,r.metallicReflectanceColor=s.a.White(),r.ambientColor=new s.a(0,0,0),r.albedoColor=new s.a(1,1,1),r.reflectivityColor=new s.a(1,1,1),r.reflectionColor=new s.a(1,1,1),r.emissiveColor=new s.a(0,0,0),r.microSurface=1,r.useLightmapAsShadowmap=!1,r.useAlphaFromAlbedoTexture=!1,r.forceAlphaTest=!1,r.alphaCutOff=.4,r.useSpecularOverAlpha=!0,r.useMicroSurfaceFromReflectivityMapAlpha=!1,r.useRoughnessFromMetallicTextureAlpha=!0,r.useRoughnessFromMetallicTextureGreen=!1,r.useMetallnessFromMetallicTextureBlue=!1,r.useAmbientOcclusionFromMetallicTextureRed=!1,r.useAmbientInGrayScale=!1,r.useAutoMicroSurfaceFromReflectivityMap=!1,r.useRadianceOverAlpha=!0,r.useObjectSpaceNormalMap=!1,r.useParallax=!1,r.useParallaxOcclusion=!1,r.parallaxScaleBias=.05,r.disableLighting=!1,r.forceIrradianceInFragment=!1,r.maxSimultaneousLights=4,r.invertNormalMapX=!1,r.invertNormalMapY=!1,r.twoSidedLighting=!1,r.useAlphaFresnel=!1,r.useLinearAlphaFresnel=!1,r.environmentBRDFTexture=null,r.forceNormalForward=!1,r.enableSpecularAntiAliasing=!1,r.useHorizonOcclusion=!0,r.useRadianceOcclusion=!0,r.unlit=!1,r._environmentBRDFTexture=io.GetEnvironmentBRDFTexture(n),r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"refractionTexture",{get:function(){return this.subSurface.refractionTexture},set:function(e){this.subSurface.refractionTexture=e,e?this.subSurface.isRefractionEnabled=!0:this.subSurface.linkRefractionWithTransparency||(this.subSurface.isRefractionEnabled=!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"indexOfRefraction",{get:function(){return this.subSurface.indexOfRefraction},set:function(e){this.subSurface.indexOfRefraction=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"invertRefractionY",{get:function(){return this.subSurface.invertRefractionY},set:function(e){this.subSurface.invertRefractionY=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkRefractionWithTransparency",{get:function(){return this.subSurface.linkRefractionWithTransparency},set:function(e){this.subSurface.linkRefractionWithTransparency=e,e&&(this.subSurface.isRefractionEnabled=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"usePhysicalLightFalloff",{get:function(){return this._lightFalloff===_o.LIGHTFALLOFF_PHYSICAL},set:function(e){e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?_o.LIGHTFALLOFF_PHYSICAL:_o.LIGHTFALLOFF_STANDARD)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useGLTFLightFalloff",{get:function(){return this._lightFalloff===_o.LIGHTFALLOFF_GLTF},set:function(e){e!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?_o.LIGHTFALLOFF_GLTF:_o.LIGHTFALLOFF_STANDARD)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this._imageProcessingConfiguration.colorGradingTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this._imageProcessingConfiguration.colorCurves},set:function(e){this._imageProcessingConfiguration.colorCurves=e},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PBRMaterial"},t.prototype.clone=function(e){var i=this,n=w.a.Clone(function(){return new t(e,i.getScene())},this);return n.id=e,n.name=e,this.clearCoat.copyTo(n.clearCoat),this.anisotropy.copyTo(n.anisotropy),this.brdf.copyTo(n.brdf),this.sheen.copyTo(n.sheen),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON.PBRMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,i,n){var r=w.a.Parse(function(){return new t(e.name,i)},e,i,n);return e.clearCoat&&r.clearCoat.parse(e.clearCoat,i,n),e.anisotropy&&r.anisotropy.parse(e.anisotropy,i,n),e.brdf&&r.brdf.parse(e.brdf,i,n),e.sheen&&r.sheen.parse(e.sheen,i,n),e.subSurface&&r.subSurface.parse(e.subSurface,i,n),r},t.PBRMATERIAL_OPAQUE=_o.PBRMATERIAL_OPAQUE,t.PBRMATERIAL_ALPHATEST=_o.PBRMATERIAL_ALPHATEST,t.PBRMATERIAL_ALPHABLEND=_o.PBRMATERIAL_ALPHABLEND,t.PBRMATERIAL_ALPHATESTANDBLEND=_o.PBRMATERIAL_ALPHATESTANDBLEND,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=_o.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"directIntensity",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveIntensity",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentIntensity",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularIntensity",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"disableBumpMap",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureStrength",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureImpactOnAnalyticalLights",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicF0Factor",void 0),Object(h.c)([Object(w.e)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicReflectanceColor",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicReflectanceTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurfaceTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),Object(h.c)([Object(w.e)("ambient"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientColor",void 0),Object(h.c)([Object(w.e)("albedo"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoColor",void 0),Object(h.c)([Object(w.e)("reflectivity"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityColor",void 0),Object(h.c)([Object(w.e)("reflection"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionColor",void 0),Object(h.c)([Object(w.e)("emissive"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurface",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"useAlphaFromAlbedoTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"forceAlphaTest",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"alphaCutOff",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureGreen",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMetallnessFromMetallicTextureBlue",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientInGrayScale",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0),Object(h.c)([Object(w.c)()],t.prototype,"usePhysicalLightFalloff",null),Object(h.c)([Object(w.c)()],t.prototype,"useGLTFLightFalloff",null),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOverAlpha",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"parallaxScaleBias",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceIrradianceInFragment",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFresnel",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLinearAlphaFresnel",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentBRDFTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceNormalForward",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableSpecularAntiAliasing",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useHorizonOcclusion",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOcclusion",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsMiscDirty")],t.prototype,"unlit",void 0),t}(_o);function go(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}c.a.RegisteredTypes["BABYLON.PBRMaterial"]=mo;var vo=go("DXT1"),bo=go("DXT3"),yo=go("DXT5"),To=go("DX10"),Eo=function(){function e(){}return e.GetDDSInfo=function(e){var t=new Int32Array(e.buffer,e.byteOffset,31),i=new Int32Array(e.buffer,e.byteOffset,35),n=1;131072&t[2]&&(n=Math.max(1,t[7]));var r=t[21],o=r===To?i[32]:0,a=g.a.TEXTURETYPE_UNSIGNED_INT;switch(r){case 113:a=g.a.TEXTURETYPE_HALF_FLOAT;break;case 116:a=g.a.TEXTURETYPE_FLOAT;break;case To:if(10===o){a=g.a.TEXTURETYPE_HALF_FLOAT;break}if(2===o){a=g.a.TEXTURETYPE_FLOAT;break}}return{width:t[4],height:t[3],mipmapCount:n,isFourCC:4==(4&t[20]),isRGB:64==(64&t[20]),isLuminance:131072==(131072&t[20]),isCube:512==(512&t[28]),isCompressed:r===vo||r===bo||r===yo,dxgiFormat:o,textureType:a}},e._ToHalfFloat=function(t){e._FloatView||(e._FloatView=new Float32Array(1),e._Int32View=new Int32Array(e._FloatView.buffer)),e._FloatView[0]=t;var i=e._Int32View[0],n=i>>16&32768,r=i>>12&2047,o=i>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&i):o<113?n|=((r|=2048)>>114-o)+(r>>113-o&1):(n|=o-112<<10|r>>1,n+=1&r)},e._FromHalfFloat=function(e){var t=(32768&e)>>15,i=(31744&e)>>10,n=1023&e;return 0===i?(t?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):31==i?n?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,i-15)*(1+n/Math.pow(2,10))},e._GetHalfFloatAsFloatRGBAArrayBuffer=function(t,i,n,r,o,a){for(var s=new Float32Array(r),c=new Uint16Array(o,n),l=0,u=0;u<i;u++)for(var h=0;h<t;h++){var d=4*(h+u*t);s[l]=e._FromHalfFloat(c[d]),s[l+1]=e._FromHalfFloat(c[d+1]),s[l+2]=e._FromHalfFloat(c[d+2]),e.StoreLODInAlphaChannel?s[l+3]=a:s[l+3]=e._FromHalfFloat(c[d+3]),l+=4}return s},e._GetHalfFloatRGBAArrayBuffer=function(t,i,n,r,o,a){if(e.StoreLODInAlphaChannel){for(var s=new Uint16Array(r),c=new Uint16Array(o,n),l=0,u=0;u<i;u++)for(var h=0;h<t;h++){var d=4*(h+u*t);s[l]=c[d],s[l+1]=c[d+1],s[l+2]=c[d+2],s[l+3]=e._ToHalfFloat(a),l+=4}return s}return new Uint16Array(o,n,r)},e._GetFloatRGBAArrayBuffer=function(t,i,n,r,o,a){if(e.StoreLODInAlphaChannel){for(var s=new Float32Array(r),c=new Float32Array(o,n),l=0,u=0;u<i;u++)for(var h=0;h<t;h++){var d=4*(h+u*t);s[l]=c[d],s[l+1]=c[d+1],s[l+2]=c[d+2],s[l+3]=a,l+=4}return s}return new Float32Array(o,n,r)},e._GetFloatAsUIntRGBAArrayBuffer=function(t,i,n,r,o,a){for(var s=new Uint8Array(r),c=new Float32Array(o,n),l=0,u=0;u<i;u++)for(var h=0;h<t;h++){var d=4*(h+u*t);s[l]=255*L.a.Clamp(c[d]),s[l+1]=255*L.a.Clamp(c[d+1]),s[l+2]=255*L.a.Clamp(c[d+2]),e.StoreLODInAlphaChannel?s[l+3]=a:s[l+3]=255*L.a.Clamp(c[d+3]),l+=4}return s},e._GetHalfFloatAsUIntRGBAArrayBuffer=function(t,i,n,r,o,a){for(var s=new Uint8Array(r),c=new Uint16Array(o,n),l=0,u=0;u<i;u++)for(var h=0;h<t;h++){var d=4*(h+u*t);s[l]=255*L.a.Clamp(e._FromHalfFloat(c[d])),s[l+1]=255*L.a.Clamp(e._FromHalfFloat(c[d+1])),s[l+2]=255*L.a.Clamp(e._FromHalfFloat(c[d+2])),e.StoreLODInAlphaChannel?s[l+3]=a:s[l+3]=255*L.a.Clamp(e._FromHalfFloat(c[d+3])),l+=4}return s},e._GetRGBAArrayBuffer=function(e,t,i,n,r,o,a,s,c){for(var l=new Uint8Array(n),u=new Uint8Array(r,i),h=0,d=0;d<t;d++)for(var f=0;f<e;f++){var p=4*(f+d*e);l[h]=u[p+o],l[h+1]=u[p+a],l[h+2]=u[p+s],l[h+3]=u[p+c],h+=4}return l},e._ExtractLongWordOrder=function(t){return 0===t||255===t||-16777216===t?0:1+e._ExtractLongWordOrder(t>>8)},e._GetRGBArrayBuffer=function(e,t,i,n,r,o,a,s){for(var c=new Uint8Array(n),l=new Uint8Array(r,i),u=0,h=0;h<t;h++)for(var d=0;d<e;d++){var f=3*(d+h*e);c[u]=l[f+o],c[u+1]=l[f+a],c[u+2]=l[f+s],u+=3}return c},e._GetLuminanceArrayBuffer=function(e,t,i,n,r){for(var o=new Uint8Array(n),a=new Uint8Array(r,i),s=0,c=0;c<t;c++)for(var l=0;l<e;l++){var u=l+c*e;o[s]=a[u],s++}return o},e.UploadDDSLevels=function(t,i,n,r,o,a,s,c){void 0===s&&(s=-1);var l=null;r.sphericalPolynomial&&(l=new Array);var u,h,d,f,p,_,v,b=t.getCaps().s3tc,y=new Int32Array(n.buffer,n.byteOffset,31),T=0,E=0,S=1;if(542327876===y[0])if(r.isFourCC||r.isRGB||r.isLuminance)if(!r.isCompressed||b){var A=y[22];f=y[1]+4;var P,C=!1;if(r.isFourCC)switch(u=y[21]){case vo:S=8,E=b.COMPRESSED_RGBA_S3TC_DXT1_EXT;break;case bo:S=16,E=b.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case yo:S=16,E=b.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;case 113:case 116:C=!0;break;case To:f+=20;var R=!1;switch(r.dxgiFormat){case 10:case 2:C=!0,R=!0;break;case 88:r.isRGB=!0,r.isFourCC=!1,A=32,R=!0}if(R)break;default:return void console.error("Unsupported FourCC code:",(P=u,String.fromCharCode(255&P,P>>8&255,P>>16&255,P>>24&255)))}var x=e._ExtractLongWordOrder(y[23]),O=e._ExtractLongWordOrder(y[24]),M=e._ExtractLongWordOrder(y[25]),I=e._ExtractLongWordOrder(y[26]);C&&(E=t._getRGBABufferInternalSizedFormat(r.textureType)),_=1,131072&y[2]&&!1!==o&&(_=Math.max(1,y[7]));for(var D=c||0;D<a;D++){for(h=y[4],d=y[3],v=0;v<_;++v){if(-1===s||s===v){var N=-1===s?v:0;if(!r.isCompressed&&r.isFourCC){i.format=g.a.TEXTUREFORMAT_RGBA,T=h*d*4;var L=null;t._badOS||t._badDesktopOS||!t.getCaps().textureHalfFloat&&!t.getCaps().textureFloat?(128===A?(L=e._GetFloatAsUIntRGBAArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,N),l&&0==N&&l.push(e._GetFloatRGBAArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,N))):64===A&&(L=e._GetHalfFloatAsUIntRGBAArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,N),l&&0==N&&l.push(e._GetHalfFloatAsFloatRGBAArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,N))),i.type=g.a.TEXTURETYPE_UNSIGNED_INT):128===A?(i.type=g.a.TEXTURETYPE_FLOAT,L=e._GetFloatRGBAArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,N),l&&0==N&&l.push(L)):64!==A||t.getCaps().textureHalfFloat?(i.type=g.a.TEXTURETYPE_HALF_FLOAT,L=e._GetHalfFloatRGBAArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,N),l&&0==N&&l.push(e._GetHalfFloatAsFloatRGBAArrayBuffer(h,d,f,T,n.buffer,N))):(i.type=g.a.TEXTURETYPE_FLOAT,L=e._GetHalfFloatAsFloatRGBAArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,N),l&&0==N&&l.push(L)),L&&t._uploadDataToTextureDirectly(i,L,D,N)}else if(r.isRGB)i.type=g.a.TEXTURETYPE_UNSIGNED_INT,24===A?(i.format=g.a.TEXTUREFORMAT_RGB,T=h*d*3,p=e._GetRGBArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,x,O,M),t._uploadDataToTextureDirectly(i,p,D,N)):(i.format=g.a.TEXTUREFORMAT_RGBA,T=h*d*4,p=e._GetRGBAArrayBuffer(h,d,n.byteOffset+f,T,n.buffer,x,O,M,I),t._uploadDataToTextureDirectly(i,p,D,N));else if(r.isLuminance){var w=t._getUnpackAlignement(),F=h;T=Math.floor((h+w-1)/w)*w*(d-1)+F,p=e._GetLuminanceArrayBuffer(h,d,n.byteOffset+f,T,n.buffer),i.format=g.a.TEXTUREFORMAT_LUMINANCE,i.type=g.a.TEXTURETYPE_UNSIGNED_INT,t._uploadDataToTextureDirectly(i,p,D,N)}else T=Math.max(4,h)/4*Math.max(4,d)/4*S,p=new Uint8Array(n.buffer,n.byteOffset+f,T),i.type=g.a.TEXTURETYPE_UNSIGNED_INT,t._uploadCompressedDataToTextureDirectly(i,E,h,d,p,D,N)}f+=A?h*d*(A/8):T,h*=.5,d*=.5,h=Math.max(1,h),d=Math.max(1,d)}if(void 0!==c)break}l&&l.length>0?r.sphericalPolynomial=Yn.ConvertCubeMapToSphericalPolynomial({size:y[4],right:l[0],left:l[1],up:l[2],down:l[3],front:l[4],back:l[5],format:g.a.TEXTUREFORMAT_RGBA,type:g.a.TEXTURETYPE_FLOAT,gammaSpace:!1}):r.sphericalPolynomial=void 0}else m.a.Error("Compressed textures are not supported on this platform.");else m.a.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");else m.a.Error("Invalid magic number in DDS header")},e.StoreLODInAlphaChannel=!1,e}();qe.a.prototype.createPrefilteredCubeTexture=function(e,t,i,n,r,o,a,s,c){var l=this;return void 0===r&&(r=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===c&&(c=!0),this.createCubeTexture(e,t,null,!1,function(e){if(e){var o=e.texture;if(c?e.info.sphericalPolynomial&&(o._sphericalPolynomial=e.info.sphericalPolynomial):o._sphericalPolynomial=new Wn,o._source=Qe.b.CubePrefiltered,l.getCaps().textureLOD)r&&r(o);else{var a=l._gl,s=e.width;if(s){for(var u=[],h=0;h<3;h++){var d=1-h/2,f=n,p=L.a.Log2(s)*i+n,_=f+(p-f)*d,v=Math.round(Math.min(Math.max(_,0),p)),b=new Qe.a(l,Qe.b.Temp);if(b.type=o.type,b.format=o.format,b.width=Math.pow(2,Math.max(L.a.Log2(s)-v,0)),b.height=b.width,b.isCube=!0,l._bindTextureDirectly(a.TEXTURE_CUBE_MAP,b,!0),b.samplingMode=g.a.TEXTURE_LINEAR_LINEAR,a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),e.isDDS){var y=e.info,T=e.data;l._unpackFlipY(y.isCompressed),Eo.UploadDDSLevels(l,b,T,y,!0,6,v)}else m.a.Warn("DDS is the only prefiltered cube map supported so far.");l._bindTextureDirectly(a.TEXTURE_CUBE_MAP,null);var E=new Hn.a(t);E.isCube=!0,E._texture=b,b.isReady=!0,u.push(E)}o._lodTextureHigh=u[2],o._lodTextureMid=u[1],o._lodTextureLow=u[0],r&&r(o)}}}else r&&r(null)},o,a,s,c,i,n)};var So=function(){function e(){this.supportCascades=!0}return e.prototype.canLoad=function(e){return jr.a.EndsWith(e,".dds")},e.prototype.loadCubeData=function(e,t,i,n,r){var o,a=t.getEngine(),s=!1;if(Array.isArray(e))for(var c=0;c<e.length;c++){var l=e[c];o=Eo.GetDDSInfo(l),t.width=o.width,t.height=o.height,s=(o.isRGB||o.isLuminance||o.mipmapCount>1)&&t.generateMipMaps,a._unpackFlipY(o.isCompressed),Eo.UploadDDSLevels(a,t,l,o,s,6,-1,c),o.isFourCC||1!==o.mipmapCount||a.generateMipMapsForCubemap(t)}else{var u=e;o=Eo.GetDDSInfo(u),t.width=o.width,t.height=o.height,i&&(o.sphericalPolynomial=new Wn),s=(o.isRGB||o.isLuminance||o.mipmapCount>1)&&t.generateMipMaps,a._unpackFlipY(o.isCompressed),Eo.UploadDDSLevels(a,t,u,o,s,6),o.isFourCC||1!==o.mipmapCount||a.generateMipMapsForCubemap(t,!1)}a._setCubeMapTextureParams(t,s),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n({isDDS:!0,width:t.width,info:o,data:e,texture:t})},e.prototype.loadData=function(e,t,i){var n=Eo.GetDDSInfo(e),r=(n.isRGB||n.isLuminance||n.mipmapCount>1)&&t.generateMipMaps&&n.width>>n.mipmapCount-1==1;i(n.width,n.height,r,n.isFourCC,function(){Eo.UploadDDSLevels(t.getEngine(),t,e,n,r,1)})},e}();Se.a._TextureLoaders.push(new So);var Ao=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return jr.a.EndsWith(e,".env")},e.prototype.loadCubeData=function(e,t,i,n,r){if(!Array.isArray(e)){var o=Kn.GetEnvInfo(e);o?(t.width=o.width,t.height=o.width,Kn.UploadEnvSpherical(t,o),Kn.UploadEnvLevelsAsync(t,e,o).then(function(){t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n()})):r&&r("Can not parse the environment file",null)}},e.prototype.loadData=function(e,t,i){throw".env not supported in 2d."},e}();Se.a._TextureLoaders.push(new Ao);var Po=function(){function e(t,i,n,r){if(this.data=t,this.isInvalid=!1,!e.IsValid(t))return this.isInvalid=!0,void m.a.Error("texture missing KTX identifier");var o=Uint32Array.BYTES_PER_ELEMENT,a=new DataView(this.data.buffer,this.data.byteOffset+12,13*o),s=67305985===a.getUint32(0,!0);this.glType=a.getUint32(1*o,s),this.glTypeSize=a.getUint32(2*o,s),this.glFormat=a.getUint32(3*o,s),this.glInternalFormat=a.getUint32(4*o,s),this.glBaseInternalFormat=a.getUint32(5*o,s),this.pixelWidth=a.getUint32(6*o,s),this.pixelHeight=a.getUint32(7*o,s),this.pixelDepth=a.getUint32(8*o,s),this.numberOfArrayElements=a.getUint32(9*o,s),this.numberOfFaces=a.getUint32(10*o,s),this.numberOfMipmapLevels=a.getUint32(11*o,s),this.bytesOfKeyValueData=a.getUint32(12*o,s),0===this.glType?(this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===i?this.loadType=e.COMPRESSED_2D:m.a.Error("number of faces expected"+i+", but found "+this.numberOfFaces):m.a.Error("texture arrays not currently supported"):m.a.Error("only 2D textures currently supported")):m.a.Error("only compressed formats currently supported")}return e.prototype.uploadLevels=function(t,i){switch(this.loadType){case e.COMPRESSED_2D:this._upload2DCompressedLevels(t,i);break;case e.TEX_2D:case e.COMPRESSED_3D:case e.TEX_3D:}},e.prototype._upload2DCompressedLevels=function(t,i){for(var n=e.HEADER_LEN+this.bytesOfKeyValueData,r=this.pixelWidth,o=this.pixelHeight,a=i?this.numberOfMipmapLevels:1,s=0;s<a;s++){var c=new Int32Array(this.data.buffer,this.data.byteOffset+n,1)[0];n+=4;for(var l=0;l<this.numberOfFaces;l++){var u=new Uint8Array(this.data.buffer,this.data.byteOffset+n,c);t.getEngine()._uploadCompressedDataToTextureDirectly(t,this.glInternalFormat,r,o,u,l,s),n+=c,n+=3-(c+3)%4}r=Math.max(1,.5*r),o=Math.max(1,.5*o)}},e.IsValid=function(e){if(e.byteLength>=12){var t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&49===t[5]&&49===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1},e.HEADER_LEN=64,e.COMPRESSED_2D=0,e.COMPRESSED_3D=1,e.TEX_2D=2,e.TEX_3D=3,e}(),Co=function(){function e(e){this._pendingActions=new Array,this._workerInfos=e.map(function(e){return{worker:e,active:!1}})}return e.prototype.dispose=function(){for(var e=0,t=this._workerInfos;e<t.length;e++)t[e].worker.terminate();this._workerInfos=[],this._pendingActions=[]},e.prototype.push=function(e){for(var t=0,i=this._workerInfos;t<i.length;t++){var n=i[t];if(!n.active)return void this._execute(n,e)}this._pendingActions.push(e)},e.prototype._execute=function(e,t){var i=this;e.active=!0,t(e.worker,function(){e.active=!1;var t=i._pendingActions.shift();t&&i._execute(e,t)})},e}(),Ro=function(){function e(t,i){void 0===i&&(i=e.DefaultNumWorkers),this._engine=t,e._Initialized||e._CreateWorkerPool(i)}return e.GetDefaultNumWorkers=function(){return"object"==typeof navigator&&navigator.hardwareConcurrency?Math.min(Math.floor(.5*navigator.hardwareConcurrency),4):1},e._CreateWorkerPool=function(t){this._Initialized=!0,t&&"function"==typeof Worker?e._WorkerPoolPromise=new Promise(function(i){for(var n="("+function(){var e;onmessage=function(t){switch(t.data.action){case"init":var i=t.data.urls;importScripts(i.jsDecoderModule),null!==i.wasmUASTCToASTC&&(KTX2DECODER.LiteTranscoder_UASTC_ASTC.WasmModuleURL=i.wasmUASTCToASTC),null!==i.wasmUASTCToBC7&&(KTX2DECODER.LiteTranscoder_UASTC_BC7.WasmModuleURL=i.wasmUASTCToBC7),null!==i.wasmUASTCToRGBA_UNORM&&(KTX2DECODER.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL=i.wasmUASTCToRGBA_UNORM),null!==i.wasmUASTCToRGBA_SRGB&&(KTX2DECODER.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL=i.wasmUASTCToRGBA_SRGB),null!==i.jsMSCTranscoder&&(KTX2DECODER.MSCTranscoder.JSModuleURL=i.jsMSCTranscoder),null!==i.wasmMSCTranscoder&&(KTX2DECODER.MSCTranscoder.WasmModuleURL=i.wasmMSCTranscoder),e=new KTX2DECODER.KTX2Decoder,postMessage({action:"init"});break;case"decode":e.decode(t.data.data,t.data.caps,t.data.options).then(function(e){for(var t=[],i=0;i<e.mipmaps.length;++i){var n=e.mipmaps[i];n&&n.data&&t.push(n.data.buffer)}postMessage({action:"decoded",success:!0,decodedData:e},t)}).catch(function(e){postMessage({action:"decoded",success:!1,msg:e})})}}}+")()",r=URL.createObjectURL(new Blob([n],{type:"application/javascript"})),o=new Array(t),a=0;a<o.length;a++)o[a]=new Promise(function(t,i){var n=new Worker(r),o=function(e){n.removeEventListener("error",o),n.removeEventListener("message",a),i(e)},a=function(e){"init"===e.data.action&&(n.removeEventListener("error",o),n.removeEventListener("message",a),t(n))};n.addEventListener("error",o),n.addEventListener("message",a),n.postMessage({action:"init",urls:e.URLConfig})});Promise.all(o).then(function(e){i(new Co(e))})}):(KTX2DECODER.MSCTranscoder.UseFromWorkerThread=!1,KTX2DECODER.WASMMemoryManager.LoadBinariesFromCurrentThread=!0)},e.prototype.uploadAsync=function(t,i,n){var r=this,o=this._engine.getCaps(),a={astc:!!o.astc,bptc:!!o.bptc,s3tc:!!o.s3tc,pvrtc:!!o.pvrtc,etc2:!!o.etc2,etc1:!!o.etc1};return e._WorkerPoolPromise?e._WorkerPoolPromise.then(function(e){return new Promise(function(o,s){e.push(function(e,c){var l=function(t){e.removeEventListener("error",l),e.removeEventListener("message",u),s(t),c()},u=function(t){if("decoded"===t.data.action){if(e.removeEventListener("error",l),e.removeEventListener("message",u),t.data.success)try{r._createTexture(t.data.decodedData,i,n),o()}catch(e){s({message:e})}else s({message:t.data.msg});c()}};e.addEventListener("error",l),e.addEventListener("message",u),e.postMessage({action:"decode",data:t,caps:a,options:n})})})}):new Promise(function(n,a){e._Ktx2Decoder||(e._Ktx2Decoder=new KTX2DECODER.KTX2Decoder),e._Ktx2Decoder.decode(t,o).then(function(e){r._createTexture(e,i),n()}).catch(function(e){a({message:e})})})},e.prototype.dispose=function(){e._WorkerPoolPromise&&e._WorkerPoolPromise.then(function(e){e.dispose()}),delete e._WorkerPoolPromise},e.prototype._createTexture=function(e,t,i){if(this._engine._bindTextureDirectly(this._engine._gl.TEXTURE_2D,t),i&&(i.transcodedFormat=e.transcodedFormat,i.isInGammaSpace=e.isInGammaSpace,i.transcoderName=e.transcoderName),32856===e.transcodedFormat?(t.type=g.a.TEXTURETYPE_UNSIGNED_BYTE,t.format=g.a.TEXTUREFORMAT_RGBA):t.format=e.transcodedFormat,t._gammaSpace=e.isInGammaSpace,e.errors)throw new Error("KTX2 container - could not transcode the data. "+e.errors);for(var n=0;n<e.mipmaps.length;++n){var r=e.mipmaps[n];if(!r||!r.data)throw new Error("KTX2 container - could not transcode one of the image");32856===e.transcodedFormat?(t.width=r.width,t.height=r.height,this._engine._uploadDataToTextureDirectly(t,r.data,0,n,void 0,!0)):this._engine._uploadCompressedDataToTextureDirectly(t,e.transcodedFormat,r.width,r.height,r.data,0,n)}t.width=e.mipmaps[0].width,t.height=e.mipmaps[0].height,t.generateMipMaps=e.mipmaps.length>1,t.isReady=!0,this._engine._bindTextureDirectly(this._engine._gl.TEXTURE_2D,null)},e.IsValid=function(e){if(e.byteLength>=12){var t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&50===t[5]&&48===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1},e.URLConfig={jsDecoderModule:"https://preview.babylonjs.com/babylon.ktx2Decoder.js",wasmUASTCToASTC:null,wasmUASTCToBC7:null,wasmUASTCToRGBA_UNORM:null,wasmUASTCToRGBA_SRGB:null,jsMSCTranscoder:null,wasmMSCTranscoder:null},e.DefaultNumWorkers=e.GetDefaultNumWorkers(),e}();var xo=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e,t){return jr.a.EndsWith(e,".ktx")||jr.a.EndsWith(e,".ktx2")||"image/ktx"===t||"image/ktx2"===t},e.prototype.loadCubeData=function(e,t,i,n,r){if(!Array.isArray(e)){t._invertVScale=!t.invertY;var o=t.getEngine(),a=new Po(e,6),s=a.numberOfMipmapLevels>1&&t.generateMipMaps;o._unpackFlipY(!0),a.uploadLevels(t,t.generateMipMaps),t.width=a.pixelWidth,t.height=a.pixelHeight,o._setCubeMapTextureParams(t,s),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n()}},e.prototype.loadData=function(e,t,i,n){if(Po.IsValid(e)){t._invertVScale=!t.invertY;var r=new Po(e,1);i(r.pixelWidth,r.pixelHeight,t.generateMipMaps,!0,function(){r.uploadLevels(t,t.generateMipMaps)},r.isInvalid)}else Ro.IsValid(e)?new Ro(t.getEngine()).uploadAsync(e,t,n).then(function(){i(t.width,t.height,t.generateMipMaps,!0,function(){},!1)},function(e){m.a.Warn("Failed to load KTX2 texture data: "+e.message),i(0,0,!1,!1,function(){},!0)}):(m.a.Error("texture missing KTX identifier"),i(0,0,!1,!1,function(){},!0))},e}();Se.a._TextureLoaders.unshift(new xo);var Oo=function(e){function t(t,i,n){var r=e.call(this,t,a.e.Zero(),i)||this;return r._xrSessionManager=n,r._firstFrame=!1,r._referenceQuaternion=a.b.Identity(),r._referencedPosition=new a.e,r._xrInvPositionCache=new a.e,r._xrInvQuaternionCache=a.b.Identity(),r._trackingState=Ki.NOT_TRACKING,r.onBeforeCameraTeleport=new o.c,r.onAfterCameraTeleport=new o.c,r.onTrackingStateChanged=new o.c,r.compensateOnFirstFrame=!0,r._rotate180=new a.b(0,1,0,0),r.minZ=.1,r.rotationQuaternion=new a.b,r.cameraRigMode=je.a.RIG_MODE_CUSTOM,r.updateUpVectorFromRotation=!0,r._updateNumberOfRigCameras(1),r.freezeProjectionMatrix(),r._xrSessionManager.onXRSessionInit.add(function(){r._referencedPosition.copyFromFloats(0,0,0),r._referenceQuaternion.copyFromFloats(0,0,0,1),r._firstFrame=r.compensateOnFirstFrame}),r._xrSessionManager.onXRFrameObservable.add(function(e){r._firstFrame&&r._updateFromXRSession(),r._updateReferenceSpace(),r._updateFromXRSession()},void 0,!0),r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"trackingState",{get:function(){return this._trackingState},enumerable:!1,configurable:!0}),t.prototype._setTrackingState=function(e){this._trackingState!==e&&(this._trackingState=e,this.onTrackingStateChanged.notifyObservers(e))},Object.defineProperty(t.prototype,"realWorldHeight",{get:function(){var e=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.baseReferenceSpace);return e&&e.transform?e.transform.position.y:0},enumerable:!1,configurable:!0}),t.prototype._updateForDualEyeDebugging=function(){this._updateNumberOfRigCameras(2),this.rigCameras[0].viewport=new mi.a(0,0,.5,1),this.rigCameras[0].outputRenderTarget=null,this.rigCameras[1].viewport=new mi.a(.5,0,.5,1),this.rigCameras[1].outputRenderTarget=null},t.prototype.setTransformationFromNonVRCamera=function(e,t){void 0===e&&(e=this.getScene().activeCamera),void 0===t&&(t=!0),e&&e!==this&&(e.computeWorldMatrix().decompose(void 0,this.rotationQuaternion,this.position),this.position.y=0,a.b.FromEulerAnglesToRef(0,this.rotationQuaternion.toEulerAngles().y,0,this.rotationQuaternion),this._firstFrame=!0,t&&this._xrSessionManager.resetReferenceSpace())},t.prototype.getClassName=function(){return"WebXRCamera"},t.prototype._updateFromXRSession=function(){var e=this,t=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.referenceSpace);if(t){var i=t.emulatedPosition?Ki.TRACKING_LOST:Ki.TRACKING;if(this._setTrackingState(i),t.transform){var n=t.transform.position;this._referencedPosition.set(n.x,n.y,n.z);var r=t.transform.orientation;this._referenceQuaternion.set(r.x,r.y,r.z,r.w),this._scene.useRightHandedSystem||(this._referencedPosition.z*=-1,this._referenceQuaternion.z*=-1,this._referenceQuaternion.w*=-1),this._firstFrame?(this._firstFrame=!1,this.position.y+=this._referencedPosition.y,this._referenceQuaternion.copyFromFloats(0,0,0,1)):(this.rotationQuaternion.copyFrom(this._referenceQuaternion),this.position.copyFrom(this._referencedPosition))}this.rigCameras.length!==t.views.length&&this._updateNumberOfRigCameras(t.views.length),t.views.forEach(function(t,i){var n=e.rigCameras[i];n.isLeftCamera||n.isRightCamera||("right"===t.eye?n._isRightCamera=!0:"left"===t.eye&&(n._isLeftCamera=!0));var r=t.transform.position,o=t.transform.orientation;if(n.position.set(r.x,r.y,r.z),n.rotationQuaternion.set(o.x,o.y,o.z,o.w),e._scene.useRightHandedSystem?n.rotationQuaternion.multiplyInPlace(e._rotate180):(n.position.z*=-1,n.rotationQuaternion.z*=-1,n.rotationQuaternion.w*=-1),a.a.FromFloat32ArrayToRefScaled(t.projectionMatrix,0,1,n._projectionMatrix),e._scene.useRightHandedSystem||n._projectionMatrix.toggleProjectionMatrixHandInPlace(),0===i&&e._projectionMatrix.copyFrom(n._projectionMatrix),e._xrSessionManager.session.renderState.baseLayer){var s=e._xrSessionManager.session.renderState.baseLayer.getViewport(t),c=e._xrSessionManager.session.renderState.baseLayer.framebufferWidth,l=e._xrSessionManager.session.renderState.baseLayer.framebufferHeight;n.viewport.width=s.width/c,n.viewport.height=s.height/l,n.viewport.x=s.x/c,n.viewport.y=s.y/l}n.outputRenderTarget=e._xrSessionManager.getRenderTargetTextureForEye(t.eye)})}else this._setTrackingState(Ki.NOT_TRACKING)},t.prototype._updateNumberOfRigCameras=function(e){for(void 0===e&&(e=1);this.rigCameras.length<e;){var t=new Lt("XR-RigCamera: "+this.rigCameras.length,a.e.Zero(),this.getScene());t.minZ=.1,t.rotationQuaternion=new a.b,t.updateUpVectorFromRotation=!0,t.isRigCamera=!0,t.rigParent=this,t.freezeProjectionMatrix(),this.rigCameras.push(t)}for(;this.rigCameras.length>e;){var i=this.rigCameras.pop();i&&i.dispose()}},t.prototype._updateReferenceSpace=function(){this.position.equals(this._referencedPosition)&&this.rotationQuaternion.equals(this._referenceQuaternion)||(this.position.subtractToRef(this._referencedPosition,this._referencedPosition),this._referenceQuaternion.conjugateInPlace(),this._referenceQuaternion.multiplyToRef(this.rotationQuaternion,this._referenceQuaternion),this._updateReferenceSpaceOffset(this._referencedPosition,this._referenceQuaternion.normalize()))},t.prototype._updateReferenceSpaceOffset=function(e,t,i){if(void 0===i&&(i=!1),this._xrSessionManager.referenceSpace&&this._xrSessionManager.currentFrame){this._xrInvPositionCache.copyFrom(e),t?this._xrInvQuaternionCache.copyFrom(t):this._xrInvQuaternionCache.copyFromFloats(0,0,0,1),this._scene.useRightHandedSystem||(this._xrInvPositionCache.z*=-1,this._xrInvQuaternionCache.z*=-1,this._xrInvQuaternionCache.w*=-1),this._xrInvPositionCache.negateInPlace(),this._xrInvQuaternionCache.conjugateInPlace(),this._xrInvPositionCache.rotateByQuaternionToRef(this._xrInvQuaternionCache,this._xrInvPositionCache),i&&(this._xrInvPositionCache.y=0);var n=new XRRigidTransform({x:this._xrInvPositionCache.x,y:this._xrInvPositionCache.y,z:this._xrInvPositionCache.z},{x:this._xrInvQuaternionCache.x,y:this._xrInvQuaternionCache.y,z:this._xrInvQuaternionCache.z,w:this._xrInvQuaternionCache.w}),r=this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(n),o=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(r);if(o){var s=new a.e(o.transform.position.x,o.transform.position.y,o.transform.position.z);this._scene.useRightHandedSystem||(s.z*=-1),this.position.subtractToRef(s,s),this._scene.useRightHandedSystem||(s.z*=-1),s.negateInPlace();var c=new XRRigidTransform({x:s.x,y:s.y,z:s.z});this._xrSessionManager.referenceSpace=r.getOffsetReferenceSpace(c)}}},t}(wt),Mo=function(){function e(){}return e.ANCHOR_SYSTEM="xr-anchor-system",e.BACKGROUND_REMOVER="xr-background-remover",e.HIT_TEST="xr-hit-test",e.PHYSICS_CONTROLLERS="xr-physics-controller",e.PLANE_DETECTION="xr-plane-detection",e.POINTER_SELECTION="xr-controller-pointer-selection",e.TELEPORTATION="xr-controller-teleportation",e.FEATURE_POINTS="xr-feature-points",e.HAND_TRACKING="xr-hand-tracking",e}(),Io=function(){function e(e){var t=this;this._xrSessionManager=e,this._features={},this._xrSessionManager.onXRSessionInit.add(function(){t.getEnabledFeatures().forEach(function(e){var i=t._features[e];!i.enabled||i.featureImplementation.attached||i.featureImplementation.disableAutoAttach||t.attachFeature(e)})}),this._xrSessionManager.onXRSessionEnded.add(function(){t.getEnabledFeatures().forEach(function(e){var i=t._features[e];i.enabled&&i.featureImplementation.attached&&t.detachFeature(e)})})}return e.AddWebXRFeature=function(e,t,i,n){void 0===i&&(i=1),void 0===n&&(n=!1),this._AvailableFeatures[e]=this._AvailableFeatures[e]||{latest:i},i>this._AvailableFeatures[e].latest&&(this._AvailableFeatures[e].latest=i),n&&(this._AvailableFeatures[e].stable=i),this._AvailableFeatures[e][i]=t},e.ConstructFeature=function(e,t,i,n){void 0===t&&(t=1);var r=this._AvailableFeatures[e][t];if(!r)throw new Error("feature not found");return r(i,n)},e.GetAvailableFeatures=function(){return Object.keys(this._AvailableFeatures)},e.GetAvailableVersions=function(e){return Object.keys(this._AvailableFeatures[e])},e.GetLatestVersionOfFeature=function(e){return this._AvailableFeatures[e]&&this._AvailableFeatures[e].latest||-1},e.GetStableVersionOfFeature=function(e){return this._AvailableFeatures[e]&&this._AvailableFeatures[e].stable||-1},e.prototype.attachFeature=function(e){var t=this._features[e];t&&t.enabled&&!t.featureImplementation.attached&&t.featureImplementation.attach()},e.prototype.detachFeature=function(e){var t=this._features[e];t&&t.featureImplementation.attached&&t.featureImplementation.detach()},e.prototype.disableFeature=function(e){var t="string"==typeof e?e:e.Name,i=this._features[t];return!(!i||!i.enabled||(i.enabled=!1,this.detachFeature(t),i.featureImplementation.dispose(),0))},e.prototype.dispose=function(){var e=this;this.getEnabledFeatures().forEach(function(t){e.disableFeature(t),e._features[t].featureImplementation.dispose()})},e.prototype.enableFeature=function(t,i,n,r,o){var a=this;void 0===i&&(i="latest"),void 0===n&&(n={}),void 0===r&&(r=!0),void 0===o&&(o=!0);var s="string"==typeof t?t:t.Name,c=0;if("string"==typeof i){if(!i)throw new Error("Error in provided version - "+s+" ("+i+")");if(-1===(c="stable"===i?e.GetStableVersionOfFeature(s):"latest"===i?e.GetLatestVersionOfFeature(s):+i)||isNaN(c))throw new Error("feature not found - "+s+" ("+i+")")}else c=i;var l=this._features[s],u=e.ConstructFeature(s,c,this._xrSessionManager,n);if(!u)throw new Error("feature not found - "+s);l&&this.disableFeature(s);var h=u();if(h.dependsOn&&!h.dependsOn.every(function(e){return!!a._features[e]}))throw new Error("Dependant features missing. Make sure the following features are enabled - "+h.dependsOn.join(", "));if(h.isCompatible())return this._features[s]={featureImplementation:h,enabled:!0,version:c,required:o},r?this._xrSessionManager.session&&!this._features[s].featureImplementation.attached&&this.attachFeature(s):this._features[s].featureImplementation.disableAutoAttach=!0,this._features[s].featureImplementation;if(o)throw new Error("required feature not compatible");return Ce.b.Warn("Feature "+s+" not compatible with the current environment/browser and was not enabled."),h},e.prototype.getEnabledFeature=function(e){return this._features[e]&&this._features[e].featureImplementation},e.prototype.getEnabledFeatures=function(){return Object.keys(this._features)},e.prototype.extendXRSessionInitObject=function(e){var t=this;return this.getEnabledFeatures().forEach(function(i){var n=t._features[i],r=n.featureImplementation.xrNativeFeatureName;r&&(n.required?(e.requiredFeatures=e.requiredFeatures||[],-1===e.requiredFeatures.indexOf(r)&&e.requiredFeatures.push(r)):(e.optionalFeatures=e.optionalFeatures||[],-1===e.optionalFeatures.indexOf(r)&&e.optionalFeatures.push(r)))}),e},e._AvailableFeatures={},e}(),Do=function(){function e(e){var t=this;this.scene=e,this._nonVRCamera=null,this._originalSceneAutoClear=!0,this._supported=!1,this.onInitialXRPoseSetObservable=new o.c,this.onStateChangedObservable=new o.c,this.state=Yi.NOT_IN_XR,this.sessionManager=new $i(e),this.camera=new Oo("",e,this.sessionManager),this.featuresManager=new Io(this.sessionManager),e.onDisposeObservable.add(function(){t.exitXRAsync()})}return e.CreateAsync=function(t){var i=new e(t);return i.sessionManager.initializeAsync().then(function(){return i._supported=!0,i}).catch(function(e){throw i._setState(Yi.NOT_IN_XR),i.dispose(),e})},e.prototype.dispose=function(){this.camera.dispose(),this.onStateChangedObservable.clear(),this.onInitialXRPoseSetObservable.clear(),this.sessionManager.dispose(),this._nonVRCamera&&(this.scene.activeCamera=this._nonVRCamera)},e.prototype.enterXRAsync=function(e,t,i,n){var r=this;if(void 0===i&&(i=this.sessionManager.getWebXRRenderTarget()),void 0===n&&(n={}),!this._supported)throw"WebXR not supported in this browser or environment";return this._setState(Yi.ENTERING_XR),"viewer"!==t&&"local"!==t&&(n.optionalFeatures=n.optionalFeatures||[],n.optionalFeatures.push(t)),this.featuresManager.extendXRSessionInitObject(n),"immersive-ar"===e&&"unbounded"!==t&&m.a.Warn("We recommend using 'unbounded' reference space type when using 'immersive-ar' session mode"),this.sessionManager.initializeSessionAsync(e,n).then(function(){return r.sessionManager.setReferenceSpaceTypeAsync(t)}).then(function(){return i.initializeXRLayerAsync(r.sessionManager.session)}).then(function(){return r.sessionManager.updateRenderStateAsync({depthFar:r.camera.maxZ,depthNear:r.camera.minZ,baseLayer:i.xrLayer})}).then(function(){return r.sessionManager.runXRRenderLoop(),r._originalSceneAutoClear=r.scene.autoClear,r._nonVRCamera=r.scene.activeCamera,r.scene.activeCamera=r.camera,"immersive-ar"!==e?r._nonXRToXRCamera():(r.scene.autoClear=!1,r.camera.compensateOnFirstFrame=!1),r.sessionManager.onXRSessionEnded.addOnce(function(){r.camera.rigCameras.forEach(function(e){e.outputRenderTarget=null}),r.scene.autoClear=r._originalSceneAutoClear,r.scene.activeCamera=r._nonVRCamera,"immersive-ar"!==e&&r.camera.compensateOnFirstFrame&&(r._nonVRCamera.setPosition?r._nonVRCamera.setPosition(r.camera.position):r._nonVRCamera.position.copyFrom(r.camera.position)),r._setState(Yi.NOT_IN_XR)}),r.sessionManager.onXRFrameObservable.addOnce(function(){r._setState(Yi.IN_XR)}),r.sessionManager}).catch(function(e){throw console.log(e),console.log(e.message),r._setState(Yi.NOT_IN_XR),e})},e.prototype.exitXRAsync=function(){return this.state!==Yi.IN_XR?Promise.resolve():(this._setState(Yi.EXITING_XR),this.sessionManager.exitXRAsync())},e.prototype._nonXRToXRCamera=function(){this.camera.setTransformationFromNonVRCamera(this._nonVRCamera),this.onInitialXRPoseSetObservable.notifyObservers(this.camera)},e.prototype._setState=function(e){this.state!==e&&(this.state=e,this.onStateChangedObservable.notifyObservers(this.state))},e}(),No=function(){function e(e,t,i,n){void 0===i&&(i=-1),void 0===n&&(n=[]),this.id=e,this.type=t,this._buttonIndex=i,this._axesIndices=n,this._axes={x:0,y:0},this._changes={},this._currentValue=0,this._hasChanges=!1,this._pressed=!1,this._touched=!1,this.onAxisValueChangedObservable=new o.c,this.onButtonStateChangedObservable=new o.c}return Object.defineProperty(e.prototype,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changes",{get:function(){return this._changes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasChanges",{get:function(){return this._hasChanges},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pressed",{get:function(){return this._pressed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"touched",{get:function(){return this._touched},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._currentValue},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.onAxisValueChangedObservable.clear(),this.onButtonStateChangedObservable.clear()},e.prototype.isAxes=function(){return 0!==this._axesIndices.length},e.prototype.isButton=function(){return-1!==this._buttonIndex},e.prototype.update=function(e){var t=!1,i=!1;if(this._hasChanges=!1,this._changes={},this.isButton()){var n=e.buttons[this._buttonIndex];if(!n)return;this._currentValue!==n.value&&(this.changes.value={current:n.value,previous:this._currentValue},t=!0,this._currentValue=n.value),this._touched!==n.touched&&(this.changes.touched={current:n.touched,previous:this._touched},t=!0,this._touched=n.touched),this._pressed!==n.pressed&&(this.changes.pressed={current:n.pressed,previous:this._pressed},t=!0,this._pressed=n.pressed)}this.isAxes()&&(this._axes.x!==e.axes[this._axesIndices[0]]&&(this.changes.axes={current:{x:e.axes[this._axesIndices[0]],y:this._axes.y},previous:{x:this._axes.x,y:this._axes.y}},this._axes.x=e.axes[this._axesIndices[0]],i=!0),this._axes.y!==e.axes[this._axesIndices[1]]&&(this.changes.axes?this.changes.axes.current.y=e.axes[this._axesIndices[1]]:this.changes.axes={current:{x:this._axes.x,y:e.axes[this._axesIndices[1]]},previous:{x:this._axes.x,y:this._axes.y}},this._axes.y=e.axes[this._axesIndices[1]],i=!0)),t&&(this._hasChanges=!0,this.onButtonStateChangedObservable.notifyObservers(this)),i&&(this._hasChanges=!0,this.onAxisValueChangedObservable.notifyObservers(this._axes))},e.BUTTON_TYPE="button",e.SQUEEZE_TYPE="squeeze",e.THUMBSTICK_TYPE="thumbstick",e.TOUCHPAD_TYPE="touchpad",e.TRIGGER_TYPE="trigger",e}(),Lo=function(){function e(e,t,i,n,r){var a=this;void 0===r&&(r=!1),this.scene=e,this.layout=t,this.gamepadObject=i,this.handedness=n,this._initComponent=function(e){if(e){var t=a.layout.components[e],i=t.type,n=t.gamepadIndices.button,r=[];void 0!==t.gamepadIndices.xAxis&&void 0!==t.gamepadIndices.yAxis&&r.push(t.gamepadIndices.xAxis,t.gamepadIndices.yAxis),a.components[e]=new No(e,i,n,r)}},this._modelReady=!1,this.components={},this.disableAnimation=!1,this.onModelLoadedObservable=new o.c,t.components&&Object.keys(t.components).forEach(this._initComponent)}return e.prototype.dispose=function(){var e=this;this.getComponentIds().forEach(function(t){return e.getComponent(t).dispose()}),this.rootMesh&&this.rootMesh.dispose()},e.prototype.getAllComponentsOfType=function(e){var t=this;return this.getComponentIds().map(function(e){return t.components[e]}).filter(function(t){return t.type===e})},e.prototype.getComponent=function(e){return this.components[e]},e.prototype.getComponentIds=function(){return Object.keys(this.components)},e.prototype.getComponentOfType=function(e){return this.getAllComponentsOfType(e)[0]||null},e.prototype.getMainComponent=function(){return this.getComponent(this.layout.selectComponentId)},e.prototype.loadModel=function(){return Object(h.b)(this,void 0,void 0,function(){var e,t,i=this;return Object(h.e)(this,function(n){return e=!this._getModelLoadingConstraints(),t=this._getGenericFilenameAndPath(),e?m.a.Warn("Falling back to generic models"):t=this._getFilenameAndPath(),[2,new Promise(function(n,r){ar.ImportMesh("",t.path,t.filename,i.scene,function(t){e?i._getGenericParentMesh(t):i._setRootMesh(t),i._processLoadedModel(t),i._modelReady=!0,i.onModelLoadedObservable.notifyObservers(i),n(!0)},null,function(e,n){m.a.Log(n),m.a.Warn("Failed to retrieve controller model of type "+i.profileId+" from the remote server: "+t.path+t.filename),r(n)})})]})})},e.prototype.updateFromXRFrame=function(e){var t=this;this.getComponentIds().forEach(function(e){return t.getComponent(e).update(t.gamepadObject)}),this.updateModel(e)},Object.defineProperty(e.prototype,"handness",{get:function(){return this.handedness},enumerable:!1,configurable:!0}),e.prototype.pulse=function(e,t,i){return void 0===i&&(i=0),this.gamepadObject.hapticActuators&&this.gamepadObject.hapticActuators[i]?this.gamepadObject.hapticActuators[i].pulse(e,t):Promise.resolve(!1)},e.prototype._getChildByName=function(e,t){return e.getChildren(function(e){return e.name===t},!1)[0]},e.prototype._getImmediateChildByName=function(e,t){return e.getChildren(function(e){return e.name==t},!0)[0]},e.prototype._lerpTransform=function(e,t,i){if(e.minMesh&&e.maxMesh&&e.valueMesh&&e.minMesh.rotationQuaternion&&e.maxMesh.rotationQuaternion&&e.valueMesh.rotationQuaternion){var n=i?.5*t+.5:t;a.b.SlerpToRef(e.minMesh.rotationQuaternion,e.maxMesh.rotationQuaternion,n,e.valueMesh.rotationQuaternion),a.e.LerpToRef(e.minMesh.position,e.maxMesh.position,n,e.valueMesh.position)}},e.prototype.updateModel=function(e){this._modelReady&&this._updateModel(e)},e.prototype._getGenericFilenameAndPath=function(){return{filename:"generic.babylon",path:"https://controllers.babylonjs.com/generic/"}},e.prototype._getGenericParentMesh=function(e){var t=this;this.rootMesh=new be.a(this.profileId+" "+this.handedness,this.scene),e.forEach(function(e){e.parent||(e.isPickable=!1,e.setParent(t.rootMesh))}),this.rootMesh.rotationQuaternion=a.b.FromEulerAngles(0,Math.PI,0)},e}(),wo=function(e){function t(i,n,r){var o=e.call(this,i,Fo[r],n,r)||this;return o.profileId=t.ProfileId,o}return Object(h.d)(t,e),t.prototype._getFilenameAndPath=function(){return{filename:"generic.babylon",path:"https://controllers.babylonjs.com/generic/"}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){},t.prototype._setRootMesh=function(e){var t=this;this.rootMesh=new be.a(this.profileId+" "+this.handedness,this.scene),e.forEach(function(e){e.isPickable=!1,e.parent||e.setParent(t.rootMesh)}),this.rootMesh.rotationQuaternion=a.b.FromEulerAngles(0,Math.PI,0)},t.prototype._updateModel=function(){},t.ProfileId="generic-trigger",t}(Lo),Fo={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-right",assetPath:"right.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-none",assetPath:"none.glb"}},Bo=function(e){function t(t,i,n,r){var o=e.call(this,t,n.layouts[i.handedness||"none"],i.gamepad,i.handedness)||this;return o._repositoryUrl=r,o._buttonMeshMapping={},o._touchDots={},o.profileId=n.profileId,o}return Object(h.d)(t,e),t.prototype.dispose=function(){var t=this;e.prototype.dispose.call(this),Object.keys(this._touchDots).forEach(function(e){t._touchDots[e].dispose()})},t.prototype._getFilenameAndPath=function(){return{filename:this.layout.assetPath,path:this._repositoryUrl+"/profiles/"+this.profileId+"/"}},t.prototype._getModelLoadingConstraints=function(){var e=ar.IsPluginForExtensionAvailable(".glb");return e||m.a.Warn("glTF / glb loaded was not registered, using generic controller instead"),e},t.prototype._processLoadedModel=function(e){var t=this;this.getComponentIds().forEach(function(e){var i=t.layout.components[e];t._buttonMeshMapping[e]={mainMesh:t._getChildByName(t.rootMesh,i.rootNodeName),states:{}},Object.keys(i.visualResponses).forEach(function(n){var r=i.visualResponses[n];if("transform"===r.valueNodeProperty)t._buttonMeshMapping[e].states[n]={valueMesh:t._getChildByName(t.rootMesh,r.valueNodeName),minMesh:t._getChildByName(t.rootMesh,r.minNodeName),maxMesh:t._getChildByName(t.rootMesh,r.maxNodeName)};else{var o=i.type===No.TOUCHPAD_TYPE&&i.touchPointNodeName?i.touchPointNodeName:r.valueNodeName;if(t._buttonMeshMapping[e].states[n]={valueMesh:t._getChildByName(t.rootMesh,o)},i.type===No.TOUCHPAD_TYPE&&!t._touchDots[n]){var a=yr.a.CreateSphere(n+"dot",{diameter:.0015,segments:8},t.scene);a.material=new Ui.a(n+"mat",t.scene),a.material.diffuseColor=s.a.Red(),a.parent=t._buttonMeshMapping[e].states[n].valueMesh||null,a.isVisible=!1,t._touchDots[n]=a}}})})},t.prototype._setRootMesh=function(e){var t;this.rootMesh=new be.a(this.profileId+"-"+this.handedness,this.scene),this.rootMesh.isPickable=!1;for(var i=0;i<e.length;i++){var n=e[i];n.isPickable=!1,n.parent||(t=n)}t&&t.setParent(this.rootMesh),this.scene.useRightHandedSystem||this.rootMesh.rotate(J.a.Y,Math.PI,J.c.WORLD)},t.prototype._updateModel=function(e){var t=this;this.disableAnimation||this.getComponentIds().forEach(function(e){var i=t.getComponent(e);if(i.hasChanges){var n=t._buttonMeshMapping[e],r=t.layout.components[e];Object.keys(r.visualResponses).forEach(function(e){var o=r.visualResponses[e],a=i.value;if("xAxis"===o.componentProperty?a=i.axes.x:"yAxis"===o.componentProperty&&(a=i.axes.y),"transform"===o.valueNodeProperty)t._lerpTransform(n.states[e],a,"button"!==o.componentProperty);else{var s=n.states[e].valueMesh;s&&(s.isVisible=i.touched||i.pressed),t._touchDots[e]&&(t._touchDots[e].isVisible=i.touched||i.pressed)}})}})},t}(Lo),Uo=function(){function e(){}return e.ClearProfilesCache=function(){this._ProfilesList=null,this._ProfileLoadingPromises={}},e.DefaultFallbacks=function(){this.RegisterFallbacksForProfileId("google-daydream",["generic-touchpad"]),this.RegisterFallbacksForProfileId("htc-vive-focus",["generic-trigger-touchpad"]),this.RegisterFallbacksForProfileId("htc-vive",["generic-trigger-squeeze-touchpad"]),this.RegisterFallbacksForProfileId("magicleap-one",["generic-trigger-squeeze-touchpad"]),this.RegisterFallbacksForProfileId("windows-mixed-reality",["generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("microsoft-mixed-reality",["windows-mixed-reality","generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("oculus-go",["generic-trigger-touchpad"]),this.RegisterFallbacksForProfileId("oculus-touch-v2",["oculus-touch","generic-trigger-squeeze-thumbstick"]),this.RegisterFallbacksForProfileId("oculus-touch",["generic-trigger-squeeze-thumbstick"]),this.RegisterFallbacksForProfileId("samsung-gearvr",["windows-mixed-reality","generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("samsung-odyssey",["generic-touchpad"]),this.RegisterFallbacksForProfileId("valve-index",["generic-trigger-squeeze-touchpad-thumbstick"])},e.FindFallbackWithProfileId=function(e){var t=this._Fallbacks[e]||[];return t.unshift(e),t},e.GetMotionControllerWithXRInput=function(e,t,i){var n=this,r=[];if(i&&r.push(i),r.push.apply(r,e.profiles||[]),r.length&&!r[0]&&r.pop(),e.gamepad&&e.gamepad.id)switch(e.gamepad.id){case e.gamepad.id.match(/oculus touch/gi)?e.gamepad.id:void 0:r.push("oculus-touch-v2")}var o=r.indexOf("windows-mixed-reality");if(-1!==o&&r.splice(o,0,"microsoft-mixed-reality"),r.length||r.push("generic-trigger"),this.UseOnlineRepository){var a=this.PrioritizeOnlineRepository?this._LoadProfileFromRepository:this._LoadProfilesFromAvailableControllers,s=this.PrioritizeOnlineRepository?this._LoadProfilesFromAvailableControllers:this._LoadProfileFromRepository;return a.call(this,r,e,t).catch(function(){return s.call(n,r,e,t)})}return this._LoadProfilesFromAvailableControllers(r,e,t)},e.RegisterController=function(e,t){this._AvailableControllers[e]=t},e.RegisterFallbacksForProfileId=function(e,t){var i;this._Fallbacks[e]?(i=this._Fallbacks[e]).push.apply(i,t):this._Fallbacks[e]=t},e.UpdateProfilesList=function(){return this._ProfilesList=Ce.b.LoadFileAsync(this.BaseRepositoryUrl+"/profiles/profilesList.json",!1).then(function(e){return JSON.parse(e.toString())}),this._ProfilesList},e._LoadProfileFromRepository=function(e,t,i){var n=this;return Promise.resolve().then(function(){return n._ProfilesList?n._ProfilesList:n.UpdateProfilesList()}).then(function(t){for(var i=0;i<e.length;++i)if(e[i]&&t[e[i]])return e[i];throw new Error("neither controller "+e[0]+" nor all fallbacks were found in the repository,")}).then(function(e){return n._ProfileLoadingPromises[e]||(n._ProfileLoadingPromises[e]=Ce.b.LoadFileAsync(n.BaseRepositoryUrl+"/profiles/"+e+"/profile.json",!1).then(function(e){return JSON.parse(e)})),n._ProfileLoadingPromises[e]}).then(function(e){return new Bo(i,t,e,n.BaseRepositoryUrl)})},e._LoadProfilesFromAvailableControllers=function(e,t,i){for(var n=0;n<e.length;++n)if(e[n])for(var r=this.FindFallbackWithProfileId(e[n]),o=0;o<r.length;++o){var a=this._AvailableControllers[r[o]];if(a)return Promise.resolve(a(t,i))}throw new Error("no controller requested was found in the available controllers list")},e._AvailableControllers={},e._Fallbacks={},e._ProfileLoadingPromises={},e.BaseRepositoryUrl="https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist",e.PrioritizeOnlineRepository=!0,e.UseOnlineRepository=!0,e}();Uo.RegisterController(wo.ProfileId,function(e,t){return new wo(t,e.gamepad,e.handedness)}),Uo.DefaultFallbacks();var Vo=0,ko=function(){function e(e,t,i){var n=this;void 0===i&&(i={}),this._scene=e,this.inputSource=t,this._options=i,this._tmpVector=new a.e,this._disposed=!1,this.onDisposeObservable=new o.c,this.onMeshLoadedObservable=new o.c,this.onMotionControllerInitObservable=new o.c,this._uniqueId="controller-"+Vo+++"-"+t.targetRayMode+"-"+t.handedness,this.pointer=new ze.a(this._uniqueId+"-pointer",e),this.pointer.rotationQuaternion=new a.b,this.inputSource.gripSpace&&(this.grip=new ze.a(this._uniqueId+"-grip",this._scene),this.grip.rotationQuaternion=new a.b),this._tmpVector.set(0,0,this._scene.useRightHandedSystem?-1:1),this.inputSource.gamepad&&Uo.GetMotionControllerWithXRInput(t,e,this._options.forceControllerProfile).then(function(e){n.motionController=e,n.onMotionControllerInitObservable.notifyObservers(e),n._options.doNotLoadControllerMesh||n.motionController.loadModel().then(function(e){var t;e&&n.motionController&&n.motionController.rootMesh&&(n._options.renderingGroupId&&(n.motionController.rootMesh.renderingGroupId=n._options.renderingGroupId,n.motionController.rootMesh.getChildMeshes(!1).forEach(function(e){return e.renderingGroupId=n._options.renderingGroupId})),n.onMeshLoadedObservable.notifyObservers(n.motionController.rootMesh),n.motionController.rootMesh.parent=n.grip||n.pointer,n.motionController.disableAnimation=!!n._options.disableMotionControllerAnimation),n._disposed&&(null===(t=n.motionController)||void 0===t||t.dispose())})},function(){Ce.b.Warn("Could not find a matching motion controller for the registered input source")})}return Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.grip&&this.grip.dispose(),this.motionController&&this.motionController.dispose(),this.pointer.dispose(),this.onMotionControllerInitObservable.clear(),this.onMeshLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._disposed=!0},e.prototype.getWorldPointerRayToRef=function(e,t){void 0===t&&(t=!1);var i=t&&this.grip?this.grip:this.pointer;a.e.TransformNormalToRef(this._tmpVector,i.getWorldMatrix(),e.direction),e.direction.normalize(),e.origin.copyFrom(i.absolutePosition),e.length=1e3},e.prototype.updateFromXRFrame=function(e,t){var i=e.getPose(this.inputSource.targetRaySpace,t);if(i){var n=i.transform.position;this.pointer.position.set(n.x,n.y,n.z);var r=i.transform.orientation;this.pointer.rotationQuaternion.set(r.x,r.y,r.z,r.w),this._scene.useRightHandedSystem||(this.pointer.position.z*=-1,this.pointer.rotationQuaternion.z*=-1,this.pointer.rotationQuaternion.w*=-1)}if(this.inputSource.gripSpace&&this.grip){var o=e.getPose(this.inputSource.gripSpace,t);if(o){n=o.transform.position;var a=o.transform.orientation;this.grip.position.set(n.x,n.y,n.z),this.grip.rotationQuaternion.set(a.x,a.y,a.z,a.w),this._scene.useRightHandedSystem||(this.grip.position.z*=-1,this.grip.rotationQuaternion.z*=-1,this.grip.rotationQuaternion.w*=-1)}}this.motionController&&this.motionController.updateFromXRFrame(e)},e}(),Go=function(){function e(e,t,i){var n=this;if(void 0===i&&(i={}),this.xrSessionManager=e,this.xrCamera=t,this.options=i,this.controllers=[],this.onControllerAddedObservable=new o.c,this.onControllerRemovedObservable=new o.c,this._onInputSourcesChange=function(e){n._addAndRemoveControllers(e.added,e.removed)},this._sessionEndedObserver=this.xrSessionManager.onXRSessionEnded.add(function(){n._addAndRemoveControllers([],n.controllers.map(function(e){return e.inputSource}))}),this._sessionInitObserver=this.xrSessionManager.onXRSessionInit.add(function(e){e.addEventListener("inputsourceschange",n._onInputSourcesChange)}),this._frameObserver=this.xrSessionManager.onXRFrameObservable.add(function(e){n.controllers.forEach(function(t){t.updateFromXRFrame(e,n.xrSessionManager.referenceSpace)})}),this.options.customControllersRepositoryURL&&(Uo.BaseRepositoryUrl=this.options.customControllersRepositoryURL),Uo.UseOnlineRepository=!this.options.disableOnlineControllerRepository,Uo.UseOnlineRepository)try{Uo.UpdateProfilesList().catch(function(){Uo.UseOnlineRepository=!1})}catch(e){Uo.UseOnlineRepository=!1}}return e.prototype._addAndRemoveControllers=function(e,t){for(var i=this,n=this.controllers.map(function(e){return e.inputSource}),r=0,o=e;r<o.length;r++){var a=o[r];if(-1===n.indexOf(a)){var s=new ko(this.xrSessionManager.scene,a,Object(h.a)(Object(h.a)({},this.options.controllerOptions||{}),{forceControllerProfile:this.options.forceInputProfile,doNotLoadControllerMesh:this.options.doNotLoadControllerMeshes,disableMotionControllerAnimation:this.options.disableControllerAnimation}));this.controllers.push(s),this.onControllerAddedObservable.notifyObservers(s)}}var c=[],l=[];this.controllers.forEach(function(e){-1===t.indexOf(e.inputSource)?c.push(e):l.push(e)}),this.controllers=c,l.forEach(function(e){i.onControllerRemovedObservable.notifyObservers(e),e.dispose()})},e.prototype.dispose=function(){this.controllers.forEach(function(e){e.dispose()}),this.xrSessionManager.onXRFrameObservable.remove(this._frameObserver),this.xrSessionManager.onXRSessionInit.remove(this._sessionInitObserver),this.xrSessionManager.onXRSessionEnded.remove(this._sessionEndedObserver),this.onControllerAddedObservable.clear(),this.onControllerRemovedObservable.clear()},e}(),zo=function(){function e(e){this._xrSessionManager=e,this._attached=!1,this._removeOnDetach=[],this.isDisposed=!1,this.disableAutoAttach=!1,this.xrNativeFeatureName=""}return Object.defineProperty(e.prototype,"attached",{get:function(){return this._attached},enumerable:!1,configurable:!0}),e.prototype.attach=function(e){var t=this;if(this.isDisposed)return!1;if(e)this.attached&&this.detach();else if(this.attached)return!1;return this._attached=!0,this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable,function(e){return t._onXRFrame(e)}),!0},e.prototype.detach=function(){return this._attached?(this._attached=!1,this._removeOnDetach.forEach(function(e){e.observable.remove(e.observer)}),!0):(this.disableAutoAttach=!0,!1)},e.prototype.dispose=function(){this.detach(),this.isDisposed=!0},e.prototype.isCompatible=function(){return!0},e.prototype._addNewAttachObserver=function(e,t){this._removeOnDetach.push({observable:e,observer:e.add(t)})},e}(),jo=function(e){function t(i,n){var r=e.call(this,i)||this;return r._options=n,r._attachController=function(e){if(!r._controllers[e.uniqueId]){var i=r._generateNewMeshPair(e.pointer),n=i.laserPointer,o=i.selectionMesh;switch(r._controllers[e.uniqueId]={xrController:e,laserPointer:n,selectionMesh:o,meshUnderPointer:null,pick:null,tmpRay:new Xt.a(new a.e,new a.e),id:t._idCounter++},r._attachedController?!r._options.enablePointerSelectionOnAllControllers&&r._options.preferredHandedness&&e.inputSource.handedness===r._options.preferredHandedness&&(r._attachedController=e.uniqueId):r._options.enablePointerSelectionOnAllControllers||(r._attachedController=e.uniqueId),e.inputSource.targetRayMode){case"tracked-pointer":return r._attachTrackedPointerRayMode(e);case"gaze":return r._attachGazeMode(e);case"screen":return r._attachScreenRayMode(e)}}},r._controllers={},r._tmpVectorForPickCompare=new a.e,r.disablePointerLighting=!0,r.disableSelectionMeshLighting=!0,r.displayLaserPointer=!0,r.displaySelectionMesh=!0,r.laserPointerPickedColor=new s.a(.9,.9,.9),r.laserPointerDefaultColor=new s.a(.7,.7,.7),r.selectionMeshDefaultColor=new s.a(.8,.8,.8),r.selectionMeshPickedColor=new s.a(.3,.3,1),r._identityMatrix=a.a.Identity(),r._screenCoordinatesRef=a.e.Zero(),r._viewportRef=new mi.a(0,0,0,0),r._scene=r._xrSessionManager.scene,r}return Object(h.d)(t,e),t.prototype.attach=function(){var i=this;if(!e.prototype.attach.call(this))return!1;if(this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,function(e){i._detachController(e.uniqueId)}),this._scene.constantlyUpdateMeshUnderPointer=!0,this._options.gazeCamera){var n=this._options.gazeCamera,r=this._generateNewMeshPair(n),o=r.laserPointer,s=r.selectionMesh;this._controllers.camera={webXRCamera:n,laserPointer:o,selectionMesh:s,meshUnderPointer:null,pick:null,tmpRay:new Xt.a(new a.e,new a.e),id:t._idCounter++},this._attachGazeMode()}return!0},t.prototype.detach=function(){var t=this;return!!e.prototype.detach.call(this)&&(Object.keys(this._controllers).forEach(function(e){t._detachController(e)}),!0)},t.prototype.getMeshUnderPointer=function(e){return this._controllers[e]?this._controllers[e].meshUnderPointer:null},t.prototype.getXRControllerByPointerId=function(e){for(var t=Object.keys(this._controllers),i=0;i<t.length;++i)if(this._controllers[t[i]].id===e)return this._controllers[t[i]].xrController||null;return null},t.prototype._onXRFrame=function(e){var t=this;Object.keys(this._controllers).forEach(function(e){var i,n=t._controllers[e];if(!t._options.enablePointerSelectionOnAllControllers&&e!==t._attachedController)return n.selectionMesh.isVisible=!1,n.laserPointer.isVisible=!1,void(n.pick=null);if(n.laserPointer.isVisible=t.displayLaserPointer,n.xrController)i=n.xrController.pointer.position,n.xrController.getWorldPointerRayToRef(n.tmpRay);else{if(!n.webXRCamera)return;i=n.webXRCamera.position,n.webXRCamera.getForwardRayToRef(n.tmpRay)}if(t._options.maxPointerDistance&&(n.tmpRay.length=t._options.maxPointerDistance),!t._options.disableScenePointerVectorUpdate&&i){var r=t._xrSessionManager.scene,o=t._options.xrInput.xrCamera;o&&(o.viewport.toGlobalToRef(r.getEngine().getRenderWidth(),r.getEngine().getRenderHeight(),t._viewportRef),a.e.ProjectToRef(i,t._identityMatrix,r.getTransformMatrix(),t._viewportRef,t._screenCoordinatesRef),r.pointerX=t._screenCoordinatesRef.x,r.pointerY=t._screenCoordinatesRef.y)}n.pick=t._scene.pickWithRay(n.tmpRay,t._scene.pointerMovePredicate||t.raySelectionPredicate);var s=n.pick;if(s&&s.pickedPoint&&s.hit){t._updatePointerDistance(n.laserPointer,s.distance),n.selectionMesh.position.copyFrom(s.pickedPoint),n.selectionMesh.scaling.x=Math.sqrt(s.distance),n.selectionMesh.scaling.y=Math.sqrt(s.distance),n.selectionMesh.scaling.z=Math.sqrt(s.distance);var c=t._convertNormalToDirectionOfRay(s.getNormal(!0),n.tmpRay);if(n.selectionMesh.position.copyFrom(s.pickedPoint),c){var l=a.e.Cross(J.a.Y,c),u=a.e.Cross(c,l);a.e.RotationFromAxisToRef(u,c,l,n.selectionMesh.rotation),n.selectionMesh.position.addInPlace(c.scale(.001))}n.selectionMesh.isVisible=t.displaySelectionMesh,n.meshUnderPointer=s.pickedMesh}else n.selectionMesh.isVisible=!1,t._updatePointerDistance(n.laserPointer,1),n.meshUnderPointer=null})},t.prototype._attachGazeMode=function(e){var t=this,i=this._controllers[e&&e.uniqueId||"camera"],n=this._options.timeToSelect||3e3,r=this._options.useUtilityLayer?this._options.customUtilityLayerScene||vr.a.DefaultUtilityLayer.utilityLayerScene:this._scene,o=new hn.a,a=Qi.CreateTorus("selection",{diameter:.0525,thickness:.015,tessellation:20},r);a.isVisible=!1,a.isPickable=!1,a.parent=i.selectionMesh;var s=0,c=!1;i.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add(function(){if(i.pick){if(i.laserPointer.material.alpha=0,a.isVisible=!1,i.pick.hit)if(t._pickingMoved(o,i.pick))c&&(t._options.disablePointerUpOnTouchOut||t._scene.simulatePointerUp(i.pick,{pointerId:i.id})),c=!1,s=0;else if(s>n/10&&(a.isVisible=!0),(s+=t._scene.getEngine().getDeltaTime())>=n)t._scene.simulatePointerDown(i.pick,{pointerId:i.id}),c=!0,t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(i.pick,{pointerId:i.id}),a.isVisible=!1;else{var e=1-s/n;a.scaling.set(e,e,e)}else c=!1,s=0;t._scene.simulatePointerMove(i.pick,{pointerId:i.id}),o=i.pick}}),void 0!==this._options.renderingGroupId&&(a.renderingGroupId=this._options.renderingGroupId),e&&e.onDisposeObservable.addOnce(function(){i.pick&&!t._options.disablePointerUpOnTouchOut&&c&&t._scene.simulatePointerUp(i.pick,{pointerId:i.id}),a.dispose()})},t.prototype._attachScreenRayMode=function(e){var t=this,i=this._controllers[e.uniqueId],n=!1;i.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add(function(){!i.pick||t._options.disablePointerUpOnTouchOut&&n||(n?t._scene.simulatePointerMove(i.pick,{pointerId:i.id}):(t._scene.simulatePointerDown(i.pick,{pointerId:i.id}),n=!0,t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(i.pick,{pointerId:i.id})))}),e.onDisposeObservable.addOnce(function(){i.pick&&n&&!t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(i.pick,{pointerId:i.id})})},t.prototype._attachTrackedPointerRayMode=function(e){var t=this,i=this._controllers[e.uniqueId];if(this._options.forceGazeMode)return this._attachGazeMode(e);if(i.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add(function(){i.laserPointer.material.disableLighting=t.disablePointerLighting,i.selectionMesh.material.disableLighting=t.disableSelectionMeshLighting,i.pick&&t._scene.simulatePointerMove(i.pick,{pointerId:i.id})}),e.inputSource.gamepad){var n=function(n){t._options.overrideButtonId&&(i.selectionComponent=n.getComponent(t._options.overrideButtonId)),i.selectionComponent||(i.selectionComponent=n.getMainComponent()),i.onButtonChangedObserver=i.selectionComponent.onButtonStateChangedObservable.add(function(n){if(n.changes.pressed){var r=n.changes.pressed.current;i.pick?(t._options.enablePointerSelectionOnAllControllers||e.uniqueId===t._attachedController)&&(r?(t._scene.simulatePointerDown(i.pick,{pointerId:i.id}),i.selectionMesh.material.emissiveColor=t.selectionMeshPickedColor,i.laserPointer.material.emissiveColor=t.laserPointerPickedColor):(t._scene.simulatePointerUp(i.pick,{pointerId:i.id}),i.selectionMesh.material.emissiveColor=t.selectionMeshDefaultColor,i.laserPointer.material.emissiveColor=t.laserPointerDefaultColor)):!r||t._options.enablePointerSelectionOnAllControllers||t._options.disableSwitchOnClick||(t._attachedController=e.uniqueId)}})};e.motionController?n(e.motionController):e.onMotionControllerInitObservable.add(n)}else{var r=function(e){i.xrController&&e.inputSource===i.xrController.inputSource&&i.pick&&(t._scene.simulatePointerDown(i.pick,{pointerId:i.id}),i.selectionMesh.material.emissiveColor=t.selectionMeshPickedColor,i.laserPointer.material.emissiveColor=t.laserPointerPickedColor)},o=function(e){i.xrController&&e.inputSource===i.xrController.inputSource&&i.pick&&(t._scene.simulatePointerUp(i.pick,{pointerId:i.id}),i.selectionMesh.material.emissiveColor=t.selectionMeshDefaultColor,i.laserPointer.material.emissiveColor=t.laserPointerDefaultColor)};i.eventListeners={selectend:o,selectstart:r},this._xrSessionManager.session.addEventListener("selectstart",r),this._xrSessionManager.session.addEventListener("selectend",o)}},t.prototype._convertNormalToDirectionOfRay=function(e,t){return e&&Math.acos(a.e.Dot(e,t.direction))<Math.PI/2&&e.scaleInPlace(-1),e},t.prototype._detachController=function(e){var t=this,i=this._controllers[e];if(i&&(i.selectionComponent&&i.onButtonChangedObserver&&i.selectionComponent.onButtonStateChangedObservable.remove(i.onButtonChangedObserver),i.onFrameObserver&&this._xrSessionManager.onXRFrameObservable.remove(i.onFrameObserver),i.eventListeners&&Object.keys(i.eventListeners).forEach(function(e){var n=i.eventListeners&&i.eventListeners[e];n&&t._xrSessionManager.session.removeEventListener(e,n)}),i.selectionMesh.dispose(),i.laserPointer.dispose(),delete this._controllers[e],this._attachedController===e)){var n=Object.keys(this._controllers);n.length?this._attachedController=n[0]:this._attachedController=""}},t.prototype._generateNewMeshPair=function(e){var t=this._options.useUtilityLayer?this._options.customUtilityLayerScene||vr.a.DefaultUtilityLayer.utilityLayerScene:this._scene,i=qi.a.CreateCylinder("laserPointer",{height:1,diameterTop:2e-4,diameterBottom:.004,tessellation:20,subdivisions:1},t);i.parent=e;var n=new Ui.a("laserPointerMat",t);n.emissiveColor=this.laserPointerDefaultColor,n.alpha=.7,i.material=n,i.rotation.x=Math.PI/2,this._updatePointerDistance(i,1),i.isPickable=!1;var r=Qi.CreateTorus("gazeTracker",{diameter:.0105,thickness:.0075,tessellation:20},t);r.bakeCurrentTransformIntoVertices(),r.isPickable=!1,r.isVisible=!1;var o=new Ui.a("targetMat",t);return o.specularColor=s.a.Black(),o.emissiveColor=this.selectionMeshDefaultColor,o.backFaceCulling=!1,r.material=o,void 0!==this._options.renderingGroupId&&(i.renderingGroupId=this._options.renderingGroupId,r.renderingGroupId=this._options.renderingGroupId),{laserPointer:i,selectionMesh:r}},t.prototype._pickingMoved=function(e,t){var i;if(!e.hit||!t.hit)return!0;if(!(e.pickedMesh&&e.pickedPoint&&t.pickedMesh&&t.pickedPoint))return!0;if(e.pickedMesh!==t.pickedMesh)return!0;null===(i=e.pickedPoint)||void 0===i||i.subtractToRef(t.pickedPoint,this._tmpVectorForPickCompare),this._tmpVectorForPickCompare.set(Math.abs(this._tmpVectorForPickCompare.x),Math.abs(this._tmpVectorForPickCompare.y),Math.abs(this._tmpVectorForPickCompare.z));var n=.01*(this._options.gazeModePointerMovedFactor||1)*t.distance;return this._tmpVectorForPickCompare.length()>n},t.prototype._updatePointerDistance=function(e,t){void 0===t&&(t=100),e.scaling.y=t,this._scene.useRightHandedSystem&&(t*=-1),e.position.z=t/2+.05},Object.defineProperty(t.prototype,"lasterPointerDefaultColor",{get:function(){return this.laserPointerDefaultColor},enumerable:!1,configurable:!0}),t._idCounter=200,t.Name=Mo.POINTER_SELECTION,t.Version=1,t}(zo);Io.AddWebXRFeature(jo.Name,function(e,t){return function(){return new jo(e,t)}},jo.Version,!0);var Wo,Ho=function(){function e(e,t,i){this.element=e,this.sessionMode=t,this.referenceSpaceType=i}return e.prototype.update=function(e){},e}(),Xo=function(){},Yo=function(){function e(e,t){var i=this;if(this.scene=e,this.options=t,this._activeButton=null,this._buttons=[],this.activeButtonChangedObservable=new o.c,this.overlay=document.createElement("div"),this.overlay.classList.add("xr-button-overlay"),this.overlay.style.cssText="z-index:11;position: absolute; right: 20px;bottom: 50px;","undefined"!=typeof window&&window.location&&"http:"===window.location.protocol&&Ce.b.Warn("WebXR can only be served over HTTPS"),t.customButtons)this._buttons=t.customButtons;else{var n=t.sessionMode||"immersive-vr",r=t.referenceSpaceType||"local-floor",a=".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url("+("undefined"==typeof SVGSVGElement?"https://cdn.babylonjs.com/Assets/vrButton.png":"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";a+='.babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: "EXIT"} .xr-error::after { content: "ERROR"}';var s=document.createElement("style");s.appendChild(document.createTextNode(a)),document.getElementsByTagName("head")[0].appendChild(s);var c=document.createElement("button");c.className="babylonVRicon",c.title=n+" - "+r,this._buttons.push(new Ho(c,n,r)),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",c.className="babylonVRicon"+(e===this?" vrdisplaypresenting":"")},this._updateButtons(null)}var l=e.getEngine().getInputElement();l&&l.parentNode&&(l.parentNode.appendChild(this.overlay),e.onDisposeObservable.addOnce(function(){i.dispose()}))}return e.CreateAsync=function(t,i,n){var r=this,o=new e(t,n),a=o._buttons.map(function(e){return i.sessionManager.isSessionSupportedAsync(e.sessionMode)});return i.onStateChangedObservable.add(function(e){e==Yi.NOT_IN_XR&&o._updateButtons(null)}),Promise.all(a).then(function(e){return e.forEach(function(e,t){e?(o.overlay.appendChild(o._buttons[t].element),o._buttons[t].element.onclick=function(){return Object(h.b)(r,void 0,void 0,function(){var e,r,a;return Object(h.e)(this,function(s){switch(s.label){case 0:return i.state!=Yi.IN_XR?[3,2]:[4,i.exitXRAsync()];case 1:return s.sent(),o._updateButtons(null),[3,6];case 2:if(i.state!=Yi.NOT_IN_XR)return[3,6];if(!n.renderTarget)return[3,6];s.label=3;case 3:return s.trys.push([3,5,,6]),[4,i.enterXRAsync(o._buttons[t].sessionMode,o._buttons[t].referenceSpaceType,n.renderTarget,{optionalFeatures:n.optionalFeatures,requiredFeatures:n.requiredFeatures})];case 4:return s.sent(),o._updateButtons(o._buttons[t]),[3,6];case 5:return e=s.sent(),o._updateButtons(null),r=o._buttons[t].element,a=r.title,r.title="Error entering XR session : "+a,r.classList.add("xr-error"),n.onError&&n.onError(e),[3,6];case 6:return[2]}})})}):Ce.b.Warn('Session mode "'+o._buttons[t].sessionMode+'" not supported in browser')}),o})},e.prototype.dispose=function(){var e=this.scene.getEngine().getInputElement();e&&e.parentNode&&e.parentNode.contains(this.overlay)&&e.parentNode.removeChild(this.overlay),this.activeButtonChangedObservable.clear()},e.prototype._updateButtons=function(e){var t=this;this._activeButton=e,this._buttons.forEach(function(e){e.update(t._activeButton)}),this.activeButtonChangedObservable.notifyObservers(this._activeButton)},e}();function Ko(e){var t,i=0,n=Date.now();e.observableParameters=null!==(t=e.observableParameters)&&void 0!==t?t:{};var r=e.contextObservable.add(function(t){var o=Date.now(),a={startTime:n,currentTime:o,deltaTime:i=o-n,completeRate:i/e.timeout,payload:t};e.onTick&&e.onTick(a),e.breakCondition&&e.breakCondition()&&(e.contextObservable.remove(r),e.onAborted&&e.onAborted(a)),i>=e.timeout&&(e.contextObservable.remove(r),e.onEnded&&e.onEnded(a))},e.observableParameters.mask,e.observableParameters.insertFirst,e.observableParameters.scope);return r}!function(e){e[e.INIT=0]="INIT",e[e.STARTED=1]="STARTED",e[e.ENDED=2]="ENDED"}(Wo||(Wo={}));var Qo=function(){function e(e){var t,i,n=this;this.onEachCountObservable=new o.c,this.onTimerAbortedObservable=new o.c,this.onTimerEndedObservable=new o.c,this.onStateChangedObservable=new o.c,this._observer=null,this._breakOnNextTick=!1,this._tick=function(e){var t=Date.now();n._timer=t-n._startTime;var i={startTime:n._startTime,currentTime:t,deltaTime:n._timer,completeRate:n._timer/n._timeToEnd,payload:e},r=n._breakOnNextTick||n._breakCondition(i);r||n._timer>=n._timeToEnd?n._stop(i,r):n.onEachCountObservable.notifyObservers(i)},this._setState(Wo.INIT),this._contextObservable=e.contextObservable,this._observableParameters=null!==(t=e.observableParameters)&&void 0!==t?t:{},this._breakCondition=null!==(i=e.breakCondition)&&void 0!==i?i:function(){return!1},e.onEnded&&this.onTimerEndedObservable.add(e.onEnded),e.onTick&&this.onEachCountObservable.add(e.onTick),e.onAborted&&this.onTimerAbortedObservable.add(e.onAborted)}return Object.defineProperty(e.prototype,"breakCondition",{set:function(e){this._breakCondition=e},enumerable:!1,configurable:!0}),e.prototype.clearObservables=function(){this.onEachCountObservable.clear(),this.onTimerAbortedObservable.clear(),this.onTimerEndedObservable.clear(),this.onStateChangedObservable.clear()},e.prototype.start=function(e){if(void 0===e&&(e=this._timeToEnd),this._state===Wo.STARTED)throw new Error("Timer already started. Please stop it before starting again");this._timeToEnd=e,this._startTime=Date.now(),this._timer=0,this._observer=this._contextObservable.add(this._tick,this._observableParameters.mask,this._observableParameters.insertFirst,this._observableParameters.scope),this._setState(Wo.STARTED)},e.prototype.stop=function(){this._state===Wo.STARTED&&(this._breakOnNextTick=!0)},e.prototype.dispose=function(){this._observer&&this._contextObservable.remove(this._observer),this.clearObservables()},e.prototype._setState=function(e){this._state=e,this.onStateChangedObservable.notifyObservers(this._state)},e.prototype._stop=function(e,t){void 0===t&&(t=!1),this._contextObservable.remove(this._observer),this._setState(Wo.ENDED),t?this.onTimerAbortedObservable.notifyObservers(e):this.onTimerEndedObservable.notifyObservers(e)},e}(),qo=function(e){function t(t,i){var n=e.call(this,t)||this;return n._options=i,n._controllers={},n._snappedToPoint=!1,n._tmpRay=new Xt.a(new a.e,new a.e),n._tmpVector=new a.e,n._tmpQuaternion=new a.b,n.backwardsMovementEnabled=!0,n.backwardsTeleportationDistance=.7,n.parabolicCheckRadius=5,n.parabolicRayEnabled=!0,n.straightRayEnabled=!0,n.rotationAngle=Math.PI/8,n._rotationEnabled=!0,n._attachController=function(e){if(!(n._controllers[e.uniqueId]||n._options.forceHandedness&&e.inputSource.handedness!==n._options.forceHandedness)){n._controllers[e.uniqueId]={xrController:e,teleportationState:{forward:!1,backwards:!1,rotating:!1,currentRotation:0,baseRotation:0}};var t=n._controllers[e.uniqueId];if("tracked-pointer"===t.xrController.inputSource.targetRayMode&&t.xrController.inputSource.gamepad){var i=function(){if(e.motionController){var i=e.motionController.getComponentOfType(No.THUMBSTICK_TYPE)||e.motionController.getComponentOfType(No.TOUCHPAD_TYPE);if(!i||n._options.useMainComponentOnly){var r=e.motionController.getMainComponent();if(!r)return;t.teleportationComponent=r,t.onButtonChangedObserver=r.onButtonStateChangedObservable.add(function(){r.changes.pressed&&(r.changes.pressed.current?(t.teleportationState.forward=!0,n._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=n._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y,t.teleportationState.currentRotation=0,Ko({timeout:n._options.timeToTeleport||3e3,contextObservable:n._xrSessionManager.onXRFrameObservable,breakCondition:function(){return!r.pressed},onEnded:function(){n._currentTeleportationControllerId===t.xrController.uniqueId&&t.teleportationState.forward&&n._teleportForward(e.uniqueId)}})):(t.teleportationState.forward=!1,n._currentTeleportationControllerId=""))})}else t.teleportationComponent=i,t.onAxisChangedObserver=i.onAxisValueChangedObservable.add(function(i){if(i.y<=.7&&t.teleportationState.backwards&&(t.teleportationState.backwards=!1),i.y>.7&&!t.teleportationState.forward&&n.backwardsMovementEnabled&&!n.snapPointsOnly&&!t.teleportationState.backwards){t.teleportationState.backwards=!0,n._tmpQuaternion.copyFrom(n._options.xrInput.xrCamera.rotationQuaternion),n._tmpQuaternion.toEulerAnglesToRef(n._tmpVector),n._tmpVector.x=0,n._tmpVector.z=0,a.b.FromEulerVectorToRef(n._tmpVector,n._tmpQuaternion),n._tmpVector.set(0,0,n.backwardsTeleportationDistance*(n._xrSessionManager.scene.useRightHandedSystem?1:-1)),n._tmpVector.rotateByQuaternionToRef(n._tmpQuaternion,n._tmpVector),n._tmpVector.addInPlace(n._options.xrInput.xrCamera.position),n._tmpRay.origin.copyFrom(n._tmpVector),n._tmpRay.length=n._options.xrInput.xrCamera.realWorldHeight+.1,n._tmpRay.direction.set(0,-1,0);var r=n._xrSessionManager.scene.pickWithRay(n._tmpRay,function(e){return-1!==n._floorMeshes.indexOf(e)});r&&r.pickedPoint&&(n._options.xrInput.xrCamera.position.x=r.pickedPoint.x,n._options.xrInput.xrCamera.position.z=r.pickedPoint.z)}if(i.y<-.7&&!n._currentTeleportationControllerId&&!t.teleportationState.rotating&&(t.teleportationState.forward=!0,n._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=n._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y),i.x){if(t.teleportationState.forward)n._currentTeleportationControllerId===t.xrController.uniqueId&&(n.rotationEnabled?setTimeout(function(){t.teleportationState.currentRotation=Math.atan2(i.x,i.y*(n._xrSessionManager.scene.useRightHandedSystem?1:-1))}):t.teleportationState.currentRotation=0);else if(!t.teleportationState.rotating&&Math.abs(i.x)>.7){t.teleportationState.rotating=!0;var o=n.rotationAngle*(i.x>0?1:-1)*(n._xrSessionManager.scene.useRightHandedSystem?-1:1);n._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(a.b.FromEulerAngles(0,o,0))}}else t.teleportationState.rotating=!1;0===i.x&&0===i.y&&t.teleportationState.forward&&n._teleportForward(e.uniqueId)})}};e.motionController?i():e.onMotionControllerInitObservable.addOnce(function(){i()})}else n._xrSessionManager.scene.onPointerObservable.add(function(i){i.type===Ne.a.POINTERDOWN?(t.teleportationState.forward=!0,n._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=n._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y,t.teleportationState.currentRotation=0,Ko({timeout:n._options.timeToTeleport||3e3,contextObservable:n._xrSessionManager.onXRFrameObservable,onEnded:function(){n._currentTeleportationControllerId===t.xrController.uniqueId&&t.teleportationState.forward&&n._teleportForward(e.uniqueId)}})):i.type===Ne.a.POINTERUP&&(t.teleportationState.forward=!1,n._currentTeleportationControllerId="")})}},n._options.teleportationTargetMesh||n._createDefaultTargetMesh(),n._floorMeshes=n._options.floorMeshes||[],n._snapToPositions=n._options.snapPositions||[],n._setTargetMeshVisibility(!1),n}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"rotationEnabled",{get:function(){return this._rotationEnabled},set:function(e){if(this._rotationEnabled=e,this._options.teleportationTargetMesh){var t=this._options.teleportationTargetMesh.getChildMeshes(!1,function(e){return"rotationCone"===e.name});t[0]&&t[0].setEnabled(e)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"teleportationTargetMesh",{get:function(){return this._options.teleportationTargetMesh||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapPointsOnly",{get:function(){return!!this._options.snapPointsOnly},set:function(e){this._options.snapPointsOnly=e},enumerable:!1,configurable:!0}),t.prototype.addFloorMesh=function(e){this._floorMeshes.push(e)},t.prototype.addSnapPoint=function(e){this._snapToPositions.push(e)},t.prototype.attach=function(){var t=this;return!!e.prototype.attach.call(this)&&(this._currentTeleportationControllerId="",this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,function(e){t._detachController(e.uniqueId)}),!0)},t.prototype.detach=function(){var t=this;return!!e.prototype.detach.call(this)&&(Object.keys(this._controllers).forEach(function(e){t._detachController(e)}),this._setTargetMeshVisibility(!1),this._currentTeleportationControllerId="",this._controllers={},!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.dispose(!1,!0)},t.prototype.removeFloorMesh=function(e){var t=this._floorMeshes.indexOf(e);-1!==t&&this._floorMeshes.splice(t,1)},t.prototype.removeFloorMeshByName=function(e){var t=this._xrSessionManager.scene.getMeshByName(e);t&&this.removeFloorMesh(t)},t.prototype.removeSnapPoint=function(e){var t=this._snapToPositions.indexOf(e);if(-1===t)for(var i=0;i<this._snapToPositions.length;++i)if(this._snapToPositions[i].equals(e)){t=i;break}return-1!==t&&(this._snapToPositions.splice(t,1),!0)},t.prototype.setSelectionFeature=function(e){this._selectionFeature=e},t.prototype._onXRFrame=function(e){var t=this,i=this._xrSessionManager.currentFrame,n=this._xrSessionManager.scene;if(this.attach&&i){var r=this._options.teleportationTargetMesh;if(this._currentTeleportationControllerId){if(!r)return;r.rotationQuaternion=r.rotationQuaternion||new a.b;var o=this._controllers[this._currentTeleportationControllerId];if(o&&o.teleportationState.forward){a.b.RotationYawPitchRollToRef(o.teleportationState.currentRotation+o.teleportationState.baseRotation,0,0,r.rotationQuaternion);var s=!1;if(o.xrController.getWorldPointerRayToRef(this._tmpRay),this.straightRayEnabled){if((c=n.pickWithRay(this._tmpRay,function(e){if(t._options.pickBlockerMeshes&&-1!==t._options.pickBlockerMeshes.indexOf(e))return!0;var i=t._floorMeshes.indexOf(e);return-1!==i&&t._floorMeshes[i].absolutePosition.y<t._options.xrInput.xrCamera.position.y}))&&c.pickedMesh&&this._options.pickBlockerMeshes&&-1!==this._options.pickBlockerMeshes.indexOf(c.pickedMesh))return;c&&c.pickedPoint&&(s=!0,this._setTargetMeshPosition(c.pickedPoint),this._setTargetMeshVisibility(!0),this._showParabolicPath(c))}if(this.parabolicRayEnabled&&!s){var c,l=o.xrController.pointer.rotationQuaternion.toEulerAngles().x,u=Math.PI/2-Math.abs(l)+1,h=this.parabolicCheckRadius*u;if(this._tmpRay.origin.addToRef(this._tmpRay.direction.scale(2*h),this._tmpVector),this._tmpVector.y=this._tmpRay.origin.y,this._tmpRay.origin.addInPlace(this._tmpRay.direction.scale(h)),this._tmpVector.subtractToRef(this._tmpRay.origin,this._tmpRay.direction),this._tmpRay.direction.normalize(),(c=n.pickWithRay(this._tmpRay,function(e){return!(!t._options.pickBlockerMeshes||-1===t._options.pickBlockerMeshes.indexOf(e))||-1!==t._floorMeshes.indexOf(e)}))&&c.pickedMesh&&this._options.pickBlockerMeshes&&-1!==this._options.pickBlockerMeshes.indexOf(c.pickedMesh))return;c&&c.pickedPoint&&(s=!0,this._setTargetMeshPosition(c.pickedPoint),this._setTargetMeshVisibility(!0),this._showParabolicPath(c))}this._setTargetMeshVisibility(s)}else this._setTargetMeshVisibility(!1)}else this._setTargetMeshVisibility(!1)}},t.prototype._createDefaultTargetMesh=function(){this._options.defaultTargetMeshOptions=this._options.defaultTargetMeshOptions||{};var e=this._options.useUtilityLayer?this._options.customUtilityLayerScene||vr.a.DefaultUtilityLayer.utilityLayerScene:this._xrSessionManager.scene,t=Xi.CreateGround("teleportationTarget",{width:2,height:2,subdivisions:2},e);t.isPickable=!1;var i=new Vi.a("teleportationPlaneDynamicTexture",512,e,!0);i.hasAlpha=!0;var n=i.getContext();n.beginPath(),n.arc(256,256,200,0,2*Math.PI,!1),n.fillStyle=this._options.defaultTargetMeshOptions.teleportationFillColor||"#444444",n.fill(),n.lineWidth=10,n.strokeStyle=this._options.defaultTargetMeshOptions.teleportationBorderColor||"#FFFFFF",n.stroke(),n.closePath(),i.update();var r=new Ui.a("teleportationPlaneMaterial",e);r.diffuseTexture=i,t.material=r;var o=Qi.CreateTorus("torusTeleportation",{diameter:.75,thickness:.1,tessellation:20},e);if(o.isPickable=!1,o.parent=t,!this._options.defaultTargetMeshOptions.disableAnimation){var a=new G("animationInnerCircle","position.y",30,G.ANIMATIONTYPE_FLOAT,G.ANIMATIONLOOPMODE_CYCLE),c=[];c.push({frame:0,value:0}),c.push({frame:30,value:.4}),c.push({frame:60,value:0}),a.setKeys(c);var l=new me;l.setEasingMode(oe.EASINGMODE_EASEINOUT),a.setEasingFunction(l),o.animations=[],o.animations.push(a),e.beginAnimation(o,0,60,!0)}var u=qi.a.CreateCylinder("rotationCone",{diameterTop:0,tessellation:4},e);if(u.isPickable=!1,u.scaling.set(.5,.12,.2),u.rotate(J.a.X,Math.PI/2),u.position.z=.6,u.parent=o,this._options.defaultTargetMeshOptions.torusArrowMaterial)o.material=this._options.defaultTargetMeshOptions.torusArrowMaterial,u.material=this._options.defaultTargetMeshOptions.torusArrowMaterial;else{var h=new Ui.a("torusConsMat",e);h.disableLighting=!!this._options.defaultTargetMeshOptions.disableLighting,h.disableLighting?h.emissiveColor=new s.a(.3,.3,1):h.diffuseColor=new s.a(.3,.3,1),h.alpha=.9,o.material=h,u.material=h,this._teleportationRingMaterial=h}void 0!==this._options.renderingGroupId&&(t.renderingGroupId=this._options.renderingGroupId,o.renderingGroupId=this._options.renderingGroupId,u.renderingGroupId=this._options.renderingGroupId),this._options.teleportationTargetMesh=t},t.prototype._detachController=function(e){var t=this._controllers[e];t&&(t.teleportationComponent&&(t.onAxisChangedObserver&&t.teleportationComponent.onAxisValueChangedObservable.remove(t.onAxisChangedObserver),t.onButtonChangedObserver&&t.teleportationComponent.onButtonStateChangedObservable.remove(t.onButtonChangedObserver)),delete this._controllers[e])},t.prototype._findClosestSnapPointWithRadius=function(e,t){void 0===t&&(t=this._options.snapToPositionRadius||.8);var i=null,n=Number.MAX_VALUE;if(this._snapToPositions.length){var r=t*t;this._snapToPositions.forEach(function(t){var o=a.e.DistanceSquared(t,e);o<=r&&o<n&&(n=o,i=t)})}return i},t.prototype._setTargetMeshPosition=function(e){if(this._options.teleportationTargetMesh){var t=this._findClosestSnapPointWithRadius(e);this._snappedToPoint=!!t,this.snapPointsOnly&&!this._snappedToPoint&&this._teleportationRingMaterial?this._teleportationRingMaterial.diffuseColor.set(1,.3,.3):this.snapPointsOnly&&this._snappedToPoint&&this._teleportationRingMaterial&&this._teleportationRingMaterial.diffuseColor.set(.3,.3,1),this._options.teleportationTargetMesh.position.copyFrom(t||e),this._options.teleportationTargetMesh.position.y+=.01}},t.prototype._setTargetMeshVisibility=function(e){this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.isVisible!==e&&(this._options.teleportationTargetMesh.isVisible=e,this._options.teleportationTargetMesh.getChildren(void 0,!1).forEach(function(t){t.isVisible=e}),e?this._selectionFeature&&this._selectionFeature.detach():(this._quadraticBezierCurve&&(this._quadraticBezierCurve.dispose(),this._quadraticBezierCurve=null),this._selectionFeature&&this._selectionFeature.attach()))},t.prototype._showParabolicPath=function(e){if(e.pickedPoint){var t=this._controllers[this._currentTeleportationControllerId],i=re.d.CreateQuadraticBezier(t.xrController.pointer.absolutePosition,e.ray.origin,e.pickedPoint,25);this._options.generateRayPathMesh?this._quadraticBezierCurve=this._options.generateRayPathMesh(i.getPoints()):this._quadraticBezierCurve=Tr.a.CreateLines("teleportation path line",{points:i.getPoints(),instance:this._quadraticBezierCurve,updatable:!0}),this._quadraticBezierCurve.isPickable=!1}},t.prototype._teleportForward=function(e){var t=this._controllers[e];if(t&&t.teleportationState.forward&&(t.teleportationState.forward=!1,this._currentTeleportationControllerId="",(!this.snapPointsOnly||this._snappedToPoint)&&this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.isVisible)){var i=this._options.xrInput.xrCamera.realWorldHeight;this._options.xrInput.xrCamera.onBeforeCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position),this._options.xrInput.xrCamera.position.copyFrom(this._options.teleportationTargetMesh.position),this._options.xrInput.xrCamera.position.y+=i,this._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(a.b.FromEulerAngles(0,t.teleportationState.currentRotation-(this._xrSessionManager.scene.useRightHandedSystem?Math.PI:0),0)),this._options.xrInput.xrCamera.onAfterCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position)}},t.Name=Mo.TELEPORTATION,t.Version=1,t}(zo);Io.AddWebXRFeature(qo.Name,function(e,t){return function(){return new qo(e,t)}},qo.Version,!0);var Zo=function(){},Jo=function(){function e(){}return e.CreateAsync=function(t,i){void 0===i&&(i={});var n=new e;return Do.CreateAsync(t).then(function(e){if(n.baseExperience=e,i.ignoreNativeCameraTransformation&&(n.baseExperience.camera.compensateOnFirstFrame=!1),n.input=new Go(e.sessionManager,e.camera,Object(h.a)({controllerOptions:{renderingGroupId:i.renderingGroupId}},i.inputOptions||{})),n.pointerSelection=n.baseExperience.featuresManager.enableFeature(jo.Name,i.useStablePlugins?"stable":"latest",{xrInput:n.input,renderingGroupId:i.renderingGroupId}),i.disableTeleportation||(n.teleportation=n.baseExperience.featuresManager.enableFeature(qo.Name,i.useStablePlugins?"stable":"latest",{floorMeshes:i.floorMeshes,xrInput:n.input,renderingGroupId:i.renderingGroupId}),n.teleportation.setSelectionFeature(n.pointerSelection)),n.renderTarget=n.baseExperience.sessionManager.getWebXRRenderTarget(i.outputCanvasOptions),!i.disableDefaultUI){var r=Object(h.a)({renderTarget:n.renderTarget},i.uiOptions||{});return i.optionalFeatures&&("boolean"==typeof i.optionalFeatures?r.optionalFeatures=["hit-test","anchors","plane-detection","hand-tracking"]:r.optionalFeatures=i.optionalFeatures),Yo.CreateAsync(t,n.baseExperience,r).then(function(e){n.enterExitUI=e})}}).then(function(){return n}).catch(function(e){return m.a.Error("Error initializing XR"),m.a.Error(e),n})},e.prototype.dispose=function(){this.baseExperience&&this.baseExperience.dispose(),this.input&&this.input.dispose(),this.enterExitUI&&this.enterExitUI.dispose(),this.renderTarget&&this.renderTarget.dispose()},e}(),$o=!0;Q.a.prototype.createDefaultLight=function(e){if(void 0===e&&(e=!1),e&&this.lights)for(var t=0;t<this.lights.length;t++)this.lights[t].dispose();0===this.lights.length&&new Li.a("default light",a.e.Up(),this)},Q.a.prototype.createDefaultCamera=function(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===i&&(i=!1),t&&this.activeCamera&&(this.activeCamera.dispose(),this.activeCamera=null),!this.activeCamera){var n,r=this.getWorldExtends(function(e){return e.isVisible&&e.isEnabled()}),o=r.max.subtract(r.min),s=r.min.add(o.scale(.5)),c=1.5*o.length();if(isFinite(c)||(c=1,s.copyFromFloats(0,0,0)),e){var l=new Bt("default camera",-Math.PI/2,Math.PI/2,c,s,this);l.lowerRadiusLimit=.01*c,l.wheelPrecision=100/c,n=l}else{var u=new wt("default camera",new a.e(s.x,s.y,-c),this);u.setTarget(s),n=u}n.minZ=.01*c,n.maxZ=1e3*c,n.speed=.2*c,this.activeCamera=n;var h=this.getEngine().getInputElement();i&&h&&n.attachControl()}},Q.a.prototype.createDefaultCameraOrLight=function(e,t,i){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===i&&(i=!1),this.createDefaultLight(t),this.createDefaultCamera(e,t,i)},Q.a.prototype.createDefaultSkybox=function(e,t,i,n,r){if(void 0===t&&(t=!1),void 0===i&&(i=1e3),void 0===n&&(n=0),void 0===r&&(r=!0),!e)return m.a.Warn("Can not create default skybox without environment texture."),null;r&&e&&(this.environmentTexture=e);var o=be.a.CreateBox("hdrSkyBox",i,this);if(t){var a=new mo("skyBox",this);a.backFaceCulling=!1,a.reflectionTexture=e.clone(),a.reflectionTexture&&(a.reflectionTexture.coordinatesMode=Ke.a.SKYBOX_MODE),a.microSurface=1-n,a.disableLighting=!0,a.twoSidedLighting=!0,o.infiniteDistance=!0,o.material=a}else{var s=new Ui.a("skyBox",this);s.backFaceCulling=!1,s.reflectionTexture=e.clone(),s.reflectionTexture&&(s.reflectionTexture.coordinatesMode=Ke.a.SKYBOX_MODE),s.disableLighting=!0,o.infiniteDistance=!0,o.material=s}return o.isPickable=!1,o},Q.a.prototype.createDefaultEnvironment=function(e){return Jr?new Jr(e,this):null},Q.a.prototype.createDefaultVRExperience=function(e){return void 0===e&&(e={}),new an(this,e)},Q.a.prototype.createDefaultXRExperienceAsync=function(e){return void 0===e&&(e={}),Jo.CreateAsync(this,e).then(function(e){return e})};var ea=function(e){function t(t,i,n,r,o,a,s){void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===a&&(a=Ke.a.TRILINEAR_SAMPLINGMODE),void 0===s&&(s={autoPlay:!0,loop:!0,autoUpdateTexture:!0});var c=e.call(this,null,n,!r,o)||this;c._onUserActionRequestedObservable=null,c._stillImageCaptured=!1,c._displayingPosterTexture=!1,c._frameId=-1,c._currentSrc=null,c._createInternalTexture=function(){if(null!=c._texture){if(!c._displayingPosterTexture)return;c._texture.dispose(),c._displayingPosterTexture=!1}if(!c._getEngine().needPOTTextures||Ce.b.IsExponentOfTwo(c.video.videoWidth)&&Ce.b.IsExponentOfTwo(c.video.videoHeight)?(c.wrapU=Ke.a.WRAP_ADDRESSMODE,c.wrapV=Ke.a.WRAP_ADDRESSMODE):(c.wrapU=Ke.a.CLAMP_ADDRESSMODE,c.wrapV=Ke.a.CLAMP_ADDRESSMODE,c._generateMipMaps=!1),c._texture=c._getEngine().createDynamicTexture(c.video.videoWidth,c.video.videoHeight,c._generateMipMaps,c.samplingMode),c.video.autoplay||c._settings.poster)c._texture.isReady=!0,c._updateInternalTexture(),c.onLoadObservable.hasObservers()&&c.onLoadObservable.notifyObservers(c);else{var e=c.video.onplaying,t=!1,i=c.video.muted;c.video.muted=!0,c.video.onplaying=function(){c.video.muted=i,c.video.onplaying=e,c._texture.isReady=!0,c._updateInternalTexture(),t||c.video.pause(),c.onLoadObservable.hasObservers()&&c.onLoadObservable.notifyObservers(c)};var n=c.video.play();n?n.then(function(){}).catch(function(){t=!0,c._onUserActionRequestedObservable&&c._onUserActionRequestedObservable.hasObservers()&&c._onUserActionRequestedObservable.notifyObservers(c)}):(c.video.onplaying=e,c._texture.isReady=!0,c._updateInternalTexture(),c.onLoadObservable.hasObservers()&&c.onLoadObservable.notifyObservers(c))}},c.reset=function(){null!=c._texture&&(c._displayingPosterTexture||(c._texture.dispose(),c._texture=null))},c._updateInternalTexture=function(){if(null!=c._texture&&c._texture.isReady&&!(c.video.readyState<c.video.HAVE_CURRENT_DATA||c._displayingPosterTexture)){var e=c.getScene().getFrameId();c._frameId!==e&&(c._frameId=e,c._getEngine().updateVideoTexture(c._texture,c.video,c._invertY))}},c._generateMipMaps=r,c._initialSamplingMode=a,c.autoUpdateTexture=s.autoUpdateTexture,c._currentSrc=i,c.name=t||c._getName(i),c.video=c._getVideo(i),c._settings=s,s.poster&&(c.video.poster=s.poster),void 0!==s.autoPlay&&(c.video.autoplay=s.autoPlay),void 0!==s.loop&&(c.video.loop=s.loop),void 0!==s.muted&&(c.video.muted=s.muted),c.video.setAttribute("playsinline",""),c.video.addEventListener("paused",c._updateInternalTexture),c.video.addEventListener("seeked",c._updateInternalTexture),c.video.addEventListener("emptied",c.reset),c._createInternalTextureOnEvent=s.poster&&!s.autoPlay?"play":"canplay",c.video.addEventListener(c._createInternalTextureOnEvent,c._createInternalTexture),s.autoPlay&&c.video.play();var l=c.video.readyState>=c.video.HAVE_CURRENT_DATA;return!s.poster||s.autoPlay&&l?l&&c._createInternalTexture():(c._texture=c._getEngine().createTexture(s.poster,!1,!c.invertY,n),c._displayingPosterTexture=!0),c}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"onUserActionRequestedObservable",{get:function(){return this._onUserActionRequestedObservable||(this._onUserActionRequestedObservable=new o.c),this._onUserActionRequestedObservable},enumerable:!1,configurable:!0}),t.prototype._getName=function(e){return e instanceof HTMLVideoElement?e.currentSrc:"object"==typeof e?e.toString():e},t.prototype._getVideo=function(e){if(e instanceof HTMLVideoElement)return Ce.b.SetCorsBehavior(e.currentSrc,e),e;var t=document.createElement("video");return"string"==typeof e?(Ce.b.SetCorsBehavior(e,t),t.src=e):(Ce.b.SetCorsBehavior(e[0],t),e.forEach(function(e){var i=document.createElement("source");i.src=e,t.appendChild(i)})),t},t.prototype._rebuild=function(){this.update()},t.prototype.update=function(){this.autoUpdateTexture&&this.updateTexture(!0)},t.prototype.updateTexture=function(e){e&&(this.video.paused&&this._stillImageCaptured||(this._stillImageCaptured=!0,this._updateInternalTexture()))},t.prototype.updateURL=function(e){this.video.src=e,this._currentSrc=e},t.prototype.clone=function(){return new t(this.name,this._currentSrc,this.getScene(),this._generateMipMaps,this.invertY,this.samplingMode,this._settings)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._currentSrc=null,this._onUserActionRequestedObservable&&(this._onUserActionRequestedObservable.clear(),this._onUserActionRequestedObservable=null),this.video.removeEventListener(this._createInternalTextureOnEvent,this._createInternalTexture),this.video.removeEventListener("paused",this._updateInternalTexture),this.video.removeEventListener("seeked",this._updateInternalTexture),this.video.removeEventListener("emptied",this.reset),this.video.pause()},t.CreateFromStreamAsync=function(e,i){var n=document.createElement("video");return e.getEngine()._badOS&&(document.body.appendChild(n),n.style.transform="scale(0.0001, 0.0001)",n.style.opacity="0",n.style.position="fixed",n.style.bottom="0px",n.style.right="0px"),n.setAttribute("autoplay",""),n.setAttribute("muted","true"),n.setAttribute("playsinline",""),n.muted=!0,void 0!==n.mozSrcObject?n.mozSrcObject=i:"object"==typeof n.srcObject?n.srcObject=i:(window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,n.src=window.URL&&window.URL.createObjectURL(i)),new Promise(function(i){var r=function(){i(new t("video",n,e,!0,!0)),n.removeEventListener("playing",r)};n.addEventListener("playing",r),n.play()})},t.CreateFromWebCamAsync=function(e,t,i){var n,r=this;return void 0===i&&(i=!1),t&&t.deviceId&&(n={exact:t.deviceId}),navigator.mediaDevices?navigator.mediaDevices.getUserMedia({video:t,audio:i}).then(function(t){return r.CreateFromStreamAsync(e,t)}):(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,navigator.getUserMedia&&navigator.getUserMedia({video:{deviceId:n,width:{min:t&&t.minWidth||256,max:t&&t.maxWidth||640},height:{min:t&&t.minHeight||256,max:t&&t.maxHeight||480}},audio:i},function(t){return r.CreateFromStreamAsync(e,t)},function(e){m.a.Error(e.name)}),Promise.reject("No support for userMedia on this device"))},t.CreateFromWebCam=function(e,t,i,n){void 0===n&&(n=!1),this.CreateFromWebCamAsync(e,i,n).then(function(e){t&&t(e)}).catch(function(e){m.a.Error(e.name)})},t}(Ke.a),ta=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"videoTexture",{get:function(){return this._texture},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoMode",{get:function(){return this.textureMode},set:function(e){this.textureMode=e},enumerable:!1,configurable:!0}),t.prototype._initTexture=function(e,t,i){var n=this,r={loop:i.loop,autoPlay:i.autoPlay,autoUpdateTexture:!0,poster:i.poster},o=new ea((this.name||"videoDome")+"_texture",e,t,i.generateMipMaps,this._useDirectMapping,Ke.a.TRILINEAR_SAMPLINGMODE,r);return i.clickToPlay&&(t.onPointerUp=function(){n._texture.video.play()}),o},t.MODE_MONOSCOPIC=$r.MODE_MONOSCOPIC,t.MODE_TOPBOTTOM=$r.MODE_TOPBOTTOM,t.MODE_SIDEBYSIDE=$r.MODE_SIDEBYSIDE,t}($r),ia=i(55),na=function(){function e(e){this.engine=e,this._captureGPUFrameTime=!1,this._gpuFrameTime=new ia.a,this._captureShaderCompilationTime=!1,this._shaderCompilationTime=new ia.a,this._onBeginFrameObserver=null,this._onEndFrameObserver=null,this._onBeforeShaderCompilationObserver=null,this._onAfterShaderCompilationObserver=null}return Object.defineProperty(e.prototype,"gpuFrameTimeCounter",{get:function(){return this._gpuFrameTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureGPUFrameTime",{get:function(){return this._captureGPUFrameTime},set:function(e){var t=this;e!==this._captureGPUFrameTime&&(this._captureGPUFrameTime=e,e?(this._onBeginFrameObserver=this.engine.onBeginFrameObservable.add(function(){t._gpuFrameTimeToken||(t._gpuFrameTimeToken=t.engine.startTimeQuery())}),this._onEndFrameObserver=this.engine.onEndFrameObservable.add(function(){if(t._gpuFrameTimeToken){var e=t.engine.endTimeQuery(t._gpuFrameTimeToken);e>-1&&(t._gpuFrameTimeToken=null,t._gpuFrameTime.fetchNewFrame(),t._gpuFrameTime.addCount(e,!0))}})):(this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shaderCompilationTimeCounter",{get:function(){return this._shaderCompilationTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureShaderCompilationTime",{get:function(){return this._captureShaderCompilationTime},set:function(e){var t=this;e!==this._captureShaderCompilationTime&&(this._captureShaderCompilationTime=e,e?(this._onBeforeShaderCompilationObserver=this.engine.onBeforeShaderCompilationObservable.add(function(){t._shaderCompilationTime.fetchNewFrame(),t._shaderCompilationTime.beginMonitoring()}),this._onAfterShaderCompilationObserver=this.engine.onAfterShaderCompilationObservable.add(function(){t._shaderCompilationTime.endMonitoring()})):(this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null))},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null,this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null,this.engine=null},e}(),ra=function(){function e(e){var t=this;this.scene=e,this._captureActiveMeshesEvaluationTime=!1,this._activeMeshesEvaluationTime=new ia.a,this._captureRenderTargetsRenderTime=!1,this._renderTargetsRenderTime=new ia.a,this._captureFrameTime=!1,this._frameTime=new ia.a,this._captureRenderTime=!1,this._renderTime=new ia.a,this._captureInterFrameTime=!1,this._interFrameTime=new ia.a,this._captureParticlesRenderTime=!1,this._particlesRenderTime=new ia.a,this._captureSpritesRenderTime=!1,this._spritesRenderTime=new ia.a,this._capturePhysicsTime=!1,this._physicsTime=new ia.a,this._captureAnimationsTime=!1,this._animationsTime=new ia.a,this._captureCameraRenderTime=!1,this._cameraRenderTime=new ia.a,this._onBeforeActiveMeshesEvaluationObserver=null,this._onAfterActiveMeshesEvaluationObserver=null,this._onBeforeRenderTargetsRenderObserver=null,this._onAfterRenderTargetsRenderObserver=null,this._onAfterRenderObserver=null,this._onBeforeDrawPhaseObserver=null,this._onAfterDrawPhaseObserver=null,this._onBeforeAnimationsObserver=null,this._onBeforeParticlesRenderingObserver=null,this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver=null,this._onAfterSpritesRenderingObserver=null,this._onBeforePhysicsObserver=null,this._onAfterPhysicsObserver=null,this._onAfterAnimationsObserver=null,this._onBeforeCameraRenderObserver=null,this._onAfterCameraRenderObserver=null,this._onBeforeAnimationsObserver=e.onBeforeAnimationsObservable.add(function(){t._captureActiveMeshesEvaluationTime&&t._activeMeshesEvaluationTime.fetchNewFrame(),t._captureRenderTargetsRenderTime&&t._renderTargetsRenderTime.fetchNewFrame(),t._captureFrameTime&&(Ce.b.StartPerformanceCounter("Scene rendering"),t._frameTime.beginMonitoring()),t._captureInterFrameTime&&t._interFrameTime.endMonitoring(),t._captureParticlesRenderTime&&t._particlesRenderTime.fetchNewFrame(),t._captureSpritesRenderTime&&t._spritesRenderTime.fetchNewFrame(),t._captureAnimationsTime&&t._animationsTime.beginMonitoring(),t.scene.getEngine()._drawCalls.fetchNewFrame()}),this._onAfterRenderObserver=e.onAfterRenderObservable.add(function(){t._captureFrameTime&&(Ce.b.EndPerformanceCounter("Scene rendering"),t._frameTime.endMonitoring()),t._captureRenderTime&&t._renderTime.endMonitoring(!1),t._captureInterFrameTime&&t._interFrameTime.beginMonitoring()})}return Object.defineProperty(e.prototype,"activeMeshesEvaluationTimeCounter",{get:function(){return this._activeMeshesEvaluationTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureActiveMeshesEvaluationTime",{get:function(){return this._captureActiveMeshesEvaluationTime},set:function(e){var t=this;e!==this._captureActiveMeshesEvaluationTime&&(this._captureActiveMeshesEvaluationTime=e,e?(this._onBeforeActiveMeshesEvaluationObserver=this.scene.onBeforeActiveMeshesEvaluationObservable.add(function(){Ce.b.StartPerformanceCounter("Active meshes evaluation"),t._activeMeshesEvaluationTime.beginMonitoring()}),this._onAfterActiveMeshesEvaluationObserver=this.scene.onAfterActiveMeshesEvaluationObservable.add(function(){Ce.b.EndPerformanceCounter("Active meshes evaluation"),t._activeMeshesEvaluationTime.endMonitoring()})):(this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderTargetsRenderTimeCounter",{get:function(){return this._renderTargetsRenderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureRenderTargetsRenderTime",{get:function(){return this._captureRenderTargetsRenderTime},set:function(e){var t=this;e!==this._captureRenderTargetsRenderTime&&(this._captureRenderTargetsRenderTime=e,e?(this._onBeforeRenderTargetsRenderObserver=this.scene.onBeforeRenderTargetsRenderObservable.add(function(){Ce.b.StartPerformanceCounter("Render targets rendering"),t._renderTargetsRenderTime.beginMonitoring()}),this._onAfterRenderTargetsRenderObserver=this.scene.onAfterRenderTargetsRenderObservable.add(function(){Ce.b.EndPerformanceCounter("Render targets rendering"),t._renderTargetsRenderTime.endMonitoring(!1)})):(this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"particlesRenderTimeCounter",{get:function(){return this._particlesRenderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureParticlesRenderTime",{get:function(){return this._captureParticlesRenderTime},set:function(e){var t=this;e!==this._captureParticlesRenderTime&&(this._captureParticlesRenderTime=e,e?(this._onBeforeParticlesRenderingObserver=this.scene.onBeforeParticlesRenderingObservable.add(function(){Ce.b.StartPerformanceCounter("Particles"),t._particlesRenderTime.beginMonitoring()}),this._onAfterParticlesRenderingObserver=this.scene.onAfterParticlesRenderingObservable.add(function(){Ce.b.EndPerformanceCounter("Particles"),t._particlesRenderTime.endMonitoring(!1)})):(this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spritesRenderTimeCounter",{get:function(){return this._spritesRenderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureSpritesRenderTime",{get:function(){return this._captureSpritesRenderTime},set:function(e){var t=this;e!==this._captureSpritesRenderTime&&(this._captureSpritesRenderTime=e,this.scene.spriteManagers&&(e?(this._onBeforeSpritesRenderingObserver=this.scene.onBeforeSpritesRenderingObservable.add(function(){Ce.b.StartPerformanceCounter("Sprites"),t._spritesRenderTime.beginMonitoring()}),this._onAfterSpritesRenderingObserver=this.scene.onAfterSpritesRenderingObservable.add(function(){Ce.b.EndPerformanceCounter("Sprites"),t._spritesRenderTime.endMonitoring(!1)})):(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null,this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"physicsTimeCounter",{get:function(){return this._physicsTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capturePhysicsTime",{get:function(){return this._capturePhysicsTime},set:function(e){var t=this;e!==this._capturePhysicsTime&&this.scene.onBeforePhysicsObservable&&(this._capturePhysicsTime=e,e?(this._onBeforePhysicsObserver=this.scene.onBeforePhysicsObservable.add(function(){Ce.b.StartPerformanceCounter("Physics"),t._physicsTime.beginMonitoring()}),this._onAfterPhysicsObserver=this.scene.onAfterPhysicsObservable.add(function(){Ce.b.EndPerformanceCounter("Physics"),t._physicsTime.endMonitoring()})):(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null,this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationsTimeCounter",{get:function(){return this._animationsTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureAnimationsTime",{get:function(){return this._captureAnimationsTime},set:function(e){var t=this;e!==this._captureAnimationsTime&&(this._captureAnimationsTime=e,e?this._onAfterAnimationsObserver=this.scene.onAfterAnimationsObservable.add(function(){t._animationsTime.endMonitoring()}):(this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frameTimeCounter",{get:function(){return this._frameTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureFrameTime",{get:function(){return this._captureFrameTime},set:function(e){this._captureFrameTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"interFrameTimeCounter",{get:function(){return this._interFrameTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureInterFrameTime",{get:function(){return this._captureInterFrameTime},set:function(e){this._captureInterFrameTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderTimeCounter",{get:function(){return this._renderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureRenderTime",{get:function(){return this._captureRenderTime},set:function(e){var t=this;e!==this._captureRenderTime&&(this._captureRenderTime=e,e?(this._onBeforeDrawPhaseObserver=this.scene.onBeforeDrawPhaseObservable.add(function(){t._renderTime.beginMonitoring(),Ce.b.StartPerformanceCounter("Main render")}),this._onAfterDrawPhaseObserver=this.scene.onAfterDrawPhaseObservable.add(function(){t._renderTime.endMonitoring(!1),Ce.b.EndPerformanceCounter("Main render")})):(this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cameraRenderTimeCounter",{get:function(){return this._cameraRenderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureCameraRenderTime",{get:function(){return this._captureCameraRenderTime},set:function(e){var t=this;e!==this._captureCameraRenderTime&&(this._captureCameraRenderTime=e,e?(this._onBeforeCameraRenderObserver=this.scene.onBeforeCameraRenderObservable.add(function(e){t._cameraRenderTime.beginMonitoring(),Ce.b.StartPerformanceCounter("Rendering camera "+e.name)}),this._onAfterCameraRenderObserver=this.scene.onAfterCameraRenderObservable.add(function(e){t._cameraRenderTime.endMonitoring(!1),Ce.b.EndPerformanceCounter("Rendering camera "+e.name)})):(this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCallsCounter",{get:function(){return this.scene.getEngine()._drawCalls},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=null,this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null,this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null,this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null,this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver&&(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null),this._onAfterSpritesRenderingObserver&&(this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null),this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null,this._onBeforePhysicsObserver&&(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null),this._onAfterPhysicsObserver&&(this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null),this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null,this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null,this.scene=null},e}();ai.a.ShadersStore.glowMapGenerationPixelShader="#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform sampler2D opacitySampler;\nuniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef VERTEXALPHA\nvarying vec4 vColor;\n#endif\nuniform vec4 glowColor;\nvoid main(void)\n{\nvec4 finalColor=glowColor;\n\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\n#ifdef GLOW\n\nfinalColor.a*=albedoTexture.a;\n#endif\n#ifdef HIGHLIGHT\n\nfinalColor.a=albedoTexture.a;\n#endif\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor.a*=getLuminance(opacityMap.rgb);\n#else\nfinalColor.a*=opacityMap.a;\n#endif\nfinalColor.a*=opacityIntensity;\n#endif\n#ifdef VERTEXALPHA\nfinalColor.a*=vColor.a;\n#endif\n#ifdef ALPHATEST\nif (finalColor.a<ALPHATESTVALUE)\ndiscard;\n#endif\n#ifdef EMISSIVE\ngl_FragColor=texture2D(emissiveSampler,vUVEmissive)*finalColor;\n#else\ngl_FragColor=finalColor;\n#endif\n#ifdef HIGHLIGHT\n\ngl_FragColor.a=glowColor.a;\n#endif\n}";ai.a.ShadersStore.glowMapGenerationVertexShader="\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nvarying vec4 vPosition;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform mat4 opacityMatrix;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef VERTEXALPHA\nattribute vec4 color;\nvarying vec4 vColor;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef CUBEMAP\nvPosition=finalWorld*vec4(positionUpdated,1.0);\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#else\nvPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\ngl_Position=vPosition;\n#endif\n#ifdef DIFFUSE\n#ifdef DIFFUSEUV1\nvUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef DIFFUSEUV2\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef OPACITY\n#ifdef OPACITYUV1\nvUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef OPACITYUV2\nvUVOpacity=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef EMISSIVE\n#ifdef EMISSIVEUV1\nvUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef EMISSIVEUV2\nvUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef VERTEXALPHA\nvColor=color;\n#endif\n}";var oa=function(){function e(t,i){this._vertexBuffers={},this._maxSize=0,this._mainTextureDesiredSize={width:0,height:0},this._shouldRender=!0,this._postProcesses=[],this._textures=[],this._emissiveTextureAndColor={texture:null,color:new s.b},this.neutralColor=new s.b,this.isEnabled=!0,this.disableBoundingBoxesFromEffectLayer=!1,this.onDisposeObservable=new o.c,this.onBeforeRenderMainTextureObservable=new o.c,this.onBeforeComposeObservable=new o.c,this.onBeforeRenderMeshToEffect=new o.c,this.onAfterRenderMeshToEffect=new o.c,this.onAfterComposeObservable=new o.c,this.onSizeChangedObservable=new o.c,this.name=t,this._scene=i||x.a.LastCreatedScene,e._SceneComponentInitialization(this._scene),this._engine=this._scene.getEngine(),this._maxSize=this._engine.getCaps().maxTextureSize,this._scene.effectLayers.push(this),this._generateIndexBuffer(),this._generateVertexBuffer()}return Object.defineProperty(e.prototype,"camera",{get:function(){return this._effectLayerOptions.camera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._effectLayerOptions.renderingGroupId},set:function(e){this._effectLayerOptions.renderingGroupId=e},enumerable:!1,configurable:!0}),e.prototype._init=function(e){this._effectLayerOptions=Object(h.a)({mainTextureRatio:.5,alphaBlendingMode:g.a.ALPHA_COMBINE,camera:null,renderingGroupId:-1},e),this._setMainTextureSize(),this._createMainTexture(),this._createTextureAndPostProcesses(),this._mergeEffect=this._createMergeEffect()},e.prototype._generateIndexBuffer=function(){var e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._engine.createIndexBuffer(e)},e.prototype._generateVertexBuffer=function(){var e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1);var t=new ji.b(this._engine,e,ji.b.PositionKind,!1,!1,2);this._vertexBuffers[ji.b.PositionKind]=t},e.prototype._setMainTextureSize=function(){this._effectLayerOptions.mainTextureFixedSize?(this._mainTextureDesiredSize.width=this._effectLayerOptions.mainTextureFixedSize,this._mainTextureDesiredSize.height=this._effectLayerOptions.mainTextureFixedSize):(this._mainTextureDesiredSize.width=this._engine.getRenderWidth()*this._effectLayerOptions.mainTextureRatio,this._mainTextureDesiredSize.height=this._engine.getRenderHeight()*this._effectLayerOptions.mainTextureRatio,this._mainTextureDesiredSize.width=this._engine.needPOTTextures?Se.a.GetExponentOfTwo(this._mainTextureDesiredSize.width,this._maxSize):this._mainTextureDesiredSize.width,this._mainTextureDesiredSize.height=this._engine.needPOTTextures?Se.a.GetExponentOfTwo(this._mainTextureDesiredSize.height,this._maxSize):this._mainTextureDesiredSize.height),this._mainTextureDesiredSize.width=Math.floor(this._mainTextureDesiredSize.width),this._mainTextureDesiredSize.height=Math.floor(this._mainTextureDesiredSize.height)},e.prototype._createMainTexture=function(){var e=this;this._mainTexture=new Ri("HighlightLayerMainRTT",{width:this._mainTextureDesiredSize.width,height:this._mainTextureDesiredSize.height},this._scene,!1,!0,g.a.TEXTURETYPE_UNSIGNED_INT),this._mainTexture.activeCamera=this._effectLayerOptions.camera,this._mainTexture.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._mainTexture.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._mainTexture.anisotropicFilteringLevel=1,this._mainTexture.updateSamplingMode(Ke.a.BILINEAR_SAMPLINGMODE),this._mainTexture.renderParticles=!1,this._mainTexture.renderList=null,this._mainTexture.ignoreCameraViewport=!0,this._mainTexture.customRenderFunction=function(t,i,n,r){var o;e.onBeforeRenderMainTextureObservable.notifyObservers(e);var a=e._scene.getEngine();if(r.length){for(a.setColorWrite(!1),o=0;o<r.length;o++)e._renderSubMesh(r.data[o]);a.setColorWrite(!0)}for(o=0;o<t.length;o++)e._renderSubMesh(t.data[o]);for(o=0;o<i.length;o++)e._renderSubMesh(i.data[o]);var s=a.getAlphaMode();for(o=0;o<n.length;o++)e._renderSubMesh(n.data[o],!0);a.setAlphaMode(s)},this._mainTexture.onClearObservable.add(function(t){t.clear(e.neutralColor,!0,!0,!0)});var t=this._scene.getBoundingBoxRenderer().enabled;this._mainTexture.onBeforeBindObservable.add(function(){e._scene.getBoundingBoxRenderer().enabled=!e.disableBoundingBoxesFromEffectLayer&&t}),this._mainTexture.onAfterUnbindObservable.add(function(){e._scene.getBoundingBoxRenderer().enabled=t})},e.prototype._addCustomEffectDefines=function(e){},e.prototype._isReady=function(e,t,i){var n=e.getMaterial();if(!n)return!1;if(!n.isReadyForSubMesh(e.getMesh(),e,t))return!1;var r=[],o=[ji.b.PositionKind],a=e.getMesh(),s=!1,c=!1;if(n){var l=n.needAlphaTesting(),u=n.getAlphaTestTexture(),h=u&&u.hasAlpha&&(n.useAlphaFromDiffuseTexture||n._useAlphaFromAlbedoTexture);u&&(l||h)&&(r.push("#define DIFFUSE"),a.isVerticesDataPresent(ji.b.UV2Kind)&&1===u.coordinatesIndex?(r.push("#define DIFFUSEUV2"),c=!0):a.isVerticesDataPresent(ji.b.UVKind)&&(r.push("#define DIFFUSEUV1"),s=!0),l&&(r.push("#define ALPHATEST"),r.push("#define ALPHATESTVALUE 0.4")));var d=n.opacityTexture;d&&(r.push("#define OPACITY"),a.isVerticesDataPresent(ji.b.UV2Kind)&&1===d.coordinatesIndex?(r.push("#define OPACITYUV2"),c=!0):a.isVerticesDataPresent(ji.b.UVKind)&&(r.push("#define OPACITYUV1"),s=!0))}i&&(r.push("#define EMISSIVE"),a.isVerticesDataPresent(ji.b.UV2Kind)&&1===i.coordinatesIndex?(r.push("#define EMISSIVEUV2"),c=!0):a.isVerticesDataPresent(ji.b.UVKind)&&(r.push("#define EMISSIVEUV1"),s=!0)),a.isVerticesDataPresent(ji.b.ColorKind)&&a.hasVertexAlpha&&(o.push(ji.b.ColorKind),r.push("#define VERTEXALPHA")),s&&(o.push(ji.b.UVKind),r.push("#define UV1")),c&&(o.push(ji.b.UV2Kind),r.push("#define UV2"));var f=new Qr.a;if(a.useBones&&a.computeBonesUsingShaders){o.push(ji.b.MatricesIndicesKind),o.push(ji.b.MatricesWeightsKind),a.numBoneInfluencers>4&&(o.push(ji.b.MatricesIndicesExtraKind),o.push(ji.b.MatricesWeightsExtraKind)),r.push("#define NUM_BONE_INFLUENCERS "+a.numBoneInfluencers);var p=a.skeleton;p&&p.isUsingTextureForMatrices?r.push("#define BONETEXTURE"):r.push("#define BonesPerMesh "+(p?p.bones.length+1:0)),a.numBoneInfluencers>0&&f.addCPUSkinningFallback(0,a)}else r.push("#define NUM_BONE_INFLUENCERS 0");var _=a.morphTargetManager,m=0;_&&_.numInfluencers>0&&(r.push("#define MORPHTARGETS"),m=_.numInfluencers,r.push("#define NUM_MORPH_INFLUENCERS "+m),Hr.a.PrepareAttributesForMorphTargetsInfluencers(o,a,m)),t&&(r.push("#define INSTANCES"),Hr.a.PushAttributesForInstances(o),e.getRenderingMesh().hasThinInstances&&r.push("#define THIN_INSTANCES")),this._addCustomEffectDefines(r);var g=r.join("\n");return this._cachedDefines!==g&&(this._cachedDefines=g,this._effectLayerMapGenerationEffect=this._scene.getEngine().createEffect("glowMapGeneration",o,["world","mBones","viewProjection","glowColor","morphTargetInfluences","boneTextureWidth","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity"],["diffuseSampler","emissiveSampler","opacitySampler","boneSampler"],g,f,void 0,void 0,{maxSimultaneousMorphTargets:m})),this._effectLayerMapGenerationEffect.isReady()},e.prototype.render=function(){var e=this._mergeEffect;if(e.isReady()){for(var t=0;t<this._postProcesses.length;t++)if(!this._postProcesses[t].isReady())return;var i=this._scene.getEngine();this.onBeforeComposeObservable.notifyObservers(this),i.enableEffect(e),i.setState(!1),i.bindBuffers(this._vertexBuffers,this._indexBuffer,e);var n=i.getAlphaMode();i.setAlphaMode(this._effectLayerOptions.alphaBlendingMode),this._internalRender(e),i.setAlphaMode(n),this.onAfterComposeObservable.notifyObservers(this);var r=this._mainTexture.getSize();this._setMainTextureSize(),r.width===this._mainTextureDesiredSize.width&&r.height===this._mainTextureDesiredSize.height||(this.onSizeChangedObservable.notifyObservers(this),this._disposeTextureAndPostProcesses(),this._createMainTexture(),this._createTextureAndPostProcesses())}},e.prototype.hasMesh=function(e){return-1===this.renderingGroupId||e.renderingGroupId===this.renderingGroupId},e.prototype.shouldRender=function(){return this.isEnabled&&this._shouldRender},e.prototype._shouldRenderMesh=function(e){return!0},e.prototype._canRenderMesh=function(e,t){return!t.needAlphaBlendingForMesh(e)},e.prototype._shouldRenderEmissiveTextureForMesh=function(){return!0},e.prototype._renderSubMesh=function(e,t){var i,n=this;if(void 0===t&&(t=!1),this.shouldRender()){var r=e.getMaterial(),o=e.getMesh(),a=e.getReplacementMesh(),s=e.getRenderingMesh(),c=e.getEffectiveMesh(),l=this._scene,u=l.getEngine();if(c._internalAbstractMeshDataInfo._isActiveIntermediate=!1,r&&this._canRenderMesh(s,r)){var h=null!==(i=s.overrideMaterialSideOrientation)&&void 0!==i?i:r.sideOrientation;s._getWorldMatrixDeterminant()<0&&(h=h===lo.a.ClockWiseSideOrientation?lo.a.CounterClockWiseSideOrientation:lo.a.ClockWiseSideOrientation);var d=h===lo.a.ClockWiseSideOrientation;u.setState(r.backFaceCulling,r.zOffset,void 0,d);var f=s._getInstancesRenderList(e._id,!!a);if(!f.mustReturn&&this._shouldRenderMesh(s)){var p=f.hardwareInstancedRendering[e._id]||s.hasThinInstances;if(this._setEmissiveTextureAndColor(s,e,r),this.onBeforeRenderMeshToEffect.notifyObservers(o),this._useMeshMaterial(s))s.render(e,p,a||void 0);else if(this._isReady(e,p,this._emissiveTextureAndColor.texture)){u.enableEffect(this._effectLayerMapGenerationEffect),s._bind(e,this._effectLayerMapGenerationEffect,lo.a.TriangleFillMode),this._effectLayerMapGenerationEffect.setMatrix("viewProjection",l.getTransformMatrix()),this._effectLayerMapGenerationEffect.setMatrix("world",c.getWorldMatrix()),this._effectLayerMapGenerationEffect.setFloat4("glowColor",this._emissiveTextureAndColor.color.r,this._emissiveTextureAndColor.color.g,this._emissiveTextureAndColor.color.b,this._emissiveTextureAndColor.color.a);var _=r.needAlphaTesting(),m=r.getAlphaTestTexture(),g=m&&m.hasAlpha&&(r.useAlphaFromDiffuseTexture||r._useAlphaFromAlbedoTexture);m&&(_||g)&&(this._effectLayerMapGenerationEffect.setTexture("diffuseSampler",m),(v=m.getTextureMatrix())&&this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix",v));var v,b=r.opacityTexture;if(b&&(this._effectLayerMapGenerationEffect.setTexture("opacitySampler",b),this._effectLayerMapGenerationEffect.setFloat("opacityIntensity",b.level),(v=b.getTextureMatrix())&&this._effectLayerMapGenerationEffect.setMatrix("opacityMatrix",v)),this._emissiveTextureAndColor.texture&&(this._effectLayerMapGenerationEffect.setTexture("emissiveSampler",this._emissiveTextureAndColor.texture),this._effectLayerMapGenerationEffect.setMatrix("emissiveMatrix",this._emissiveTextureAndColor.texture.getTextureMatrix())),s.useBones&&s.computeBonesUsingShaders&&s.skeleton){var y=s.skeleton;if(y.isUsingTextureForMatrices){var T=y.getTransformMatrixTexture(s);if(!T)return;this._effectLayerMapGenerationEffect.setTexture("boneSampler",T),this._effectLayerMapGenerationEffect.setFloat("boneTextureWidth",4*(y.bones.length+1))}else this._effectLayerMapGenerationEffect.setMatrices("mBones",y.getTransformMatrices(s))}Hr.a.BindMorphTargetParameters(s,this._effectLayerMapGenerationEffect),t&&u.setAlphaMode(r.alphaMode),s._processRendering(c,e,this._effectLayerMapGenerationEffect,r.fillMode,f,p,function(e,t){return n._effectLayerMapGenerationEffect.setMatrix("world",t)})}else this._mainTexture.resetRefreshCounter();this.onAfterRenderMeshToEffect.notifyObservers(o)}}}},e.prototype._useMeshMaterial=function(e){return!1},e.prototype._rebuild=function(){var e=this._vertexBuffers[ji.b.PositionKind];e&&e._rebuild(),this._generateIndexBuffer()},e.prototype._disposeTextureAndPostProcesses=function(){this._mainTexture.dispose();for(var e=0;e<this._postProcesses.length;e++)this._postProcesses[e]&&this._postProcesses[e].dispose();for(this._postProcesses=[],e=0;e<this._textures.length;e++)this._textures[e]&&this._textures[e].dispose();this._textures=[]},e.prototype.dispose=function(){var e=this._vertexBuffers[ji.b.PositionKind];e&&(e.dispose(),this._vertexBuffers[ji.b.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this._disposeTextureAndPostProcesses();var t=this._scene.effectLayers.indexOf(this,0);t>-1&&this._scene.effectLayers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onBeforeRenderMainTextureObservable.clear(),this.onBeforeComposeObservable.clear(),this.onBeforeRenderMeshToEffect.clear(),this.onAfterRenderMeshToEffect.clear(),this.onAfterComposeObservable.clear(),this.onSizeChangedObservable.clear()},e.prototype.getClassName=function(){return"EffectLayer"},e.Parse=function(e,t,i){return Ce.b.Instantiate(e.customType).Parse(e,t,i)},e._SceneComponentInitialization=function(e){throw Re.a.WarnImport("EffectLayerSceneComponent")},Object(h.c)([Object(w.c)()],e.prototype,"name",void 0),Object(h.c)([Object(w.f)()],e.prototype,"neutralColor",void 0),Object(h.c)([Object(w.c)()],e.prototype,"isEnabled",void 0),Object(h.c)([Object(w.d)()],e.prototype,"camera",null),Object(h.c)([Object(w.c)()],e.prototype,"renderingGroupId",null),Object(h.c)([Object(w.c)()],e.prototype,"disableBoundingBoxesFromEffectLayer",void 0),e}();n.a.AddParser(Me.a.NAME_EFFECTLAYER,function(e,t,i,n){if(e.effectLayers){i.effectLayers||(i.effectLayers=new Array);for(var r=0;r<e.effectLayers.length;r++){var o=oa.Parse(e.effectLayers[r],t,n);i.effectLayers.push(o)}}}),n.a.prototype.removeEffectLayer=function(e){var t=this.effectLayers.indexOf(e);return-1!==t&&this.effectLayers.splice(t,1),t},n.a.prototype.addEffectLayer=function(e){this.effectLayers.push(e)};var aa=function(){function e(e){this.name=Me.a.NAME_EFFECTLAYER,this._renderEffects=!1,this._needStencil=!1,this._previousStencilState=!1,this.scene=e,this._engine=e.getEngine(),e.effectLayers=new Array}return e.prototype.register=function(){this.scene._isReadyForMeshStage.registerStep(Me.a.STEP_ISREADYFORMESH_EFFECTLAYER,this,this._isReadyForMesh),this.scene._cameraDrawRenderTargetStage.registerStep(Me.a.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER,this,this._renderMainTexture),this.scene._beforeCameraDrawStage.registerStep(Me.a.STEP_BEFORECAMERADRAW_EFFECTLAYER,this,this._setStencil),this.scene._afterRenderingGroupDrawStage.registerStep(Me.a.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW,this,this._drawRenderingGroup),this.scene._afterCameraDrawStage.registerStep(Me.a.STEP_AFTERCAMERADRAW_EFFECTLAYER,this,this._setStencilBack),this.scene._afterCameraDrawStage.registerStep(Me.a.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW,this,this._drawCamera)},e.prototype.rebuild=function(){for(var e=0,t=this.scene.effectLayers;e<t.length;e++)t[e]._rebuild()},e.prototype.serialize=function(e){e.effectLayers=[];for(var t=0,i=this.scene.effectLayers;t<i.length;t++){var n=i[t];n.serialize&&e.effectLayers.push(n.serialize())}},e.prototype.addFromContainer=function(e){var t=this;e.effectLayers&&e.effectLayers.forEach(function(e){t.scene.addEffectLayer(e)})},e.prototype.removeFromContainer=function(e,t){var i=this;e.effectLayers&&e.effectLayers.forEach(function(e){i.scene.removeEffectLayer(e),t&&e.dispose()})},e.prototype.dispose=function(){for(var e=this.scene.effectLayers;e.length;)e[0].dispose()},e.prototype._isReadyForMesh=function(e,t){for(var i=0,n=this.scene.effectLayers;i<n.length;i++){var r=n[i];if(r.hasMesh(e))for(var o=0,a=e.subMeshes;o<a.length;o++){var s=a[o];if(!r.isReady(s,t))return!1}}return!0},e.prototype._renderMainTexture=function(e){this._renderEffects=!1,this._needStencil=!1;var t=!1,i=this.scene.effectLayers;if(i&&i.length>0){this._previousStencilState=this._engine.getStencilBuffer();for(var n=0,r=i;n<r.length;n++){var o=r[n];if(o.shouldRender()&&(!o.camera||o.camera.cameraRigMode===je.a.RIG_MODE_NONE&&e===o.camera||o.camera.cameraRigMode!==je.a.RIG_MODE_NONE&&o.camera._rigCameras.indexOf(e)>-1)){this._renderEffects=!0,this._needStencil=this._needStencil||o.needStencil();var a=o._mainTexture;a._shouldRender()&&(this.scene.incrementRenderId(),a.render(!1,!1),t=!0)}}this.scene.incrementRenderId()}return t},e.prototype._setStencil=function(){this._needStencil&&this._engine.setStencilBuffer(!0)},e.prototype._setStencilBack=function(){this._needStencil&&this._engine.setStencilBuffer(this._previousStencilState)},e.prototype._draw=function(e){if(this._renderEffects){this._engine.setDepthBuffer(!1);for(var t=this.scene.effectLayers,i=0;i<t.length;i++){var n=t[i];n.renderingGroupId===e&&n.shouldRender()&&n.render()}this._engine.setDepthBuffer(!0)}},e.prototype._drawCamera=function(){this._renderEffects&&this._draw(-1)},e.prototype._drawRenderingGroup=function(e){!this.scene._isInIntermediateRendering()&&this._renderEffects&&this._draw(e)},e}();oa._SceneComponentInitialization=function(e){var t=e._getComponent(Me.a.NAME_EFFECTLAYER);t||(t=new aa(e),e._addComponent(t))};ai.a.ShadersStore.glowMapMergePixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#ifdef EMISSIVE\nuniform sampler2D textureSampler2;\n#endif\n\nuniform float offset;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef EMISSIVE\nbaseColor+=texture2D(textureSampler2,vUV);\nbaseColor*=offset;\n#else\nbaseColor.a=abs(offset-baseColor.a);\n#ifdef STROKE\nfloat alpha=smoothstep(.0,.1,baseColor.a);\nbaseColor.a=alpha;\nbaseColor.rgb=baseColor.rgb*alpha;\n#endif\n#endif\ngl_FragColor=baseColor;\n}";ai.a.ShadersStore.glowMapMergeVertexShader="\nattribute vec2 position;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}",n.a.prototype.getGlowLayerByName=function(e){for(var t=0;t<this.effectLayers.length;t++)if(this.effectLayers[t].name===e&&this.effectLayers[t].getEffectName()===sa.EffectName)return this.effectLayers[t];return null};var sa=function(e){function t(i,n,r){var o=e.call(this,i,n)||this;return o._intensity=1,o._includedOnlyMeshes=[],o._excludedMeshes=[],o._meshesUsingTheirOwnMaterials=[],o.neutralColor=new s.b(0,0,0,1),o._options=Object(h.a)({mainTextureRatio:t.DefaultTextureRatio,blurKernelSize:32,mainTextureFixedSize:void 0,camera:null,mainTextureSamples:1,renderingGroupId:-1},r),o._init({alphaBlendingMode:g.a.ALPHA_ADD,camera:o._options.camera,mainTextureFixedSize:o._options.mainTextureFixedSize,mainTextureRatio:o._options.mainTextureRatio,renderingGroupId:o._options.renderingGroupId}),o}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"blurKernelSize",{get:function(){return this._horizontalBlurPostprocess1.kernel},set:function(e){this._horizontalBlurPostprocess1.kernel=e,this._verticalBlurPostprocess1.kernel=e,this._horizontalBlurPostprocess2.kernel=e,this._verticalBlurPostprocess2.kernel=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intensity",{get:function(){return this._intensity},set:function(e){this._intensity=e},enumerable:!1,configurable:!0}),t.prototype.getEffectName=function(){return t.EffectName},t.prototype._createMergeEffect=function(){return this._engine.createEffect("glowMapMerge",[ji.b.PositionKind],["offset"],["textureSampler","textureSampler2"],"#define EMISSIVE \n")},t.prototype._createTextureAndPostProcesses=function(){var e=this,t=this._mainTextureDesiredSize.width,i=this._mainTextureDesiredSize.height;t=this._engine.needPOTTextures?Se.a.GetExponentOfTwo(t,this._maxSize):t,i=this._engine.needPOTTextures?Se.a.GetExponentOfTwo(i,this._maxSize):i;var n;n=this._engine.getCaps().textureHalfFloatRender?g.a.TEXTURETYPE_HALF_FLOAT:g.a.TEXTURETYPE_UNSIGNED_INT,this._blurTexture1=new Ri("GlowLayerBlurRTT",{width:t,height:i},this._scene,!1,!0,n),this._blurTexture1.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._blurTexture1.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._blurTexture1.updateSamplingMode(Ke.a.BILINEAR_SAMPLINGMODE),this._blurTexture1.renderParticles=!1,this._blurTexture1.ignoreCameraViewport=!0;var r=Math.floor(t/2),o=Math.floor(i/2);this._blurTexture2=new Ri("GlowLayerBlurRTT2",{width:r,height:o},this._scene,!1,!0,n),this._blurTexture2.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._blurTexture2.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._blurTexture2.updateSamplingMode(Ke.a.BILINEAR_SAMPLINGMODE),this._blurTexture2.renderParticles=!1,this._blurTexture2.ignoreCameraViewport=!0,this._textures=[this._blurTexture1,this._blurTexture2],this._horizontalBlurPostprocess1=new Gr("GlowLayerHBP1",new a.d(1,0),this._options.blurKernelSize/2,{width:t,height:i},null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess1.width=t,this._horizontalBlurPostprocess1.height=i,this._horizontalBlurPostprocess1.onApplyObservable.add(function(t){t.setTexture("textureSampler",e._mainTexture)}),this._verticalBlurPostprocess1=new Gr("GlowLayerVBP1",new a.d(0,1),this._options.blurKernelSize/2,{width:t,height:i},null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess2=new Gr("GlowLayerHBP2",new a.d(1,0),this._options.blurKernelSize/2,{width:r,height:o},null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess2.width=r,this._horizontalBlurPostprocess2.height=o,this._horizontalBlurPostprocess2.onApplyObservable.add(function(t){t.setTexture("textureSampler",e._blurTexture1)}),this._verticalBlurPostprocess2=new Gr("GlowLayerVBP2",new a.d(0,1),this._options.blurKernelSize/2,{width:r,height:o},null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._postProcesses=[this._horizontalBlurPostprocess1,this._verticalBlurPostprocess1,this._horizontalBlurPostprocess2,this._verticalBlurPostprocess2],this._postProcesses1=[this._horizontalBlurPostprocess1,this._verticalBlurPostprocess1],this._postProcesses2=[this._horizontalBlurPostprocess2,this._verticalBlurPostprocess2],this._mainTexture.samples=this._options.mainTextureSamples,this._mainTexture.onAfterUnbindObservable.add(function(){var t=e._blurTexture1.getInternalTexture();if(t){e._scene.postProcessManager.directRender(e._postProcesses1,t,!0);var i=e._blurTexture2.getInternalTexture();i&&e._scene.postProcessManager.directRender(e._postProcesses2,i,!0),e._engine.unBindFramebuffer(null!=i?i:t,!0)}}),this._postProcesses.map(function(e){e.autoClear=!1})},t.prototype.isReady=function(t,i){var n=t.getMaterial(),r=t.getRenderingMesh();if(!n||!r)return!1;var o=n.emissiveTexture;return e.prototype._isReady.call(this,t,i,o)},t.prototype.needStencil=function(){return!1},t.prototype._canRenderMesh=function(e,t){return!0},t.prototype._internalRender=function(e){e.setTexture("textureSampler",this._blurTexture1),e.setTexture("textureSampler2",this._blurTexture2),e.setFloat("offset",this._intensity);var t=this._engine,i=t.getStencilBuffer();t.setStencilBuffer(!1),t.drawElementsType(lo.a.TriangleFillMode,0,6),t.setStencilBuffer(i)},t.prototype._setEmissiveTextureAndColor=function(e,t,i){var n=1;this.customEmissiveTextureSelector?this._emissiveTextureAndColor.texture=this.customEmissiveTextureSelector(e,t,i):i?(this._emissiveTextureAndColor.texture=i.emissiveTexture,this._emissiveTextureAndColor.texture&&(n=this._emissiveTextureAndColor.texture.level)):this._emissiveTextureAndColor.texture=null,this.customEmissiveColorSelector?this.customEmissiveColorSelector(e,t,i,this._emissiveTextureAndColor.color):i.emissiveColor?this._emissiveTextureAndColor.color.set(i.emissiveColor.r*n,i.emissiveColor.g*n,i.emissiveColor.b*n,i.alpha):this._emissiveTextureAndColor.color.set(this.neutralColor.r,this.neutralColor.g,this.neutralColor.b,this.neutralColor.a)},t.prototype._shouldRenderMesh=function(e){return this.hasMesh(e)},t.prototype._addCustomEffectDefines=function(e){e.push("#define GLOW")},t.prototype.addExcludedMesh=function(e){-1===this._excludedMeshes.indexOf(e.uniqueId)&&this._excludedMeshes.push(e.uniqueId)},t.prototype.removeExcludedMesh=function(e){var t=this._excludedMeshes.indexOf(e.uniqueId);-1!==t&&this._excludedMeshes.splice(t,1)},t.prototype.addIncludedOnlyMesh=function(e){-1===this._includedOnlyMeshes.indexOf(e.uniqueId)&&this._includedOnlyMeshes.push(e.uniqueId)},t.prototype.removeIncludedOnlyMesh=function(e){var t=this._includedOnlyMeshes.indexOf(e.uniqueId);-1!==t&&this._includedOnlyMeshes.splice(t,1)},t.prototype.hasMesh=function(t){return!!e.prototype.hasMesh.call(this,t)&&(this._includedOnlyMeshes.length?-1!==this._includedOnlyMeshes.indexOf(t.uniqueId):!this._excludedMeshes.length||-1===this._excludedMeshes.indexOf(t.uniqueId))},t.prototype._useMeshMaterial=function(e){return 0!=this._meshesUsingTheirOwnMaterials.length&&this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId)>-1},t.prototype.referenceMeshToUseItsOwnMaterial=function(e){this._meshesUsingTheirOwnMaterials.push(e.uniqueId)},t.prototype.unReferenceMeshFromUsingItsOwnMaterial=function(e){for(var t=this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);t>=0;)this._meshesUsingTheirOwnMaterials.splice(t,1),t=this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId)},t.prototype._disposeMesh=function(e){this.removeIncludedOnlyMesh(e),this.removeExcludedMesh(e)},t.prototype.getClassName=function(){return"GlowLayer"},t.prototype.serialize=function(){var e,t=w.a.Serialize(this);if(t.customType="BABYLON.GlowLayer",t.includedMeshes=[],this._includedOnlyMeshes.length)for(e=0;e<this._includedOnlyMeshes.length;e++)(i=this._scene.getMeshByUniqueID(this._includedOnlyMeshes[e]))&&t.includedMeshes.push(i.id);if(t.excludedMeshes=[],this._excludedMeshes.length)for(e=0;e<this._excludedMeshes.length;e++){var i;(i=this._scene.getMeshByUniqueID(this._excludedMeshes[e]))&&t.excludedMeshes.push(i.id)}return t},t.Parse=function(e,i,n){var r,o=w.a.Parse(function(){return new t(e.name,i,e.options)},e,i,n);for(r=0;r<e.excludedMeshes.length;r++)(a=i.getMeshByID(e.excludedMeshes[r]))&&o.addExcludedMesh(a);for(r=0;r<e.includedMeshes.length;r++){var a;(a=i.getMeshByID(e.includedMeshes[r]))&&o.addIncludedOnlyMesh(a)}return o},t.EffectName="GlowLayer",t.DefaultBlurKernelSize=32,t.DefaultTextureRatio=.5,Object(h.c)([Object(w.c)()],t.prototype,"blurKernelSize",null),Object(h.c)([Object(w.c)()],t.prototype,"intensity",null),Object(h.c)([Object(w.c)("options")],t.prototype,"_options",void 0),t}(oa);c.a.RegisteredTypes["BABYLON.GlowLayer"]=sa;ai.a.ShadersStore.glowBlurPostProcessPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nuniform vec2 direction;\nuniform float blurWidth;\n\nfloat getLuminance(vec3 color)\n{\nreturn dot(color,vec3(0.2126,0.7152,0.0722));\n}\nvoid main(void)\n{\nfloat weights[7];\nweights[0]=0.05;\nweights[1]=0.1;\nweights[2]=0.2;\nweights[3]=0.3;\nweights[4]=0.2;\nweights[5]=0.1;\nweights[6]=0.05;\nvec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);\nvec2 texelStep=texelSize*direction*blurWidth;\nvec2 start=vUV-3.0*texelStep;\nvec4 baseColor=vec4(0.,0.,0.,0.);\nvec2 texelOffset=vec2(0.,0.);\nfor (int i=0; i<7; i++)\n{\n\nvec4 texel=texture2D(textureSampler,start+texelOffset);\nbaseColor.a+=texel.a*weights[i];\n\nfloat luminance=getLuminance(baseColor.rgb);\nfloat luminanceTexel=getLuminance(texel.rgb);\nfloat choice=step(luminanceTexel,luminance);\nbaseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;\ntexelOffset+=texelStep;\n}\ngl_FragColor=baseColor;\n}",n.a.prototype.getHighlightLayerByName=function(e){for(var t=0;t<this.effectLayers.length;t++)if(this.effectLayers[t].name===e&&this.effectLayers[t].getEffectName()===la.EffectName)return this.effectLayers[t];return null};var ca=function(e){function t(t,i,n,r,o,a,s,c){void 0===a&&(a=Ke.a.BILINEAR_SAMPLINGMODE);var l=e.call(this,t,"glowBlurPostProcess",["screenSize","direction","blurWidth"],null,r,o,a,s,c)||this;return l.direction=i,l.kernel=n,l.onApplyObservable.add(function(e){e.setFloat2("screenSize",l.width,l.height),e.setVector2("direction",l.direction),e.setFloat("blurWidth",l.kernel)}),l}return Object(h.d)(t,e),t}(ci),la=function(e){function t(i,n,r){var a=e.call(this,i,n)||this;return a.name=i,a.innerGlow=!0,a.outerGlow=!0,a.onBeforeBlurObservable=new o.c,a.onAfterBlurObservable=new o.c,a._instanceGlowingMeshStencilReference=t.GlowingMeshStencilReference++,a._meshes={},a._excludedMeshes={},a.neutralColor=t.NeutralColor,a._engine.isStencilEnable||m.a.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }"),a._options=Object(h.a)({mainTextureRatio:.5,blurTextureSizeRatio:.5,blurHorizontalSize:1,blurVerticalSize:1,alphaBlendingMode:g.a.ALPHA_COMBINE,camera:null,renderingGroupId:-1},r),a._init({alphaBlendingMode:a._options.alphaBlendingMode,camera:a._options.camera,mainTextureFixedSize:a._options.mainTextureFixedSize,mainTextureRatio:a._options.mainTextureRatio,renderingGroupId:a._options.renderingGroupId}),a._shouldRender=!1,a}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"blurHorizontalSize",{get:function(){return this._horizontalBlurPostprocess.kernel},set:function(e){this._horizontalBlurPostprocess.kernel=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurVerticalSize",{get:function(){return this._verticalBlurPostprocess.kernel},set:function(e){this._verticalBlurPostprocess.kernel=e},enumerable:!1,configurable:!0}),t.prototype.getEffectName=function(){return t.EffectName},t.prototype._createMergeEffect=function(){return this._engine.createEffect("glowMapMerge",[ji.b.PositionKind],["offset"],["textureSampler"],this._options.isStroke?"#define STROKE \n":void 0)},t.prototype._createTextureAndPostProcesses=function(){var e=this,t=this._mainTextureDesiredSize.width*this._options.blurTextureSizeRatio,i=this._mainTextureDesiredSize.height*this._options.blurTextureSizeRatio;t=this._engine.needPOTTextures?Se.a.GetExponentOfTwo(t,this._maxSize):t,i=this._engine.needPOTTextures?Se.a.GetExponentOfTwo(i,this._maxSize):i;var n;n=this._engine.getCaps().textureHalfFloatRender?g.a.TEXTURETYPE_HALF_FLOAT:g.a.TEXTURETYPE_UNSIGNED_INT,this._blurTexture=new Ri("HighlightLayerBlurRTT",{width:t,height:i},this._scene,!1,!0,n),this._blurTexture.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._blurTexture.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._blurTexture.anisotropicFilteringLevel=16,this._blurTexture.updateSamplingMode(Ke.a.TRILINEAR_SAMPLINGMODE),this._blurTexture.renderParticles=!1,this._blurTexture.ignoreCameraViewport=!0,this._textures=[this._blurTexture],this._options.alphaBlendingMode===g.a.ALPHA_COMBINE?(this._downSamplePostprocess=new li("HighlightLayerPPP",this._options.blurTextureSizeRatio,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._downSamplePostprocess.onApplyObservable.add(function(t){t.setTexture("textureSampler",e._mainTexture)}),this._horizontalBlurPostprocess=new ca("HighlightLayerHBP",new a.d(1,0),this._options.blurHorizontalSize,1,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._horizontalBlurPostprocess.onApplyObservable.add(function(e){e.setFloat2("screenSize",t,i)}),this._verticalBlurPostprocess=new ca("HighlightLayerVBP",new a.d(0,1),this._options.blurVerticalSize,1,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._verticalBlurPostprocess.onApplyObservable.add(function(e){e.setFloat2("screenSize",t,i)}),this._postProcesses=[this._downSamplePostprocess,this._horizontalBlurPostprocess,this._verticalBlurPostprocess]):(this._horizontalBlurPostprocess=new Gr("HighlightLayerHBP",new a.d(1,0),this._options.blurHorizontalSize/2,{width:t,height:i},null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess.width=t,this._horizontalBlurPostprocess.height=i,this._horizontalBlurPostprocess.onApplyObservable.add(function(t){t.setTexture("textureSampler",e._mainTexture)}),this._verticalBlurPostprocess=new Gr("HighlightLayerVBP",new a.d(0,1),this._options.blurVerticalSize/2,{width:t,height:i},null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._postProcesses=[this._horizontalBlurPostprocess,this._verticalBlurPostprocess]),this._mainTexture.onAfterUnbindObservable.add(function(){e.onBeforeBlurObservable.notifyObservers(e);var t=e._blurTexture.getInternalTexture();t&&(e._scene.postProcessManager.directRender(e._postProcesses,t,!0),e._engine.unBindFramebuffer(t,!0)),e.onAfterBlurObservable.notifyObservers(e)}),this._postProcesses.map(function(e){e.autoClear=!1})},t.prototype.needStencil=function(){return!0},t.prototype.isReady=function(t,i){var n=t.getMaterial(),r=t.getRenderingMesh();if(!n||!r||!this._meshes)return!1;var o=null,a=this._meshes[r.uniqueId];return a&&a.glowEmissiveOnly&&n&&(o=n.emissiveTexture),e.prototype._isReady.call(this,t,i,o)},t.prototype._internalRender=function(e){e.setTexture("textureSampler",this._blurTexture);var t=this._engine;t.cacheStencilState(),t.setStencilOperationPass(g.a.REPLACE),t.setStencilOperationFail(g.a.KEEP),t.setStencilOperationDepthFail(g.a.KEEP),t.setStencilMask(0),t.setStencilBuffer(!0),t.setStencilFunctionReference(this._instanceGlowingMeshStencilReference),this.outerGlow&&(e.setFloat("offset",0),t.setStencilFunction(g.a.NOTEQUAL),t.drawElementsType(lo.a.TriangleFillMode,0,6)),this.innerGlow&&(e.setFloat("offset",1),t.setStencilFunction(g.a.EQUAL),t.drawElementsType(lo.a.TriangleFillMode,0,6)),t.restoreStencilState()},t.prototype.shouldRender=function(){return!!e.prototype.shouldRender.call(this)&&!!this._meshes},t.prototype._shouldRenderMesh=function(t){return!(this._excludedMeshes&&this._excludedMeshes[t.uniqueId]||!e.prototype.hasMesh.call(this,t))},t.prototype._canRenderMesh=function(e,t){return!0},t.prototype._addCustomEffectDefines=function(e){e.push("#define HIGHLIGHT")},t.prototype._setEmissiveTextureAndColor=function(e,t,i){var n=this._meshes[e.uniqueId];n?this._emissiveTextureAndColor.color.set(n.color.r,n.color.g,n.color.b,1):this._emissiveTextureAndColor.color.set(this.neutralColor.r,this.neutralColor.g,this.neutralColor.b,this.neutralColor.a),n&&n.glowEmissiveOnly&&i?(this._emissiveTextureAndColor.texture=i.emissiveTexture,this._emissiveTextureAndColor.color.set(1,1,1,1)):this._emissiveTextureAndColor.texture=null},t.prototype.addExcludedMesh=function(e){this._excludedMeshes&&(this._excludedMeshes[e.uniqueId]||(this._excludedMeshes[e.uniqueId]={mesh:e,beforeBind:e.onBeforeBindObservable.add(function(e){e.getEngine().setStencilBuffer(!1)}),afterRender:e.onAfterRenderObservable.add(function(e){e.getEngine().setStencilBuffer(!0)})}))},t.prototype.removeExcludedMesh=function(e){if(this._excludedMeshes){var t=this._excludedMeshes[e.uniqueId];t&&(t.beforeBind&&e.onBeforeBindObservable.remove(t.beforeBind),t.afterRender&&e.onAfterRenderObservable.remove(t.afterRender)),this._excludedMeshes[e.uniqueId]=null}},t.prototype.hasMesh=function(t){return!!this._meshes&&!!e.prototype.hasMesh.call(this,t)&&void 0!==this._meshes[t.uniqueId]&&null!==this._meshes[t.uniqueId]},t.prototype.addMesh=function(e,t,i){var n=this;if(void 0===i&&(i=!1),this._meshes){var r=this._meshes[e.uniqueId];r?r.color=t:(this._meshes[e.uniqueId]={mesh:e,color:t,observerHighlight:e.onBeforeBindObservable.add(function(e){n.isEnabled&&(n._excludedMeshes&&n._excludedMeshes[e.uniqueId]?n._defaultStencilReference(e):e.getScene().getEngine().setStencilFunctionReference(n._instanceGlowingMeshStencilReference))}),observerDefault:e.onAfterRenderObservable.add(function(e){n.isEnabled&&n._defaultStencilReference(e)}),glowEmissiveOnly:i},e.onDisposeObservable.add(function(){n._disposeMesh(e)})),this._shouldRender=!0}},t.prototype.removeMesh=function(e){if(this._meshes){var t=this._meshes[e.uniqueId];for(var i in t&&(t.observerHighlight&&e.onBeforeBindObservable.remove(t.observerHighlight),t.observerDefault&&e.onAfterRenderObservable.remove(t.observerDefault),delete this._meshes[e.uniqueId]),this._shouldRender=!1,this._meshes)if(this._meshes[i]){this._shouldRender=!0;break}}},t.prototype.removeAllMeshes=function(){if(this._meshes)for(var e in this._meshes)if(this._meshes.hasOwnProperty(e)){var t=this._meshes[e];t&&this.removeMesh(t.mesh)}},t.prototype._defaultStencilReference=function(e){e.getScene().getEngine().setStencilFunctionReference(t.NormalMeshStencilReference)},t.prototype._disposeMesh=function(e){this.removeMesh(e),this.removeExcludedMesh(e)},t.prototype.dispose=function(){if(this._meshes){for(var t in this._meshes)(i=this._meshes[t])&&i.mesh&&(i.observerHighlight&&i.mesh.onBeforeBindObservable.remove(i.observerHighlight),i.observerDefault&&i.mesh.onAfterRenderObservable.remove(i.observerDefault));this._meshes=null}if(this._excludedMeshes){for(var t in this._excludedMeshes){var i;(i=this._excludedMeshes[t])&&(i.beforeBind&&i.mesh.onBeforeBindObservable.remove(i.beforeBind),i.afterRender&&i.mesh.onAfterRenderObservable.remove(i.afterRender))}this._excludedMeshes=null}e.prototype.dispose.call(this)},t.prototype.getClassName=function(){return"HighlightLayer"},t.prototype.serialize=function(){var e=w.a.Serialize(this);if(e.customType="BABYLON.HighlightLayer",e.meshes=[],this._meshes)for(var t in this._meshes){var i=this._meshes[t];i&&e.meshes.push({glowEmissiveOnly:i.glowEmissiveOnly,color:i.color.asArray(),meshId:i.mesh.id})}if(e.excludedMeshes=[],this._excludedMeshes)for(var n in this._excludedMeshes){var r=this._excludedMeshes[n];r&&e.excludedMeshes.push(r.mesh.id)}return e},t.Parse=function(e,i,n){var r,o=w.a.Parse(function(){return new t(e.name,i,e.options)},e,i,n);for(r=0;r<e.excludedMeshes.length;r++)(a=i.getMeshByID(e.excludedMeshes[r]))&&o.addExcludedMesh(a);for(r=0;r<e.meshes.length;r++){var a,c=e.meshes[r];(a=i.getMeshByID(c.meshId))&&o.addMesh(a,s.a.FromArray(c.color),c.glowEmissiveOnly)}return o},t.EffectName="HighlightLayer",t.NeutralColor=new s.b(0,0,0,0),t.GlowingMeshStencilReference=2,t.NormalMeshStencilReference=1,Object(h.c)([Object(w.c)()],t.prototype,"innerGlow",void 0),Object(h.c)([Object(w.c)()],t.prototype,"outerGlow",void 0),Object(h.c)([Object(w.c)()],t.prototype,"blurHorizontalSize",null),Object(h.c)([Object(w.c)()],t.prototype,"blurVerticalSize",null),Object(h.c)([Object(w.c)("options")],t.prototype,"_options",void 0),t}(oa);c.a.RegisteredTypes["BABYLON.HighlightLayer"]=la;var ua=function(){function e(e){this.name=Me.a.NAME_LAYER,this.scene=e,this._engine=e.getEngine(),e.layers=new Array}return e.prototype.register=function(){this.scene._beforeCameraDrawStage.registerStep(Me.a.STEP_BEFORECAMERADRAW_LAYER,this,this._drawCameraBackground),this.scene._afterCameraDrawStage.registerStep(Me.a.STEP_AFTERCAMERADRAW_LAYER,this,this._drawCameraForeground),this.scene._beforeRenderTargetDrawStage.registerStep(Me.a.STEP_BEFORERENDERTARGETDRAW_LAYER,this,this._drawRenderTargetBackground),this.scene._afterRenderTargetDrawStage.registerStep(Me.a.STEP_AFTERRENDERTARGETDRAW_LAYER,this,this._drawRenderTargetForeground)},e.prototype.rebuild=function(){for(var e=0,t=this.scene.layers;e<t.length;e++)t[e]._rebuild()},e.prototype.dispose=function(){for(var e=this.scene.layers;e.length;)e[0].dispose()},e.prototype._draw=function(e){var t=this.scene.layers;if(t.length){this._engine.setDepthBuffer(!1);for(var i=0,n=t;i<n.length;i++){var r=n[i];e(r)&&r.render()}this._engine.setDepthBuffer(!0)}},e.prototype._drawCameraPredicate=function(e,t,i){return!e.renderOnlyInRenderTargetTextures&&e.isBackground===t&&0!=(e.layerMask&i)},e.prototype._drawCameraBackground=function(e){var t=this;this._draw(function(i){return t._drawCameraPredicate(i,!0,e.layerMask)})},e.prototype._drawCameraForeground=function(e){var t=this;this._draw(function(i){return t._drawCameraPredicate(i,!1,e.layerMask)})},e.prototype._drawRenderTargetPredicate=function(e,t,i,n){return e.renderTargetTextures.length>0&&e.isBackground===t&&e.renderTargetTextures.indexOf(n)>-1&&0!=(e.layerMask&i)},e.prototype._drawRenderTargetBackground=function(e){var t=this;this._draw(function(i){return t._drawRenderTargetPredicate(i,!0,t.scene.activeCamera.layerMask,e)})},e.prototype._drawRenderTargetForeground=function(e){var t=this;this._draw(function(i){return t._drawRenderTargetPredicate(i,!1,t.scene.activeCamera.layerMask,e)})},e.prototype.addFromContainer=function(e){var t=this;e.layers&&e.layers.forEach(function(e){t.scene.layers.push(e)})},e.prototype.removeFromContainer=function(e,t){var i=this;void 0===t&&(t=!1),e.layers&&e.layers.forEach(function(e){var n=i.scene.layers.indexOf(e);-1!==n&&i.scene.layers.splice(n,1),t&&e.dispose()})},e}();ai.a.ShadersStore.layerPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\n\n#include<helperFunctions>\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef LINEAR\nbaseColor.rgb=toGammaSpace(baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n}";ai.a.ShadersStore.layerVertexShader="\nattribute vec2 position;\n\nuniform vec2 scale;\nuniform vec2 offset;\nuniform mat4 textureMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvec2 shiftedPosition=position*scale+offset;\nvUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));\ngl_Position=vec4(shiftedPosition,0.0,1.0);\n}";var ha=function(){function e(e,t,i,n,r){this.name=e,this.scale=new a.d(1,1),this.offset=new a.d(0,0),this.alphaBlendingMode=g.a.ALPHA_COMBINE,this.layerMask=268435455,this.renderTargetTextures=[],this.renderOnlyInRenderTargetTextures=!1,this._vertexBuffers={},this.onDisposeObservable=new o.c,this.onBeforeRenderObservable=new o.c,this.onAfterRenderObservable=new o.c,this.texture=t?new Ke.a(t,i,!0):null,this.isBackground=void 0===n||n,this.color=void 0===r?new s.b(1,1,1,1):r,this._scene=i||x.a.LastCreatedScene;var c=this._scene._getComponent(Me.a.NAME_LAYER);c||(c=new ua(this._scene),this._scene._addComponent(c)),this._scene.layers.push(this);var l=this._scene.getEngine(),u=[];u.push(1,1),u.push(-1,1),u.push(-1,-1),u.push(1,-1);var h=new ji.b(l,u,ji.b.PositionKind,!1,!1,2);this._vertexBuffers[ji.b.PositionKind]=h,this._createIndexBuffer()}return Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!1,configurable:!0}),e.prototype._createIndexBuffer=function(){var e=this._scene.getEngine(),t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)},e.prototype._rebuild=function(){var e=this._vertexBuffers[ji.b.PositionKind];e&&e._rebuild(),this._createIndexBuffer()},e.prototype.render=function(){var e=this._scene.getEngine(),t="";this.alphaTest&&(t="#define ALPHATEST"),this.texture&&!this.texture.gammaSpace&&(t+="\r\n#define LINEAR"),this._previousDefines!==t&&(this._previousDefines=t,this._effect=e.createEffect("layer",[ji.b.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],t));var i=this._effect;i&&i.isReady()&&this.texture&&this.texture.isReady()&&(e=this._scene.getEngine(),this.onBeforeRenderObservable.notifyObservers(this),e.enableEffect(i),e.setState(!1),i.setTexture("textureSampler",this.texture),i.setMatrix("textureMatrix",this.texture.getTextureMatrix()),i.setFloat4("color",this.color.r,this.color.g,this.color.b,this.color.a),i.setVector2("offset",this.offset),i.setVector2("scale",this.scale),e.bindBuffers(this._vertexBuffers,this._indexBuffer,i),this.alphaTest?e.drawElementsType(lo.a.TriangleFillMode,0,6):(e.setAlphaMode(this.alphaBlendingMode),e.drawElementsType(lo.a.TriangleFillMode,0,6),e.setAlphaMode(g.a.ALPHA_DISABLE)),this.onAfterRenderObservable.notifyObservers(this))},e.prototype.dispose=function(){var e=this._vertexBuffers[ji.b.PositionKind];e&&(e.dispose(),this._vertexBuffers[ji.b.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this.texture&&(this.texture.dispose(),this.texture=null),this.renderTargetTextures=[];var t=this._scene.layers.indexOf(this);this._scene.layers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderObservable.clear()},e}(),da=function(){function e(e,t,i,n,r){this.size=e,this.position=t,this.alphaMode=g.a.ALPHA_ONEONE,this.color=i||new s.a(1,1,1),this.texture=n?new Ke.a(n,r.getScene(),!0):null,this._system=r,r.lensFlares.push(this)}return e.AddFlare=function(t,i,n,r,o){return new e(t,i,n,r,o)},e.prototype.dispose=function(){this.texture&&this.texture.dispose();var e=this._system.lensFlares.indexOf(this);this._system.lensFlares.splice(e,1)},e}();ai.a.ShadersStore.lensFlarePixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\ngl_FragColor=baseColor*color;\n}";ai.a.ShadersStore.lensFlareVertexShader="\nattribute vec2 position;\n\nuniform mat4 viewportMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=viewportMatrix*vec4(position,0.0,1.0);\n}";var fa=function(){function e(t,i,n){this.name=t,this.lensFlares=new Array,this.borderLimit=300,this.viewportBorder=0,this.layerMask=268435455,this._vertexBuffers={},this._isEnabled=!0,this._scene=n||x.a.LastCreatedScene,e._SceneComponentInitialization(this._scene),this._emitter=i,this.id=t,n.lensFlareSystems.push(this),this.meshesSelectionPredicate=function(e){return n.activeCamera&&e.material&&e.isVisible&&e.isEnabled()&&e.isBlocker&&0!=(e.layerMask&n.activeCamera.layerMask)};var r=n.getEngine(),o=[];o.push(1,1),o.push(-1,1),o.push(-1,-1),o.push(1,-1),this._vertexBuffers[ji.b.PositionKind]=new ji.b(r,o,ji.b.PositionKind,!1,!1,2);var a=[];a.push(0),a.push(1),a.push(2),a.push(0),a.push(2),a.push(3),this._indexBuffer=r.createIndexBuffer(a),this._effect=r.createEffect("lensFlare",[ji.b.PositionKind],["color","viewportMatrix"],["textureSampler"],"")}return Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getEmitter=function(){return this._emitter},e.prototype.setEmitter=function(e){this._emitter=e},e.prototype.getEmitterPosition=function(){return this._emitter.getAbsolutePosition?this._emitter.getAbsolutePosition():this._emitter.position},e.prototype.computeEffectivePosition=function(e){var t=this.getEmitterPosition();return t=a.e.Project(t,a.a.Identity(),this._scene.getTransformMatrix(),e),this._positionX=t.x,this._positionY=t.y,t=a.e.TransformCoordinates(this.getEmitterPosition(),this._scene.getViewMatrix()),this.viewportBorder>0&&(e.x-=this.viewportBorder,e.y-=this.viewportBorder,e.width+=2*this.viewportBorder,e.height+=2*this.viewportBorder,t.x+=this.viewportBorder,t.y+=this.viewportBorder,this._positionX+=this.viewportBorder,this._positionY+=this.viewportBorder),t.z>0&&(this._positionX>e.x&&this._positionX<e.x+e.width&&this._positionY>e.y&&(this._positionY,e.y,e.height),!0)},e.prototype._isVisible=function(){if(!this._isEnabled||!this._scene.activeCamera)return!1;var e=this.getEmitterPosition().subtract(this._scene.activeCamera.globalPosition),t=e.length();e.normalize();var i=new Xt.a(this._scene.activeCamera.globalPosition,e),n=this._scene.pickWithRay(i,this.meshesSelectionPredicate,!0);return!n||!n.hit||n.distance>t},e.prototype.render=function(){if(!this._effect.isReady()||!this._scene.activeCamera)return!1;var e,t,i=this._scene.getEngine(),n=this._scene.activeCamera.viewport.toGlobal(i.getRenderWidth(!0),i.getRenderHeight(!0));if(!this.computeEffectivePosition(n))return!1;if(!this._isVisible())return!1;var r=(e=this._positionX<this.borderLimit+n.x?this.borderLimit+n.x-this._positionX:this._positionX>n.x+n.width-this.borderLimit?this._positionX-n.x-n.width+this.borderLimit:0)>(t=this._positionY<this.borderLimit+n.y?this.borderLimit+n.y-this._positionY:this._positionY>n.y+n.height-this.borderLimit?this._positionY-n.y-n.height+this.borderLimit:0)?e:t;(r-=this.viewportBorder)>this.borderLimit&&(r=this.borderLimit);var o=1-L.a.Clamp(r/this.borderLimit,0,1);if(o<0)return!1;o>1&&(o=1),this.viewportBorder>0&&(n.x+=this.viewportBorder,n.y+=this.viewportBorder,n.width-=2*this.viewportBorder,n.height-=2*this.viewportBorder,this._positionX-=this.viewportBorder,this._positionY-=this.viewportBorder);var s=n.x+n.width/2,c=n.y+n.height/2,l=s-this._positionX,u=c-this._positionY;i.enableEffect(this._effect),i.setState(!1),i.setDepthBuffer(!1),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect);for(var h=0;h<this.lensFlares.length;h++){var d=this.lensFlares[h];if(!d.texture||d.texture.isReady()){i.setAlphaMode(d.alphaMode);var f=s-l*d.position,p=c-u*d.position,_=d.size,m=d.size*i.getAspectRatio(this._scene.activeCamera,!0),v=f/(n.width+2*n.x)*2-1,b=1-p/(n.height+2*n.y)*2,y=a.a.FromValues(_/2,0,0,0,0,m/2,0,0,0,0,1,0,v,b,0,1);this._effect.setMatrix("viewportMatrix",y),this._effect.setTexture("textureSampler",d.texture),this._effect.setFloat4("color",d.color.r*o,d.color.g*o,d.color.b*o,1),i.drawElementsType(lo.a.TriangleFillMode,0,6)}}return i.setDepthBuffer(!0),i.setAlphaMode(g.a.ALPHA_DISABLE),!0},e.prototype.dispose=function(){var e=this._vertexBuffers[ji.b.PositionKind];for(e&&(e.dispose(),this._vertexBuffers[ji.b.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null);this.lensFlares.length;)this.lensFlares[0].dispose();var t=this._scene.lensFlareSystems.indexOf(this);this._scene.lensFlareSystems.splice(t,1)},e.Parse=function(t,i,n){var r=i.getLastEntryByID(t.emitterId),o=t.name||"lensFlareSystem#"+t.emitterId,a=new e(o,r,i);a.id=t.id||o,a.borderLimit=t.borderLimit;for(var c=0;c<t.flares.length;c++){var l=t.flares[c];da.AddFlare(l.size,l.position,s.a.FromArray(l.color),l.textureName?n+l.textureName:"",a)}return a},e.prototype.serialize=function(){var e={};e.id=this.id,e.name=this.name,e.emitterId=this.getEmitter().id,e.borderLimit=this.borderLimit,e.flares=[];for(var t=0;t<this.lensFlares.length;t++){var i=this.lensFlares[t];e.flares.push({size:i.size,position:i.position,color:i.color.asArray(),textureName:Ce.b.GetFilename(i.texture?i.texture.name:"")})}return e},e._SceneComponentInitialization=function(e){throw Re.a.WarnImport("LensFlareSystemSceneComponent")},e}();n.a.AddParser(Me.a.NAME_LENSFLARESYSTEM,function(e,t,i,n){if(void 0!==e.lensFlareSystems&&null!==e.lensFlareSystems){i.lensFlareSystems||(i.lensFlareSystems=new Array);for(var r=0,o=e.lensFlareSystems.length;r<o;r++){var a=e.lensFlareSystems[r],s=fa.Parse(a,t,n);i.lensFlareSystems.push(s)}}}),n.a.prototype.getLensFlareSystemByName=function(e){for(var t=0;t<this.lensFlareSystems.length;t++)if(this.lensFlareSystems[t].name===e)return this.lensFlareSystems[t];return null},n.a.prototype.getLensFlareSystemByID=function(e){for(var t=0;t<this.lensFlareSystems.length;t++)if(this.lensFlareSystems[t].id===e)return this.lensFlareSystems[t];return null},n.a.prototype.removeLensFlareSystem=function(e){var t=this.lensFlareSystems.indexOf(e);return-1!==t&&this.lensFlareSystems.splice(t,1),t},n.a.prototype.addLensFlareSystem=function(e){this.lensFlareSystems.push(e)};var pa=function(){function e(e){this.name=Me.a.NAME_LENSFLARESYSTEM,this.scene=e,e.lensFlareSystems=new Array}return e.prototype.register=function(){this.scene._afterCameraDrawStage.registerStep(Me.a.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM,this,this._draw)},e.prototype.rebuild=function(){},e.prototype.addFromContainer=function(e){var t=this;e.lensFlareSystems&&e.lensFlareSystems.forEach(function(e){t.scene.addLensFlareSystem(e)})},e.prototype.removeFromContainer=function(e,t){var i=this;e.lensFlareSystems&&e.lensFlareSystems.forEach(function(e){i.scene.removeLensFlareSystem(e),t&&e.dispose()})},e.prototype.serialize=function(e){e.lensFlareSystems=[];for(var t=0,i=this.scene.lensFlareSystems;t<i.length;t++){var n=i[t];e.lensFlareSystems.push(n.serialize())}},e.prototype.dispose=function(){for(var e=this.scene.lensFlareSystems;e.length;)e[0].dispose()},e.prototype._draw=function(e){if(this.scene.lensFlaresEnabled){var t=this.scene.lensFlareSystems;Ce.b.StartPerformanceCounter("Lens flares",t.length>0);for(var i=0,n=t;i<n.length;i++){var r=n[i];0!=(e.layerMask&r.layerMask)&&r.render()}Ce.b.EndPerformanceCounter("Lens flares",t.length>0)}},e}();fa._SceneComponentInitialization=function(e){var t=e._getComponent(Me.a.NAME_LENSFLARESYSTEM);t||(t=new pa(e),e._addComponent(t))};ai.a.IncludesShadersStore.bayerDitherFunctions="\n\n\n\n\nfloat bayerDither2(vec2 _P) {\nreturn mod(2.0*_P.y+_P.x+1.0,4.0);\n}\n\n\nfloat bayerDither4(vec2 _P) {\nvec2 P1=mod(_P,2.0);\nvec2 P2=floor(0.5*mod(_P,4.0));\nreturn 4.0*bayerDither2(P1)+bayerDither2(P2);\n}\n\nfloat bayerDither8(vec2 _P) {\nvec2 P1=mod(_P,2.0);\nvec2 P2=floor(0.5*mod(_P,4.0));\nvec2 P4=floor(0.25*mod(_P,8.0));\nreturn 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);\n}\n";ai.a.IncludesShadersStore.shadowMapFragmentDeclaration="#if SM_FLOAT == 0\n#include<packingFunctions>\n#endif\n#if SM_SOFTTRANSPARENTSHADOW == 1\n#include<bayerDitherFunctions>\nuniform float softTransparentShadowSM;\n#endif\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE == 1\nuniform vec3 lightDataSM;\nvarying vec3 vPositionWSM;\n#endif\nuniform vec3 biasAndScaleSM;\nuniform vec2 depthValuesSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nvarying float zSM;\n#endif\n";ai.a.IncludesShadersStore.shadowMapFragment=" float depthSM=vDepthMetricSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\n#if SM_USEDISTANCE == 1\ndepthSM=clamp(((length(vPositionWSM-lightDataSM)+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x,0.0,1.0);\n#else\ndepthSM=clamp(((zSM+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x,0.0,1.0);\n#endif\ngl_FragDepth=depthSM;\n#elif SM_USEDISTANCE == 1\ndepthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/(depthValuesSM.y)+biasAndScaleSM.x;\n#endif\n#if SM_ESM == 1\ndepthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);\n#endif\n#if SM_FLOAT == 1\ngl_FragColor=vec4(depthSM,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depthSM);\n#endif\nreturn;";ai.a.ShadersStore.shadowMapPixelShader="#include<shadowMapFragmentDeclaration>\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvoid main(void)\n{\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nfloat alphaFromAlphaTexture=texture2D(diffuseSampler,vUV).a;\nif (alphaFromAlphaTexture<0.4)\ndiscard;\n#endif\n#if SM_SOFTTRANSPARENTSHADOW == 1\n#ifdef ALPHATEST\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alphaFromAlphaTexture) discard;\n#else\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM) discard;\n#endif\n#endif\n#include<shadowMapFragment>\n}";ai.a.IncludesShadersStore.shadowMapVertexDeclaration="#if SM_NORMALBIAS == 1\nuniform vec3 lightDataSM;\n#endif\nuniform vec3 biasAndScaleSM;\nuniform vec2 depthValuesSM;\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE == 1\nvarying vec3 vPositionWSM;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nvarying float zSM;\n#endif\n";ai.a.IncludesShadersStore.shadowMapVertexNormalBias="\n#if SM_NORMALBIAS == 1\n#if SM_DIRECTIONINLIGHTDATA == 1\nvec3 worldLightDirSM=normalize(-lightDataSM.xyz);\n#else\nvec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;\nvec3 worldLightDirSM=normalize(directionToLightSM);\n#endif\nfloat ndlSM=dot(vNormalW,worldLightDirSM);\nfloat sinNLSM=sqrt(1.0-ndlSM*ndlSM);\nfloat normalBiasSM=biasAndScaleSM.y*sinNLSM;\nworldPos.xyz-=vNormalW*normalBiasSM;\n#endif\n";ai.a.IncludesShadersStore.shadowMapVertexMetric="#if SM_USEDISTANCE == 1\nvPositionWSM=worldPos.xyz;\n#endif\n#if SM_DEPTHTEXTURE == 1\n\ngl_Position.z+=biasAndScaleSM.x*gl_Position.w;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nzSM=gl_Position.z;\ngl_Position.z=0.0;\n#elif SM_USEDISTANCE == 0\n\nvDepthMetricSM=((gl_Position.z+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x;\n#endif\n";ai.a.ShadersStore.shadowMapVertexShader="\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\n#include<helperFunctions>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<shadowMapVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normWorldSM=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));\nvNormalW=normalize(normWorldSM*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormWorldSM=transposeMat3(inverseMat3(normWorldSM));\n#endif\nvec3 vNormalW=normalize(normWorldSM*normalUpdated);\n#endif\n#endif\n#include<shadowMapVertexNormalBias>\n\ngl_Position=viewProjection*worldPos;\n#include<shadowMapVertexMetric>\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<clipPlaneVertex>\n}";ai.a.ShadersStore.depthBoxBlurPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nvoid main(void)\n{\nvec4 colorDepth=vec4(0.0);\nfor (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);\ngl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));\n}";ai.a.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow="#if SM_SOFTTRANSPARENTSHADOW == 1\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alpha) discard;\n#endif\n";var _a=new a.a,ma=new a.a,ga=function(){function e(t,i,n){this.onBeforeShadowMapRenderObservable=new o.c,this.onAfterShadowMapRenderObservable=new o.c,this.onBeforeShadowMapRenderMeshObservable=new o.c,this.onAfterShadowMapRenderMeshObservable=new o.c,this._bias=5e-5,this._normalBias=0,this._blurBoxOffset=1,this._blurScale=2,this._blurKernel=1,this._useKernelBlur=!1,this._filter=e.FILTER_NONE,this._filteringQuality=e.QUALITY_HIGH,this._contactHardeningLightSizeUVRatio=.1,this._darkness=0,this._transparencyShadow=!1,this.enableSoftTransparentShadow=!1,this.frustumEdgeFalloff=0,this.forceBackFacesOnly=!1,this._lightDirection=a.e.Zero(),this._viewMatrix=a.a.Zero(),this._projectionMatrix=a.a.Zero(),this._transformMatrix=a.a.Zero(),this._cachedPosition=new a.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cachedDirection=new a.e(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._currentFaceIndex=0,this._currentFaceIndexCache=0,this._defaultTextureMatrix=a.a.Identity(),this._mapSize=t,this._light=i,this._scene=i.getScene(),i._shadowGenerator=this,this.id=i.id,e._SceneComponentInitialization(this._scene);var r=this._scene.getEngine().getCaps();n?r.textureFloatRender&&r.textureFloatLinearFiltering?this._textureType=g.a.TEXTURETYPE_FLOAT:r.textureHalfFloatRender&&r.textureHalfFloatLinearFiltering?this._textureType=g.a.TEXTURETYPE_HALF_FLOAT:this._textureType=g.a.TEXTURETYPE_UNSIGNED_INT:r.textureHalfFloatRender&&r.textureHalfFloatLinearFiltering?this._textureType=g.a.TEXTURETYPE_HALF_FLOAT:r.textureFloatRender&&r.textureFloatLinearFiltering?this._textureType=g.a.TEXTURETYPE_FLOAT:this._textureType=g.a.TEXTURETYPE_UNSIGNED_INT,this._initializeGenerator(),this._applyFilterValues()}return Object.defineProperty(e.prototype,"bias",{get:function(){return this._bias},set:function(e){this._bias=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"normalBias",{get:function(){return this._normalBias},set:function(e){this._normalBias=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurBoxOffset",{get:function(){return this._blurBoxOffset},set:function(e){this._blurBoxOffset!==e&&(this._blurBoxOffset=e,this._disposeBlurPostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurScale",{get:function(){return this._blurScale},set:function(e){this._blurScale!==e&&(this._blurScale=e,this._disposeBlurPostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurKernel",{get:function(){return this._blurKernel},set:function(e){this._blurKernel!==e&&(this._blurKernel=e,this._disposeBlurPostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useKernelBlur",{get:function(){return this._useKernelBlur},set:function(e){this._useKernelBlur!==e&&(this._useKernelBlur=e,this._disposeBlurPostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthScale",{get:function(){return void 0!==this._depthScale?this._depthScale:this._light.getDepthScale()},set:function(e){this._depthScale=e},enumerable:!1,configurable:!0}),e.prototype._validateFilter=function(e){return e},Object.defineProperty(e.prototype,"filter",{get:function(){return this._filter},set:function(t){if(t=this._validateFilter(t),this._light.needCube()){if(t===e.FILTER_BLUREXPONENTIALSHADOWMAP)return void(this.useExponentialShadowMap=!0);if(t===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)return void(this.useCloseExponentialShadowMap=!0);if(t===e.FILTER_PCF||t===e.FILTER_PCSS)return void(this.usePoissonSampling=!0)}t!==e.FILTER_PCF&&t!==e.FILTER_PCSS||1!==this._scene.getEngine().webGLVersion?this._filter!==t&&(this._filter=t,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty()):this.usePoissonSampling=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usePoissonSampling",{get:function(){return this.filter===e.FILTER_POISSONSAMPLING},set:function(t){var i=this._validateFilter(e.FILTER_POISSONSAMPLING);(t||this.filter===e.FILTER_POISSONSAMPLING)&&(this.filter=t?i:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useExponentialShadowMap",{get:function(){return this.filter===e.FILTER_EXPONENTIALSHADOWMAP},set:function(t){var i=this._validateFilter(e.FILTER_EXPONENTIALSHADOWMAP);(t||this.filter===e.FILTER_EXPONENTIALSHADOWMAP)&&(this.filter=t?i:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useBlurExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP},set:function(t){var i=this._validateFilter(e.FILTER_BLUREXPONENTIALSHADOWMAP);(t||this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP)&&(this.filter=t?i:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP},set:function(t){var i=this._validateFilter(e.FILTER_CLOSEEXPONENTIALSHADOWMAP);(t||this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?i:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useBlurCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP},set:function(t){var i=this._validateFilter(e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);(t||this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?i:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usePercentageCloserFiltering",{get:function(){return this.filter===e.FILTER_PCF},set:function(t){var i=this._validateFilter(e.FILTER_PCF);(t||this.filter===e.FILTER_PCF)&&(this.filter=t?i:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filteringQuality",{get:function(){return this._filteringQuality},set:function(e){this._filteringQuality!==e&&(this._filteringQuality=e,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useContactHardeningShadow",{get:function(){return this.filter===e.FILTER_PCSS},set:function(t){var i=this._validateFilter(e.FILTER_PCSS);(t||this.filter===e.FILTER_PCSS)&&(this.filter=t?i:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contactHardeningLightSizeUVRatio",{get:function(){return this._contactHardeningLightSizeUVRatio},set:function(e){this._contactHardeningLightSizeUVRatio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"darkness",{get:function(){return this._darkness},set:function(e){this.setDarkness(e)},enumerable:!1,configurable:!0}),e.prototype.getDarkness=function(){return this._darkness},e.prototype.setDarkness=function(e){return this._darkness=e>=1?1:e<=0?0:e,this},Object.defineProperty(e.prototype,"transparencyShadow",{get:function(){return this._transparencyShadow},set:function(e){this.setTransparencyShadow(e)},enumerable:!1,configurable:!0}),e.prototype.setTransparencyShadow=function(e){return this._transparencyShadow=e,this},e.prototype.getShadowMap=function(){return this._shadowMap},e.prototype.getShadowMapForRendering=function(){return this._shadowMap2?this._shadowMap2:this._shadowMap},e.prototype.getClassName=function(){return e.CLASSNAME},e.prototype.addShadowCaster=function(e,t){var i;return void 0===t&&(t=!0),this._shadowMap?(this._shadowMap.renderList||(this._shadowMap.renderList=[]),this._shadowMap.renderList.push(e),t&&(i=this._shadowMap.renderList).push.apply(i,e.getChildMeshes()),this):this},e.prototype.removeShadowCaster=function(e,t){if(void 0===t&&(t=!0),!this._shadowMap||!this._shadowMap.renderList)return this;var i=this._shadowMap.renderList.indexOf(e);if(-1!==i&&this._shadowMap.renderList.splice(i,1),t)for(var n=0,r=e.getChildren();n<r.length;n++){var o=r[n];this.removeShadowCaster(o)}return this},e.prototype.getLight=function(){return this._light},Object.defineProperty(e.prototype,"mapSize",{get:function(){return this._mapSize},set:function(e){this._mapSize=e,this._light._markMeshesAsLightDirty(),this.recreateShadowMap()},enumerable:!1,configurable:!0}),e.prototype._initializeGenerator=function(){this._light._markMeshesAsLightDirty(),this._initializeShadowMap()},e.prototype._createTargetRenderTexture=function(){this._scene.getEngine().webGLVersion>1?(this._shadowMap=new Ri(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube(),void 0,!1,!1),this._shadowMap.createDepthStencilTexture(g.a.LESS,!0)):this._shadowMap=new Ri(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube())},e.prototype._initializeShadowMap=function(){var t=this;if(this._createTargetRenderTexture(),null!==this._shadowMap){this._shadowMap.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._shadowMap.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._shadowMap.anisotropicFilteringLevel=1,this._shadowMap.updateSamplingMode(Ke.a.BILINEAR_SAMPLINGMODE),this._shadowMap.renderParticles=!1,this._shadowMap.ignoreCameraViewport=!0,this._storedUniqueId&&(this._shadowMap.uniqueId=this._storedUniqueId),this._shadowMap.customRenderFunction=this._renderForShadowMap.bind(this),this._shadowMap.customIsReadyFunction=function(e,t){return!0};var i=this._scene.getEngine();this._shadowMap.onBeforeRenderObservable.add(function(n){if(t._currentFaceIndex=n,t._filter===e.FILTER_PCF&&i.setColorWrite(!1),t._scene.getSceneUniformBuffer().useUbo){var r=t._scene.getSceneUniformBuffer();r.updateMatrix("viewProjection",t.getTransformMatrix()),r.updateMatrix("view",t._viewMatrix),r.update()}}),this._shadowMap.onAfterUnbindObservable.add(function(){if(t._scene.getSceneUniformBuffer().useUbo){var n=t._scene.getSceneUniformBuffer();n.updateMatrix("viewProjection",t._scene.getTransformMatrix()),n.updateMatrix("view",t._scene.getViewMatrix()),n.update()}if(t._filter===e.FILTER_PCF&&i.setColorWrite(!0),t.useBlurExponentialShadowMap||t.useBlurCloseExponentialShadowMap){var r=t.getShadowMapForRendering();if(r){var o=r.getInternalTexture();t._scene.postProcessManager.directRender(t._blurPostProcesses,o,!0),i.unBindFramebuffer(o,!0)}}});var n=new s.b(0,0,0,0),r=new s.b(1,1,1,1);this._shadowMap.onClearObservable.add(function(i){t._filter===e.FILTER_PCF?i.clear(r,!1,!0,!1):t.useExponentialShadowMap||t.useBlurExponentialShadowMap?i.clear(n,!0,!0,!1):i.clear(r,!0,!0,!1)}),this._shadowMap.onResizeObservable.add(function(e){t._storedUniqueId=t._shadowMap.uniqueId,t._mapSize=e.getRenderSize(),t._light._markMeshesAsLightDirty(),t.recreateShadowMap()});for(var o=Ci.b.MIN_RENDERINGGROUPS;o<Ci.b.MAX_RENDERINGGROUPS;o++)this._shadowMap.setRenderingAutoClearDepthStencil(o,!1)}},e.prototype._initializeBlurRTTAndPostProcesses=function(){var e=this,t=this._scene.getEngine(),i=this._mapSize/this.blurScale;this.useKernelBlur&&1===this.blurScale||(this._shadowMap2=new Ri(this._light.name+"_shadowMap2",i,this._scene,!1,!0,this._textureType),this._shadowMap2.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._shadowMap2.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._shadowMap2.updateSamplingMode(Ke.a.BILINEAR_SAMPLINGMODE)),this.useKernelBlur?(this._kernelBlurXPostprocess=new Gr(this._light.name+"KernelBlurX",new a.d(1,0),this.blurKernel,1,null,Ke.a.BILINEAR_SAMPLINGMODE,t,!1,this._textureType),this._kernelBlurXPostprocess.width=i,this._kernelBlurXPostprocess.height=i,this._kernelBlurXPostprocess.onApplyObservable.add(function(t){t.setTexture("textureSampler",e._shadowMap)}),this._kernelBlurYPostprocess=new Gr(this._light.name+"KernelBlurY",new a.d(0,1),this.blurKernel,1,null,Ke.a.BILINEAR_SAMPLINGMODE,t,!1,this._textureType),this._kernelBlurXPostprocess.autoClear=!1,this._kernelBlurYPostprocess.autoClear=!1,this._textureType===g.a.TEXTURETYPE_UNSIGNED_INT&&(this._kernelBlurXPostprocess.packedFloat=!0,this._kernelBlurYPostprocess.packedFloat=!0),this._blurPostProcesses=[this._kernelBlurXPostprocess,this._kernelBlurYPostprocess]):(this._boxBlurPostprocess=new ci(this._light.name+"DepthBoxBlur","depthBoxBlur",["screenSize","boxOffset"],[],1,null,Ke.a.BILINEAR_SAMPLINGMODE,t,!1,"#define OFFSET "+this._blurBoxOffset,this._textureType),this._boxBlurPostprocess.onApplyObservable.add(function(t){t.setFloat2("screenSize",i,i),t.setTexture("textureSampler",e._shadowMap)}),this._boxBlurPostprocess.autoClear=!1,this._blurPostProcesses=[this._boxBlurPostprocess])},e.prototype._renderForShadowMap=function(e,t,i,n){var r,o=this._scene.getEngine(),a=o.getColorWrite();if(n.length){for(o.setColorWrite(!1),r=0;r<n.length;r++)this._renderSubMeshForShadowMap(n.data[r]);o.setColorWrite(a)}for(r=0;r<e.length;r++)this._renderSubMeshForShadowMap(e.data[r]);for(r=0;r<t.length;r++)this._renderSubMeshForShadowMap(t.data[r]);if(this._transparencyShadow)for(r=0;r<i.length;r++)this._renderSubMeshForShadowMap(i.data[r],!0);else for(r=0;r<i.length;r++)i.data[r].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate=!1},e.prototype._bindCustomEffectForRenderSubMeshForShadowMap=function(e,t,i,n){var r,o,a,s,c,l;t.setMatrix(null!==(r=null==i?void 0:i.viewProjection)&&void 0!==r?r:"viewProjection",this.getTransformMatrix()),t.setMatrix(null!==(o=null==i?void 0:i.view)&&void 0!==o?o:"view",this._viewMatrix),t.setMatrix(null!==(a=null==i?void 0:i.projection)&&void 0!==a?a:"projection",this._projectionMatrix);var u=n.getWorldMatrix();t.setMatrix(null!==(s=null==i?void 0:i.world)&&void 0!==s?s:"world",u),u.multiplyToRef(this.getTransformMatrix(),_a),t.setMatrix(null!==(c=null==i?void 0:i.worldViewProjection)&&void 0!==c?c:"worldViewProjection",_a),u.multiplyToRef(this._viewMatrix,ma),t.setMatrix(null!==(l=null==i?void 0:i.worldView)&&void 0!==l?l:"worldView",ma)},e.prototype._renderSubMeshForShadowMap=function(e,t){var i,n;void 0===t&&(t=!1);var r=e.getRenderingMesh(),o=e.getEffectiveMesh(),a=this._scene,s=a.getEngine(),c=e.getMaterial();if(o._internalAbstractMeshDataInfo._isActiveIntermediate=!1,c&&0!==e.verticesCount&&e._renderId!==a.getRenderId()){s.setState(c.backFaceCulling);var l=r._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(!l.mustReturn){var u=s.getCaps().instancedArrays&&(null!==l.visibleInstances[e._id]&&void 0!==l.visibleInstances[e._id]||r.hasThinInstances);if(!this.customAllowRendering||this.customAllowRendering(e))if(this.isReady(e,u,t)){e._renderId=a.getRenderId();var h=null===(i=r.material)||void 0===i?void 0:i.shadowDepthWrapper,d=null!==(n=null==h?void 0:h.getEffect(e,this))&&void 0!==n?n:this._effect;if(s.enableEffect(d),r._bind(e,d,c.fillMode),this.getTransformMatrix(),d.setFloat3("biasAndScaleSM",this.bias,this.normalBias,this.depthScale),this.getLight().getTypeID()===Dr.a.LIGHTTYPEID_DIRECTIONALLIGHT?d.setVector3("lightDataSM",this._cachedDirection):d.setVector3("lightDataSM",this._cachedPosition),a.activeCamera&&d.setFloat2("depthValuesSM",this.getLight().getDepthMinZ(a.activeCamera),this.getLight().getDepthMinZ(a.activeCamera)+this.getLight().getDepthMaxZ(a.activeCamera)),t&&this.enableSoftTransparentShadow&&d.setFloat("softTransparentShadowSM",o.visibility),h)e._effectOverride=d,h.standalone?h.baseMaterial.bindForSubMesh(o.getWorldMatrix(),r,e):c.bindForSubMesh(o.getWorldMatrix(),r,e),e._effectOverride=null;else{if(d.setMatrix("viewProjection",this.getTransformMatrix()),c&&c.needAlphaTesting()){var f=c.getAlphaTestTexture();f&&(d.setTexture("diffuseSampler",f),d.setMatrix("diffuseMatrix",f.getTextureMatrix()||this._defaultTextureMatrix))}if(r.useBones&&r.computeBonesUsingShaders&&r.skeleton){var p=r.skeleton;if(p.isUsingTextureForMatrices){var _=p.getTransformMatrixTexture(r);if(!_)return;d.setTexture("boneSampler",_),d.setFloat("boneTextureWidth",4*(p.bones.length+1))}else d.setMatrices("mBones",p.getTransformMatrices(r))}Hr.a.BindMorphTargetParameters(r,d),Hr.a.BindClipPlane(d,a)}this._bindCustomEffectForRenderSubMeshForShadowMap(e,d,null==h?void 0:h._matriceNames,o),this.forceBackFacesOnly&&s.setState(!0,0,!1,!0),this.onBeforeShadowMapRenderMeshObservable.notifyObservers(r),this.onBeforeShadowMapRenderObservable.notifyObservers(d),r._processRendering(o,e,d,c.fillMode,l,u,function(e,t){return d.setMatrix("world",t)}),this.forceBackFacesOnly&&s.setState(!0,0,!1,!1),this.onAfterShadowMapRenderObservable.notifyObservers(d),this.onAfterShadowMapRenderMeshObservable.notifyObservers(r)}else this._shadowMap&&this._shadowMap.resetRefreshCounter()}}},e.prototype._applyFilterValues=function(){this._shadowMap&&(this.filter===e.FILTER_NONE||this.filter===e.FILTER_PCSS?this._shadowMap.updateSamplingMode(Ke.a.NEAREST_SAMPLINGMODE):this._shadowMap.updateSamplingMode(Ke.a.BILINEAR_SAMPLINGMODE))},e.prototype.forceCompilation=function(e,t){var i=this,n=Object(h.a)({useInstances:!1},t),r=this.getShadowMap();if(r){var o=r.renderList;if(o){for(var a=new Array,s=0,c=o;s<c.length;s++){var l=c[s];a.push.apply(a,l.subMeshes)}if(0!==a.length){var u=0,d=function(){var t,r;if(i._scene&&i._scene.getEngine()){for(;i.isReady(a[u],n.useInstances,null!==(r=null===(t=a[u].getMaterial())||void 0===t?void 0:t.needAlphaBlendingForMesh(a[u].getMesh()))&&void 0!==r&&r);)if(++u>=a.length)return void(e&&e(i));setTimeout(d,16)}};d()}else e&&e(this)}else e&&e(this)}else e&&e(this)},e.prototype.forceCompilationAsync=function(e){var t=this;return new Promise(function(i){t.forceCompilation(function(){i()},e)})},e.prototype._isReadyCustomDefines=function(e,t,i){},e.prototype._prepareShadowDefines=function(e,t,i,n){i.push("#define SM_FLOAT "+(this._textureType!==g.a.TEXTURETYPE_UNSIGNED_INT?"1":"0")),i.push("#define SM_ESM "+(this.useExponentialShadowMap||this.useBlurExponentialShadowMap?"1":"0")),i.push("#define SM_DEPTHTEXTURE "+(this.usePercentageCloserFiltering||this.useContactHardeningShadow?"1":"0"));var r=e.getMesh();return i.push("#define SM_NORMALBIAS "+(this.normalBias&&r.isVerticesDataPresent(ji.b.NormalKind)?"1":"0")),i.push("#define SM_DIRECTIONINLIGHTDATA "+(this.getLight().getTypeID()===Dr.a.LIGHTTYPEID_DIRECTIONALLIGHT?"1":"0")),i.push("#define SM_USEDISTANCE "+(this._light.needCube()?"1":"0")),i.push("#define SM_SOFTTRANSPARENTSHADOW "+(this.enableSoftTransparentShadow&&n?"1":"0")),this._isReadyCustomDefines(i,e,t),i},e.prototype.isReady=function(e,t,i){var n=e.getMaterial(),r=null==n?void 0:n.shadowDepthWrapper,o=[];if(this._prepareShadowDefines(e,t,o,i),r){if(!r.isReadyForSubMesh(e,o,this,t))return!1}else{var a=[ji.b.PositionKind],s=e.getMesh();if(this.normalBias&&s.isVerticesDataPresent(ji.b.NormalKind)&&(a.push(ji.b.NormalKind),o.push("#define NORMAL"),s.nonUniformScaling&&o.push("#define NONUNIFORMSCALING")),n&&n.needAlphaTesting()){var c=n.getAlphaTestTexture();if(c){if(!c.isReady())return!1;o.push("#define ALPHATEST"),s.isVerticesDataPresent(ji.b.UVKind)&&(a.push(ji.b.UVKind),o.push("#define UV1")),s.isVerticesDataPresent(ji.b.UV2Kind)&&1===c.coordinatesIndex&&(a.push(ji.b.UV2Kind),o.push("#define UV2"))}}var l=new Qr.a;if(s.useBones&&s.computeBonesUsingShaders&&s.skeleton){a.push(ji.b.MatricesIndicesKind),a.push(ji.b.MatricesWeightsKind),s.numBoneInfluencers>4&&(a.push(ji.b.MatricesIndicesExtraKind),a.push(ji.b.MatricesWeightsExtraKind));var u=s.skeleton;o.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers),s.numBoneInfluencers>0&&l.addCPUSkinningFallback(0,s),u.isUsingTextureForMatrices?o.push("#define BONETEXTURE"):o.push("#define BonesPerMesh "+(u.bones.length+1))}else o.push("#define NUM_BONE_INFLUENCERS 0");var h=s.morphTargetManager,d=0;h&&h.numInfluencers>0&&(o.push("#define MORPHTARGETS"),d=h.numInfluencers,o.push("#define NUM_MORPH_INFLUENCERS "+d),Hr.a.PrepareAttributesForMorphTargetsInfluencers(a,s,d));var f=this._scene;if(f.clipPlane&&o.push("#define CLIPPLANE"),f.clipPlane2&&o.push("#define CLIPPLANE2"),f.clipPlane3&&o.push("#define CLIPPLANE3"),f.clipPlane4&&o.push("#define CLIPPLANE4"),f.clipPlane5&&o.push("#define CLIPPLANE5"),f.clipPlane6&&o.push("#define CLIPPLANE6"),t&&(o.push("#define INSTANCES"),Hr.a.PushAttributesForInstances(a),e.getRenderingMesh().hasThinInstances&&o.push("#define THIN_INSTANCES")),this.customShaderOptions&&this.customShaderOptions.defines)for(var p=0,_=this.customShaderOptions.defines;p<_.length;p++){var m=_[p];-1===o.indexOf(m)&&o.push(m)}var g=o.join("\n");if(this._cachedDefines!==g){this._cachedDefines=g;var v="shadowMap",b=["world","mBones","viewProjection","diffuseMatrix","lightDataSM","depthValuesSM","biasAndScaleSM","morphTargetInfluences","boneTextureWidth","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","softTransparentShadowSM"],y=["diffuseSampler","boneSampler"];if(this.customShaderOptions){if(v=this.customShaderOptions.shaderName,this.customShaderOptions.attributes)for(var T=0,E=this.customShaderOptions.attributes;T<E.length;T++){var S=E[T];-1===a.indexOf(S)&&a.push(S)}if(this.customShaderOptions.uniforms)for(var A=0,P=this.customShaderOptions.uniforms;A<P.length;A++){var C=P[A];-1===b.indexOf(C)&&b.push(C)}if(this.customShaderOptions.samplers)for(var R=0,x=this.customShaderOptions.samplers;R<x.length;R++){var O=x[R];-1===y.indexOf(O)&&y.push(O)}}this._effect=this._scene.getEngine().createEffect(v,a,b,y,g,l,void 0,void 0,{maxSimultaneousMorphTargets:d})}if(!this._effect.isReady())return!1}return(this.useBlurExponentialShadowMap||this.useBlurCloseExponentialShadowMap)&&(this._blurPostProcesses&&this._blurPostProcesses.length||this._initializeBlurRTTAndPostProcesses()),!(this._kernelBlurXPostprocess&&!this._kernelBlurXPostprocess.isReady()||this._kernelBlurYPostprocess&&!this._kernelBlurYPostprocess.isReady()||this._boxBlurPostprocess&&!this._boxBlurPostprocess.isReady())},e.prototype.prepareDefines=function(t,i){var n=this._scene,r=this._light;n.shadowsEnabled&&r.shadowEnabled&&(t["SHADOW"+i]=!0,this.useContactHardeningShadow?(t["SHADOWPCSS"+i]=!0,this._filteringQuality===e.QUALITY_LOW?t["SHADOWLOWQUALITY"+i]=!0:this._filteringQuality===e.QUALITY_MEDIUM&&(t["SHADOWMEDIUMQUALITY"+i]=!0)):this.usePercentageCloserFiltering?(t["SHADOWPCF"+i]=!0,this._filteringQuality===e.QUALITY_LOW?t["SHADOWLOWQUALITY"+i]=!0:this._filteringQuality===e.QUALITY_MEDIUM&&(t["SHADOWMEDIUMQUALITY"+i]=!0)):this.usePoissonSampling?t["SHADOWPOISSON"+i]=!0:this.useExponentialShadowMap||this.useBlurExponentialShadowMap?t["SHADOWESM"+i]=!0:(this.useCloseExponentialShadowMap||this.useBlurCloseExponentialShadowMap)&&(t["SHADOWCLOSEESM"+i]=!0),r.needCube()&&(t["SHADOWCUBE"+i]=!0))},e.prototype.bindShadowLight=function(t,i){var n=this._light,r=this._scene;if(r.shadowsEnabled&&n.shadowEnabled){var o=r.activeCamera;if(o){var a=this.getShadowMap();a&&(n.needCube()||i.setMatrix("lightMatrix"+t,this.getTransformMatrix()),this._filter===e.FILTER_PCF?(i.setDepthStencilTexture("shadowSampler"+t,this.getShadowMapForRendering()),n._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),a.getSize().width,1/a.getSize().width,this.frustumEdgeFalloff,t)):this._filter===e.FILTER_PCSS?(i.setDepthStencilTexture("shadowSampler"+t,this.getShadowMapForRendering()),i.setTexture("depthSampler"+t,this.getShadowMapForRendering()),n._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),1/a.getSize().width,this._contactHardeningLightSizeUVRatio*a.getSize().width,this.frustumEdgeFalloff,t)):(i.setTexture("shadowSampler"+t,this.getShadowMapForRendering()),n._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),this.blurScale/a.getSize().width,this.depthScale,this.frustumEdgeFalloff,t)),n._uniformBuffer.updateFloat2("depthValues",this.getLight().getDepthMinZ(o),this.getLight().getDepthMinZ(o)+this.getLight().getDepthMaxZ(o),t))}}},e.prototype.getTransformMatrix=function(){var e=this._scene;if(this._currentRenderID===e.getRenderId()&&this._currentFaceIndexCache===this._currentFaceIndex)return this._transformMatrix;this._currentRenderID=e.getRenderId(),this._currentFaceIndexCache=this._currentFaceIndex;var t=this._light.position;if(this._light.computeTransformedInformation()&&(t=this._light.transformedPosition),a.e.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex),this._lightDirection),1===Math.abs(a.e.Dot(this._lightDirection,a.e.Up()))&&(this._lightDirection.z=1e-13),this._light.needProjectionMatrixCompute()||!this._cachedPosition||!this._cachedDirection||!t.equals(this._cachedPosition)||!this._lightDirection.equals(this._cachedDirection)){this._cachedPosition.copyFrom(t),this._cachedDirection.copyFrom(this._lightDirection),a.a.LookAtLHToRef(t,t.add(this._lightDirection),a.e.Up(),this._viewMatrix);var i=this.getShadowMap();if(i){var n=i.renderList;n&&this._light.setShadowProjectionMatrix(this._projectionMatrix,this._viewMatrix,n)}this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix)}return this._transformMatrix},e.prototype.recreateShadowMap=function(){var e=this._shadowMap;if(e){var t=e.renderList;this._disposeRTTandPostProcesses(),this._initializeGenerator(),this.filter=this.filter,this._applyFilterValues(),this._shadowMap.renderList=t}},e.prototype._disposeBlurPostProcesses=function(){this._shadowMap2&&(this._shadowMap2.dispose(),this._shadowMap2=null),this._boxBlurPostprocess&&(this._boxBlurPostprocess.dispose(),this._boxBlurPostprocess=null),this._kernelBlurXPostprocess&&(this._kernelBlurXPostprocess.dispose(),this._kernelBlurXPostprocess=null),this._kernelBlurYPostprocess&&(this._kernelBlurYPostprocess.dispose(),this._kernelBlurYPostprocess=null),this._blurPostProcesses=[]},e.prototype._disposeRTTandPostProcesses=function(){this._shadowMap&&(this._shadowMap.dispose(),this._shadowMap=null),this._disposeBlurPostProcesses()},e.prototype.dispose=function(){this._disposeRTTandPostProcesses(),this._light&&(this._light._shadowGenerator=null,this._light._markMeshesAsLightDirty()),this.onBeforeShadowMapRenderMeshObservable.clear(),this.onBeforeShadowMapRenderObservable.clear(),this.onAfterShadowMapRenderMeshObservable.clear(),this.onAfterShadowMapRenderObservable.clear()},e.prototype.serialize=function(){var e={},t=this.getShadowMap();if(!t)return e;if(e.className=this.getClassName(),e.lightId=this._light.id,e.id=this._light.id,e.mapSize=t.getRenderSize(),e.forceBackFacesOnly=this.forceBackFacesOnly,e.darkness=this.getDarkness(),e.transparencyShadow=this._transparencyShadow,e.frustumEdgeFalloff=this.frustumEdgeFalloff,e.bias=this.bias,e.normalBias=this.normalBias,e.usePercentageCloserFiltering=this.usePercentageCloserFiltering,e.useContactHardeningShadow=this.useContactHardeningShadow,e.contactHardeningLightSizeUVRatio=this.contactHardeningLightSizeUVRatio,e.filteringQuality=this.filteringQuality,e.useExponentialShadowMap=this.useExponentialShadowMap,e.useBlurExponentialShadowMap=this.useBlurExponentialShadowMap,e.useCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.useBlurCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.usePoissonSampling=this.usePoissonSampling,e.depthScale=this.depthScale,e.blurBoxOffset=this.blurBoxOffset,e.blurKernel=this.blurKernel,e.blurScale=this.blurScale,e.useKernelBlur=this.useKernelBlur,e.renderList=[],t.renderList)for(var i=0;i<t.renderList.length;i++){var n=t.renderList[i];e.renderList.push(n.id)}return e},e.Parse=function(t,i,n){for(var r=i.getLightByID(t.lightId),o=n?n(t.mapSize,r):new e(t.mapSize,r),a=o.getShadowMap(),s=0;s<t.renderList.length;s++)i.getMeshesByID(t.renderList[s]).forEach(function(e){a&&(a.renderList||(a.renderList=[]),a.renderList.push(e))});return void 0!==t.id&&(o.id=t.id),o.forceBackFacesOnly=!!t.forceBackFacesOnly,void 0!==t.darkness&&o.setDarkness(t.darkness),t.transparencyShadow&&o.setTransparencyShadow(!0),void 0!==t.frustumEdgeFalloff&&(o.frustumEdgeFalloff=t.frustumEdgeFalloff),void 0!==t.bias&&(o.bias=t.bias),void 0!==t.normalBias&&(o.normalBias=t.normalBias),t.usePercentageCloserFiltering?o.usePercentageCloserFiltering=!0:t.useContactHardeningShadow?o.useContactHardeningShadow=!0:t.usePoissonSampling?o.usePoissonSampling=!0:t.useExponentialShadowMap?o.useExponentialShadowMap=!0:t.useBlurExponentialShadowMap?o.useBlurExponentialShadowMap=!0:t.useCloseExponentialShadowMap?o.useCloseExponentialShadowMap=!0:t.useBlurCloseExponentialShadowMap?o.useBlurCloseExponentialShadowMap=!0:t.useVarianceShadowMap?o.useExponentialShadowMap=!0:t.useBlurVarianceShadowMap&&(o.useBlurExponentialShadowMap=!0),void 0!==t.contactHardeningLightSizeUVRatio&&(o.contactHardeningLightSizeUVRatio=t.contactHardeningLightSizeUVRatio),void 0!==t.filteringQuality&&(o.filteringQuality=t.filteringQuality),t.depthScale&&(o.depthScale=t.depthScale),t.blurScale&&(o.blurScale=t.blurScale),t.blurBoxOffset&&(o.blurBoxOffset=t.blurBoxOffset),t.useKernelBlur&&(o.useKernelBlur=t.useKernelBlur),t.blurKernel&&(o.blurKernel=t.blurKernel),o},e.CLASSNAME="ShadowGenerator",e.FILTER_NONE=0,e.FILTER_EXPONENTIALSHADOWMAP=1,e.FILTER_POISSONSAMPLING=2,e.FILTER_BLUREXPONENTIALSHADOWMAP=3,e.FILTER_CLOSEEXPONENTIALSHADOWMAP=4,e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP=5,e.FILTER_PCF=6,e.FILTER_PCSS=7,e.QUALITY_HIGH=0,e.QUALITY_MEDIUM=1,e.QUALITY_LOW=2,e._SceneComponentInitialization=function(e){throw Re.a.WarnImport("ShadowGeneratorSceneComponent")},e}();ai.a.ShadersStore.depthPixelShader="#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nvarying float vDepthMetric;\n#ifdef PACKED\n#include<packingFunctions>\n#endif\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#ifdef NONLINEARDEPTH\n#ifdef PACKED\ngl_FragColor=pack(gl_FragCoord.z);\n#else\ngl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);\n#endif\n#else\n#ifdef PACKED\ngl_FragColor=pack(vDepthMetric);\n#else\ngl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);\n#endif\n#endif\n}";ai.a.ShadersStore.depthVertexShader="\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvarying float vDepthMetric;\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n";var va=function(){function e(t,i,n,r){var o=this;void 0===i&&(i=g.a.TEXTURETYPE_FLOAT),void 0===n&&(n=null),void 0===r&&(r=!1),this.enabled=!0,this.useOnlyInActiveCamera=!1,this._scene=t,this._storeNonLinearDepth=r,this.isPacked=i===g.a.TEXTURETYPE_UNSIGNED_BYTE,this.isPacked?this._clearColor=new s.b(1,1,1,1):this._clearColor=new s.b(1,0,0,1),e._SceneComponentInitialization(this._scene),this._camera=n;var a=t.getEngine(),c=this.isPacked||1===a.webGLVersion?g.a.TEXTUREFORMAT_RGBA:g.a.TEXTUREFORMAT_R;this._depthMap=new Ri("depthMap",{width:a.getRenderWidth(),height:a.getRenderHeight()},this._scene,!1,!0,i,!1,void 0,void 0,void 0,void 0,c),this._depthMap.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._depthMap.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._depthMap.refreshRate=1,this._depthMap.renderParticles=!1,this._depthMap.renderList=null,this._depthMap.activeCamera=this._camera,this._depthMap.ignoreCameraViewport=!0,this._depthMap.useCameraPostProcesses=!1,this._depthMap.onClearObservable.add(function(e){e.clear(o._clearColor,!0,!0,!0)});var l=function(e){var t=e.getRenderingMesh(),i=e.getEffectiveMesh(),n=o._scene,r=n.getEngine(),a=e.getMaterial();if(i._internalAbstractMeshDataInfo._isActiveIntermediate=!1,a&&0!==e.verticesCount&&e._renderId!==n.getRenderId()){r.setState(a.backFaceCulling,0,!1,n.useRightHandedSystem);var s=t._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(!s.mustReturn){var c=r.getCaps().instancedArrays&&(null!==s.visibleInstances[e._id]&&void 0!==s.visibleInstances[e._id]||t.hasThinInstances),l=o._camera||n.activeCamera;if(o.isReady(e,c)&&l){if(e._renderId=n.getRenderId(),r.enableEffect(o._effect),t._bind(e,o._effect,a.fillMode),o._effect.setMatrix("viewProjection",n.getTransformMatrix()),o._effect.setFloat2("depthValues",l.minZ,l.minZ+l.maxZ),a&&a.needAlphaTesting()){var u=a.getAlphaTestTexture();u&&(o._effect.setTexture("diffuseSampler",u),o._effect.setMatrix("diffuseMatrix",u.getTextureMatrix()))}t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&o._effect.setMatrices("mBones",t.skeleton.getTransformMatrices(t)),Hr.a.BindMorphTargetParameters(t,o._effect),t._processRendering(i,e,o._effect,a.fillMode,s,c,function(e,t){return o._effect.setMatrix("world",t)})}}}};this._depthMap.customRenderFunction=function(e,t,i,n){var r;if(n.length){for(a.setColorWrite(!1),r=0;r<n.length;r++)l(n.data[r]);a.setColorWrite(!0)}for(r=0;r<e.length;r++)l(e.data[r]);for(r=0;r<t.length;r++)l(t.data[r])}}return e.prototype.isReady=function(e,t){var i=e.getMaterial();if(i.disableDepthWrite)return!1;var n=[],r=[ji.b.PositionKind],o=e.getMesh();i&&i.needAlphaTesting()&&i.getAlphaTestTexture()&&(n.push("#define ALPHATEST"),o.isVerticesDataPresent(ji.b.UVKind)&&(r.push(ji.b.UVKind),n.push("#define UV1")),o.isVerticesDataPresent(ji.b.UV2Kind)&&(r.push(ji.b.UV2Kind),n.push("#define UV2"))),o.useBones&&o.computeBonesUsingShaders?(r.push(ji.b.MatricesIndicesKind),r.push(ji.b.MatricesWeightsKind),o.numBoneInfluencers>4&&(r.push(ji.b.MatricesIndicesExtraKind),r.push(ji.b.MatricesWeightsExtraKind)),n.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),n.push("#define BonesPerMesh "+(o.skeleton?o.skeleton.bones.length+1:0))):n.push("#define NUM_BONE_INFLUENCERS 0");var a=o.morphTargetManager,s=0;a&&a.numInfluencers>0&&(s=a.numInfluencers,n.push("#define MORPHTARGETS"),n.push("#define NUM_MORPH_INFLUENCERS "+s),Hr.a.PrepareAttributesForMorphTargetsInfluencers(r,o,s)),t&&(n.push("#define INSTANCES"),Hr.a.PushAttributesForInstances(r),e.getRenderingMesh().hasThinInstances&&n.push("#define THIN_INSTANCES")),this._storeNonLinearDepth&&n.push("#define NONLINEARDEPTH"),this.isPacked&&n.push("#define PACKED");var c=n.join("\n");return this._cachedDefines!==c&&(this._cachedDefines=c,this._effect=this._scene.getEngine().createEffect("depth",r,["world","mBones","viewProjection","diffuseMatrix","depthValues","morphTargetInfluences"],["diffuseSampler"],c,void 0,void 0,void 0,{maxSimultaneousMorphTargets:s})),this._effect.isReady()},e.prototype.getDepthMap=function(){return this._depthMap},e.prototype.dispose=function(){this._depthMap.dispose()},e._SceneComponentInitialization=function(e){throw Re.a.WarnImport("DepthRendererSceneComponent")},e}();ai.a.ShadersStore.minmaxReduxPixelShader="attribute vec2 vUV;\nuniform sampler2D textureSampler;\n#if defined(INITIAL)\nuniform sampler2D sourceTexture;\nuniform vec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*(texSize-1.0));\nfloat f1=texelFetch(sourceTexture,coord,0).r;\nfloat f2=texelFetch(sourceTexture,coord+ivec2(1,0),0).r;\nfloat f3=texelFetch(sourceTexture,coord+ivec2(1,1),0).r;\nfloat f4=texelFetch(sourceTexture,coord+ivec2(0,1),0).r;\nfloat minz=min(min(min(f1,f2),f3),f4);\n#ifdef DEPTH_REDUX\nfloat maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);\n#else\nfloat maxz=max(max(max(f1,f2),f3),f4);\n#endif\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(MAIN)\nuniform vec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*(texSize-1.0));\nvec2 f1=texelFetch(textureSampler,coord,0).rg;\nvec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;\nvec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;\nvec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;\nfloat minz=min(min(min(f1.x,f2.x),f3.x),f4.x);\nfloat maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(ONEBEFORELAST)\nuniform ivec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*vec2(texSize-1));\nvec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;\nvec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;\nvec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;\nvec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;\nfloat minz=min(f1.x,f2.x);\nfloat maxz=max(f1.y,f2.y);\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(LAST)\nvoid main(void)\n{\ndiscard;\nglFragColor=vec4(0.);\n}\n#endif\n";var ba=function(){function e(e){this.onAfterReductionPerformed=new o.c,this._forceFullscreenViewport=!0,this._activated=!1,this._camera=e,this._postProcessManager=new Pi.a(e.getScene())}return Object.defineProperty(e.prototype,"sourceTexture",{get:function(){return this._sourceTexture},enumerable:!1,configurable:!0}),e.prototype.setSourceTexture=function(e,t,i,n){var r=this;if(void 0===i&&(i=g.a.TEXTURETYPE_HALF_FLOAT),void 0===n&&(n=!0),e!==this._sourceTexture){this.dispose(!1),this._sourceTexture=e,this._reductionSteps=[],this._forceFullscreenViewport=n;var o=this._camera.getScene(),a=new ci("Initial reduction phase","minmaxRedux",["texSize"],["sourceTexture"],1,null,g.a.TEXTURE_NEAREST_NEAREST,o.getEngine(),!1,"#define INITIAL"+(t?"\n#define DEPTH_REDUX":""),i,void 0,void 0,void 0,g.a.TEXTUREFORMAT_RG);a.autoClear=!1,a.forceFullscreenViewport=n;var s=this._sourceTexture.getRenderWidth(),c=this._sourceTexture.getRenderHeight();a.onApply=function(e,t){return function(i){i.setTexture("sourceTexture",r._sourceTexture),i.setFloatArray2("texSize",new Float32Array([e,t]))}}(s,c),this._reductionSteps.push(a);for(var l=1;s>1||c>1;){s=Math.max(Math.round(s/2),1),c=Math.max(Math.round(c/2),1);var u=new ci("Reduction phase "+l,"minmaxRedux",["texSize"],null,{width:s,height:c},null,g.a.TEXTURE_NEAREST_NEAREST,o.getEngine(),!1,"#define "+(1==s&&1==c?"LAST":1==s||1==c?"ONEBEFORELAST":"MAIN"),i,void 0,void 0,void 0,g.a.TEXTUREFORMAT_RG);u.autoClear=!1,u.forceFullscreenViewport=n,u.onApply=function(e,t){return function(i){1==e||1==t?i.setIntArray2("texSize",new Int32Array([e,t])):i.setFloatArray2("texSize",new Float32Array([e,t]))}}(s,c),this._reductionSteps.push(u),l++,1==s&&1==c&&u.onAfterRenderObservable.add(function(e,t,i){var n=new Float32Array(4*e*t),a={min:0,max:0};return function(){o.getEngine()._readTexturePixels(i.inputTexture,e,t,-1,0,n),a.min=n[0],a.max=n[1],r.onAfterReductionPerformed.notifyObservers(a)}}(s,c,u))}}},Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._sourceTexture?this._sourceTexture.refreshRate:-1},set:function(e){this._sourceTexture&&(this._sourceTexture.refreshRate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activated",{get:function(){return this._activated},enumerable:!1,configurable:!0}),e.prototype.activate=function(){var e=this;!this._onAfterUnbindObserver&&this._sourceTexture&&(this._onAfterUnbindObserver=this._sourceTexture.onAfterUnbindObservable.add(function(){e._reductionSteps[0].activate(e._camera),e._postProcessManager.directRender(e._reductionSteps,e._reductionSteps[0].inputTexture,e._forceFullscreenViewport),e._camera.getScene().getEngine().unBindFramebuffer(e._reductionSteps[0].inputTexture,!1)}),this._activated=!0)},e.prototype.deactivate=function(){this._onAfterUnbindObserver&&this._sourceTexture&&(this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=null,this._activated=!1)},e.prototype.dispose=function(e){if(void 0===e&&(e=!0),e&&this.onAfterReductionPerformed.clear(),this.deactivate(),this._reductionSteps){for(var t=0;t<this._reductionSteps.length;++t)this._reductionSteps[t].dispose();this._reductionSteps=null}this._postProcessManager&&e&&this._postProcessManager.dispose(),this._sourceTexture=null},e}(),ya=function(e){function t(t){return e.call(this,t)||this}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"depthRenderer",{get:function(){return this._depthRenderer},enumerable:!1,configurable:!0}),t.prototype.setDepthRenderer=function(t,i,n){void 0===t&&(t=null),void 0===i&&(i=g.a.TEXTURETYPE_HALF_FLOAT),void 0===n&&(n=!0);var r=this._camera.getScene();this._depthRenderer&&(delete r._depthRenderer[this._depthRendererId],this._depthRenderer.dispose(),this._depthRenderer=null),null===t&&(r._depthRenderer||(r._depthRenderer={}),(t=this._depthRenderer=new va(r,i,this._camera,!1)).enabled=!1,this._depthRendererId="minmax"+this._camera.id,r._depthRenderer[this._depthRendererId]=t),e.prototype.setSourceTexture.call(this,t.getDepthMap(),!0,i,n)},t.prototype.setSourceTexture=function(t,i,n,r){void 0===n&&(n=g.a.TEXTURETYPE_HALF_FLOAT),void 0===r&&(r=!0),e.prototype.setSourceTexture.call(this,t,i,n,r)},t.prototype.activate=function(){this._depthRenderer&&(this._depthRenderer.enabled=!0),e.prototype.activate.call(this)},t.prototype.deactivate=function(){e.prototype.deactivate.call(this),this._depthRenderer&&(this._depthRenderer.enabled=!1)},t.prototype.dispose=function(t){if(void 0===t&&(t=!0),e.prototype.dispose.call(this,t),this._depthRenderer&&t){var i=this._depthRenderer.getDepthMap().getScene();i&&delete i._depthRenderer[this._depthRendererId],this._depthRenderer.dispose(),this._depthRenderer=null}},t}(ba),Ta=a.e.Up(),Ea=a.e.Zero(),Sa=new a.e,Aa=new a.e,Pa=new a.a,Ca=new a.a,Ra=function(e){function t(i,n,r){var o=this;if(t.IsSupported)return(o=e.call(this,i,n,r)||this).usePercentageCloserFiltering=!0,o;m.a.Error("CascadedShadowMap needs WebGL 2 support.")}return Object(h.d)(t,e),t.prototype._validateFilter=function(e){return e===ga.FILTER_NONE||e===ga.FILTER_PCF||e===ga.FILTER_PCSS?e:(console.error('Unsupported filter "'+e+'"!'),ga.FILTER_NONE)},Object.defineProperty(t.prototype,"numCascades",{get:function(){return this._numCascades},set:function(e){(e=Math.min(Math.max(e,t.MIN_CASCADES_COUNT),t.MAX_CASCADES_COUNT))!==this._numCascades&&(this._numCascades=e,this.recreateShadowMap())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"freezeShadowCastersBoundingInfo",{get:function(){return this._freezeShadowCastersBoundingInfo},set:function(e){this._freezeShadowCastersBoundingInfoObservable&&e&&(this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable),this._freezeShadowCastersBoundingInfoObservable=null),this._freezeShadowCastersBoundingInfoObservable||e||(this._freezeShadowCastersBoundingInfoObservable=this._scene.onBeforeRenderObservable.add(this._computeShadowCastersBoundingInfo.bind(this))),this._freezeShadowCastersBoundingInfo=e,e&&this._computeShadowCastersBoundingInfo()},enumerable:!1,configurable:!0}),t.prototype._computeShadowCastersBoundingInfo=function(){if(this._scbiMin.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._scbiMax.copyFromFloats(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),this._shadowMap&&this._shadowMap.renderList){for(var e=this._shadowMap.renderList,t=0;t<e.length;t++)if(r=e[t]){var i=r.getBoundingInfo().boundingBox;this._scbiMin.minimizeInPlace(i.minimumWorld),this._scbiMax.maximizeInPlace(i.maximumWorld)}var n=this._scene.meshes;for(t=0;t<n.length;t++){var r;(r=n[t])&&r.isVisible&&r.isEnabled&&r.receiveShadows&&(i=r.getBoundingInfo().boundingBox,this._scbiMin.minimizeInPlace(i.minimumWorld),this._scbiMax.maximizeInPlace(i.maximumWorld))}}this._shadowCastersBoundingInfo.reConstruct(this._scbiMin,this._scbiMax)},Object.defineProperty(t.prototype,"shadowCastersBoundingInfo",{get:function(){return this._shadowCastersBoundingInfo},set:function(e){this._shadowCastersBoundingInfo=e},enumerable:!1,configurable:!0}),t.prototype.setMinMaxDistance=function(e,t){this._minDistance===e&&this._maxDistance===t||(e>t&&(e=0,t=1),e<0&&(e=0),t>1&&(t=1),this._minDistance=e,this._maxDistance=t,this._breaksAreDirty=!0)},Object.defineProperty(t.prototype,"minDistance",{get:function(){return this._minDistance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxDistance",{get:function(){return this._maxDistance},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return t.CLASSNAME},t.prototype.getCascadeMinExtents=function(e){return e>=0&&e<this._numCascades?this._cascadeMinExtents[e]:null},t.prototype.getCascadeMaxExtents=function(e){return e>=0&&e<this._numCascades?this._cascadeMaxExtents[e]:null},Object.defineProperty(t.prototype,"shadowMaxZ",{get:function(){return this._scene&&this._scene.activeCamera?this._shadowMaxZ:0},set:function(e){this._scene&&this._scene.activeCamera?this._shadowMaxZ===e||e<this._scene.activeCamera.minZ||e>this._scene.activeCamera.maxZ||(this._shadowMaxZ=e,this._light._markMeshesAsLightDirty(),this._breaksAreDirty=!0):this._shadowMaxZ=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debug",{get:function(){return this._debug},set:function(e){this._debug=e,this._light._markMeshesAsLightDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthClamp",{get:function(){return this._depthClamp},set:function(e){this._depthClamp=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cascadeBlendPercentage",{get:function(){return this._cascadeBlendPercentage},set:function(e){this._cascadeBlendPercentage=e,this._light._markMeshesAsLightDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lambda",{get:function(){return this._lambda},set:function(e){var t=Math.min(Math.max(e,0),1);this._lambda!=t&&(this._lambda=t,this._breaksAreDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.getCascadeViewMatrix=function(e){return e>=0&&e<this._numCascades?this._viewMatrices[e]:null},t.prototype.getCascadeProjectionMatrix=function(e){return e>=0&&e<this._numCascades?this._projectionMatrices[e]:null},t.prototype.getCascadeTransformMatrix=function(e){return e>=0&&e<this._numCascades?this._transformMatrices[e]:null},t.prototype.setDepthRenderer=function(e){this._depthRenderer=e,this._depthReducer&&this._depthReducer.setDepthRenderer(this._depthRenderer)},Object.defineProperty(t.prototype,"autoCalcDepthBounds",{get:function(){return this._autoCalcDepthBounds},set:function(e){var t=this,i=this._scene.activeCamera;if(i){if(this._autoCalcDepthBounds=e,!e)return this._depthReducer&&this._depthReducer.deactivate(),void this.setMinMaxDistance(0,1);this._depthReducer||(this._depthReducer=new ya(i),this._depthReducer.onAfterReductionPerformed.add(function(e){var i=e.min,n=e.max;i>=n&&(i=0,n=1),i==t._minDistance&&n==t._maxDistance||t.setMinMaxDistance(i,n)}),this._depthReducer.setDepthRenderer(this._depthRenderer)),this._depthReducer.activate()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoCalcDepthBoundsRefreshRate",{get:function(){var e,t,i;return null!==(i=null===(t=null===(e=this._depthReducer)||void 0===e?void 0:e.depthRenderer)||void 0===t?void 0:t.getDepthMap().refreshRate)&&void 0!==i?i:-1},set:function(e){var t;(null===(t=this._depthReducer)||void 0===t?void 0:t.depthRenderer)&&(this._depthReducer.depthRenderer.getDepthMap().refreshRate=e)},enumerable:!1,configurable:!0}),t.prototype.splitFrustum=function(){this._breaksAreDirty=!0},t.prototype._splitFrustum=function(){var e=this._scene.activeCamera;if(e){for(var t=e.minZ,i=e.maxZ,n=i-t,r=this._minDistance,o=t+r*n,a=t+(this._shadowMaxZ<i&&this._shadowMaxZ>=t?Math.min((this._shadowMaxZ-t)/(i-t),this._maxDistance):this._maxDistance)*n,s=a-o,c=a/o,l=0;l<this._cascades.length;++l){var u=(l+1)/this._numCascades,h=o*Math.pow(c,u),d=o+s*u,f=this._lambda*(h-d)+d;this._cascades[l].prevBreakDistance=0===l?r:this._cascades[l-1].breakDistance,this._cascades[l].breakDistance=(f-t)/n,this._viewSpaceFrustumsZ[l]=t+this._cascades[l].breakDistance*n,this._frustumLengths[l]=(this._cascades[l].breakDistance-this._cascades[l].prevBreakDistance)*n}this._breaksAreDirty=!1}},t.prototype._computeMatrices=function(){if(this._scene.activeCamera){a.e.NormalizeToRef(this._light.getShadowDirection(0),this._lightDirection),1===Math.abs(a.e.Dot(this._lightDirection,a.e.Up()))&&(this._lightDirection.z=1e-13),this._cachedDirection.copyFrom(this._lightDirection);for(var e=0;e<this._numCascades;++e){this._computeFrustumInWorldSpace(e),this._computeCascadeFrustum(e),this._cascadeMaxExtents[e].subtractToRef(this._cascadeMinExtents[e],Sa),this._frustumCenter[e].addToRef(this._lightDirection.scale(this._cascadeMinExtents[e].z),this._shadowCameraPos[e]),a.a.LookAtLHToRef(this._shadowCameraPos[e],this._frustumCenter[e],Ta,this._viewMatrices[e]);var t=0,i=Sa.z,n=this._shadowCastersBoundingInfo;n.update(this._viewMatrices[e]),i=Math.min(i,n.boundingBox.maximumWorld.z),t=this._depthClamp&&this.filter!==ga.FILTER_PCSS?Math.max(t,n.boundingBox.minimumWorld.z):Math.min(t,n.boundingBox.minimumWorld.z),a.a.OrthoOffCenterLHToRef(this._cascadeMinExtents[e].x,this._cascadeMaxExtents[e].x,this._cascadeMinExtents[e].y,this._cascadeMaxExtents[e].y,t,i,this._projectionMatrices[e]),this._cascadeMinExtents[e].z=t,this._cascadeMaxExtents[e].z=i,this._viewMatrices[e].multiplyToRef(this._projectionMatrices[e],this._transformMatrices[e]),a.e.TransformCoordinatesToRef(Ea,this._transformMatrices[e],Sa),Sa.scaleInPlace(this._mapSize/2),Aa.copyFromFloats(Math.round(Sa.x),Math.round(Sa.y),Math.round(Sa.z)),Aa.subtractInPlace(Sa).scaleInPlace(2/this._mapSize),a.a.TranslationToRef(Aa.x,Aa.y,0,Pa),this._projectionMatrices[e].multiplyToRef(Pa,this._projectionMatrices[e]),this._viewMatrices[e].multiplyToRef(this._projectionMatrices[e],this._transformMatrices[e]),this._transformMatrices[e].copyToArray(this._transformMatricesAsArray,16*e)}}},t.prototype._computeFrustumInWorldSpace=function(e){if(this._scene.activeCamera){var i=this._cascades[e].prevBreakDistance,n=this._cascades[e].breakDistance;this._scene.activeCamera.getViewMatrix();for(var r=a.a.Invert(this._scene.activeCamera.getTransformationMatrix()),o=0;o<t.frustumCornersNDCSpace.length;++o)a.e.TransformCoordinatesToRef(t.frustumCornersNDCSpace[o],r,this._frustumCornersWorldSpace[e][o]);for(o=0;o<t.frustumCornersNDCSpace.length/2;++o)Sa.copyFrom(this._frustumCornersWorldSpace[e][o+4]).subtractInPlace(this._frustumCornersWorldSpace[e][o]),Aa.copyFrom(Sa).scaleInPlace(i),Sa.scaleInPlace(n),Sa.addInPlace(this._frustumCornersWorldSpace[e][o]),this._frustumCornersWorldSpace[e][o+4].copyFrom(Sa),this._frustumCornersWorldSpace[e][o].addInPlace(Aa)}},t.prototype._computeCascadeFrustum=function(e){if(this._cascadeMinExtents[e].copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cascadeMaxExtents[e].copyFromFloats(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),this._frustumCenter[e].copyFromFloats(0,0,0),this._scene.activeCamera){for(var t=0;t<this._frustumCornersWorldSpace[e].length;++t)this._frustumCenter[e].addInPlace(this._frustumCornersWorldSpace[e][t]);if(this._frustumCenter[e].scaleInPlace(1/this._frustumCornersWorldSpace[e].length),this.stabilizeCascades){var i=0;for(t=0;t<this._frustumCornersWorldSpace[e].length;++t){var n=this._frustumCornersWorldSpace[e][t].subtractToRef(this._frustumCenter[e],Sa).length();i=Math.max(i,n)}i=Math.ceil(16*i)/16,this._cascadeMaxExtents[e].copyFromFloats(i,i,i),this._cascadeMinExtents[e].copyFromFloats(-i,-i,-i)}else{var r=this._frustumCenter[e];for(this._frustumCenter[e].addToRef(this._lightDirection,Sa),a.a.LookAtLHToRef(r,Sa,Ta,Pa),t=0;t<this._frustumCornersWorldSpace[e].length;++t)a.e.TransformCoordinatesToRef(this._frustumCornersWorldSpace[e][t],Pa,Sa),this._cascadeMinExtents[e].minimizeInPlace(Sa),this._cascadeMaxExtents[e].maximizeInPlace(Sa)}}},Object.defineProperty(t,"IsSupported",{get:function(){var e=x.a.LastCreatedEngine;return!!e&&1!=e.webGLVersion},enumerable:!1,configurable:!0}),t.prototype._initializeGenerator=function(){var i,n,r,o,s,c,l,u,h,d,f,p,_,m,g,v,b,y,T,E;this.penumbraDarkness=null!==(i=this.penumbraDarkness)&&void 0!==i?i:1,this._numCascades=null!==(n=this._numCascades)&&void 0!==n?n:t.DEFAULT_CASCADES_COUNT,this.stabilizeCascades=null!==(r=this.stabilizeCascades)&&void 0!==r&&r,this._freezeShadowCastersBoundingInfoObservable=null!==(o=this._freezeShadowCastersBoundingInfoObservable)&&void 0!==o?o:null,this.freezeShadowCastersBoundingInfo=null!==(s=this.freezeShadowCastersBoundingInfo)&&void 0!==s&&s,this._scbiMin=null!==(c=this._scbiMin)&&void 0!==c?c:new a.e(0,0,0),this._scbiMax=null!==(l=this._scbiMax)&&void 0!==l?l:new a.e(0,0,0),this._shadowCastersBoundingInfo=null!==(u=this._shadowCastersBoundingInfo)&&void 0!==u?u:new _n.a(new a.e(0,0,0),new a.e(0,0,0)),this._breaksAreDirty=null===(h=this._breaksAreDirty)||void 0===h||h,this._minDistance=null!==(d=this._minDistance)&&void 0!==d?d:0,this._maxDistance=null!==(f=this._maxDistance)&&void 0!==f?f:1,this._currentLayer=null!==(p=this._currentLayer)&&void 0!==p?p:0,this._shadowMaxZ=null!==(g=null!==(_=this._shadowMaxZ)&&void 0!==_?_:null===(m=this._scene.activeCamera)||void 0===m?void 0:m.maxZ)&&void 0!==g?g:1e4,this._debug=null!==(v=this._debug)&&void 0!==v&&v,this._depthClamp=null===(b=this._depthClamp)||void 0===b||b,this._cascadeBlendPercentage=null!==(y=this._cascadeBlendPercentage)&&void 0!==y?y:.1,this._lambda=null!==(T=this._lambda)&&void 0!==T?T:.5,this._autoCalcDepthBounds=null!==(E=this._autoCalcDepthBounds)&&void 0!==E&&E,e.prototype._initializeGenerator.call(this)},t.prototype._createTargetRenderTexture=function(){var e={width:this._mapSize,height:this._mapSize,layers:this.numCascades};this._shadowMap=new Ri(this._light.name+"_shadowMap",e,this._scene,!1,!0,this._textureType,!1,void 0,!1,!1,void 0),this._shadowMap.createDepthStencilTexture(g.a.LESS,!0)},t.prototype._initializeShadowMap=function(){var i=this;if(e.prototype._initializeShadowMap.call(this),null!==this._shadowMap){this._transformMatricesAsArray=new Float32Array(16*this._numCascades),this._viewSpaceFrustumsZ=new Array(this._numCascades),this._frustumLengths=new Array(this._numCascades),this._lightSizeUVCorrection=new Array(2*this._numCascades),this._depthCorrection=new Array(this._numCascades),this._cascades=[],this._viewMatrices=[],this._projectionMatrices=[],this._transformMatrices=[],this._cascadeMinExtents=[],this._cascadeMaxExtents=[],this._frustumCenter=[],this._shadowCameraPos=[],this._frustumCornersWorldSpace=[];for(var n=0;n<this._numCascades;++n){this._cascades[n]={prevBreakDistance:0,breakDistance:0},this._viewMatrices[n]=a.a.Zero(),this._projectionMatrices[n]=a.a.Zero(),this._transformMatrices[n]=a.a.Zero(),this._cascadeMinExtents[n]=new a.e,this._cascadeMaxExtents[n]=new a.e,this._frustumCenter[n]=new a.e,this._shadowCameraPos[n]=new a.e,this._frustumCornersWorldSpace[n]=new Array(t.frustumCornersNDCSpace.length);for(var r=0;r<t.frustumCornersNDCSpace.length;++r)this._frustumCornersWorldSpace[n][r]=new a.e}this._shadowMap.onBeforeRenderObservable.add(function(e){if(i._currentLayer=e,i._scene.getSceneUniformBuffer().useUbo){var t=i._scene.getSceneUniformBuffer();t.updateMatrix("viewProjection",i.getCascadeTransformMatrix(e)),t.updateMatrix("view",i.getCascadeViewMatrix(e)),t.update()}}),this._shadowMap.onBeforeBindObservable.add(function(){i._breaksAreDirty&&i._splitFrustum(),i._computeMatrices()}),this._splitFrustum()}},t.prototype._bindCustomEffectForRenderSubMeshForShadowMap=function(e,t,i,n){var r,o,a,s,c,l;t.setMatrix(null!==(r=null==i?void 0:i.viewProjection)&&void 0!==r?r:"viewProjection",this.getCascadeTransformMatrix(this._currentLayer)),t.setMatrix(null!==(o=null==i?void 0:i.view)&&void 0!==o?o:"view",this.getCascadeViewMatrix(this._currentLayer)),t.setMatrix(null!==(a=null==i?void 0:i.projection)&&void 0!==a?a:"projection",this.getCascadeProjectionMatrix(this._currentLayer));var u=n.getWorldMatrix();t.setMatrix(null!==(s=null==i?void 0:i.world)&&void 0!==s?s:"world",u),u.multiplyToRef(this.getCascadeTransformMatrix(this._currentLayer),Pa),t.setMatrix(null!==(c=null==i?void 0:i.worldViewProjection)&&void 0!==c?c:"worldViewProjection",Pa),u.multiplyToRef(this.getCascadeViewMatrix(this._currentLayer),Ca),t.setMatrix(null!==(l=null==i?void 0:i.worldView)&&void 0!==l?l:"worldView",Ca)},t.prototype._isReadyCustomDefines=function(e,t,i){e.push("#define SM_DEPTHCLAMP "+(this._depthClamp&&this._filter!==ga.FILTER_PCSS?"1":"0"))},t.prototype.prepareDefines=function(t,i){e.prototype.prepareDefines.call(this,t,i);var n=this._scene,r=this._light;if(n.shadowsEnabled&&r.shadowEnabled){t["SHADOWCSM"+i]=!0,t["SHADOWCSMDEBUG"+i]=this.debug,t["SHADOWCSMNUM_CASCADES"+i]=this.numCascades,t["SHADOWCSM_RIGHTHANDED"+i]=n.useRightHandedSystem;var o=n.activeCamera;o&&this._shadowMaxZ<o.maxZ&&(t["SHADOWCSMUSESHADOWMAXZ"+i]=!0),0===this.cascadeBlendPercentage&&(t["SHADOWCSMNOBLEND"+i]=!0)}},t.prototype.bindShadowLight=function(e,t){var i=this._light,n=this._scene;if(n.shadowsEnabled&&i.shadowEnabled){var r=n.activeCamera;if(r){var o=this.getShadowMap();if(o){var a=o.getSize().width;if(t.setMatrices("lightMatrix"+e,this._transformMatricesAsArray),t.setArray("viewFrustumZ"+e,this._viewSpaceFrustumsZ),t.setFloat("cascadeBlendFactor"+e,0===this.cascadeBlendPercentage?1e4:1/this.cascadeBlendPercentage),t.setArray("frustumLengths"+e,this._frustumLengths),this._filter===ga.FILTER_PCF)t.setDepthStencilTexture("shadowSampler"+e,o),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),a,1/a,this.frustumEdgeFalloff,e);else if(this._filter===ga.FILTER_PCSS){for(var s=0;s<this._numCascades;++s)this._lightSizeUVCorrection[2*s+0]=0===s?1:(this._cascadeMaxExtents[0].x-this._cascadeMinExtents[0].x)/(this._cascadeMaxExtents[s].x-this._cascadeMinExtents[s].x),this._lightSizeUVCorrection[2*s+1]=0===s?1:(this._cascadeMaxExtents[0].y-this._cascadeMinExtents[0].y)/(this._cascadeMaxExtents[s].y-this._cascadeMinExtents[s].y),this._depthCorrection[s]=0===s?1:(this._cascadeMaxExtents[s].z-this._cascadeMinExtents[s].z)/(this._cascadeMaxExtents[0].z-this._cascadeMinExtents[0].z);t.setDepthStencilTexture("shadowSampler"+e,o),t.setTexture("depthSampler"+e,o),t.setArray2("lightSizeUVCorrection"+e,this._lightSizeUVCorrection),t.setArray("depthCorrection"+e,this._depthCorrection),t.setFloat("penumbraDarkness"+e,this.penumbraDarkness),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),1/a,this._contactHardeningLightSizeUVRatio*a,this.frustumEdgeFalloff,e)}else t.setTexture("shadowSampler"+e,o),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),a,1/a,this.frustumEdgeFalloff,e);i._uniformBuffer.updateFloat2("depthValues",this.getLight().getDepthMinZ(r),this.getLight().getDepthMinZ(r)+this.getLight().getDepthMaxZ(r),e)}}}},t.prototype.getTransformMatrix=function(){return this.getCascadeTransformMatrix(0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._freezeShadowCastersBoundingInfoObservable&&(this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable),this._freezeShadowCastersBoundingInfoObservable=null),this._depthReducer&&(this._depthReducer.dispose(),this._depthReducer=null)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this),i=this.getShadowMap();if(!i)return t;if(t.numCascades=this._numCascades,t.debug=this._debug,t.stabilizeCascades=this.stabilizeCascades,t.lambda=this._lambda,t.cascadeBlendPercentage=this.cascadeBlendPercentage,t.depthClamp=this._depthClamp,t.autoCalcDepthBounds=this.autoCalcDepthBounds,t.shadowMaxZ=this._shadowMaxZ,t.penumbraDarkness=this.penumbraDarkness,t.freezeShadowCastersBoundingInfo=this._freezeShadowCastersBoundingInfo,t.minDistance=this.minDistance,t.maxDistance=this.maxDistance,t.renderList=[],i.renderList)for(var n=0;n<i.renderList.length;n++){var r=i.renderList[n];t.renderList.push(r.id)}return t},t.Parse=function(e,i){var n=ga.Parse(e,i,function(e,i){return new t(e,i)});return void 0!==e.numCascades&&(n.numCascades=e.numCascades),void 0!==e.debug&&(n.debug=e.debug),void 0!==e.stabilizeCascades&&(n.stabilizeCascades=e.stabilizeCascades),void 0!==e.lambda&&(n.lambda=e.lambda),void 0!==e.cascadeBlendPercentage&&(n.cascadeBlendPercentage=e.cascadeBlendPercentage),void 0!==e.depthClamp&&(n.depthClamp=e.depthClamp),void 0!==e.autoCalcDepthBounds&&(n.autoCalcDepthBounds=e.autoCalcDepthBounds),void 0!==e.shadowMaxZ&&(n.shadowMaxZ=e.shadowMaxZ),void 0!==e.penumbraDarkness&&(n.penumbraDarkness=e.penumbraDarkness),void 0!==e.freezeShadowCastersBoundingInfo&&(n.freezeShadowCastersBoundingInfo=e.freezeShadowCastersBoundingInfo),void 0!==e.minDistance&&void 0!==e.maxDistance&&n.setMinMaxDistance(e.minDistance,e.maxDistance),n},t.frustumCornersNDCSpace=[new a.e(-1,1,-1),new a.e(1,1,-1),new a.e(1,-1,-1),new a.e(-1,-1,-1),new a.e(-1,1,1),new a.e(1,1,1),new a.e(1,-1,1),new a.e(-1,-1,1)],t.CLASSNAME="CascadedShadowGenerator",t.DEFAULT_CASCADES_COUNT=4,t.MIN_CASCADES_COUNT=2,t.MAX_CASCADES_COUNT=4,t._SceneComponentInitialization=function(e){throw Re.a.WarnImport("ShadowGeneratorSceneComponent")},t}(ga);n.a.AddParser(Me.a.NAME_SHADOWGENERATOR,function(e,t){if(void 0!==e.shadowGenerators&&null!==e.shadowGenerators)for(var i=0,n=e.shadowGenerators.length;i<n;i++){var r=e.shadowGenerators[i];r.className===Ra.CLASSNAME?Ra.Parse(r,t):ga.Parse(r,t)}});var xa=function(){function e(e){this.name=Me.a.NAME_SHADOWGENERATOR,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(Me.a.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR,this,this._gatherRenderTargets)},e.prototype.rebuild=function(){},e.prototype.serialize=function(e){e.shadowGenerators=[];for(var t=0,i=this.scene.lights;t<i.length;t++){var n=i[t].getShadowGenerator();n&&e.shadowGenerators.push(n.serialize())}},e.prototype.addFromContainer=function(e){},e.prototype.removeFromContainer=function(e,t){},e.prototype.dispose=function(){},e.prototype._gatherRenderTargets=function(e){var t=this.scene;if(this.scene.shadowsEnabled)for(var i=0;i<t.lights.length;i++){var n=t.lights[i],r=n.getShadowGenerator();if(n.isEnabled()&&n.shadowEnabled&&r){var o=r.getShadowMap();-1!==t.textures.indexOf(o)&&e.push(o)}}},e}();ga._SceneComponentInitialization=function(e){var t=e._getComponent(Me.a.NAME_SHADOWGENERATOR);t||(t=new xa(e),e._addComponent(t))},B.a.AddNodeConstructor("Light_Type_0",function(e,t){return function(){return new Oa(e,a.e.Zero(),t)}});var Oa=function(e){function t(t,i,n){var r=e.call(this,t,n)||this;return r._shadowAngle=Math.PI/2,r.position=i,r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"shadowAngle",{get:function(){return this._shadowAngle},set:function(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},set:function(e){var t=this.needCube();this._direction=e,this.needCube()!==t&&this._shadowGenerator&&this._shadowGenerator.recreateShadowMap()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PointLight"},t.prototype.getTypeID=function(){return Dr.a.LIGHTTYPEID_POINTLIGHT},t.prototype.needCube=function(){return!this.direction},t.prototype.getShadowDirection=function(t){if(this.direction)return e.prototype.getShadowDirection.call(this,t);switch(t){case 0:return new a.e(1,0,0);case 1:return new a.e(-1,0,0);case 2:return new a.e(0,-1,0);case 3:return new a.e(0,1,0);case 4:return new a.e(0,0,1);case 5:return new a.e(0,0,-1)}return a.e.Zero()},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,i){var n=this.getScene().activeCamera;n&&a.a.PerspectiveFovLHToRef(this.shadowAngle,1,this.getDepthMinZ(n),this.getDepthMaxZ(n),e)},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,0,t):this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,0,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,t),this},t.prototype.transferToNodeMaterialEffect=function(e,t){return this.computeTransformedInformation()?e.setFloat3(t,this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z):e.setFloat3(t,this.position.x,this.position.y,this.position.z),this},t.prototype.prepareLightSpecificDefines=function(e,t){e["POINTLIGHT"+t]=!0},Object(h.c)([Object(w.c)()],t.prototype,"shadowAngle",null),t}(Nr),Ma=function(){function e(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="black"),this._renderingCanvas=e,this._loadingText=t,this._loadingDivBackgroundColor=i,this._resizeLoadingUI=function(){var e=n._renderingCanvas.getBoundingClientRect(),t=window.getComputedStyle(n._renderingCanvas).position;n._loadingDiv&&(n._loadingDiv.style.position="fixed"===t?"fixed":"absolute",n._loadingDiv.style.left=e.left+"px",n._loadingDiv.style.top=e.top+"px",n._loadingDiv.style.width=e.width+"px",n._loadingDiv.style.height=e.height+"px")}}return e.prototype.displayLoadingUI=function(){if(!this._loadingDiv){this._loadingDiv=document.createElement("div"),this._loadingDiv.id="babylonjsLoadingDiv",this._loadingDiv.style.opacity="0",this._loadingDiv.style.transition="opacity 1.5s ease",this._loadingDiv.style.pointerEvents="none",this._loadingDiv.style.display="grid",this._loadingDiv.style.gridTemplateRows="100%",this._loadingDiv.style.gridTemplateColumns="100%",this._loadingDiv.style.justifyItems="center",this._loadingDiv.style.alignItems="center",this._loadingTextDiv=document.createElement("div"),this._loadingTextDiv.style.position="absolute",this._loadingTextDiv.style.left="0",this._loadingTextDiv.style.top="50%",this._loadingTextDiv.style.marginTop="80px",this._loadingTextDiv.style.width="100%",this._loadingTextDiv.style.height="20px",this._loadingTextDiv.style.fontFamily="Arial",this._loadingTextDiv.style.fontSize="14px",this._loadingTextDiv.style.color="white",this._loadingTextDiv.style.textAlign="center",this._loadingTextDiv.style.zIndex="1",this._loadingTextDiv.innerHTML="Loading",this._loadingDiv.appendChild(this._loadingTextDiv),this._loadingTextDiv.innerHTML=this._loadingText;var t=document.createElement("style");t.type="text/css",t.innerHTML="@-webkit-keyframes spin1 {                    0% { -webkit-transform: rotate(0deg);}\n                    100% { -webkit-transform: rotate(360deg);}\n                }                @keyframes spin1 {                    0% { transform: rotate(0deg);}\n                    100% { transform: rotate(360deg);}\n                }",document.getElementsByTagName("head")[0].appendChild(t);var i=!!window.SVGSVGElement,n=new Image;e.DefaultLogoUrl?n.src=e.DefaultLogoUrl:n.src=i?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODAuMTcgMjA4LjA0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6I2UwNjg0Yjt9LmNscy0ze2ZpbGw6I2JiNDY0Yjt9LmNscy00e2ZpbGw6I2UwZGVkODt9LmNscy01e2ZpbGw6I2Q1ZDJjYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJhYnlsb25Mb2dvPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iUGFnZV9FbGVtZW50cyIgZGF0YS1uYW1lPSJQYWdlIEVsZW1lbnRzIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05MC4wOSwwLDAsNTJWMTU2bDkwLjA5LDUyLDkwLjA4LTUyVjUyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxODAuMTcgNTIuMDEgMTUxLjk3IDM1LjczIDEyNC44NSA1MS4zOSAxNTMuMDUgNjcuNjcgMTgwLjE3IDUyLjAxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjI3LjEyIDY3LjY3IDExNy4yMSAxNS42NiA5MC4wOCAwIDAgNTIuMDEgMjcuMTIgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNjEuODkgMTIwLjMgOTAuMDggMTM2LjU4IDExOC4yOCAxMjAuMyA5MC4wOCAxMDQuMDIgNjEuODkgMTIwLjMiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDE1My4wNSAxNDAuMzcgOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyAwIDUyLjAxIDAgMTU2LjAzIDkwLjA4IDIwOC4wNCAxODAuMTcgMTU2LjAzIDE4MC4xNyA1Mi4wMSAxNTMuMDUgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOTAuMDggNzEuNDYgNjEuODkgODcuNzQgNjEuODkgMTIwLjMgOTAuMDggMTA0LjAyIDExOC4yOCAxMjAuMyAxMTguMjggODcuNzQgOTAuMDggNzEuNDYiLz48cG9seWdvbiBjbGFzcz0iY2xzLTQiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDExOC4yOCA4Ny43NCAxMTguMjggMTIwLjMgOTAuMDggMTM2LjU4IDkwLjA4IDE3Ni43MiAxNTMuMDUgMTQwLjM3IDE1My4wNSA2Ny42NyIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIyNy4xMiA2Ny42NyA2MS44OSA4Ny43NCA2MS44OSAxMjAuMyA5MC4wOCAxMzYuNTggOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyIvPjwvZz48L2c+PC9zdmc+":"https://cdn.babylonjs.com/Assets/babylonLogo.png",n.style.width="150px",n.style.gridColumn="1",n.style.gridRow="1",n.style.top="50%",n.style.left="50%",n.style.transform="translate(-50%, -50%)",n.style.position="absolute";var r=document.createElement("div");r.style.width="300px",r.style.gridColumn="1",r.style.gridRow="1",r.style.top="50%",r.style.left="50%",r.style.transform="translate(-50%, -50%)",r.style.position="absolute";var o=new Image;if(e.DefaultSpinnerUrl?o.src=e.DefaultSpinnerUrl:o.src=i?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOTIgMzkyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwNjg0Yjt9LmNscy0ye2ZpbGw6bm9uZTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlNwaW5uZXJJY29uPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iU3Bpbm5lciI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDAuMjEsMTI2LjQzYzMuNy03LjMxLDcuNjctMTQuNDQsMTItMjEuMzJsMy4zNi01LjEsMy41Mi01YzEuMjMtMS42MywyLjQxLTMuMjksMy42NS00LjkxczIuNTMtMy4yMSwzLjgyLTQuNzlBMTg1LjIsMTg1LjIsMCwwLDEsODMuNCw2Ny40M2EyMDgsMjA4LDAsMCwxLDE5LTE1LjY2YzMuMzUtMi40MSw2Ljc0LTQuNzgsMTAuMjUtN3M3LjExLTQuMjgsMTAuNzUtNi4zMmM3LjI5LTQsMTQuNzMtOCwyMi41My0xMS40OSwzLjktMS43Miw3Ljg4LTMuMywxMi00LjY0YTEwNC4yMiwxMDQuMjIsMCwwLDEsMTIuNDQtMy4yMyw2Mi40NCw2Mi40NCwwLDAsMSwxMi43OC0xLjM5QTI1LjkyLDI1LjkyLDAsMCwxLDE5NiwyMS40NGE2LjU1LDYuNTUsMCwwLDEsMi4wNSw5LDYuNjYsNi42NiwwLDAsMS0xLjY0LDEuNzhsLS40MS4yOWEyMi4wNywyMi4wNywwLDAsMS01Ljc4LDMsMzAuNDIsMzAuNDIsMCwwLDEtNS42NywxLjYyLDM3LjgyLDM3LjgyLDAsMCwxLTUuNjkuNzFjLTEsMC0xLjkuMTgtMi44NS4yNmwtMi44NS4yNHEtNS43Mi41MS0xMS40OCwxLjFjLTMuODQuNC03LjcxLjgyLTExLjU4LDEuNGExMTIuMzQsMTEyLjM0LDAsMCwwLTIyLjk0LDUuNjFjLTMuNzIsMS4zNS03LjM0LDMtMTAuOTQsNC42NHMtNy4xNCwzLjUxLTEwLjYsNS41MUExNTEuNiwxNTEuNiwwLDAsMCw2OC41Niw4N0M2Ny4yMyw4OC40OCw2Niw5MCw2NC42NCw5MS41NnMtMi41MSwzLjE1LTMuNzUsNC43M2wtMy41NCw0LjljLTEuMTMsMS42Ni0yLjIzLDMuMzUtMy4zMyw1YTEyNywxMjcsMCwwLDAtMTAuOTMsMjEuNDksMS41OCwxLjU4LDAsMSwxLTMtMS4xNVM0MC4xOSwxMjYuNDcsNDAuMjEsMTI2LjQzWiIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjM5MiIgaGVpZ2h0PSIzOTIiLz48L2c+PC9nPjwvc3ZnPg==":"https://cdn.babylonjs.com/Assets/loadingIcon.png",o.style.animation="spin1 0.75s infinite linear",o.style.webkitAnimation="spin1 0.75s infinite linear",o.style.transformOrigin="50% 50%",o.style.webkitTransformOrigin="50% 50%",!i){var a={w:16,h:18.5},s={w:30,h:30};n.style.width=a.w+"vh",n.style.height=a.h+"vh",n.style.left="calc(50% - "+a.w/2+"vh)",n.style.top="calc(50% - "+a.h/2+"vh)",o.style.width=s.w+"vh",o.style.height=s.h+"vh",o.style.left="calc(50% - "+s.w/2+"vh)",o.style.top="calc(50% - "+s.h/2+"vh)"}r.appendChild(o),this._loadingDiv.appendChild(n),this._loadingDiv.appendChild(r),this._resizeLoadingUI(),window.addEventListener("resize",this._resizeLoadingUI),this._loadingDiv.style.backgroundColor=this._loadingDivBackgroundColor,document.body.appendChild(this._loadingDiv),this._loadingDiv.style.opacity="1"}},e.prototype.hideLoadingUI=function(){var e=this;this._loadingDiv&&(this._loadingDiv.style.opacity="0",this._loadingDiv.addEventListener("transitionend",function(){e._loadingDiv&&(e._loadingDiv.parentElement&&e._loadingDiv.parentElement.removeChild(e._loadingDiv),window.removeEventListener("resize",e._resizeLoadingUI),e._loadingDiv=null)}))},Object.defineProperty(e.prototype,"loadingUIText",{get:function(){return this._loadingText},set:function(e){this._loadingText=e,this._loadingTextDiv&&(this._loadingTextDiv.innerHTML=this._loadingText)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loadingUIBackgroundColor",{get:function(){return this._loadingDivBackgroundColor},set:function(e){this._loadingDivBackgroundColor=e,this._loadingDiv&&(this._loadingDiv.style.backgroundColor=this._loadingDivBackgroundColor)},enumerable:!1,configurable:!0}),e.DefaultLogoUrl="",e.DefaultSpinnerUrl="",e}();Se.a.DefaultLoadingScreenFactory=function(e){return new Ma(e)};var Ia=i(71),Da=i(68),Na=function(){function e(){}return e.ConvertPanoramaToCubemap=function(e,t,i,n){if(!e)throw"ConvertPanoramaToCubemap: input cannot be null";if(e.length!=t*i*3)throw"ConvertPanoramaToCubemap: input size is wrong";return{front:this.CreateCubemapTexture(n,this.FACE_FRONT,e,t,i),back:this.CreateCubemapTexture(n,this.FACE_BACK,e,t,i),left:this.CreateCubemapTexture(n,this.FACE_LEFT,e,t,i),right:this.CreateCubemapTexture(n,this.FACE_RIGHT,e,t,i),up:this.CreateCubemapTexture(n,this.FACE_UP,e,t,i),down:this.CreateCubemapTexture(n,this.FACE_DOWN,e,t,i),size:n,type:g.a.TEXTURETYPE_FLOAT,format:g.a.TEXTUREFORMAT_RGB,gammaSpace:!1}},e.CreateCubemapTexture=function(e,t,i,n,r){for(var o=new ArrayBuffer(e*e*4*3),a=new Float32Array(o),s=t[1].subtract(t[0]).scale(1/e),c=t[3].subtract(t[2]).scale(1/e),l=1/e,u=0,h=0;h<e;h++){for(var d=t[0],f=t[2],p=0;p<e;p++){var _=f.subtract(d).scale(u).add(d);_.normalize();var m=this.CalcProjectionSpherical(_,i,n,r);a[h*e*3+3*p+0]=m.r,a[h*e*3+3*p+1]=m.g,a[h*e*3+3*p+2]=m.b,d=d.add(s),f=f.add(c)}u+=l}return a},e.CalcProjectionSpherical=function(e,t,i,n){for(var r=Math.atan2(e.z,e.x),o=Math.acos(e.y);r<-Math.PI;)r+=2*Math.PI;for(;r>Math.PI;)r-=2*Math.PI;var a=r/Math.PI,s=o/Math.PI;a=.5*a+.5;var c=Math.round(a*i);c<0?c=0:c>=i&&(c=i-1);var l=Math.round(s*n);l<0?l=0:l>=n&&(l=n-1);var u=n-l-1;return{r:t[u*i*3+3*c+0],g:t[u*i*3+3*c+1],b:t[u*i*3+3*c+2]}},e.FACE_LEFT=[new a.e(-1,-1,-1),new a.e(1,-1,-1),new a.e(-1,1,-1),new a.e(1,1,-1)],e.FACE_RIGHT=[new a.e(1,-1,1),new a.e(-1,-1,1),new a.e(1,1,1),new a.e(-1,1,1)],e.FACE_FRONT=[new a.e(1,-1,-1),new a.e(1,-1,1),new a.e(1,1,-1),new a.e(1,1,1)],e.FACE_BACK=[new a.e(-1,-1,1),new a.e(-1,-1,-1),new a.e(-1,1,1),new a.e(-1,1,-1)],e.FACE_DOWN=[new a.e(1,1,-1),new a.e(1,1,1),new a.e(-1,1,-1),new a.e(-1,1,1)],e.FACE_UP=[new a.e(-1,-1,-1),new a.e(-1,-1,1),new a.e(1,-1,-1),new a.e(1,-1,1)],e}(),La=function(){function e(){}return e.Ldexp=function(e,t){return t>1023?e*Math.pow(2,1023)*Math.pow(2,t-1023):t<-1074?e*Math.pow(2,-1074)*Math.pow(2,t+1074):e*Math.pow(2,t)},e.Rgbe2float=function(e,t,i,n,r,o){r>0?(r=this.Ldexp(1,r-136),e[o+0]=t*r,e[o+1]=i*r,e[o+2]=n*r):(e[o+0]=0,e[o+1]=0,e[o+2]=0)},e.readStringLine=function(e,t){for(var i="",n="",r=t;r<e.length-t&&"\n"!=(n=String.fromCharCode(e[r]));r++)i+=n;return i},e.RGBE_ReadHeader=function(e){var t,i,n=this.readStringLine(e,0);if("#"!=n[0]||"?"!=n[1])throw"Bad HDR Format.";var r=!1,o=!1,a=0;do{a+=n.length+1,"FORMAT=32-bit_rle_rgbe"==(n=this.readStringLine(e,a))?o=!0:0==n.length&&(r=!0)}while(!r);if(!o)throw"HDR Bad header format, unsupported FORMAT";a+=n.length+1,n=this.readStringLine(e,a);var s=/^\-Y (.*) \+X (.*)$/g.exec(n);if(!s||s.length<3)throw"HDR Bad header format, no size";if(i=parseInt(s[2]),t=parseInt(s[1]),i<8||i>32767)throw"HDR Bad header format, unsupported size";return{height:t,width:i,dataPosition:a+=n.length+1}},e.GetCubeMapTextureData=function(e,t){var i=new Uint8Array(e),n=this.RGBE_ReadHeader(i),r=this.RGBE_ReadPixels(i,n);return Na.ConvertPanoramaToCubemap(r,n.width,n.height,t)},e.RGBE_ReadPixels=function(e,t){return this.RGBE_ReadPixels_RLE(e,t)},e.RGBE_ReadPixels_RLE=function(e,t){for(var i,n,r,o,a,s=t.height,c=t.width,l=t.dataPosition,u=0,h=0,d=0,f=new ArrayBuffer(4*c),p=new Uint8Array(f),_=new ArrayBuffer(t.width*t.height*4*3),m=new Float32Array(_);s>0;){if(i=e[l++],n=e[l++],r=e[l++],o=e[l++],2!=i||2!=n||128&r||t.width<8||t.width>32767)return this.RGBE_ReadPixels_NOT_RLE(e,t);if((r<<8|o)!=c)throw"HDR Bad header format, wrong scan line width";for(u=0,d=0;d<4;d++)for(h=(d+1)*c;u<h;)if(i=e[l++],n=e[l++],i>128){if(0==(a=i-128)||a>h-u)throw"HDR Bad Format, bad scanline data (run)";for(;a-- >0;)p[u++]=n}else{if(0==(a=i)||a>h-u)throw"HDR Bad Format, bad scanline data (non-run)";if(p[u++]=n,--a>0)for(var g=0;g<a;g++)p[u++]=e[l++]}for(d=0;d<c;d++)i=p[d],n=p[d+c],r=p[d+2*c],o=p[d+3*c],this.Rgbe2float(m,i,n,r,o,(t.height-s)*c*3+3*d);s--}return m},e.RGBE_ReadPixels_NOT_RLE=function(e,t){for(var i,n,r,o,a,s=t.height,c=t.width,l=t.dataPosition,u=new ArrayBuffer(t.width*t.height*4*3),h=new Float32Array(u);s>0;){for(a=0;a<t.width;a++)i=e[l++],n=e[l++],r=e[l++],o=e[l++],this.Rgbe2float(h,i,n,r,o,(t.height-s)*c*3+3*a);s--}return h},e}(),wa=function(){function e(t,i){var n;void 0===i&&(i=e._DefaultOptions),this.engine=t,this._fullscreenViewport=new mi.a(0,0,1,1),i=Object(h.a)(Object(h.a)({},e._DefaultOptions),i),this._vertexBuffers=((n={})[ji.b.PositionKind]=new ji.b(t,i.positions,ji.b.PositionKind,!1,!1,2),n),this._indexBuffer=t.createIndexBuffer(i.indices)}return e.prototype.setViewport=function(e){void 0===e&&(e=this._fullscreenViewport),this.engine.setViewport(e)},e.prototype.bindBuffers=function(e){this.engine.bindBuffers(this._vertexBuffers,this._indexBuffer,e)},e.prototype.applyEffectWrapper=function(e){this.engine.depthCullingState.depthTest=!1,this.engine.stencilState.stencilTest=!1,this.engine.enableEffect(e.effect),this.bindBuffers(e.effect),e.onApplyObservable.notifyObservers({})},e.prototype.restoreStates=function(){this.engine.depthCullingState.depthTest=!0,this.engine.stencilState.stencilTest=!0},e.prototype.draw=function(){this.engine.drawElementsType(g.a.MATERIAL_TriangleFillMode,0,6)},e.prototype.isRenderTargetTexture=function(e){return void 0!==e.renderList},e.prototype.render=function(e,t){if(void 0===t&&(t=null),e.effect.isReady()){this.setViewport();var i=null===t?null:this.isRenderTargetTexture(t)?t.getInternalTexture():t;i&&this.engine.bindFramebuffer(i),this.applyEffectWrapper(e),this.draw(),i&&this.engine.unBindFramebuffer(i),this.restoreStates()}},e.prototype.dispose=function(){var e=this._vertexBuffers[ji.b.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[ji.b.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer)},e._DefaultOptions={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]},e}(),Fa=function(){function e(e){var t,i=this;this.onApplyObservable=new o.c;var n=e.uniformNames||[];e.vertexShader?t={fragmentSource:e.fragmentShader,vertexSource:e.vertexShader,spectorName:e.name||"effectWrapper"}:(n.push("scale"),t={fragmentSource:e.fragmentShader,vertex:"postprocess",spectorName:e.name||"effectWrapper"},this.onApplyObservable.add(function(){i.effect.setFloat2("scale",1,1)}));var r=e.defines?e.defines.join("\n"):"";e.useShaderStore?(t.fragment=t.fragmentSource,t.vertex||(t.vertex=t.vertexSource),delete t.fragmentSource,delete t.vertexSource,this.effect=e.engine.createEffect(t.spectorName,e.attributeNames||["position"],n,e.samplerNames,r,void 0,e.onCompiled)):this.effect=new ai.a(t,e.attributeNames||["position"],n,e.samplerNames,e.engine,r,void 0,e.onCompiled)}return e.prototype.dispose=function(){this.effect.dispose()},e}();ai.a.ShadersStore.hdrFilteringVertexShader="\nattribute vec2 position;\n\nvarying vec3 direction;\n\nuniform vec3 up;\nuniform vec3 right;\nuniform vec3 front;\nvoid main(void) {\nmat3 view=mat3(up,right,front);\ndirection=view*vec3(position,1.0);\ngl_Position=vec4(position,0.0,1.0);\n}";ai.a.ShadersStore.hdrFilteringPixelShader="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nuniform float alphaG;\nuniform samplerCube inputTexture;\nuniform vec2 vFilteringInfo;\nuniform float hdrScale;\nvarying vec3 direction;\nvoid main() {\nvec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);\ngl_FragColor=vec4(color*hdrScale,1.0);\n}";var Ba=function(){function e(e,t){void 0===t&&(t={}),this._lodGenerationOffset=0,this._lodGenerationScale=.8,this.quality=g.a.TEXTURE_FILTERING_QUALITY_OFFLINE,this.hdrScale=1,this._engine=e,this.hdrScale=t.hdrScale||this.hdrScale,this.quality=t.hdrScale||this.quality}return e.prototype._createRenderTarget=function(e){var t=g.a.TEXTURETYPE_UNSIGNED_BYTE;this._engine.getCaps().textureHalfFloatRender?t=g.a.TEXTURETYPE_HALF_FLOAT:this._engine.getCaps().textureFloatRender&&(t=g.a.TEXTURETYPE_FLOAT);var i=this._engine.createRenderTargetCubeTexture(e,{format:g.a.TEXTUREFORMAT_RGBA,type:t,generateMipMaps:!1,generateDepthBuffer:!1,generateStencilBuffer:!1,samplingMode:g.a.TEXTURE_NEAREST_SAMPLINGMODE});return this._engine.updateTextureWrappingMode(i,g.a.TEXTURE_CLAMP_ADDRESSMODE,g.a.TEXTURE_CLAMP_ADDRESSMODE,g.a.TEXTURE_CLAMP_ADDRESSMODE),this._engine.updateTextureSamplingMode(g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,i,!0),i},e.prototype._prefilterInternal=function(e){var t=e.getSize().width,i=Math.round(L.a.Log2(t))+1,n=this._effectWrapper.effect,r=this._createRenderTarget(t);this._effectRenderer.setViewport();var o=e.getInternalTexture();o&&this._engine.updateTextureSamplingMode(g.a.TEXTURE_TRILINEAR_SAMPLINGMODE,o,!0),this._effectRenderer.applyEffectWrapper(this._effectWrapper);var s=[[new a.e(0,0,-1),new a.e(0,-1,0),new a.e(1,0,0)],[new a.e(0,0,1),new a.e(0,-1,0),new a.e(-1,0,0)],[new a.e(1,0,0),new a.e(0,0,1),new a.e(0,1,0)],[new a.e(1,0,0),new a.e(0,0,-1),new a.e(0,-1,0)],[new a.e(1,0,0),new a.e(0,-1,0),new a.e(0,0,1)],[new a.e(-1,0,0),new a.e(0,-1,0),new a.e(0,0,-1)]];n.setFloat("hdrScale",this.hdrScale),n.setFloat2("vFilteringInfo",e.getSize().width,i),n.setTexture("inputTexture",e);for(var c=0;c<6;c++){n.setVector3("up",s[c][0]),n.setVector3("right",s[c][1]),n.setVector3("front",s[c][2]);for(var l=0;l<i;l++){this._engine.bindFramebuffer(r,c,void 0,void 0,!0,l),this._effectRenderer.applyEffectWrapper(this._effectWrapper);var u=Math.pow(2,(l-this._lodGenerationOffset)/this._lodGenerationScale)/t;0===l&&(u=0),n.setFloat("alphaG",u),this._effectRenderer.draw()}}return this._effectRenderer.restoreStates(),this._engine.restoreDefaultFramebuffer(),this._engine._releaseFramebufferObjects(r),this._engine._releaseTexture(e._texture),r._swapAndDie(e._texture),e._prefiltered=!0,e},e.prototype._createEffect=function(e,t){var i=[];return e.gammaSpace&&i.push("#define GAMMA_INPUT"),i.push("#define NUM_SAMPLES "+this.quality+"u"),new Fa({engine:this._engine,name:"hdrFiltering",vertexShader:"hdrFiltering",fragmentShader:"hdrFiltering",samplerNames:["inputTexture"],uniformNames:["vSampleDirections","vWeights","up","right","front","vFilteringInfo","hdrScale","alphaG"],useShaderStore:!0,defines:i,onCompiled:t})},e.prototype.isReady=function(e){return e.isReady()&&this._effectWrapper.effect.isReady()},e.prototype.prefilter=function(e,t){var i=this;if(void 0===t&&(t=null),1!==this._engine.webGLVersion)return new Promise(function(n){i._effectRenderer=new wa(i._engine),i._effectWrapper=i._createEffect(e),i._effectWrapper.effect.executeWhenCompiled(function(){i._prefilterInternal(e),i._effectRenderer.dispose(),i._effectWrapper.dispose(),n(),t&&t()})});m.a.Warn("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.")},e}(),Ua=function(e){function t(t,i,n,r,o,s,c,l,u){var h;void 0===r&&(r=!1),void 0===o&&(o=!0),void 0===s&&(s=!1),void 0===c&&(c=!1),void 0===l&&(l=null),void 0===u&&(u=null);var d=e.call(this,i)||this;return d._generateHarmonics=!0,d._onLoad=null,d._onError=null,d._isBlocking=!0,d._rotationY=0,d.boundingBoxPosition=a.e.Zero(),t?(d._coordinatesMode=Ke.a.CUBIC_MODE,d.name=t,d.url=t,d.hasAlpha=!1,d.isCube=!0,d._textureMatrix=a.a.Identity(),d._prefilterOnLoad=c,d._onLoad=l,d._onError=u,d.gammaSpace=s,d._noMipmap=r,d._size=n,d._generateHarmonics=o,d._texture=d._getFromCache(t,d._noMipmap),d._texture?l&&(d._texture.isReady?Ce.b.SetImmediate(function(){return l()}):d._texture.onLoadedObservable.add(l)):(null===(h=d.getScene())||void 0===h?void 0:h.useDelayedTextureLoading)?d.delayLoadState=g.a.DELAYLOADSTATE_NOTLOADED:d.loadTexture(),d):d}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"isBlocking",{get:function(){return this._isBlocking},set:function(e){this._isBlocking=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationY",{get:function(){return this._rotationY},set:function(e){this._rotationY=e,this.setReflectionTextureMatrix(a.a.RotationY(this._rotationY))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"boundingBoxSize",{get:function(){return this._boundingBoxSize},set:function(e){if(!this._boundingBoxSize||!this._boundingBoxSize.equals(e)){this._boundingBoxSize=e;var t=this.getScene();t&&t.markAllMaterialsAsDirty(g.a.MATERIAL_TextureDirtyFlag)}},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"HDRCubeTexture"},t.prototype.loadTexture=function(){var e=this,i=this._getEngine();if(this._getEngine().webGLVersion>=2&&this._prefilterOnLoad){var n=this._onLoad,r=new Ba(i);this._onLoad=function(){r.prefilter(e,n)}}this._texture=i.createRawCubeTextureFromUrl(this.url,this.getScene(),this._size,g.a.TEXTUREFORMAT_RGB,i.getCaps().textureFloat?g.a.TEXTURETYPE_FLOAT:g.a.TEXTURETYPE_UNSIGNED_INT,this._noMipmap,function(n){e.lodGenerationOffset=0,e.lodGenerationScale=.8;var r=La.GetCubeMapTextureData(n,e._size);if(e._generateHarmonics){var o=Yn.ConvertCubeMapToSphericalPolynomial(r);e.sphericalPolynomial=o}for(var a=[],s=null,c=0;c<6;c++){if(!i.getCaps().textureFloat){var l=new ArrayBuffer(e._size*e._size*3);s=new Uint8Array(l)}var u=r[t._facesMapping[c]];if(e.gammaSpace||s)for(var h=0;h<e._size*e._size;h++)if(e.gammaSpace&&(u[3*h+0]=Math.pow(u[3*h+0],Nt.b),u[3*h+1]=Math.pow(u[3*h+1],Nt.b),u[3*h+2]=Math.pow(u[3*h+2],Nt.b)),s){var d=Math.max(255*u[3*h+0],0),f=Math.max(255*u[3*h+1],0),p=Math.max(255*u[3*h+2],0),_=Math.max(Math.max(d,f),p);if(_>255){var m=255/_;d*=m,f*=m,p*=m}s[3*h+0]=d,s[3*h+1]=f,s[3*h+2]=p}s?a.push(s):a.push(u)}return a},null,this._onLoad,this._onError)},t.prototype.clone=function(){var e=new t(this.url,this.getScene()||this._getEngine(),this._size,this._noMipmap,this._generateHarmonics,this.gammaSpace);return e.level=this.level,e.wrapU=this.wrapU,e.wrapV=this.wrapV,e.coordinatesIndex=this.coordinatesIndex,e.coordinatesMode=this.coordinatesMode,e},t.prototype.delayLoad=function(){this.delayLoadState===g.a.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=g.a.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap),this._texture||this.loadTexture())},t.prototype.getReflectionTextureMatrix=function(){return this._textureMatrix},t.prototype.setReflectionTextureMatrix=function(e){var t,i=this;this._textureMatrix=e,e.updateFlag!==this._textureMatrix.updateFlag&&e.isIdentity()!==this._textureMatrix.isIdentity()&&(null===(t=this.getScene())||void 0===t||t.markAllMaterialsAsDirty(g.a.MATERIAL_TextureDirtyFlag,function(e){return-1!==e.getActiveTextures().indexOf(i)}))},t.Parse=function(e,i,n){var r=null;return e.name&&!e.isRenderTarget&&((r=new t(n+e.name,i,e.size,e.noMipmap,e.generateHarmonics,e.useInGammaSpace)).name=e.name,r.hasAlpha=e.hasAlpha,r.level=e.level,r.coordinatesMode=e.coordinatesMode,r.isBlocking=e.isBlocking),r&&(e.boundingBoxPosition&&(r.boundingBoxPosition=a.e.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(r.boundingBoxSize=a.e.FromArray(e.boundingBoxSize)),e.rotationY&&(r.rotationY=e.rotationY)),r},t.prototype.serialize=function(){if(!this.name)return null;var e={};return e.name=this.name,e.hasAlpha=this.hasAlpha,e.isCube=!0,e.level=this.level,e.size=this._size,e.coordinatesMode=this.coordinatesMode,e.useInGammaSpace=this.gammaSpace,e.generateHarmonics=this._generateHarmonics,e.customType="BABYLON.HDRCubeTexture",e.noMipmap=this._noMipmap,e.isBlocking=this._isBlocking,e.rotationY=this._rotationY,e},t._facesMapping=["right","left","up","down","front","back"],t}(Hn.a);c.a.RegisteredTypes["BABYLON.HDRCubeTexture"]=Ua;var Va=function(){function e(e,t,i){void 0===t&&(t=0),void 0===i&&(i=null),this.name=e,this.animations=new Array,this._positions=null,this._normals=null,this._tangents=null,this._uvs=null,this._uniqueId=0,this.onInfluenceChanged=new o.c,this._onDataLayoutChanged=new o.c,this._animationPropertiesOverride=null,this._scene=i||x.a.LastCreatedScene,this.influence=t,this._scene&&(this._uniqueId=this._scene.getUniqueId())}return Object.defineProperty(e.prototype,"influence",{get:function(){return this._influence},set:function(e){if(this._influence!==e){var t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers()&&this.onInfluenceChanged.notifyObservers(0===t||0===e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPositions",{get:function(){return!!this._positions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNormals",{get:function(){return!!this._normals},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTangents",{get:function(){return!!this._tangents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasUVs",{get:function(){return!!this._uvs},enumerable:!1,configurable:!0}),e.prototype.setPositions=function(e){var t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getPositions=function(){return this._positions},e.prototype.setNormals=function(e){var t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getNormals=function(){return this._normals},e.prototype.setTangents=function(e){var t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getTangents=function(){return this._tangents},e.prototype.setUVs=function(e){var t=this.hasUVs;this._uvs=e,t!==this.hasUVs&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getUVs=function(){return this._uvs},e.prototype.clone=function(){var t=this,i=w.a.Clone(function(){return new e(t.name,t.influence,t._scene)},this);return i._positions=this._positions,i._normals=this._normals,i._tangents=this._tangents,i._uvs=this._uvs,i},e.prototype.serialize=function(){var e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),null!=this.id&&(e.id=this.id),this.hasNormals&&(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),this.hasUVs&&(e.uvs=Array.prototype.slice.call(this.getUVs())),w.a.AppendSerializedAnimations(this,e),e},e.prototype.getClassName=function(){return"MorphTarget"},e.Parse=function(t){var i=new e(t.name,t.influence);if(i.setPositions(t.positions),null!=t.id&&(i.id=t.id),t.normals&&i.setNormals(t.normals),t.tangents&&i.setTangents(t.tangents),t.uvs&&i.setUVs(t.uvs),t.animations)for(var n=0;n<t.animations.length;n++){var r=t.animations[n],o=c.a.GetClass("BABYLON.Animation");o&&i.animations.push(o.Parse(r))}return i},e.FromMesh=function(t,i,n){i||(i=t.name);var r=new e(i,n,t.getScene());return r.setPositions(t.getVerticesData(ji.b.PositionKind)),t.isVerticesDataPresent(ji.b.NormalKind)&&r.setNormals(t.getVerticesData(ji.b.NormalKind)),t.isVerticesDataPresent(ji.b.TangentKind)&&r.setTangents(t.getVerticesData(ji.b.TangentKind)),t.isVerticesDataPresent(ji.b.UVKind)&&r.setUVs(t.getVerticesData(ji.b.UVKind)),r},Object(h.c)([Object(w.c)()],e.prototype,"id",void 0),e}(),ka=function(){function e(e){void 0===e&&(e=null),this._targets=new Array,this._targetInfluenceChangedObservers=new Array,this._targetDataLayoutChangedObservers=new Array,this._activeTargets=new oi.a(16),this._supportsNormals=!1,this._supportsTangents=!1,this._supportsUVs=!1,this._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,this.enableNormalMorphing=!0,this.enableTangentMorphing=!0,this.enableUVMorphing=!0,e||(e=x.a.LastCreatedScene),this._scene=e,this._scene&&(this._scene.morphTargetManagers.push(this),this._uniqueId=this._scene.getUniqueId())}return Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vertexCount",{get:function(){return this._vertexCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsNormals",{get:function(){return this._supportsNormals&&this.enableNormalMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsTangents",{get:function(){return this._supportsTangents&&this.enableTangentMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsUVs",{get:function(){return this._supportsUVs&&this.enableUVMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numTargets",{get:function(){return this._targets.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numInfluencers",{get:function(){return this._activeTargets.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"influences",{get:function(){return this._influences},enumerable:!1,configurable:!0}),e.prototype.getActiveTarget=function(e){return this._activeTargets.data[e]},e.prototype.getTarget=function(e){return this._targets[e]},e.prototype.addTarget=function(e){var t=this;this._targets.push(e),this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add(function(e){t._syncActiveTargets(e)})),this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add(function(){t._syncActiveTargets(!0)})),this._syncActiveTargets(!0)},e.prototype.removeTarget=function(e){var t=this._targets.indexOf(e);t>=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._syncActiveTargets(!0))},e.prototype.clone=function(){for(var t=new e(this._scene),i=0,n=this._targets;i<n.length;i++){var r=n[i];t.addTarget(r.clone())}return t.enableNormalMorphing=this.enableNormalMorphing,t.enableTangentMorphing=this.enableTangentMorphing,t.enableUVMorphing=this.enableUVMorphing,t},e.prototype.serialize=function(){var e={};e.id=this.uniqueId,e.targets=[];for(var t=0,i=this._targets;t<i.length;t++){var n=i[t];e.targets.push(n.serialize())}return e},e.prototype._syncActiveTargets=function(e){var t=0;this._activeTargets.reset(),this._supportsNormals=!0,this._supportsTangents=!0,this._supportsUVs=!0,this._vertexCount=0;for(var i=0,n=this._targets;i<n.length;i++){var r=n[i];if(0!==r.influence){this._activeTargets.push(r),this._tempInfluences[t++]=r.influence,this._supportsNormals=this._supportsNormals&&r.hasNormals,this._supportsTangents=this._supportsTangents&&r.hasTangents,this._supportsUVs=this._supportsUVs&&r.hasUVs;var o=r.getPositions();if(o){var a=o.length/3;if(0===this._vertexCount)this._vertexCount=a;else if(this._vertexCount!==a)return void m.a.Error("Incompatible target. Targets must all have the same vertices count.")}}}this._influences&&this._influences.length===t||(this._influences=new Float32Array(t));for(var s=0;s<t;s++)this._influences[s]=this._tempInfluences[s];e&&this.synchronize()},e.prototype.synchronize=function(){if(this._scene)for(var e=0,t=this._scene.meshes;e<t.length;e++){var i=t[e];i.morphTargetManager===this&&i._syncGeometryWithMorphTargetManager()}},e.Parse=function(t,i){var n=new e(i);n._uniqueId=t.id;for(var r=0,o=t.targets;r<o.length;r++){var a=o[r];n.addTarget(Va.Parse(a))}return n},e}(),Ga=i(32),za=i(50),ja=function(){function e(t,i){if(void 0===i&&(i=e.DefaultPluginFactory()),this._physicsPlugin=i,this._impostors=[],this._joints=[],this._subTimeStep=0,!this._physicsPlugin.isSupported())throw new Error("Physics Engine "+this._physicsPlugin.name+" cannot be found. Please make sure it is included.");t=t||new a.e(0,-9.807,0),this.setGravity(t),this.setTimeStep()}return e.DefaultPluginFactory=function(){throw Re.a.WarnImport("CannonJSPlugin")},e.prototype.setGravity=function(e){this.gravity=e,this._physicsPlugin.setGravity(this.gravity)},e.prototype.setTimeStep=function(e){void 0===e&&(e=1/60),this._physicsPlugin.setTimeStep(e)},e.prototype.getTimeStep=function(){return this._physicsPlugin.getTimeStep()},e.prototype.setSubTimeStep=function(e){void 0===e&&(e=0),this._subTimeStep=e},e.prototype.getSubTimeStep=function(){return this._subTimeStep},e.prototype.dispose=function(){this._impostors.forEach(function(e){e.dispose()}),this._physicsPlugin.dispose()},e.prototype.getPhysicsPluginName=function(){return this._physicsPlugin.name},e.prototype.addImpostor=function(e){e.uniqueId=this._impostors.push(e),e.parent||this._physicsPlugin.generatePhysicsBody(e)},e.prototype.removeImpostor=function(e){var t=this._impostors.indexOf(e);t>-1&&this._impostors.splice(t,1).length&&this.getPhysicsPlugin().removePhysicsBody(e)},e.prototype.addJoint=function(e,t,i){var n={mainImpostor:e,connectedImpostor:t,joint:i};i.physicsPlugin=this._physicsPlugin,this._joints.push(n),this._physicsPlugin.generateJoint(n)},e.prototype.removeJoint=function(e,t,i){var n=this._joints.filter(function(n){return n.connectedImpostor===t&&n.joint===i&&n.mainImpostor===e});n.length&&this._physicsPlugin.removeJoint(n[0])},e.prototype._step=function(e){var t=this;this._impostors.forEach(function(e){e.isBodyInitRequired()&&t._physicsPlugin.generatePhysicsBody(e)}),e>.1?e=.1:e<=0&&(e=1/60),this._physicsPlugin.executeStep(e,this._impostors)},e.prototype.getPhysicsPlugin=function(){return this._physicsPlugin},e.prototype.getImpostors=function(){return this._impostors},e.prototype.getImpostorForPhysicsObject=function(e){for(var t=0;t<this._impostors.length;++t)if(this._impostors[t].object===e)return this._impostors[t];return null},e.prototype.getImpostorWithPhysicsBody=function(e){for(var t=0;t<this._impostors.length;++t)if(this._impostors[t].physicsBody===e)return this._impostors[t];return null},e.prototype.raycast=function(e,t){return this._physicsPlugin.raycast(e,t)},e.Epsilon=.001,e}(),Wa=function(){function e(){this._hasHit=!1,this._hitDistance=0,this._hitNormalWorld=a.e.Zero(),this._hitPointWorld=a.e.Zero(),this._rayFromWorld=a.e.Zero(),this._rayToWorld=a.e.Zero()}return Object.defineProperty(e.prototype,"hasHit",{get:function(){return this._hasHit},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hitDistance",{get:function(){return this._hitDistance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hitNormalWorld",{get:function(){return this._hitNormalWorld},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hitPointWorld",{get:function(){return this._hitPointWorld},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rayFromWorld",{get:function(){return this._rayFromWorld},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rayToWorld",{get:function(){return this._rayToWorld},enumerable:!1,configurable:!0}),e.prototype.setHitData=function(e,t){this._hasHit=!0,this._hitNormalWorld=new a.e(e.x,e.y,e.z),this._hitPointWorld=new a.e(t.x,t.y,t.z)},e.prototype.setHitDistance=function(e){this._hitDistance=e},e.prototype.calculateHitDistance=function(){this._hitDistance=a.e.Distance(this._rayFromWorld,this._hitPointWorld)},e.prototype.reset=function(e,t){void 0===e&&(e=a.e.Zero()),void 0===t&&(t=a.e.Zero()),this._rayFromWorld=e,this._rayToWorld=t,this._hasHit=!1,this._hitDistance=0,this._hitNormalWorld=a.e.Zero(),this._hitPointWorld=a.e.Zero()},e}(),Ha=function(){function e(e,t,i){void 0===e&&(e=!0),void 0===t&&(t=10),void 0===i&&(i=CANNON),this._useDeltaForWorldStep=e,this.name="CannonJSPlugin",this._physicsMaterials=new Array,this._fixedTimeStep=1/60,this._physicsBodysToRemoveAfterStep=new Array,this._firstFrame=!0,this._minus90X=new a.b(-.7071067811865475,0,0,.7071067811865475),this._plus90X=new a.b(.7071067811865475,0,0,.7071067811865475),this._tmpPosition=a.e.Zero(),this._tmpDeltaPosition=a.e.Zero(),this._tmpUnityRotation=new a.b,this.BJSCANNON=i,this.isSupported()?(this._extendNamespace(),this.world=new this.BJSCANNON.World,this.world.broadphase=new this.BJSCANNON.NaiveBroadphase,this.world.solver.iterations=t,this._cannonRaycastResult=new this.BJSCANNON.RaycastResult,this._raycastResult=new Wa):m.a.Error("CannonJS is not available. Please make sure you included the js file.")}return e.prototype.setGravity=function(e){var t=e;this.world.gravity.set(t.x,t.y,t.z)},e.prototype.setTimeStep=function(e){this._fixedTimeStep=e},e.prototype.getTimeStep=function(){return this._fixedTimeStep},e.prototype.executeStep=function(e,t){if(this._firstFrame){this._firstFrame=!1;for(var i=0,n=t;i<n.length;i++){var r=n[i];r.type!=Ga.a.HeightmapImpostor&&r.type!==Ga.a.PlaneImpostor&&r.beforeStep()}}this.world.step(this._useDeltaForWorldStep?e:this._fixedTimeStep),this._removeMarkedPhysicsBodiesFromWorld()},e.prototype._removeMarkedPhysicsBodiesFromWorld=function(){var e=this;this._physicsBodysToRemoveAfterStep.length>0&&(this._physicsBodysToRemoveAfterStep.forEach(function(t){e.world.remove(t)}),this._physicsBodysToRemoveAfterStep=[])},e.prototype.applyImpulse=function(e,t,i){var n=new this.BJSCANNON.Vec3(i.x,i.y,i.z),r=new this.BJSCANNON.Vec3(t.x,t.y,t.z);e.physicsBody.applyImpulse(r,n)},e.prototype.applyForce=function(e,t,i){var n=new this.BJSCANNON.Vec3(i.x,i.y,i.z),r=new this.BJSCANNON.Vec3(t.x,t.y,t.z);e.physicsBody.applyForce(r,n)},e.prototype.generatePhysicsBody=function(e){if(this._removeMarkedPhysicsBodiesFromWorld(),e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){var t=this._createShape(e),i=e.physicsBody;i&&this.removePhysicsBody(e);var n=this._addMaterial("mat-"+e.uniqueId,e.getParam("friction"),e.getParam("restitution")),r={mass:e.getParam("mass"),material:n},o=e.getParam("nativeOptions");for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a]);e.physicsBody=new this.BJSCANNON.Body(r),e.physicsBody.addEventListener("collide",e.onCollide),this.world.addEventListener("preStep",e.beforeStep),this.world.addEventListener("postStep",e.afterStep),e.physicsBody.addShape(t),this.world.add(e.physicsBody),i&&["force","torque","velocity","angularVelocity"].forEach(function(t){var n=i[t];e.physicsBody[t].set(n.x,n.y,n.z)}),this._processChildMeshes(e)}this._updatePhysicsBodyTransformation(e)}},e.prototype._processChildMeshes=function(e){var t=this,i=e.object.getChildMeshes?e.object.getChildMeshes(!0):[],n=e.object.rotationQuaternion;if(i.length){var r=function(i){if(n&&i.rotationQuaternion){var o=i.getPhysicsImpostor();if(o&&o.parent!==e){var a=i.getAbsolutePosition().subtract(i.parent.getAbsolutePosition()),s=i.rotationQuaternion;o.physicsBody&&(t.removePhysicsBody(o),o.physicsBody=null),o.parent=e,o.resetUpdateFlags(),e.physicsBody.addShape(t._createShape(o),new t.BJSCANNON.Vec3(a.x,a.y,a.z),new t.BJSCANNON.Quaternion(s.x,s.y,s.z,s.w)),e.physicsBody.mass+=o.getParam("mass")}n.multiplyInPlace(i.rotationQuaternion),i.getChildMeshes(!0).filter(function(e){return!!e.physicsImpostor}).forEach(r)}};i.filter(function(e){return!!e.physicsImpostor}).forEach(r)}},e.prototype.removePhysicsBody=function(e){e.physicsBody.removeEventListener("collide",e.onCollide),this.world.removeEventListener("preStep",e.beforeStep),this.world.removeEventListener("postStep",e.afterStep),-1===this._physicsBodysToRemoveAfterStep.indexOf(e.physicsBody)&&this._physicsBodysToRemoveAfterStep.push(e.physicsBody)},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,i=e.connectedImpostor.physicsBody;if(t&&i){var n,r=e.joint.jointData,o={pivotA:r.mainPivot?(new this.BJSCANNON.Vec3).set(r.mainPivot.x,r.mainPivot.y,r.mainPivot.z):null,pivotB:r.connectedPivot?(new this.BJSCANNON.Vec3).set(r.connectedPivot.x,r.connectedPivot.y,r.connectedPivot.z):null,axisA:r.mainAxis?(new this.BJSCANNON.Vec3).set(r.mainAxis.x,r.mainAxis.y,r.mainAxis.z):null,axisB:r.connectedAxis?(new this.BJSCANNON.Vec3).set(r.connectedAxis.x,r.connectedAxis.y,r.connectedAxis.z):null,maxForce:r.nativeParams.maxForce,collideConnected:!!r.collision};switch(e.joint.type){case za.e.HingeJoint:case za.e.Hinge2Joint:n=new this.BJSCANNON.HingeConstraint(t,i,o);break;case za.e.DistanceJoint:n=new this.BJSCANNON.DistanceConstraint(t,i,r.maxDistance||2);break;case za.e.SpringJoint:var a=r;n=new this.BJSCANNON.Spring(t,i,{restLength:a.length,stiffness:a.stiffness,damping:a.damping,localAnchorA:o.pivotA,localAnchorB:o.pivotB});break;case za.e.LockJoint:n=new this.BJSCANNON.LockConstraint(t,i,o);break;case za.e.PointToPointJoint:case za.e.BallAndSocketJoint:default:n=new this.BJSCANNON.PointToPointConstraint(t,o.pivotA,i,o.pivotB,o.maxForce)}n.collideConnected=!!r.collision,e.joint.physicsJoint=n,e.joint.type!==za.e.SpringJoint?this.world.addConstraint(n):(e.joint.jointData.forceApplicationCallback=e.joint.jointData.forceApplicationCallback||function(){n.applyForce()},e.mainImpostor.registerAfterPhysicsStep(e.joint.jointData.forceApplicationCallback))}},e.prototype.removeJoint=function(e){e.joint.type!==za.e.SpringJoint?this.world.removeConstraint(e.joint.physicsJoint):e.mainImpostor.unregisterAfterPhysicsStep(e.joint.jointData.forceApplicationCallback)},e.prototype._addMaterial=function(e,t,i){var n,r;for(n=0;n<this._physicsMaterials.length;n++)if((r=this._physicsMaterials[n]).friction===t&&r.restitution===i)return r;var o=new this.BJSCANNON.Material(e);return o.friction=t,o.restitution=i,this._physicsMaterials.push(o),o},e.prototype._checkWithEpsilon=function(e){return e<ja.Epsilon?ja.Epsilon:e},e.prototype._createShape=function(e){var t,i=e.object,n=e.getObjectExtendSize();switch(e.type){case Ga.a.SphereImpostor:var r=n.x,o=n.y,s=n.z;t=new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(r),this._checkWithEpsilon(o),this._checkWithEpsilon(s))/2);break;case Ga.a.CylinderImpostor:var c=e.getParam("nativeOptions");c||(c={});var l=void 0!==c.radiusTop?c.radiusTop:this._checkWithEpsilon(n.x)/2,u=void 0!==c.radiusBottom?c.radiusBottom:this._checkWithEpsilon(n.x)/2,h=void 0!==c.height?c.height:this._checkWithEpsilon(n.y),d=void 0!==c.numSegments?c.numSegments:16;t=new this.BJSCANNON.Cylinder(l,u,h,d);var f=new this.BJSCANNON.Quaternion;f.setFromAxisAngle(new this.BJSCANNON.Vec3(1,0,0),-Math.PI/2);var p=new this.BJSCANNON.Vec3(0,0,0);t.transformAllPoints(p,f);break;case Ga.a.BoxImpostor:var _=n.scale(.5);t=new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(_.x),this._checkWithEpsilon(_.y),this._checkWithEpsilon(_.z)));break;case Ga.a.PlaneImpostor:m.a.Warn("Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead"),t=new this.BJSCANNON.Plane;break;case Ga.a.MeshImpostor:var g=i.getVerticesData?i.getVerticesData(ji.b.PositionKind):[],v=i.getIndices?i.getIndices():[];if(!g)return;var b=i.position.clone(),y=i.rotation&&i.rotation.clone(),T=i.rotationQuaternion&&i.rotationQuaternion.clone();i.position.copyFromFloats(0,0,0),i.rotation&&i.rotation.copyFromFloats(0,0,0),i.rotationQuaternion&&i.rotationQuaternion.copyFrom(e.getParentsRotation()),i.rotationQuaternion&&i.parent&&i.rotationQuaternion.conjugateInPlace();var E,S=i.computeWorldMatrix(!0),A=new Array;for(E=0;E<g.length;E+=3)a.e.TransformCoordinates(a.e.FromArray(g,E),S).toArray(A,E);m.a.Warn("MeshImpostor only collides against spheres."),t=new this.BJSCANNON.Trimesh(A,v),i.position.copyFrom(b),y&&i.rotation&&i.rotation.copyFrom(y),T&&i.rotationQuaternion&&i.rotationQuaternion.copyFrom(T);break;case Ga.a.HeightmapImpostor:var P=i.position.clone(),C=i.rotation&&i.rotation.clone(),R=i.rotationQuaternion&&i.rotationQuaternion.clone();i.position.copyFromFloats(0,0,0),i.rotation&&i.rotation.copyFromFloats(0,0,0),i.rotationQuaternion&&i.rotationQuaternion.copyFrom(e.getParentsRotation()),i.rotationQuaternion&&i.parent&&i.rotationQuaternion.conjugateInPlace(),i.rotationQuaternion&&i.rotationQuaternion.multiplyInPlace(this._minus90X),t=this._createHeightmap(i),i.position.copyFrom(P),C&&i.rotation&&i.rotation.copyFrom(C),R&&i.rotationQuaternion&&i.rotationQuaternion.copyFrom(R),i.computeWorldMatrix(!0);break;case Ga.a.ParticleImpostor:t=new this.BJSCANNON.Particle;break;case Ga.a.NoImpostor:t=new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0,0,0))}return t},e.prototype._createHeightmap=function(e,t){var i,n=e.getVerticesData(ji.b.PositionKind),r=e.computeWorldMatrix(!0),o=new Array;for(i=0;i<n.length;i+=3)a.e.TransformCoordinates(a.e.FromArray(n,i),r).toArray(o,i);n=o;for(var s=new Array,c=t||~~(Math.sqrt(n.length/3)-1),l=e.getBoundingInfo(),u=Math.min(l.boundingBox.extendSizeWorld.x,l.boundingBox.extendSizeWorld.y),h=l.boundingBox.extendSizeWorld.z,d=2*u/c,f=0;f<n.length;f+=3){var p=Math.round(n[f+0]/d+c/2),_=Math.round(-1*(n[f+1]/d-c/2)),m=-n[f+2]+h;s[p]||(s[p]=[]),s[p][_]||(s[p][_]=m),s[p][_]=Math.max(m,s[p][_])}for(p=0;p<=c;++p){if(!s[p]){for(var g=1;!s[(p+g)%c];)g++;s[p]=s[(p+g)%c].slice()}for(_=0;_<=c;++_)if(!s[p][_]){var v;for(g=1;void 0===v;)v=s[p][(_+g++)%c];s[p][_]=v}}var b=new this.BJSCANNON.Heightfield(s,{elementSize:d});return b.minY=h,b},e.prototype._updatePhysicsBodyTransformation=function(e){var t=e.object;if(t.computeWorldMatrix&&t.computeWorldMatrix(!0),t.getBoundingInfo()){var i=e.getObjectCenter();this._tmpDeltaPosition.copyFrom(t.getAbsolutePivotPoint().subtract(i)),this._tmpDeltaPosition.divideInPlace(e.object.scaling),this._tmpPosition.copyFrom(i);var n=t.rotationQuaternion;if(n){if(e.type!==Ga.a.PlaneImpostor&&e.type!==Ga.a.HeightmapImpostor||(n=n.multiply(this._minus90X),e.setDeltaRotation(this._plus90X)),e.type===Ga.a.HeightmapImpostor){var r=t,o=r.getBoundingInfo(),s=r.rotationQuaternion;r.rotationQuaternion=this._tmpUnityRotation,r.computeWorldMatrix(!0);var c=i.clone(),l=r.getPivotMatrix();l=l?l.clone():a.a.Identity();var u=a.a.Translation(o.boundingBox.extendSizeWorld.x,0,-o.boundingBox.extendSizeWorld.z);r.setPreTransformMatrix(u),r.computeWorldMatrix(!0);var h=o.boundingBox.centerWorld.subtract(i).subtract(r.position).negate();this._tmpPosition.copyFromFloats(h.x,h.y-o.boundingBox.extendSizeWorld.y,h.z),this._tmpDeltaPosition.copyFrom(o.boundingBox.centerWorld.subtract(c)),this._tmpDeltaPosition.y+=o.boundingBox.extendSizeWorld.y,r.rotationQuaternion=s,r.setPreTransformMatrix(l),r.computeWorldMatrix(!0)}else e.type===Ga.a.MeshImpostor&&this._tmpDeltaPosition.copyFromFloats(0,0,0);e.setDeltaPosition(this._tmpDeltaPosition),e.physicsBody.position.set(this._tmpPosition.x,this._tmpPosition.y,this._tmpPosition.z),e.physicsBody.quaternion.set(n.x,n.y,n.z,n.w)}}},e.prototype.setTransformationFromPhysicsBody=function(e){if(e.object.position.set(e.physicsBody.position.x,e.physicsBody.position.y,e.physicsBody.position.z),e.object.rotationQuaternion){var t=e.physicsBody.quaternion;e.object.rotationQuaternion.set(t.x,t.y,t.z,t.w)}},e.prototype.setPhysicsBodyTransformation=function(e,t,i){e.physicsBody.position.set(t.x,t.y,t.z),e.physicsBody.quaternion.set(i.x,i.y,i.z,i.w)},e.prototype.isSupported=function(){return void 0!==this.BJSCANNON},e.prototype.setLinearVelocity=function(e,t){e.physicsBody.velocity.set(t.x,t.y,t.z)},e.prototype.setAngularVelocity=function(e,t){e.physicsBody.angularVelocity.set(t.x,t.y,t.z)},e.prototype.getLinearVelocity=function(e){var t=e.physicsBody.velocity;return t?new a.e(t.x,t.y,t.z):null},e.prototype.getAngularVelocity=function(e){var t=e.physicsBody.angularVelocity;return t?new a.e(t.x,t.y,t.z):null},e.prototype.setBodyMass=function(e,t){e.physicsBody.mass=t,e.physicsBody.updateMassProperties()},e.prototype.getBodyMass=function(e){return e.physicsBody.mass},e.prototype.getBodyFriction=function(e){return e.physicsBody.material.friction},e.prototype.setBodyFriction=function(e,t){e.physicsBody.material.friction=t},e.prototype.getBodyRestitution=function(e){return e.physicsBody.material.restitution},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.material.restitution=t},e.prototype.sleepBody=function(e){e.physicsBody.sleep()},e.prototype.wakeUpBody=function(e){e.physicsBody.wakeUp()},e.prototype.updateDistanceJoint=function(e,t){e.physicsJoint.distance=t},e.prototype.setMotor=function(e,t,i,n){n||(e.physicsJoint.enableMotor(),e.physicsJoint.setMotorSpeed(t),i&&this.setLimit(e,i))},e.prototype.setLimit=function(e,t,i){e.physicsJoint.motorEquation.maxForce=t,e.physicsJoint.motorEquation.minForce=void 0===i?-t:i},e.prototype.syncMeshWithImpostor=function(e,t){var i=t.physicsBody;e.position.x=i.position.x,e.position.y=i.position.y,e.position.z=i.position.z,e.rotationQuaternion&&(e.rotationQuaternion.x=i.quaternion.x,e.rotationQuaternion.y=i.quaternion.y,e.rotationQuaternion.z=i.quaternion.z,e.rotationQuaternion.w=i.quaternion.w)},e.prototype.getRadius=function(e){return e.physicsBody.shapes[0].boundingSphereRadius},e.prototype.getBoxSizeToRef=function(e,t){var i=e.physicsBody.shapes[0];t.x=2*i.halfExtents.x,t.y=2*i.halfExtents.y,t.z=2*i.halfExtents.z},e.prototype.dispose=function(){},e.prototype._extendNamespace=function(){var e=new this.BJSCANNON.Vec3,t=this.BJSCANNON;this.BJSCANNON.World.prototype.step=function(i,n,r){if(r=r||10,0===(n=n||0))this.internalStep(i),this.time+=i;else{var o=Math.floor((this.time+n)/i)-Math.floor(this.time/i);o=Math.min(o,r)||1;for(var a=performance.now(),s=0;s!==o&&(this.internalStep(i),!(performance.now()-a>1e3*i));s++);this.time+=n;for(var c=this.time%i/i,l=e,u=this.bodies,h=0;h!==u.length;h++){var d=u[h];d.type!==t.Body.STATIC&&d.sleepState!==t.Body.SLEEPING?(d.position.vsub(d.previousPosition,l),l.scale(c,l),d.position.vadd(l,d.interpolatedPosition)):(d.interpolatedPosition.set(d.position.x,d.position.y,d.position.z),d.interpolatedQuaternion.set(d.quaternion.x,d.quaternion.y,d.quaternion.z,d.quaternion.w))}}}},e.prototype.raycast=function(e,t){return this._cannonRaycastResult.reset(),this.world.raycastClosest(e,t,{},this._cannonRaycastResult),this._raycastResult.reset(e,t),this._cannonRaycastResult.hasHit&&(this._raycastResult.setHitData({x:this._cannonRaycastResult.hitNormalWorld.x,y:this._cannonRaycastResult.hitNormalWorld.y,z:this._cannonRaycastResult.hitNormalWorld.z},{x:this._cannonRaycastResult.hitPointWorld.x,y:this._cannonRaycastResult.hitPointWorld.y,z:this._cannonRaycastResult.hitPointWorld.z}),this._raycastResult.setHitDistance(this._cannonRaycastResult.distance)),this._raycastResult},e}();ja.DefaultPluginFactory=function(){return new Ha};var Xa=function(){function e(e,t,i){void 0===e&&(e=!0),void 0===i&&(i=OIMO),this._useDeltaForWorldStep=e,this.name="OimoJSPlugin",this._fixedTimeStep=1/60,this._tmpImpostorsArray=[],this._tmpPositionVector=a.e.Zero(),this.BJSOIMO=i,this.world=new this.BJSOIMO.World({iterations:t}),this.world.clear(),this._raycastResult=new Wa}return e.prototype.setGravity=function(e){this.world.gravity.set(e.x,e.y,e.z)},e.prototype.setTimeStep=function(e){this.world.timeStep=e},e.prototype.getTimeStep=function(){return this.world.timeStep},e.prototype.executeStep=function(e,t){var i=this;t.forEach(function(e){e.beforeStep()}),this.world.timeStep=this._useDeltaForWorldStep?e:this._fixedTimeStep,this.world.step(),t.forEach(function(e){e.afterStep(),i._tmpImpostorsArray[e.uniqueId]=e});for(var n=this.world.contacts;null!==n;)if(!n.touching||n.body1.sleeping||n.body2.sleeping){var r=this._tmpImpostorsArray[+n.body1.name],o=this._tmpImpostorsArray[+n.body2.name];r&&o?(r.onCollide({body:o.physicsBody,point:null}),o.onCollide({body:r.physicsBody,point:null}),n=n.next):n=n.next}else n=n.next},e.prototype.applyImpulse=function(e,t,i){var n=e.physicsBody.mass;e.physicsBody.applyImpulse(i.scale(this.world.invScale),t.scale(this.world.invScale*n))},e.prototype.applyForce=function(e,t,i){m.a.Warn("Oimo doesn't support applying force. Using impule instead."),this.applyImpulse(e,t,i)},e.prototype.generatePhysicsBody=function(e){var t=this;if(e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){var i={name:e.uniqueId,config:[e.getParam("mass")||.001,e.getParam("friction"),e.getParam("restitution")],size:[],type:[],pos:[],posShape:[],rot:[],rotShape:[],move:0!==e.getParam("mass"),density:e.getParam("mass"),friction:e.getParam("friction"),restitution:e.getParam("restitution"),world:this.world},n=[e];(s=e.object).getChildMeshes&&s.getChildMeshes().forEach(function(e){e.physicsImpostor&&n.push(e.physicsImpostor)});var r=function(e){return Math.max(e,ja.Epsilon)},o=new a.b;n.forEach(function(n){if(n.object.rotationQuaternion){var a=n.object.rotationQuaternion;o.copyFrom(a),n.object.rotationQuaternion.set(0,0,0,1),n.object.computeWorldMatrix(!0);var s=o.toEulerAngles(),c=n.getObjectExtendSize();if(n===e){var l=e.getObjectCenter();e.object.getAbsolutePivotPoint().subtractToRef(l,t._tmpPositionVector),t._tmpPositionVector.divideInPlace(e.object.scaling),i.pos.push(l.x),i.pos.push(l.y),i.pos.push(l.z),i.posShape.push(0,0,0),i.rotShape.push(0,0,0)}else{var u=n.object.position.clone();i.posShape.push(u.x),i.posShape.push(u.y),i.posShape.push(u.z),i.rotShape.push(57.29577951308232*s.x,57.29577951308232*s.y,57.29577951308232*s.z)}switch(n.object.rotationQuaternion.copyFrom(o),n.type){case Ga.a.ParticleImpostor:m.a.Warn("No Particle support in OIMO.js. using SphereImpostor instead");case Ga.a.SphereImpostor:var h=c.x,d=c.y,f=c.z,p=Math.max(r(h),r(d),r(f))/2;i.type.push("sphere"),i.size.push(p),i.size.push(p),i.size.push(p);break;case Ga.a.CylinderImpostor:var _=r(c.x)/2,g=r(c.y);i.type.push("cylinder"),i.size.push(_),i.size.push(g),i.size.push(g);break;case Ga.a.PlaneImpostor:case Ga.a.BoxImpostor:default:_=r(c.x),g=r(c.y);var v=r(c.z);i.type.push("box"),i.size.push(_),i.size.push(g),i.size.push(v)}n.object.rotationQuaternion=a}}),e.physicsBody=this.world.add(i),e.physicsBody.resetQuaternion(o),e.physicsBody.updatePosition(0)}else this._tmpPositionVector.copyFromFloats(0,0,0);var s;e.setDeltaPosition(this._tmpPositionVector)}},e.prototype.removePhysicsBody=function(e){this.world.removeRigidBody(e.physicsBody)},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,i=e.connectedImpostor.physicsBody;if(t&&i){var n,r=e.joint.jointData,o=r.nativeParams||{},a={body1:t,body2:i,axe1:o.axe1||(r.mainAxis?r.mainAxis.asArray():null),axe2:o.axe2||(r.connectedAxis?r.connectedAxis.asArray():null),pos1:o.pos1||(r.mainPivot?r.mainPivot.asArray():null),pos2:o.pos2||(r.connectedPivot?r.connectedPivot.asArray():null),min:o.min,max:o.max,collision:o.collision||r.collision,spring:o.spring,world:this.world};switch(e.joint.type){case za.e.BallAndSocketJoint:n="jointBall";break;case za.e.SpringJoint:m.a.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");var s=r;a.min=s.length||a.min,a.max=Math.max(a.min,a.max);case za.e.DistanceJoint:n="jointDistance",a.max=r.maxDistance;break;case za.e.PrismaticJoint:n="jointPrisme";break;case za.e.SliderJoint:n="jointSlide";break;case za.e.WheelJoint:n="jointWheel";break;case za.e.HingeJoint:default:n="jointHinge"}a.type=n,e.joint.physicsJoint=this.world.add(a)}},e.prototype.removeJoint=function(e){try{this.world.removeJoint(e.joint.physicsJoint)}catch(e){m.a.Warn(e)}},e.prototype.isSupported=function(){return void 0!==this.BJSOIMO},e.prototype.setTransformationFromPhysicsBody=function(e){if(!e.physicsBody.sleeping){if(e.physicsBody.shapes.next){for(var t=e.physicsBody.shapes;t.next;)t=t.next;e.object.position.set(t.position.x,t.position.y,t.position.z)}else{var i=e.physicsBody.getPosition();e.object.position.set(i.x,i.y,i.z)}if(e.object.rotationQuaternion){var n=e.physicsBody.getQuaternion();e.object.rotationQuaternion.set(n.x,n.y,n.z,n.w)}}},e.prototype.setPhysicsBodyTransformation=function(e,t,i){var n=e.physicsBody;e.physicsBody.shapes.next||(n.position.set(t.x,t.y,t.z),n.orientation.set(i.x,i.y,i.z,i.w),n.syncShapes(),n.awake())},e.prototype.setLinearVelocity=function(e,t){e.physicsBody.linearVelocity.set(t.x,t.y,t.z)},e.prototype.setAngularVelocity=function(e,t){e.physicsBody.angularVelocity.set(t.x,t.y,t.z)},e.prototype.getLinearVelocity=function(e){var t=e.physicsBody.linearVelocity;return t?new a.e(t.x,t.y,t.z):null},e.prototype.getAngularVelocity=function(e){var t=e.physicsBody.angularVelocity;return t?new a.e(t.x,t.y,t.z):null},e.prototype.setBodyMass=function(e,t){var i=0===t;e.physicsBody.shapes.density=i?1:t,e.physicsBody.setupMass(i?2:1)},e.prototype.getBodyMass=function(e){return e.physicsBody.shapes.density},e.prototype.getBodyFriction=function(e){return e.physicsBody.shapes.friction},e.prototype.setBodyFriction=function(e,t){e.physicsBody.shapes.friction=t},e.prototype.getBodyRestitution=function(e){return e.physicsBody.shapes.restitution},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.shapes.restitution=t},e.prototype.sleepBody=function(e){e.physicsBody.sleep()},e.prototype.wakeUpBody=function(e){e.physicsBody.awake()},e.prototype.updateDistanceJoint=function(e,t,i){e.physicsJoint.limitMotor.upperLimit=t,void 0!==i&&(e.physicsJoint.limitMotor.lowerLimit=i)},e.prototype.setMotor=function(e,t,i,n){void 0!==i?m.a.Warn("OimoJS plugin currently has unexpected behavior when using setMotor with force parameter"):i=1e6,t*=-1;var r=n?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;r&&r.setMotor(t,i)},e.prototype.setLimit=function(e,t,i,n){var r=n?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;r&&r.setLimit(t,void 0===i?-t:i)},e.prototype.syncMeshWithImpostor=function(e,t){var i=t.physicsBody;e.position.x=i.position.x,e.position.y=i.position.y,e.position.z=i.position.z,e.rotationQuaternion&&(e.rotationQuaternion.x=i.orientation.x,e.rotationQuaternion.y=i.orientation.y,e.rotationQuaternion.z=i.orientation.z,e.rotationQuaternion.w=i.orientation.s)},e.prototype.getRadius=function(e){return e.physicsBody.shapes.radius},e.prototype.getBoxSizeToRef=function(e,t){var i=e.physicsBody.shapes;t.x=2*i.halfWidth,t.y=2*i.halfHeight,t.z=2*i.halfDepth},e.prototype.dispose=function(){this.world.clear()},e.prototype.raycast=function(e,t){return m.a.Warn("raycast is not currently supported by the Oimo physics plugin"),this._raycastResult.reset(e,t),this._raycastResult},e}(),Ya=i(97),Ka=function(){function e(e,t,i){var n=this;void 0===e&&(e=!0),void 0===t&&(t=Ammo),void 0===i&&(i=null),this._useDeltaForWorldStep=e,this.bjsAMMO={},this.name="AmmoJSPlugin",this._timeStep=1/60,this._fixedTimeStep=1/60,this._maxSteps=5,this._tmpQuaternion=new a.b,this._tmpContactCallbackResult=!1,this._tmpContactPoint=new a.e,this._tmpMatrix=new a.a,"function"==typeof t?t(this.bjsAMMO):this.bjsAMMO=t,this.isSupported()?(this._collisionConfiguration=new this.bjsAMMO.btSoftBodyRigidBodyCollisionConfiguration,this._dispatcher=new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration),this._overlappingPairCache=i||new this.bjsAMMO.btDbvtBroadphase,this._solver=new this.bjsAMMO.btSequentialImpulseConstraintSolver,this._softBodySolver=new this.bjsAMMO.btDefaultSoftBodySolver,this.world=new this.bjsAMMO.btSoftRigidDynamicsWorld(this._dispatcher,this._overlappingPairCache,this._solver,this._collisionConfiguration,this._softBodySolver),this._tmpAmmoConcreteContactResultCallback=new this.bjsAMMO.ConcreteContactResultCallback,this._tmpAmmoConcreteContactResultCallback.addSingleResult=function(e,t,i,r){var o=(e=n.bjsAMMO.wrapPointer(e,Ammo.btManifoldPoint)).getPositionWorldOnA();n._tmpContactPoint.x=o.x(),n._tmpContactPoint.y=o.y(),n._tmpContactPoint.z=o.z(),n._tmpContactCallbackResult=!0},this._raycastResult=new Wa,this._tmpAmmoTransform=new this.bjsAMMO.btTransform,this._tmpAmmoTransform.setIdentity(),this._tmpAmmoQuaternion=new this.bjsAMMO.btQuaternion(0,0,0,1),this._tmpAmmoVectorA=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorB=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorC=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorD=new this.bjsAMMO.btVector3(0,0,0)):m.a.Error("AmmoJS is not available. Please make sure you included the js file.")}return e.prototype.setGravity=function(e){this._tmpAmmoVectorA.setValue(e.x,e.y,e.z),this.world.setGravity(this._tmpAmmoVectorA),this.world.getWorldInfo().set_m_gravity(this._tmpAmmoVectorA)},e.prototype.setTimeStep=function(e){this._timeStep=e},e.prototype.setFixedTimeStep=function(e){this._fixedTimeStep=e},e.prototype.setMaxSteps=function(e){this._maxSteps=e},e.prototype.getTimeStep=function(){return this._timeStep},e.prototype._isImpostorInContact=function(e){return this._tmpContactCallbackResult=!1,this.world.contactTest(e.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult},e.prototype._isImpostorPairInContact=function(e,t){return this._tmpContactCallbackResult=!1,this.world.contactPairTest(e.physicsBody,t.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult},e.prototype._stepSimulation=function(e,t,i){if(void 0===e&&(e=1/60),void 0===t&&(t=10),void 0===i&&(i=1/60),0==t)this.world.stepSimulation(e,0);else for(;t>0&&e>0;)e-i<i?(this.world.stepSimulation(e,0),e=0):(e-=i,this.world.stepSimulation(i,0)),t--},e.prototype.executeStep=function(e,t){for(var i=0,n=t;i<n.length;i++){var r=n[i];r.soft||r.beforeStep()}this._stepSimulation(this._useDeltaForWorldStep?e:this._timeStep,this._maxSteps,this._fixedTimeStep);for(var o=0,a=t;o<a.length;o++){var s=a[o];if(s.soft?this._afterSoftStep(s):s.afterStep(),s._onPhysicsCollideCallbacks.length>0&&this._isImpostorInContact(s))for(var c=0,l=s._onPhysicsCollideCallbacks;c<l.length;c++)for(var u=0,h=l[c].otherImpostors;u<h.length;u++){var d=h[u];(s.physicsBody.isActive()||d.physicsBody.isActive())&&this._isImpostorPairInContact(s,d)&&(s.onCollide({body:d.physicsBody,point:this._tmpContactPoint}),d.onCollide({body:s.physicsBody,point:this._tmpContactPoint}))}}},e.prototype._afterSoftStep=function(e){e.type===Ga.a.RopeImpostor?this._ropeStep(e):this._softbodyOrClothStep(e)},e.prototype._ropeStep=function(e){for(var t,i,n,r,o=e.physicsBody.get_m_nodes(),s=o.size(),c=new Array,l=0;l<s;l++)i=(t=o.at(l).get_m_x()).x(),n=t.y(),r=t.z(),c.push(new a.e(i,n,r));var u=e.object,h=e.getParam("shape");e._isFromLine?e.object=Tr.a.CreateLines("lines",{points:c,instance:u}):e.object=Ya.a.ExtrudeShape("ext",{shape:h,path:c,instance:u})},e.prototype._softbodyOrClothStep=function(e){var t=e.type===Ga.a.ClothImpostor?1:-1,i=e.object,n=i.getVerticesData(ji.b.PositionKind);n||(n=[]);var r=i.getVerticesData(ji.b.NormalKind);r||(r=[]);for(var o,a,s,c,l,u,h,d,f=n.length/3,p=e.physicsBody.get_m_nodes(),_=0;_<f;_++){var m;s=(a=(o=p.at(_)).get_m_x()).x(),c=a.y(),l=a.z()*t,u=(m=o.get_m_n()).x(),h=m.y(),d=m.z()*t,n[3*_]=s,n[3*_+1]=c,n[3*_+2]=l,r[3*_]=u,r[3*_+1]=h,r[3*_+2]=d}var g=new zi.a;g.positions=n,g.normals=r,g.uvs=i.getVerticesData(ji.b.UVKind),g.colors=i.getVerticesData(ji.b.ColorKind),i&&i.getIndices&&(g.indices=i.getIndices()),g.applyToMesh(i)},e.prototype.applyImpulse=function(e,t,i){if(e.soft)m.a.Warn("Cannot be applied to a soft body");else{e.physicsBody.activate();var n=this._tmpAmmoVectorA,r=this._tmpAmmoVectorB;e.object&&e.object.getWorldMatrix&&i.subtractInPlace(e.object.getWorldMatrix().getTranslation()),n.setValue(i.x,i.y,i.z),r.setValue(t.x,t.y,t.z),e.physicsBody.applyImpulse(r,n)}},e.prototype.applyForce=function(e,t,i){if(e.soft)m.a.Warn("Cannot be applied to a soft body");else{e.physicsBody.activate();var n=this._tmpAmmoVectorA,r=this._tmpAmmoVectorB;e.object&&e.object.getWorldMatrix&&i.subtractInPlace(e.object.getWorldMatrix().getTranslation()),n.setValue(i.x,i.y,i.z),r.setValue(t.x,t.y,t.z),e.physicsBody.applyForce(r,n)}},e.prototype.generatePhysicsBody=function(t){if(t._pluginData.toDispose=[],t.parent)t.physicsBody&&(this.removePhysicsBody(t),t.forceUpdate());else if(t.isBodyInitRequired()){var i=this._createShape(t),n=t.getParam("mass");if(t._pluginData.mass=n,t.soft)i.get_m_cfg().set_collisions(17),i.get_m_cfg().set_kDP(t.getParam("damping")),this.bjsAMMO.castObject(i,this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(t.getParam("margin")),i.setActivationState(e.DISABLE_DEACTIVATION_FLAG),this.world.addSoftBody(i,1,-1),t.physicsBody=i,t._pluginData.toDispose.push(i),this.setBodyPressure(t,0),t.type===Ga.a.SoftbodyImpostor&&this.setBodyPressure(t,t.getParam("pressure")),this.setBodyStiffness(t,t.getParam("stiffness")),this.setBodyVelocityIterations(t,t.getParam("velocityIterations")),this.setBodyPositionIterations(t,t.getParam("positionIterations"));else{var r=new this.bjsAMMO.btVector3(0,0,0),o=new this.bjsAMMO.btTransform;o.setIdentity(),0!==n&&i.calculateLocalInertia(n,r),this._tmpAmmoVectorA.setValue(t.object.position.x,t.object.position.y,t.object.position.z),this._tmpAmmoQuaternion.setValue(t.object.rotationQuaternion.x,t.object.rotationQuaternion.y,t.object.rotationQuaternion.z,t.object.rotationQuaternion.w),o.setOrigin(this._tmpAmmoVectorA),o.setRotation(this._tmpAmmoQuaternion);var a=new this.bjsAMMO.btDefaultMotionState(o),s=new this.bjsAMMO.btRigidBodyConstructionInfo(n,a,i,r),c=new this.bjsAMMO.btRigidBody(s);0===n&&(c.setCollisionFlags(c.getCollisionFlags()|e.KINEMATIC_FLAG),c.setActivationState(e.DISABLE_DEACTIVATION_FLAG)),t.type!=Ga.a.NoImpostor||i.getChildShape||c.setCollisionFlags(c.getCollisionFlags()|e.DISABLE_COLLISION_FLAG);var l=t.getParam("group"),u=t.getParam("mask");l&&u?this.world.addRigidBody(c,l,u):this.world.addRigidBody(c),t.physicsBody=c,t._pluginData.toDispose=t._pluginData.toDispose.concat([c,s,a,o,r,i])}this.setBodyRestitution(t,t.getParam("restitution")),this.setBodyFriction(t,t.getParam("friction"))}},e.prototype.removePhysicsBody=function(e){var t=this;this.world&&(e.soft?this.world.removeSoftBody(e.physicsBody):this.world.removeRigidBody(e.physicsBody),e._pluginData&&(e._pluginData.toDispose.forEach(function(e){t.bjsAMMO.destroy(e)}),e._pluginData.toDispose=[]))},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,i=e.connectedImpostor.physicsBody;if(t&&i){var n,r=e.joint.jointData;switch(r.mainPivot||(r.mainPivot=new a.e(0,0,0)),r.connectedPivot||(r.connectedPivot=new a.e(0,0,0)),e.joint.type){case za.e.DistanceJoint:var o=r.maxDistance;o&&(r.mainPivot=new a.e(0,-o/2,0),r.connectedPivot=new a.e(0,o/2,0)),n=new this.bjsAMMO.btPoint2PointConstraint(t,i,new this.bjsAMMO.btVector3(r.mainPivot.x,r.mainPivot.y,r.mainPivot.z),new this.bjsAMMO.btVector3(r.connectedPivot.x,r.connectedPivot.y,r.connectedPivot.z));break;case za.e.HingeJoint:r.mainAxis||(r.mainAxis=new a.e(0,0,0)),r.connectedAxis||(r.connectedAxis=new a.e(0,0,0));var s=new this.bjsAMMO.btVector3(r.mainAxis.x,r.mainAxis.y,r.mainAxis.z),c=new this.bjsAMMO.btVector3(r.connectedAxis.x,r.connectedAxis.y,r.connectedAxis.z);n=new this.bjsAMMO.btHingeConstraint(t,i,new this.bjsAMMO.btVector3(r.mainPivot.x,r.mainPivot.y,r.mainPivot.z),new this.bjsAMMO.btVector3(r.connectedPivot.x,r.connectedPivot.y,r.connectedPivot.z),s,c);break;case za.e.BallAndSocketJoint:n=new this.bjsAMMO.btPoint2PointConstraint(t,i,new this.bjsAMMO.btVector3(r.mainPivot.x,r.mainPivot.y,r.mainPivot.z),new this.bjsAMMO.btVector3(r.connectedPivot.x,r.connectedPivot.y,r.connectedPivot.z));break;default:m.a.Warn("JointType not currently supported by the Ammo plugin, falling back to PhysicsJoint.BallAndSocketJoint"),n=new this.bjsAMMO.btPoint2PointConstraint(t,i,new this.bjsAMMO.btVector3(r.mainPivot.x,r.mainPivot.y,r.mainPivot.z),new this.bjsAMMO.btVector3(r.connectedPivot.x,r.connectedPivot.y,r.connectedPivot.z))}this.world.addConstraint(n,!e.joint.jointData.collision),e.joint.physicsJoint=n}},e.prototype.removeJoint=function(e){this.world&&this.world.removeConstraint(e.joint.physicsJoint)},e.prototype._addMeshVerts=function(e,t,i){var n=this,r=0;if(i&&i.getIndices&&i.getWorldMatrix&&i.getChildMeshes){var o=i.getIndices();o||(o=[]);var s=i.getVerticesData(ji.b.PositionKind);s||(s=[]),i.computeWorldMatrix(!1);for(var c=o.length/3,l=0;l<c;l++){for(var u=[],h=0;h<3;h++){var d,f=new a.e(s[3*o[3*l+h]+0],s[3*o[3*l+h]+1],s[3*o[3*l+h]+2]);a.a.ScalingToRef(i.scaling.x,i.scaling.y,i.scaling.z,this._tmpMatrix),f=a.e.TransformCoordinates(f,this._tmpMatrix),(d=0==h?this._tmpAmmoVectorA:1==h?this._tmpAmmoVectorB:this._tmpAmmoVectorC).setValue(f.x,f.y,f.z),u.push(d)}e.addTriangle(u[0],u[1],u[2]),r++}i.getChildMeshes().forEach(function(i){r+=n._addMeshVerts(e,t,i)})}return r},e.prototype._softVertexData=function(e){var t=e.object;if(t&&t.getIndices&&t.getWorldMatrix&&t.getChildMeshes){var i=t.getIndices();i||(i=[]);var n=t.getVerticesData(ji.b.PositionKind);n||(n=[]);var r=t.getVerticesData(ji.b.NormalKind);r||(r=[]),t.computeWorldMatrix(!1);for(var o=[],s=[],c=0;c<n.length;c+=3){var l=new a.e(n[c],n[c+1],n[c+2]),u=new a.e(r[c],r[c+1],r[c+2]);l=a.e.TransformCoordinates(l,t.getWorldMatrix()),u=a.e.TransformNormal(u,t.getWorldMatrix()),o.push(l.x,l.y,l.z),s.push(u.x,u.y,u.z)}var h=new zi.a;return h.positions=o,h.normals=s,h.uvs=t.getVerticesData(ji.b.UVKind),h.colors=t.getVerticesData(ji.b.ColorKind),t&&t.getIndices&&(h.indices=t.getIndices()),h.applyToMesh(t),t.position=a.e.Zero(),t.rotationQuaternion=null,t.rotation=a.e.Zero(),t.computeWorldMatrix(!0),h}return zi.a.ExtractFromMesh(t)},e.prototype._createSoftbody=function(e){var t=e.object;if(t&&t.getIndices){var i=t.getIndices();i||(i=[]);var n=this._softVertexData(e),r=n.positions,o=n.normals;if(null===r||null===o)return new this.bjsAMMO.btCompoundShape;for(var s=[],c=[],l=0;l<r.length;l+=3){var u=new a.e(r[l],r[l+1],r[l+2]),h=new a.e(o[l],o[l+1],o[l+2]);s.push(u.x,u.y,-u.z),c.push(h.x,h.y,-h.z)}var d=(new this.bjsAMMO.btSoftBodyHelpers).CreateFromTriMesh(this.world.getWorldInfo(),s,t.getIndices(),i.length/3,!0),f=r.length/3,p=d.get_m_nodes();for(l=0;l<f;l++){var _;(_=p.at(l).get_m_n()).setX(c[3*l]),_.setY(c[3*l+1]),_.setZ(c[3*l+2])}return d}},e.prototype._createCloth=function(e){var t=e.object;if(t&&t.getIndices){var i=t.getIndices();i||(i=[]);var n=this._softVertexData(e),r=n.positions,o=n.normals;if(null===r||null===o)return new this.bjsAMMO.btCompoundShape;var a=r.length,s=Math.sqrt(a/3);e.segments=s;var c=s-1;return this._tmpAmmoVectorA.setValue(r[0],r[1],r[2]),this._tmpAmmoVectorB.setValue(r[3*c],r[3*c+1],r[3*c+2]),this._tmpAmmoVectorD.setValue(r[a-3],r[a-2],r[a-1]),this._tmpAmmoVectorC.setValue(r[a-3-3*c],r[a-2-3*c],r[a-1-3*c]),(new this.bjsAMMO.btSoftBodyHelpers).CreatePatch(this.world.getWorldInfo(),this._tmpAmmoVectorA,this._tmpAmmoVectorB,this._tmpAmmoVectorC,this._tmpAmmoVectorD,s,s,e.getParam("fixedPoints"),!0)}},e.prototype._createRope=function(e){var t,i,n=this._softVertexData(e),r=n.positions,o=n.normals;if(null===r||null===o)return new this.bjsAMMO.btCompoundShape;if(n.applyToMesh(e.object,!0),e._isFromLine=!0,0===o.map(function(e){return e*e}).reduce(function(e,t){return e+t}))i=(t=r.length)/3-1,this._tmpAmmoVectorA.setValue(r[0],r[1],r[2]),this._tmpAmmoVectorB.setValue(r[t-3],r[t-2],r[t-1]);else{e._isFromLine=!1;var a=e.getParam("path");if(null===e.getParam("shape"))return m.a.Warn("No shape available for extruded mesh"),new this.bjsAMMO.btCompoundShape;if(r.length%(3*a.length)!=0)return m.a.Warn("Path does not match extrusion"),new this.bjsAMMO.btCompoundShape;i=(t=a.length)-1,this._tmpAmmoVectorA.setValue(a[0].x,a[0].y,a[0].z),this._tmpAmmoVectorB.setValue(a[t-1].x,a[t-1].y,a[t-1].z)}e.segments=i;var s=e.getParam("fixedPoints");s=s>3?3:s;var c=(new this.bjsAMMO.btSoftBodyHelpers).CreateRope(this.world.getWorldInfo(),this._tmpAmmoVectorA,this._tmpAmmoVectorB,i-1,s);return c.get_m_cfg().set_collisions(17),c},e.prototype._createCustom=function(e){var t=null;return this.onCreateCustomShape&&(t=this.onCreateCustomShape(e)),null==t&&(t=new this.bjsAMMO.btCompoundShape),t},e.prototype._addHullVerts=function(e,t,i){var n=this,r=0;if(i&&i.getIndices&&i.getWorldMatrix&&i.getChildMeshes){var o=i.getIndices();o||(o=[]);var s=i.getVerticesData(ji.b.PositionKind);s||(s=[]),i.computeWorldMatrix(!1);for(var c=o.length/3,l=0;l<c;l++){for(var u=[],h=0;h<3;h++){var d,f=new a.e(s[3*o[3*l+h]+0],s[3*o[3*l+h]+1],s[3*o[3*l+h]+2]);a.a.ScalingToRef(i.scaling.x,i.scaling.y,i.scaling.z,this._tmpMatrix),f=a.e.TransformCoordinates(f,this._tmpMatrix),(d=0==h?this._tmpAmmoVectorA:1==h?this._tmpAmmoVectorB:this._tmpAmmoVectorC).setValue(f.x,f.y,f.z),u.push(d)}e.addPoint(u[0],!0),e.addPoint(u[1],!0),e.addPoint(u[2],!0),r++}i.getChildMeshes().forEach(function(i){r+=n._addHullVerts(e,t,i)})}return r},e.prototype._createShape=function(e,t){var i=this;void 0===t&&(t=!1);var n,r=e.object,o=e.getObjectExtendSize();if(!t){var s=e.object.getChildMeshes?e.object.getChildMeshes(!0):[];n=new this.bjsAMMO.btCompoundShape;var c=0;if(s.forEach(function(e){var t=e.getPhysicsImpostor();if(t){if(t.type==Ga.a.MeshImpostor)throw"A child MeshImpostor is not supported. Only primitive impostors are supported as children (eg. box or sphere)";var r=i._createShape(t),o=e.parent.getWorldMatrix().clone(),s=new a.e;o.decompose(s),i._tmpAmmoTransform.getOrigin().setValue(e.position.x*s.x,e.position.y*s.y,e.position.z*s.z),i._tmpAmmoQuaternion.setValue(e.rotationQuaternion.x,e.rotationQuaternion.y,e.rotationQuaternion.z,e.rotationQuaternion.w),i._tmpAmmoTransform.setRotation(i._tmpAmmoQuaternion),n.addChildShape(i._tmpAmmoTransform,r),t.dispose(),c++}}),c>0){if(e.type!=Ga.a.NoImpostor){var l=this._createShape(e,!0);l&&(this._tmpAmmoTransform.getOrigin().setValue(0,0,0),this._tmpAmmoQuaternion.setValue(0,0,0,1),this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion),n.addChildShape(this._tmpAmmoTransform,l))}return n}this.bjsAMMO.destroy(n),n=null}switch(e.type){case Ga.a.SphereImpostor:if(L.a.WithinEpsilon(o.x,o.y,1e-4)&&L.a.WithinEpsilon(o.x,o.z,1e-4))n=new this.bjsAMMO.btSphereShape(o.x/2);else{var u=[new this.bjsAMMO.btVector3(0,0,0)];(n=new this.bjsAMMO.btMultiSphereShape(u,[1],1)).setLocalScaling(new this.bjsAMMO.btVector3(o.x/2,o.y/2,o.z/2))}break;case Ga.a.CapsuleImpostor:n=new this.bjsAMMO.btCapsuleShape(o.x/2,o.y/2);break;case Ga.a.CylinderImpostor:this._tmpAmmoVectorA.setValue(o.x/2,o.y/2,o.z/2),n=new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);break;case Ga.a.PlaneImpostor:case Ga.a.BoxImpostor:this._tmpAmmoVectorA.setValue(o.x/2,o.y/2,o.z/2),n=new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);break;case Ga.a.MeshImpostor:if(0==e.getParam("mass")){var h=new this.bjsAMMO.btTriangleMesh;e._pluginData.toDispose.push(h);var d=this._addMeshVerts(h,r,r);n=0==d?new this.bjsAMMO.btCompoundShape:new this.bjsAMMO.btBvhTriangleMeshShape(h);break}case Ga.a.ConvexHullImpostor:var f=new this.bjsAMMO.btConvexHullShape;0==(d=this._addHullVerts(f,r,r))?(e._pluginData.toDispose.push(f),n=new this.bjsAMMO.btCompoundShape):n=f;break;case Ga.a.NoImpostor:n=new this.bjsAMMO.btSphereShape(o.x/2);break;case Ga.a.CustomImpostor:n=this._createCustom(e);break;case Ga.a.SoftbodyImpostor:n=this._createSoftbody(e);break;case Ga.a.ClothImpostor:n=this._createCloth(e);break;case Ga.a.RopeImpostor:n=this._createRope(e);break;default:m.a.Warn("The impostor type is not currently supported by the ammo plugin.")}return n},e.prototype.setTransformationFromPhysicsBody=function(e){e.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform),e.object.position.set(this._tmpAmmoTransform.getOrigin().x(),this._tmpAmmoTransform.getOrigin().y(),this._tmpAmmoTransform.getOrigin().z()),e.object.rotationQuaternion?e.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(),this._tmpAmmoTransform.getRotation().y(),this._tmpAmmoTransform.getRotation().z(),this._tmpAmmoTransform.getRotation().w()):e.object.rotation&&(this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(),this._tmpAmmoTransform.getRotation().y(),this._tmpAmmoTransform.getRotation().z(),this._tmpAmmoTransform.getRotation().w()),this._tmpQuaternion.toEulerAnglesToRef(e.object.rotation))},e.prototype.setPhysicsBodyTransformation=function(e,t,i){var n=e.physicsBody.getWorldTransform();if(Math.abs(n.getOrigin().x()-t.x)>Nt.a||Math.abs(n.getOrigin().y()-t.y)>Nt.a||Math.abs(n.getOrigin().z()-t.z)>Nt.a||Math.abs(n.getRotation().x()-i.x)>Nt.a||Math.abs(n.getRotation().y()-i.y)>Nt.a||Math.abs(n.getRotation().z()-i.z)>Nt.a||Math.abs(n.getRotation().w()-i.w)>Nt.a)if(this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),n.setOrigin(this._tmpAmmoVectorA),this._tmpAmmoQuaternion.setValue(i.x,i.y,i.z,i.w),n.setRotation(this._tmpAmmoQuaternion),e.physicsBody.setWorldTransform(n),0==e.mass){var r=e.physicsBody.getMotionState();r&&r.setWorldTransform(n)}else e.physicsBody.activate()},e.prototype.isSupported=function(){return void 0!==this.bjsAMMO},e.prototype.setLinearVelocity=function(e,t){this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.soft?e.physicsBody.linearVelocity(this._tmpAmmoVectorA):e.physicsBody.setLinearVelocity(this._tmpAmmoVectorA)},e.prototype.setAngularVelocity=function(e,t){this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.soft?e.physicsBody.angularVelocity(this._tmpAmmoVectorA):e.physicsBody.setAngularVelocity(this._tmpAmmoVectorA)},e.prototype.getLinearVelocity=function(e){if(e.soft)var t=e.physicsBody.linearVelocity();else t=e.physicsBody.getLinearVelocity();if(!t)return null;var i=new a.e(t.x(),t.y(),t.z());return this.bjsAMMO.destroy(t),i},e.prototype.getAngularVelocity=function(e){if(e.soft)var t=e.physicsBody.angularVelocity();else t=e.physicsBody.getAngularVelocity();if(!t)return null;var i=new a.e(t.x(),t.y(),t.z());return this.bjsAMMO.destroy(t),i},e.prototype.setBodyMass=function(e,t){e.soft?e.physicsBody.setTotalMass(t,!1):e.physicsBody.setMassProps(t),e._pluginData.mass=t},e.prototype.getBodyMass=function(e){return e._pluginData.mass||0},e.prototype.getBodyFriction=function(e){return e._pluginData.friction||0},e.prototype.setBodyFriction=function(e,t){e.soft?e.physicsBody.get_m_cfg().set_kDF(t):e.physicsBody.setFriction(t),e._pluginData.friction=t},e.prototype.getBodyRestitution=function(e){return e._pluginData.restitution||0},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.setRestitution(t),e._pluginData.restitution=t},e.prototype.getBodyPressure=function(e){return e.soft?e._pluginData.pressure||0:(m.a.Warn("Pressure is not a property of a rigid body"),0)},e.prototype.setBodyPressure=function(e,t){e.soft?e.type===Ga.a.SoftbodyImpostor?(e.physicsBody.get_m_cfg().set_kPR(t),e._pluginData.pressure=t):(e.physicsBody.get_m_cfg().set_kPR(0),e._pluginData.pressure=0):m.a.Warn("Pressure can only be applied to a softbody")},e.prototype.getBodyStiffness=function(e){return e.soft?e._pluginData.stiffness||0:(m.a.Warn("Stiffness is not a property of a rigid body"),0)},e.prototype.setBodyStiffness=function(e,t){e.soft?(t=(t=t<0?0:t)>1?1:t,e.physicsBody.get_m_materials().at(0).set_m_kLST(t),e._pluginData.stiffness=t):m.a.Warn("Stiffness cannot be applied to a rigid body")},e.prototype.getBodyVelocityIterations=function(e){return e.soft?e._pluginData.velocityIterations||0:(m.a.Warn("Velocity iterations is not a property of a rigid body"),0)},e.prototype.setBodyVelocityIterations=function(e,t){e.soft?(t=t<0?0:t,e.physicsBody.get_m_cfg().set_viterations(t),e._pluginData.velocityIterations=t):m.a.Warn("Velocity iterations cannot be applied to a rigid body")},e.prototype.getBodyPositionIterations=function(e){return e.soft?e._pluginData.positionIterations||0:(m.a.Warn("Position iterations is not a property of a rigid body"),0)},e.prototype.setBodyPositionIterations=function(e,t){e.soft?(t=t<0?0:t,e.physicsBody.get_m_cfg().set_piterations(t),e._pluginData.positionIterations=t):m.a.Warn("Position iterations cannot be applied to a rigid body")},e.prototype.appendAnchor=function(e,t,i,n,r,o){void 0===r&&(r=1),void 0===o&&(o=!1);var a=e.segments,s=Math.round((a-1)*i)+a*(a-1-Math.round((a-1)*n));e.physicsBody.appendAnchor(s,t.physicsBody,o,r)},e.prototype.appendHook=function(e,t,i,n,r){void 0===n&&(n=1),void 0===r&&(r=!1);var o=Math.round(e.segments*i);e.physicsBody.appendAnchor(o,t.physicsBody,r,n)},e.prototype.sleepBody=function(e){m.a.Warn("sleepBody is not currently supported by the Ammo physics plugin")},e.prototype.wakeUpBody=function(e){e.physicsBody.activate()},e.prototype.updateDistanceJoint=function(e,t,i){m.a.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin")},e.prototype.setMotor=function(e,t,i,n){e.physicsJoint.enableAngularMotor(!0,t,i)},e.prototype.setLimit=function(e,t,i){m.a.Warn("setLimit is not currently supported by the Ammo physics plugin")},e.prototype.syncMeshWithImpostor=function(e,t){t.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform),e.position.x=this._tmpAmmoTransform.getOrigin().x(),e.position.y=this._tmpAmmoTransform.getOrigin().y(),e.position.z=this._tmpAmmoTransform.getOrigin().z(),e.rotationQuaternion&&(e.rotationQuaternion.x=this._tmpAmmoTransform.getRotation().x(),e.rotationQuaternion.y=this._tmpAmmoTransform.getRotation().y(),e.rotationQuaternion.z=this._tmpAmmoTransform.getRotation().z(),e.rotationQuaternion.w=this._tmpAmmoTransform.getRotation().w())},e.prototype.getRadius=function(e){return e.getObjectExtendSize().x/2},e.prototype.getBoxSizeToRef=function(e,t){var i=e.getObjectExtendSize();t.x=i.x,t.y=i.y,t.z=i.z},e.prototype.dispose=function(){this.bjsAMMO.destroy(this.world),this.bjsAMMO.destroy(this._solver),this.bjsAMMO.destroy(this._overlappingPairCache),this.bjsAMMO.destroy(this._dispatcher),this.bjsAMMO.destroy(this._collisionConfiguration),this.bjsAMMO.destroy(this._tmpAmmoVectorA),this.bjsAMMO.destroy(this._tmpAmmoVectorB),this.bjsAMMO.destroy(this._tmpAmmoVectorC),this.bjsAMMO.destroy(this._tmpAmmoTransform),this.bjsAMMO.destroy(this._tmpAmmoQuaternion),this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback),this.world=null},e.prototype.raycast=function(e,t){this._tmpAmmoVectorRCA=new this.bjsAMMO.btVector3(e.x,e.y,e.z),this._tmpAmmoVectorRCB=new this.bjsAMMO.btVector3(t.x,t.y,t.z);var i=new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA,this._tmpAmmoVectorRCB);return this.world.rayTest(this._tmpAmmoVectorRCA,this._tmpAmmoVectorRCB,i),this._raycastResult.reset(e,t),i.hasHit()&&(this._raycastResult.setHitData({x:i.get_m_hitNormalWorld().x(),y:i.get_m_hitNormalWorld().y(),z:i.get_m_hitNormalWorld().z()},{x:i.get_m_hitPointWorld().x(),y:i.get_m_hitPointWorld().y(),z:i.get_m_hitPointWorld().z()}),this._raycastResult.calculateHitDistance()),this.bjsAMMO.destroy(i),this.bjsAMMO.destroy(this._tmpAmmoVectorRCA),this.bjsAMMO.destroy(this._tmpAmmoVectorRCB),this._raycastResult},e.DISABLE_COLLISION_FLAG=4,e.KINEMATIC_FLAG=2,e.DISABLE_DEACTIVATION_FLAG=4,e}();n.a.prototype.removeReflectionProbe=function(e){if(!this.reflectionProbes)return-1;var t=this.reflectionProbes.indexOf(e);return-1!==t&&this.reflectionProbes.splice(t,1),t},n.a.prototype.addReflectionProbe=function(e){this.reflectionProbes||(this.reflectionProbes=[]),this.reflectionProbes.push(e)};var Qa=function(){function e(e,t,i,n,r){var o=this;void 0===n&&(n=!0),void 0===r&&(r=!1),this.name=e,this._viewMatrix=a.a.Identity(),this._target=a.e.Zero(),this._add=a.e.Zero(),this._invertYAxis=!1,this.position=a.e.Zero(),this._scene=i,this._scene.reflectionProbes||(this._scene.reflectionProbes=new Array),this._scene.reflectionProbes.push(this);var s=g.a.TEXTURETYPE_UNSIGNED_BYTE;if(r){var c=this._scene.getEngine().getCaps();c.textureHalfFloatRender?s=g.a.TEXTURETYPE_HALF_FLOAT:c.textureFloatRender&&(s=g.a.TEXTURETYPE_FLOAT)}this._renderTargetTexture=new Ri(e,t,i,n,!0,s,!0),this._renderTargetTexture.onBeforeRenderObservable.add(function(e){switch(e){case 0:o._add.copyFromFloats(1,0,0);break;case 1:o._add.copyFromFloats(-1,0,0);break;case 2:o._add.copyFromFloats(0,o._invertYAxis?1:-1,0);break;case 3:o._add.copyFromFloats(0,o._invertYAxis?-1:1,0);break;case 4:o._add.copyFromFloats(0,0,1);break;case 5:o._add.copyFromFloats(0,0,-1)}o._attachedMesh&&o.position.copyFrom(o._attachedMesh.getAbsolutePosition()),o.position.addToRef(o._add,o._target),a.a.LookAtLHToRef(o.position,o._target,a.e.Up(),o._viewMatrix),i.activeCamera&&(o._projectionMatrix=a.a.PerspectiveFovLH(Math.PI/2,1,i.activeCamera.minZ,i.activeCamera.maxZ),i.setTransformMatrix(o._viewMatrix,o._projectionMatrix)),i._forcedViewPosition=o.position}),this._renderTargetTexture.onAfterUnbindObservable.add(function(){i._forcedViewPosition=null,i.updateTransformMatrix(!0)})}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._renderTargetTexture.samples},set:function(e){this._renderTargetTexture.samples=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._renderTargetTexture.refreshRate},set:function(e){this._renderTargetTexture.refreshRate=e},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},Object.defineProperty(e.prototype,"cubeTexture",{get:function(){return this._renderTargetTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderList",{get:function(){return this._renderTargetTexture.renderList},enumerable:!1,configurable:!0}),e.prototype.attachToMesh=function(e){this._attachedMesh=e},e.prototype.setRenderingAutoClearDepthStencil=function(e,t){this._renderTargetTexture.setRenderingAutoClearDepthStencil(e,t)},e.prototype.dispose=function(){var e=this._scene.reflectionProbes.indexOf(this);-1!==e&&this._scene.reflectionProbes.splice(e,1),this._renderTargetTexture&&(this._renderTargetTexture.dispose(),this._renderTargetTexture=null)},e.prototype.toString=function(e){var t="Name: "+this.name;return e&&(t+=", position: "+this.position.toString(),this._attachedMesh&&(t+=", attached mesh: "+this._attachedMesh.name)),t},e.prototype.getClassName=function(){return"ReflectionProbe"},e.prototype.serialize=function(){var e=w.a.Serialize(this,this._renderTargetTexture.serialize());return e.isReflectionProbe=!0,e},e.Parse=function(t,i,n){var r=null;if(i.reflectionProbes)for(var o=0;o<i.reflectionProbes.length;o++){var a=i.reflectionProbes[o];if(a.name===t.name){r=a;break}}return(r=w.a.Parse(function(){return r||new e(t.name,t.renderTargetSize,i,t._generateMipMaps)},t,i,n)).cubeTexture._waitingRenderList=t.renderList,t._attachedMesh&&r.attachToMesh(i.getMeshByID(t._attachedMesh)),r},Object(h.c)([Object(w.k)()],e.prototype,"_attachedMesh",void 0),Object(h.c)([Object(w.o)()],e.prototype,"position",void 0),e}(),qa=!0,Za=function(){function e(){}return e.LoaderInjectedPhysicsEngine=void 0,e}(),Ja=function(e,t,i,n){for(var r=0,o=t.materials.length;r<o;r++){var a=t.materials[r];if(a.id===e)return lo.a.Parse(a,i,n)}return null},$a=function(e,t,i){for(var n in t)if(e.name===t[n])return i.push(e.id),!0;return!(!e.parentId||-1===i.indexOf(e.parentId)||(i.push(e.id),0))},es=function(e,t){return e+" of "+(t?t.file+" from "+t.name+" version: "+t.version+", exporter version: "+t.exporter_version:"unknown")},ts=function(e,t){var i=t;if(t._waitingData.lods){if(t._waitingData.lods.ids&&t._waitingData.lods.ids.length>0){var n=t._waitingData.lods.ids,r=i.isEnabled(!1);if(t._waitingData.lods.distances){var o=t._waitingData.lods.distances;if(o.length>=n.length){var a=o.length>n.length?o[o.length-1]:0;i.setEnabled(!1);for(var s=0;s<n.length;s++){var c=n[s],l=e.getMeshByID(c);null!=l&&i.addLODLevel(o[s],l)}a>0&&i.addLODLevel(a,null),!0===r&&i.setEnabled(!0)}else Ce.b.Warn("Invalid level of detail distances for "+t.name)}}t._waitingData.lods=null}},is=function(e,t,i,r,o){void 0===o&&(o=!1);var a=new Ee(e),s="importScene has failed JSON parse";try{var l=JSON.parse(t);s="";var u,h,d=ar.loggingLevel===ar.DETAILED_LOGGING;if(void 0!==l.environmentTexture&&null!==l.environmentTexture){var f=void 0===l.isPBR||l.isPBR;if(l.environmentTextureType&&"BABYLON.HDRCubeTexture"===l.environmentTextureType){var p=l.environmentTextureSize?l.environmentTextureSize:128,_=new Ua((l.environmentTexture.match(/https?:\/\//g)?"":i)+l.environmentTexture,e,p,!0,!f);l.environmentTextureRotationY&&(_.rotationY=l.environmentTextureRotationY),e.environmentTexture=_}else if(jr.a.EndsWith(l.environmentTexture,".env")){var g=new Wr((l.environmentTexture.match(/https?:\/\//g)?"":i)+l.environmentTexture,e);l.environmentTextureRotationY&&(g.rotationY=l.environmentTextureRotationY),e.environmentTexture=g}else{var v=Wr.CreateFromPrefilteredData((l.environmentTexture.match(/https?:\/\//g)?"":i)+l.environmentTexture,e);l.environmentTextureRotationY&&(v.rotationY=l.environmentTextureRotationY),e.environmentTexture=v}if(!0===l.createDefaultSkybox){var b=void 0!==e.activeCamera&&null!==e.activeCamera?(e.activeCamera.maxZ-e.activeCamera.minZ)/2:1e3,y=l.skyboxBlurLevel||0;e.createDefaultSkybox(e.environmentTexture,f,b,y)}a.environmentTexture=e.environmentTexture}if(void 0!==l.environmentIntensity&&null!==l.environmentIntensity&&(e.environmentIntensity=l.environmentIntensity),void 0!==l.lights&&null!==l.lights)for(u=0,h=l.lights.length;u<h;u++){var T=l.lights[u],E=Dr.a.Parse(T,e);E&&(a.lights.push(E),s+=0===u?"\n\tLights:":"",s+="\n\t\t"+E.toString(d))}if(void 0!==l.reflectionProbes&&null!==l.reflectionProbes)for(u=0,h=l.reflectionProbes.length;u<h;u++){var S=l.reflectionProbes[u],A=Qa.Parse(S,e,i);A&&(a.reflectionProbes.push(A),s+=0===u?"\n\tReflection Probes:":"",s+="\n\t\t"+A.toString(d))}if(void 0!==l.animations&&null!==l.animations)for(u=0,h=l.animations.length;u<h;u++){var P=l.animations[u],C=c.a.GetClass("BABYLON.Animation");if(C){var R=C.Parse(P);e.animations.push(R),a.animations.push(R),s+=0===u?"\n\tAnimations:":"",s+="\n\t\t"+R.toString(d)}}if(void 0!==l.materials&&null!==l.materials)for(u=0,h=l.materials.length;u<h;u++){var x=l.materials[u],O=lo.a.Parse(x,e,i);O&&(a.materials.push(O),s+=0===u?"\n\tMaterials:":"",s+="\n\t\t"+O.toString(d),O.getActiveTextures().forEach(function(e){-1==a.textures.indexOf(e)&&a.textures.push(e)}))}if(void 0!==l.multiMaterials&&null!==l.multiMaterials)for(u=0,h=l.multiMaterials.length;u<h;u++){var I=l.multiMaterials[u],D=Da.a.ParseMultiMaterial(I,e);a.multiMaterials.push(D),s+=0===u?"\n\tMultiMaterials:":"",s+="\n\t\t"+D.toString(d),D.getActiveTextures().forEach(function(e){-1==a.textures.indexOf(e)&&a.textures.push(e)})}if(void 0!==l.morphTargetManagers&&null!==l.morphTargetManagers)for(var N=0,L=l.morphTargetManagers;N<L.length;N++){var w=L[N];a.morphTargetManagers.push(ka.Parse(w,e))}if(void 0!==l.skeletons&&null!==l.skeletons)for(u=0,h=l.skeletons.length;u<h;u++){var F=l.skeletons[u],B=tt.Parse(F,e);a.skeletons.push(B),s+=0===u?"\n\tSkeletons:":"",s+="\n\t\t"+B.toString(d)}var U=l.geometries;if(null!=U){var V=new Array,k=U.vertexData;if(null!=k)for(u=0,h=k.length;u<h;u++){var G=k[u];V.push(Ia.a.Parse(G,e,i))}V.forEach(function(e){e&&a.geometries.push(e)})}if(void 0!==l.transformNodes&&null!==l.transformNodes)for(u=0,h=l.transformNodes.length;u<h;u++){var z=l.transformNodes[u],j=Pr.a.Parse(z,e,i);a.transformNodes.push(j)}if(void 0!==l.meshes&&null!==l.meshes)for(u=0,h=l.meshes.length;u<h;u++){var W=l.meshes[u],H=be.a.Parse(W,e,i);if(a.meshes.push(H),H.hasInstances)for(var X=0,Y=H.instances;X<Y.length;X++){var K=Y[X];a.meshes.push(K)}s+=0===u?"\n\tMeshes:":"",s+="\n\t\t"+H.toString(d)}if(void 0!==l.cameras&&null!==l.cameras)for(u=0,h=l.cameras.length;u<h;u++){var Q=l.cameras[u],q=je.a.Parse(Q,e);a.cameras.push(q),s+=0===u?"\n\tCameras:":"",s+="\n\t\t"+q.toString(d)}if(void 0!==l.postProcesses&&null!==l.postProcesses)for(u=0,h=l.postProcesses.length;u<h;u++){var Z=l.postProcesses[u],J=ci.Parse(Z,e,i);J&&(a.postProcesses.push(J),s+=0===u?"\nPostprocesses:":"",s+="\n\t\t"+J.toString())}if(void 0!==l.animationGroups&&null!==l.animationGroups)for(u=0,h=l.animationGroups.length;u<h;u++){var $=l.animationGroups[u],ee=ie.Parse($,e);a.animationGroups.push(ee),s+=0===u?"\n\tAnimationGroups:":"",s+="\n\t\t"+ee.toString(d)}for(u=0,h=e.cameras.length;u<h;u++)(q=e.cameras[u])._waitingParentId&&(q.parent=e.getLastEntryByID(q._waitingParentId),q._waitingParentId=null);for(u=0,h=e.lights.length;u<h;u++){var te=e.lights[u];te&&te._waitingParentId&&(te.parent=e.getLastEntryByID(te._waitingParentId),te._waitingParentId=null)}for(u=0,h=e.transformNodes.length;u<h;u++){var ne=e.transformNodes[u];ne._waitingParentId&&(ne.parent=e.getLastEntryByID(ne._waitingParentId),ne._waitingParentId=null)}for(u=0,h=e.meshes.length;u<h;u++)(H=e.meshes[u])._waitingParentId&&(H.parent=e.getLastEntryByID(H._waitingParentId),H._waitingParentId=null),H._waitingData.lods&&ts(e,H);for(u=0,h=e.skeletons.length;u<h;u++)(B=e.skeletons[u])._hasWaitingData&&(null!=B.bones&&B.bones.forEach(function(t){if(t._waitingTransformNodeId){var i=e.getLastEntryByID(t._waitingTransformNodeId);i&&t.linkTransformNode(i),t._waitingTransformNodeId=null}}),B._waitingOverrideMeshId&&(B.overrideMesh=e.getMeshByID(B._waitingOverrideMeshId),B._waitingOverrideMeshId=null),B._hasWaitingData=null);for(u=0,h=e.meshes.length;u<h;u++){var re=e.meshes[u];re._waitingData.freezeWorldMatrix?(re.freezeWorldMatrix(),re._waitingData.freezeWorldMatrix=null):re.computeWorldMatrix(!0)}for(u=0,h=e.lights.length;u<h;u++){var oe=e.lights[u];if(oe._excludedMeshesIds.length>0){for(var ae=0;ae<oe._excludedMeshesIds.length;ae++){var se=e.getMeshByID(oe._excludedMeshesIds[ae]);se&&oe.excludedMeshes.push(se)}oe._excludedMeshesIds=[]}if(oe._includedOnlyMeshesIds.length>0){for(var ce=0;ce<oe._includedOnlyMeshesIds.length;ce++){var le=e.getMeshByID(oe._includedOnlyMeshesIds[ce]);le&&oe.includedOnlyMeshes.push(le)}oe._includedOnlyMeshesIds=[]}}for(n.a.Parse(l,e,a,i),u=0,h=e.meshes.length;u<h;u++)(H=e.meshes[u])._waitingData.actions&&(M.Parse(H._waitingData.actions,H,e),H._waitingData.actions=null);void 0!==l.actions&&null!==l.actions&&M.Parse(l.actions,null,e)}catch(e){var ue=es("loadAssets",l?l.producer:"Unknown")+s;if(!r)throw m.a.Log(ue),e;r(ue,e)}finally{o||a.removeAllFromScene(),null!==s&&ar.loggingLevel!==ar.NO_LOGGING&&m.a.Log(es("loadAssets",l?l.producer:"Unknown")+(ar.loggingLevel!==ar.MINIMAL_LOGGING?s:""))}return a};ar.RegisterPlugin({name:"babylon.js",extensions:".babylon",canDirectLoad:function(e){return-1!==e.indexOf("babylon")},importMesh:function(e,t,i,r,o,a,s,c){var l="importMesh has failed JSON parse";try{var u=JSON.parse(i);l="";var h=ar.loggingLevel===ar.DETAILED_LOGGING;e?Array.isArray(e)||(e=[e]):e=null;var d=new Array;if(void 0!==u.meshes&&null!==u.meshes){var f,p,_,g=[],v=[];for(f=0,p=u.meshes.length;f<p;f++){var b=u.meshes[f];if(null===e||$a(b,e,d)){if(null!==e&&delete e[e.indexOf(b.name)],void 0!==b.geometryId&&null!==b.geometryId&&void 0!==u.geometries&&null!==u.geometries){var y=!1;["boxes","spheres","cylinders","toruses","grounds","planes","torusKnots","vertexData"].forEach(function(e){!0!==y&&u.geometries[e]&&Array.isArray(u.geometries[e])&&u.geometries[e].forEach(function(i){if(i.id===b.geometryId){switch(e){case"vertexData":Ia.a.Parse(i,t,r)}y=!0}})}),!1===y&&m.a.Warn("Geometry not found for mesh "+b.id)}if(b.materialId){var T=-1!==v.indexOf(b.materialId);if(!1===T&&void 0!==u.multiMaterials&&null!==u.multiMaterials)for(var E=0,S=u.multiMaterials.length;E<S;E++){var A=u.multiMaterials[E];if(A.id===b.materialId){for(var P=0,C=A.materials.length;P<C;P++){var R,x=A.materials[P];v.push(x),(R=Ja(x,u,t,r))&&(l+="\n\tMaterial "+R.toString(h))}v.push(A.id);var O=Da.a.ParseMultiMaterial(A,t);O&&(T=!0,l+="\n\tMulti-Material "+O.toString(h));break}}!1===T&&(v.push(b.materialId),(R=Ja(b.materialId,u,t,r))?l+="\n\tMaterial "+R.toString(h):m.a.Warn("Material not found for mesh "+b.id))}if(b.skeletonId>-1&&void 0!==u.skeletons&&null!==u.skeletons&&!1==g.indexOf(b.skeletonId)>-1)for(var M=0,I=u.skeletons.length;M<I;M++){var D=u.skeletons[M];if(D.id===b.skeletonId){var N=tt.Parse(D,t);s.push(N),g.push(D.id),l+="\n\tSkeleton "+N.toString(h)}}if(void 0!==u.morphTargetManagers&&null!==u.morphTargetManagers)for(var L=0,w=u.morphTargetManagers;L<w.length;L++){var F=w[L];ka.Parse(F,t)}var B=be.a.Parse(b,t,r);o.push(B),l+="\n\tMesh "+B.toString(h)}}for(f=0,p=t.meshes.length;f<p;f++)(_=t.meshes[f])._waitingParentId&&(_.parent=t.getLastEntryByID(_._waitingParentId),_._waitingParentId=null),_._waitingData.lods&&ts(t,_);for(f=0,p=t.skeletons.length;f<p;f++)(N=t.skeletons[f])._hasWaitingData&&(null!=N.bones&&N.bones.forEach(function(e){if(e._waitingTransformNodeId){var i=t.getLastEntryByID(e._waitingTransformNodeId);i&&e.linkTransformNode(i),e._waitingTransformNodeId=null}}),N._waitingOverrideMeshId&&(N.overrideMesh=t.getMeshByID(N._waitingOverrideMeshId),N._waitingOverrideMeshId=null),N._hasWaitingData=null);for(f=0,p=t.meshes.length;f<p;f++)(_=t.meshes[f])._waitingData.freezeWorldMatrix?(_.freezeWorldMatrix(),_._waitingData.freezeWorldMatrix=null):_.computeWorldMatrix(!0)}if(void 0!==u.particleSystems&&null!==u.particleSystems){var U=n.a.GetIndividualParser(Me.a.NAME_PARTICLESYSTEM);if(U)for(f=0,p=u.particleSystems.length;f<p;f++){var V=u.particleSystems[f];-1!==d.indexOf(V.emitterId)&&a.push(U(V,t,r))}}return!0}catch(e){var k=es("importMesh",u?u.producer:"Unknown")+l;if(!c)throw m.a.Log(k),e;c(k,e)}finally{null!==l&&ar.loggingLevel!==ar.NO_LOGGING&&m.a.Log(es("importMesh",u?u.producer:"Unknown")+(ar.loggingLevel!==ar.MINIMAL_LOGGING?l:""))}return!1},load:function(e,t,i,n){var r="importScene has failed JSON parse";try{var o=JSON.parse(t);if(r="",void 0!==o.useDelayedTextureLoading&&null!==o.useDelayedTextureLoading&&(e.useDelayedTextureLoading=o.useDelayedTextureLoading&&!ar.ForceFullSceneLoadingForIncremental),void 0!==o.autoClear&&null!==o.autoClear&&(e.autoClear=o.autoClear),void 0!==o.clearColor&&null!==o.clearColor&&(e.clearColor=s.b.FromArray(o.clearColor)),void 0!==o.ambientColor&&null!==o.ambientColor&&(e.ambientColor=s.a.FromArray(o.ambientColor)),void 0!==o.gravity&&null!==o.gravity&&(e.gravity=a.e.FromArray(o.gravity)),o.fogMode&&0!==o.fogMode)switch(e.fogMode=o.fogMode,e.fogColor=s.a.FromArray(o.fogColor),e.fogStart=o.fogStart,e.fogEnd=o.fogEnd,e.fogDensity=o.fogDensity,r+="\tFog mode for scene:  ",e.fogMode){case 1:r+="exp\n";break;case 2:r+="exp2\n";break;case 3:r+="linear\n"}if(o.physicsEnabled){var c;"cannon"===o.physicsEngine?c=new Ha(void 0,void 0,Za.LoaderInjectedPhysicsEngine):"oimo"===o.physicsEngine?c=new Xa(void 0,Za.LoaderInjectedPhysicsEngine):"ammo"===o.physicsEngine&&(c=new Ka(void 0,Za.LoaderInjectedPhysicsEngine,void 0)),r="\tPhysics engine "+(o.physicsEngine?o.physicsEngine:"oimo")+" enabled\n";var l=o.physicsGravity?a.e.FromArray(o.physicsGravity):null;e.enablePhysics(l,c)}return void 0!==o.metadata&&null!==o.metadata&&(e.metadata=o.metadata),void 0!==o.collisionsEnabled&&null!==o.collisionsEnabled&&(e.collisionsEnabled=o.collisionsEnabled),!!is(e,t,i,n,!0)&&(o.autoAnimate&&e.beginAnimation(e,o.autoAnimateFrom,o.autoAnimateTo,o.autoAnimateLoop,o.autoAnimateSpeed||1),void 0!==o.activeCameraID&&null!==o.activeCameraID&&e.setActiveCameraByID(o.activeCameraID),!0)}catch(e){var u=es("importScene",o?o.producer:"Unknown")+r;if(!n)throw m.a.Log(u),e;n(u,e)}finally{null!==r&&ar.loggingLevel!==ar.NO_LOGGING&&m.a.Log(es("importScene",o?o.producer:"Unknown")+(ar.loggingLevel!==ar.MINIMAL_LOGGING?r:""))}return!1},loadAssetContainer:function(e,t,i,n){return is(e,t,i,n)}});var ns=i(121),rs=function(){function e(e){void 0===e&&(e={}),this._isEnabled=!0,this.bias=void 0===e.bias?0:e.bias,this.power=void 0===e.power?1:e.power,this.leftColor=e.leftColor||s.a.White(),this.rightColor=e.rightColor||s.a.Black(),!1===e.isEnabled&&(this.isEnabled=!1)}return Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,Se.a.MarkAllMaterialsAsDirty(g.a.MATERIAL_FresnelDirtyFlag|g.a.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),e.prototype.clone=function(){var t=new e;return O.a.DeepCopy(this,t),t},e.prototype.equals=function(e){return e&&this.bias===e.bias&&this.power===e.power&&this.leftColor.equals(e.leftColor)&&this.rightColor.equals(e.rightColor)&&this.isEnabled===e.isEnabled},e.prototype.serialize=function(){return{isEnabled:this.isEnabled,leftColor:this.leftColor.asArray(),rightColor:this.rightColor.asArray(),bias:this.bias,power:this.power}},e.Parse=function(t){return new e({isEnabled:t.isEnabled,leftColor:s.a.FromArray(t.leftColor),rightColor:s.a.FromArray(t.rightColor),bias:t.bias,power:t.power||1})},e}();w.a._FresnelParametersParser=rs.Parse;var os=i(119),as=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.maxSimultaneousLights=4,n.disableLighting=!1,n.invertNormalMapX=!1,n.invertNormalMapY=!1,n.emissiveColor=new s.a(0,0,0),n.occlusionStrength=1,n.useLightmapAsShadowmap=!1,n._useAlphaFromAlbedoTexture=!0,n._useAmbientInGrayScale=!0,n}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"doubleSided",{get:function(){return this._twoSidedLighting},set:function(e){this._twoSidedLighting!==e&&(this._twoSidedLighting=e,this.backFaceCulling=!e,this._markAllSubMeshesAsTexturesDirty())},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PBRBaseSimpleMaterial"},Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_reflectionTexture")],t.prototype,"environmentTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_bumpTexture")],t.prototype,"normalTexture",void 0),Object(h.c)([Object(w.e)("emissive"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_ambientTextureStrength")],t.prototype,"occlusionStrength",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_ambientTexture")],t.prototype,"occlusionTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_alphaCutOff")],t.prototype,"alphaCutOff",void 0),Object(h.c)([Object(w.c)()],t.prototype,"doubleSided",null),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),t}(_o),ss=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._useRoughnessFromMetallicTextureAlpha=!1,n._useRoughnessFromMetallicTextureGreen=!0,n._useMetallnessFromMetallicTextureBlue=!0,n.metallic=1,n.roughness=1,n}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"PBRMetallicRoughnessMaterial"},t.prototype.clone=function(e){var i=this,n=w.a.Clone(function(){return new t(e,i.getScene())},this);return n.id=e,n.name=e,this.clearCoat.copyTo(n.clearCoat),this.anisotropy.copyTo(n.anisotropy),this.brdf.copyTo(n.brdf),this.sheen.copyTo(n.sheen),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON.PBRMetallicRoughnessMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,i,n){var r=w.a.Parse(function(){return new t(e.name,i)},e,i,n);return e.clearCoat&&r.clearCoat.parse(e.clearCoat,i,n),e.anisotropy&&r.anisotropy.parse(e.anisotropy,i,n),e.brdf&&r.brdf.parse(e.brdf,i,n),e.sheen&&r.sheen.parse(e.sheen,i,n),e.subSurface&&r.subSurface.parse(e.subSurface,i,n),r},Object(h.c)([Object(w.e)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],t.prototype,"baseColor",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],t.prototype,"baseTexture",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_metallicTexture")],t.prototype,"metallicRoughnessTexture",void 0),t}(as);c.a.RegisteredTypes["BABYLON.PBRMetallicRoughnessMaterial"]=ss;var cs=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._useMicroSurfaceFromReflectivityMapAlpha=!0,n}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"PBRSpecularGlossinessMaterial"},t.prototype.clone=function(e){var i=this,n=w.a.Clone(function(){return new t(e,i.getScene())},this);return n.id=e,n.name=e,this.clearCoat.copyTo(n.clearCoat),this.anisotropy.copyTo(n.anisotropy),this.brdf.copyTo(n.brdf),this.sheen.copyTo(n.sheen),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON.PBRSpecularGlossinessMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,i,n){var r=w.a.Parse(function(){return new t(e.name,i)},e,i,n);return e.clearCoat&&r.clearCoat.parse(e.clearCoat,i,n),e.anisotropy&&r.anisotropy.parse(e.anisotropy,i,n),e.brdf&&r.brdf.parse(e.brdf,i,n),e.sheen&&r.sheen.parse(e.sheen,i,n),e.subSurface&&r.subSurface.parse(e.subSurface,i,n),r},Object(h.c)([Object(w.e)("diffuse"),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],t.prototype,"diffuseColor",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],t.prototype,"diffuseTexture",void 0),Object(h.c)([Object(w.e)("specular"),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_reflectivityColor")],t.prototype,"specularColor",void 0),Object(h.c)([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_microSurface")],t.prototype,"glossiness",void 0),Object(h.c)([Object(w.m)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty","_reflectivityTexture")],t.prototype,"specularGlossinessTexture",void 0),t}(as);c.a.RegisteredTypes["BABYLON.PBRSpecularGlossinessMaterial"]=cs;var ls=i(73),us=function(e){function t(t,i,n){void 0===n&&(n=null);var r=e.call(this,i)||this;if(!t)return r;if(r._textureMatrix=a.a.Identity(),r.name=t,r.url=t,r._onLoad=n,r._texture=r._getFromCache(t,!0),r._texture)r._triggerOnLoad();else{var o=r.getScene();o&&o.useDelayedTextureLoading?r.delayLoadState=g.a.DELAYLOADSTATE_NOTLOADED:r.loadTexture()}return r}return Object(h.d)(t,e),t.prototype._triggerOnLoad=function(){this._onLoad&&this._onLoad()},t.prototype.getTextureMatrix=function(){return this._textureMatrix},t.prototype.load3dlTexture=function(){var e,i=this,n=this._getEngine();e=1===n.webGLVersion?n.createRawTexture(null,1,1,g.a.TEXTUREFORMAT_RGBA,!1,!1,g.a.TEXTURE_BILINEAR_SAMPLINGMODE,null,g.a.TEXTURETYPE_UNSIGNED_INT):n.createRawTexture3D(null,1,1,1,g.a.TEXTUREFORMAT_RGBA,!1,!1,g.a.TEXTURE_BILINEAR_SAMPLINGMODE,null,g.a.TEXTURETYPE_UNSIGNED_INT),this._texture=e,this._texture.isReady=!1,this.isCube=!1,this.is3D=n.webGLVersion>1,this.wrapU=g.a.TEXTURE_CLAMP_ADDRESSMODE,this.wrapV=g.a.TEXTURE_CLAMP_ADDRESSMODE,this.wrapR=g.a.TEXTURE_CLAMP_ADDRESSMODE,this.anisotropicFilteringLevel=1;var r=function(r){if("string"==typeof r){for(var o,a=null,s=null,c=r.split("\n"),l=0,u=0,h=0,d=0,f=0,p=0;p<c.length;p++)if(o=c[p],t._noneEmptyLineRegex.test(o)&&0!==o.indexOf("#")){var _=o.split(" ");if(0!==l){if(0!=l){var m=Math.max(parseInt(_[0]),0),v=Math.max(parseInt(_[1]),0),b=Math.max(parseInt(_[2]),0);f=Math.max(m,f),f=Math.max(v,f),f=Math.max(b,f);var y=4*(u+d*l+h*l*l);s&&(s[y+0]=m,s[y+1]=v,s[y+2]=b),++h%l==0&&(h=0,++d%l==0&&(u++,d=0))}}else l=_.length,a=new Uint8Array(l*l*l*4),s=new Float32Array(l*l*l*4)}if(s&&a)for(p=0;p<s.length;p++)if(p>0&&(p+1)%4==0)a[p]=255;else{var T=s[p];a[p]=T/f*255}e.is3D?(e.updateSize(l,l,l),n.updateRawTexture3D(e,a,g.a.TEXTUREFORMAT_RGBA,!1)):(e.updateSize(l*l,l),n.updateRawTexture(e,a,g.a.TEXTUREFORMAT_RGBA,!1)),e.isReady=!0,i._triggerOnLoad()}},o=this.getScene();return o?o._loadFile(this.url,r):n._loadFile(this.url,r),this._texture},t.prototype.loadTexture=function(){this.url&&this.url.toLocaleLowerCase().indexOf(".3dl")==this.url.length-4&&this.load3dlTexture()},t.prototype.clone=function(){var e=new t(this.url,this.getScene()||this._getEngine());return e.level=this.level,e},t.prototype.delayLoad=function(){this.delayLoadState===g.a.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=g.a.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,!0),this._texture||this.loadTexture())},t.Parse=function(e,i){var n=null;return e.name&&!e.isRenderTarget&&((n=new t(e.name,i)).name=e.name,n.level=e.level),n},t.prototype.serialize=function(){if(!this.name)return null;var e={};return e.name=this.name,e.level=this.level,e.customType="BABYLON.ColorGradingTexture",e},t._noneEmptyLineRegex=/\S+/,t}(Hn.a);c.a.RegisteredTypes["BABYLON.ColorGradingTexture"]=us;var hs=function(e){function t(t,i,n,r,o,a,s){void 0===r&&(r=!1),void 0===o&&(o=!0),void 0===a&&(a=null),void 0===s&&(s=null);var c=e.call(this,i)||this;if(c._onLoad=null,c._onError=null,!t)throw new Error("Image url is not set");return c._coordinatesMode=Ke.a.CUBIC_MODE,c.name=t,c.url=t,c._size=n,c._noMipmap=r,c.gammaSpace=o,c._onLoad=a,c._onError=s,c.hasAlpha=!1,c.isCube=!0,c._texture=c._getFromCache(t,c._noMipmap),c._texture?a&&(c._texture.isReady?Ce.b.SetImmediate(function(){return a()}):c._texture.onLoadedObservable.add(a)):i.useDelayedTextureLoading?c.delayLoadState=g.a.DELAYLOADSTATE_NOTLOADED:c.loadImage(c.loadTexture.bind(c),c._onError),c}return Object(h.d)(t,e),t.prototype.loadImage=function(e,t){var i=this,n=document.createElement("canvas"),r=new Image;r.addEventListener("load",function(){i._width=r.width,i._height=r.height,n.width=i._width,n.height=i._height;var t=n.getContext("2d");t.drawImage(r,0,0);var o=t.getImageData(0,0,r.width,r.height);i._buffer=o.data.buffer,n.remove(),e()}),r.addEventListener("error",function(e){t&&t(i.getClassName()+" could not be loaded",e)}),r.src=this.url},t.prototype.loadTexture=function(){var e=this,i=this.getScene();i&&(this._texture=i.getEngine().createRawCubeTextureFromUrl(this.url,i,this._size,g.a.TEXTUREFORMAT_RGB,i.getEngine().getCaps().textureFloat?g.a.TEXTURETYPE_FLOAT:g.a.TEXTURETYPE_UNSIGNED_INTEGER,this._noMipmap,function(){for(var i=e.getFloat32ArrayFromArrayBuffer(e._buffer),n=Na.ConvertPanoramaToCubemap(i,e._width,e._height,e._size),r=[],o=0;o<6;o++){var a=n[t._FacesMapping[o]];r.push(a)}return r},null,this._onLoad,this._onError))},t.prototype.getFloat32ArrayFromArrayBuffer=function(e){for(var t=new DataView(e),i=new Float32Array(3*e.byteLength/4),n=0,r=0;r<e.byteLength;r++)(r+1)%4!=0&&(i[n++]=t.getUint8(r)/255);return i},t.prototype.getClassName=function(){return"EquiRectangularCubeTexture"},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var i=new t(this.url,e,this._size,this._noMipmap,this.gammaSpace);return i.level=this.level,i.wrapU=this.wrapU,i.wrapV=this.wrapV,i.coordinatesIndex=this.coordinatesIndex,i.coordinatesMode=this.coordinatesMode,i},t._FacesMapping=["right","left","up","down","front","back"],t}(Hn.a),ds=function(e){function t(i,n,r){var o=e.call(this,r.scene||r.engine)||this;return n&&(r.engine||r.scene)?(r=Object(h.a)(Object(h.a)({},t.DefaultOptions),r),o._generateMipMaps=r.generateMipMaps,o._samplingMode=r.samplingMode,o._textureMatrix=a.a.Identity(),o.name=i,o.element=n,o._isVideo=n instanceof HTMLVideoElement,o.anisotropicFilteringLevel=1,o._createInternalTexture(),o):o}return Object(h.d)(t,e),t.prototype._createInternalTexture=function(){var e=0,t=0;this._isVideo?(e=this.element.videoWidth,t=this.element.videoHeight):(e=this.element.width,t=this.element.height);var i=this._getEngine();i&&(this._texture=i.createDynamicTexture(e,t,this._generateMipMaps,this._samplingMode)),this.update()},t.prototype.getTextureMatrix=function(){return this._textureMatrix},t.prototype.update=function(e){void 0===e&&(e=null);var t=this._getEngine();if(null!=this._texture&&null!=t)if(this._isVideo){var i=this.element;if(i.readyState<i.HAVE_CURRENT_DATA)return;t.updateVideoTexture(this._texture,i,null===e||e)}else{var n=this.element;t.updateDynamicTexture(this._texture,n,null===e||e,!1)}},t.DefaultOptions={generateMipMaps:!1,samplingMode:g.a.TEXTURE_BILINEAR_SAMPLINGMODE,engine:null,scene:null},t}(Hn.a),fs=function(){function e(){}return e.GetTGAHeader=function(e){var t=0;return{id_length:e[t++],colormap_type:e[t++],image_type:e[t++],colormap_index:e[t++]|e[t++]<<8,colormap_length:e[t++]|e[t++]<<8,colormap_size:e[t++],origin:[e[t++]|e[t++]<<8,e[t++]|e[t++]<<8],width:e[t++]|e[t++]<<8,height:e[t++]|e[t++]<<8,pixel_size:e[t++],flags:e[t++]}},e.UploadContent=function(t,i){if(i.length<19)m.a.Error("Unable to load TGA file - Not enough data to contain header");else{var n=18,r=e.GetTGAHeader(i);if(r.id_length+n>i.length)m.a.Error("Unable to load TGA file - Not enough data");else{n+=r.id_length;var o,a=!1,s=!1,c=!1;switch(r.image_type){case e._TYPE_RLE_INDEXED:a=!0;case e._TYPE_INDEXED:s=!0;break;case e._TYPE_RLE_RGB:a=!0;case e._TYPE_RGB:break;case e._TYPE_RLE_GREY:a=!0;case e._TYPE_GREY:c=!0}var l,u,h,d,f,p,_,g=r.pixel_size>>3,v=r.width*r.height*g;if(s&&(l=i.subarray(n,n+=r.colormap_length*(r.colormap_size>>3))),a){var b,y,T;o=new Uint8Array(v);for(var E=0,S=new Uint8Array(g);n<v&&E<v;)if(y=1+(127&(b=i[n++])),128&b){for(T=0;T<g;++T)S[T]=i[n++];for(T=0;T<y;++T)o.set(S,E+T*g);E+=g*y}else{for(y*=g,T=0;T<y;++T)o[E+T]=i[n++];E+=y}}else o=i.subarray(n,n+=s?r.width*r.height:v);switch((r.flags&e._ORIGIN_MASK)>>e._ORIGIN_SHIFT){default:case e._ORIGIN_UL:u=0,d=1,_=r.width,h=0,f=1,p=r.height;break;case e._ORIGIN_BL:u=0,d=1,_=r.width,h=r.height-1,f=-1,p=-1;break;case e._ORIGIN_UR:u=r.width-1,d=-1,_=-1,h=0,f=1,p=r.height;break;case e._ORIGIN_BR:u=r.width-1,d=-1,_=-1,h=r.height-1,f=-1,p=-1}var A=e["_getImageData"+(c?"Grey":"")+r.pixel_size+"bits"](r,l,o,h,f,p,u,d,_);t.getEngine()._uploadDataToTextureDirectly(t,A)}}},e._getImageData8bits=function(e,t,i,n,r,o,a,s,c){var l,u,h,d=i,f=t,p=e.width,_=e.height,m=0,g=new Uint8Array(p*_*4);for(h=n;h!==o;h+=r)for(u=a;u!==c;u+=s,m++)l=d[m],g[4*(u+p*h)+3]=255,g[4*(u+p*h)+2]=f[3*l+0],g[4*(u+p*h)+1]=f[3*l+1],g[4*(u+p*h)+0]=f[3*l+2];return g},e._getImageData16bits=function(e,t,i,n,r,o,a,s,c){var l,u,h,d=i,f=e.width,p=e.height,_=0,m=new Uint8Array(f*p*4);for(h=n;h!==o;h+=r)for(u=a;u!==c;u+=s,_+=2){var g=255*((31744&(l=d[_+0]+(d[_+1]<<8)))>>10)/31|0,v=255*((992&l)>>5)/31|0,b=255*(31&l)/31|0;m[4*(u+f*h)+0]=g,m[4*(u+f*h)+1]=v,m[4*(u+f*h)+2]=b,m[4*(u+f*h)+3]=32768&l?0:255}return m},e._getImageData24bits=function(e,t,i,n,r,o,a,s,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=n;u!==o;u+=r)for(l=a;l!==c;l+=s,p+=3)_[4*(l+d*u)+3]=255,_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+1]=h[p+1],_[4*(l+d*u)+0]=h[p+2];return _},e._getImageData32bits=function(e,t,i,n,r,o,a,s,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=n;u!==o;u+=r)for(l=a;l!==c;l+=s,p+=4)_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+1]=h[p+1],_[4*(l+d*u)+0]=h[p+2],_[4*(l+d*u)+3]=h[p+3];return _},e._getImageDataGrey8bits=function(e,t,i,n,r,o,a,s,c){var l,u,h,d=i,f=e.width,p=e.height,_=0,m=new Uint8Array(f*p*4);for(h=n;h!==o;h+=r)for(u=a;u!==c;u+=s,_++)l=d[_],m[4*(u+f*h)+0]=l,m[4*(u+f*h)+1]=l,m[4*(u+f*h)+2]=l,m[4*(u+f*h)+3]=255;return m},e._getImageDataGrey16bits=function(e,t,i,n,r,o,a,s,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=n;u!==o;u+=r)for(l=a;l!==c;l+=s,p+=2)_[4*(l+d*u)+0]=h[p+0],_[4*(l+d*u)+1]=h[p+0],_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+3]=h[p+1];return _},e._TYPE_INDEXED=1,e._TYPE_RGB=2,e._TYPE_GREY=3,e._TYPE_RLE_INDEXED=9,e._TYPE_RLE_RGB=10,e._TYPE_RLE_GREY=11,e._ORIGIN_MASK=48,e._ORIGIN_SHIFT=4,e._ORIGIN_BL=0,e._ORIGIN_BR=1,e._ORIGIN_UL=2,e._ORIGIN_UR=3,e}(),ps=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return jr.a.EndsWith(e,".tga")},e.prototype.loadCubeData=function(e,t,i,n,r){throw".env not supported in Cube."},e.prototype.loadData=function(e,t,i){var n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=fs.GetTGAHeader(n);i(r.width,r.height,t.generateMipMaps,!1,function(){fs.UploadContent(t,n)})},e}();Se.a._TextureLoaders.push(new ps);var _s,ms=function(){};!function(e){e[e.cTFETC1=0]="cTFETC1",e[e.cTFBC1=1]="cTFBC1",e[e.cTFBC4=2]="cTFBC4",e[e.cTFPVRTC1_4_OPAQUE_ONLY=3]="cTFPVRTC1_4_OPAQUE_ONLY",e[e.cTFBC7_M6_OPAQUE_ONLY=4]="cTFBC7_M6_OPAQUE_ONLY",e[e.cTFETC2=5]="cTFETC2",e[e.cTFBC3=6]="cTFBC3",e[e.cTFBC5=7]="cTFBC5"}(_s||(_s={}));var gs=function(){function e(){}return e.GetInternalFormatFromBasisFormat=function(e){if(e===_s.cTFETC1)return 36196;if(e===_s.cTFBC1)return 33776;if(e===_s.cTFBC3)return 33779;throw"The chosen Basis transcoder format is not currently supported"},e._CreateWorkerAsync=function(){var t=this;return this._WorkerPromise||(this._WorkerPromise=new Promise(function(i){t._Worker?i(t._Worker):Ce.b.LoadFileAsync(e.WasmModuleURL).then(function(n){var r=URL.createObjectURL(new Blob(["("+vs+")()"],{type:"application/javascript"}));t._Worker=new Worker(r);var o=function(e){"init"===e.data.action&&(t._Worker.removeEventListener("message",o),i(t._Worker))};t._Worker.addEventListener("message",o),t._Worker.postMessage({action:"init",url:e.JSModuleURL,wasmBinary:n})})})),this._WorkerPromise},e.TranscodeAsync=function(e,t){var i=this,n=e instanceof ArrayBuffer?new Uint8Array(e):e;return new Promise(function(e,r){i._CreateWorkerAsync().then(function(){var o=i._actionId++,a=function(t){"transcode"===t.data.action&&t.data.id===o&&(i._Worker.removeEventListener("message",a),t.data.success?e(t.data):r("Transcode is not supported on this device"))};i._Worker.addEventListener("message",a);var s=new Uint8Array(n.byteLength);s.set(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),i._Worker.postMessage({action:"transcode",id:o,imageData:s,config:t,ignoreSupportedFormats:i._IgnoreSupportedFormats},[s.buffer])})})},e.LoadTextureFromTranscodeResult=function(t,i){for(var n,r=t.getEngine(),o=function(){if(n=i.fileInfo.images[a].levels[0],t._invertVScale=t.invertY,-1===i.format)if(t.type=g.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,t.format=g.a.TEXTUREFORMAT_RGB,r.webGLVersion<2&&(L.a.Log2(n.width)%1!=0||L.a.Log2(n.height)%1!=0)){var o=new Qe.a(r,Qe.b.Temp);t._invertVScale=t.invertY,o.type=g.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,o.format=g.a.TEXTUREFORMAT_RGB,o.width=n.width+3&-4,o.height=n.height+3&-4,r._bindTextureDirectly(r._gl.TEXTURE_2D,o,!0),r._uploadDataToTextureDirectly(o,n.transcodedPixels,a,0,g.a.TEXTUREFORMAT_RGB,!0),r._rescaleTexture(o,t,r.scenes[0],r._getInternalFormat(g.a.TEXTUREFORMAT_RGB),function(){r._releaseTexture(o),r._bindTextureDirectly(r._gl.TEXTURE_2D,t,!0)})}else t._invertVScale=!t.invertY,t.width=n.width+3&-4,t.height=n.height+3&-4,r._uploadDataToTextureDirectly(t,n.transcodedPixels,a,0,g.a.TEXTUREFORMAT_RGB,!0);else t.width=n.width,t.height=n.height,i.fileInfo.images[a].levels.forEach(function(n,o){r._uploadCompressedDataToTextureDirectly(t,e.GetInternalFormatFromBasisFormat(i.format),n.width,n.height,n.transcodedPixels,a,o)}),r.webGLVersion<2&&(L.a.Log2(t.width)%1!=0||L.a.Log2(t.height)%1!=0)&&(Ce.b.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1."),t._cachedWrapU=Ke.a.CLAMP_ADDRESSMODE,t._cachedWrapV=Ke.a.CLAMP_ADDRESSMODE)},a=0;a<i.fileInfo.images.length;a++)o()},e._IgnoreSupportedFormats=!1,e.JSModuleURL="https://preview.babylonjs.com/basisTranscoder/basis_transcoder.js",e.WasmModuleURL="https://preview.babylonjs.com/basisTranscoder/basis_transcoder.wasm",e._WorkerPromise=null,e._Worker=null,e._actionId=0,e}();function vs(){var e=null;function t(e,t,i,n,r){var o=e.getImageTranscodedSizeInBytes(t,i,n),a=new Uint8Array(o);return e.transcodeImage(a,t,i,n,1,0)?(r&&(a=function(e,t,i,n){for(var r=new Uint16Array(4),o=new Uint16Array(i*n),a=i/4,s=n/4,c=0;c<s;c++)for(var l=0;l<a;l++){var u=0+8*(c*a+l);r[0]=e[u]|e[u+1]<<8,r[1]=e[u+2]|e[u+3]<<8,r[2]=(2*(31&r[0])+1*(31&r[1]))/3|(2*(2016&r[0])+1*(2016&r[1]))/3&2016|(2*(63488&r[0])+1*(63488&r[1]))/3&63488,r[3]=(2*(31&r[1])+1*(31&r[0]))/3|(2*(2016&r[1])+1*(2016&r[0]))/3&2016|(2*(63488&r[1])+1*(63488&r[0]))/3&63488;for(var h=0;h<4;h++){var d=e[u+4+h],f=(4*c+h)*i+4*l;o[f++]=r[3&d],o[f++]=r[d>>2&3],o[f++]=r[d>>4&3],o[f++]=r[d>>6&3]}}return o}(a,0,e.getImageWidth(t,i)+3&-4,e.getImageHeight(t,i)+3&-4)),a):null}onmessage=function(i){if("init"===i.data.action)e||(Module={wasmBinary:i.data.wasmBinary},importScripts(i.data.url),e=new Promise(function(e){Module.onRuntimeInitialized=function(){Module.initializeBasis(),e()}})),e.then(function(){postMessage({action:"init"})});else if("transcode"===i.data.action){var n=i.data.config,r=i.data.imageData,o=new Module.BasisFile(r),a=function(e){for(var t=e.getHasAlpha(),i=e.getNumImages(),n=[],r=0;r<i;r++){for(var o={levels:[]},a=e.getNumLevels(r),s=0;s<a;s++){var c={width:e.getImageWidth(r,s),height:e.getImageHeight(r,s)};o.levels.push(c)}n.push(o)}return{hasAlpha:t,images:n}}(o),s=i.data.ignoreSupportedFormats?null:function(e,t){var i=null;return e.supportedCompressionFormats&&(e.supportedCompressionFormats.etc1?i=0:e.supportedCompressionFormats.s3tc?i=t.hasAlpha?6:1:e.supportedCompressionFormats.pvrtc||e.supportedCompressionFormats.etc2&&(i=5)),i}(i.data.config,a),c=!1;null===s&&(c=!0,s=a.hasAlpha?6:1);var l=!0;o.startTranscoding()||(l=!1);for(var u=[],h=0;h<a.images.length&&l;h++){var d=a.images[h];if(void 0===n.loadSingleImage||n.loadSingleImage===h){var f=d.levels.length;!1===n.loadMipmapLevels&&(f=1);for(var p=0;p<f;p++){var _=d.levels[p],m=t(o,h,p,s,c);if(!m){l=!1;break}_.transcodedPixels=m,u.push(_.transcodedPixels.buffer)}}}o.close(),o.delete(),c&&(s=-1),l?postMessage({action:"transcode",success:l,id:i.data.id,fileInfo:a,format:s},u):postMessage({action:"transcode",success:l,id:i.data.id})}}}var bs=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return jr.a.EndsWith(e,".basis")},e.prototype.loadCubeData=function(e,t,i,n,r){if(!Array.isArray(e)){var o=t.getEngine().getCaps(),a={supportedCompressionFormats:{etc1:!!o.etc1,s3tc:!!o.s3tc,pvrtc:!!o.pvrtc,etc2:!!o.etc2}};gs.TranscodeAsync(e,a).then(function(e){var i=e.fileInfo.images[0].levels.length>1&&t.generateMipMaps;gs.LoadTextureFromTranscodeResult(t,e),t.getEngine()._setCubeMapTextureParams(t,i),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n()}).catch(function(e){Ce.b.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),t.isReady=!0})}},e.prototype.loadData=function(e,t,i){var n=t.getEngine().getCaps(),r={supportedCompressionFormats:{etc1:!!n.etc1,s3tc:!!n.s3tc,pvrtc:!!n.pvrtc,etc2:!!n.etc2}};gs.TranscodeAsync(e,r).then(function(e){var n=e.fileInfo.images[0].levels[0],r=e.fileInfo.images[0].levels.length>1&&t.generateMipMaps;i(n.width,n.height,r,-1!==e.format,function(){gs.LoadTextureFromTranscodeResult(t,e)})}).catch(function(e){Ce.b.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),i(0,0,!1,!1,function(){})})},e}();Se.a._TextureLoaders.push(new bs);var ys=function(e){function t(t,i,n,r,o){var a=this,s=!(!o||!o.generateMipMaps)&&o.generateMipMaps,c=!(!o||!o.generateDepthTexture)&&o.generateDepthTexture,l=!o||void 0===o.doNotChangeAspectRatio||o.doNotChangeAspectRatio;if((a=e.call(this,t,i,r,s,l)||this).isSupported){var u=[],h=[];a._initTypes(n,u,h,o);var d=!o||void 0===o.generateDepthBuffer||o.generateDepthBuffer,f=!(!o||void 0===o.generateStencilBuffer)&&o.generateStencilBuffer;return a._size=i,a._multiRenderTargetOptions={samplingModes:h,generateMipMaps:s,generateDepthBuffer:d,generateStencilBuffer:f,generateDepthTexture:c,types:u,textureCount:n},a._count=n,a._createInternalTextures(),a._createTextures(),a}a.dispose()}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"isSupported",{get:function(){return this._getEngine().webGLVersion>1||this._getEngine().getCaps().drawBuffersExtension},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textures",{get:function(){return this._textures},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTexture",{get:function(){return this._textures[this._textures.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapU",{set:function(e){if(this._textures)for(var t=0;t<this._textures.length;t++)this._textures[t].wrapU=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapV",{set:function(e){if(this._textures)for(var t=0;t<this._textures.length;t++)this._textures[t].wrapV=e},enumerable:!1,configurable:!0}),t.prototype._initTypes=function(e,t,i,n){for(var r=0;r<e;r++)n&&n.types&&void 0!==n.types[r]?t.push(n.types[r]):t.push(n&&n.defaultType?n.defaultType:g.a.TEXTURETYPE_UNSIGNED_INT),n&&n.samplingModes&&void 0!==n.samplingModes[r]?i.push(n.samplingModes[r]):i.push(Ke.a.BILINEAR_SAMPLINGMODE)},t.prototype._rebuild=function(e){void 0===e&&(e=!1),this.releaseInternalTextures(),this._createInternalTextures(),e&&this._createTextures();for(var t=0;t<this._internalTextures.length;t++)this._textures[t]._texture=this._internalTextures[t];this._texture=this._internalTextures[0],1!==this.samples&&this._getEngine().updateMultipleRenderTargetTextureSampleCount(this._internalTextures,this.samples)},t.prototype._createInternalTextures=function(){this._internalTextures=this._getEngine().createMultipleRenderTarget(this._size,this._multiRenderTargetOptions)},t.prototype._createTextures=function(){this._textures=[];for(var e=0;e<this._internalTextures.length;e++){var t=new Ke.a(null,this.getScene());t._texture=this._internalTextures[e],this._textures.push(t)}this._texture=this._internalTextures[0]},t.prototype.replaceTexture=function(e,t){e._texture&&(this._textures[t]=e,this._internalTextures[t]=e._texture)},Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples!==e&&(this._samples=this._getEngine().updateMultipleRenderTargetTextureSampleCount(this._internalTextures,e))},enumerable:!1,configurable:!0}),t.prototype.resize=function(e){this._size=e,this._rebuild()},t.prototype.updateCount=function(e,t){this._multiRenderTargetOptions.textureCount=e,this._count=e;var i=[],n=[];this._initTypes(e,i,n,t),this._multiRenderTargetOptions.types=i,this._multiRenderTargetOptions.samplingModes=n,this._rebuild(!0)},t.prototype.unbindFrameBuffer=function(e,t){var i=this;e.unBindMultiColorAttachmentFramebuffer(this._internalTextures,this.isCube,function(){i.onAfterRenderObservable.notifyObservers(t)})},t.prototype.dispose=function(){this.releaseInternalTextures(),e.prototype.dispose.call(this)},t.prototype.releaseInternalTextures=function(){if(this._internalTextures)for(var e=this._internalTextures.length-1;e>=0;e--)void 0!==this._internalTextures[e]&&(this._internalTextures[e].dispose(),this._internalTextures.splice(e,1))},t}(Ri),Ts=function(e,t,i){this.id=e,this.scale=t,this.offset=i},Es=function(){function e(t,i,n,r){var o,a,c,l,u,h,d,f,p,_,m,g,v;return this.name=t,this.meshes=i,this.scene=r,this.options=n,this.options.map=null!==(o=this.options.map)&&void 0!==o?o:["ambientTexture","bumpTexture","diffuseTexture","emissiveTexture","lightmapTexture","opacityTexture","reflectionTexture","refractionTexture","specularTexture"],this.options.uvsIn=null!==(a=this.options.uvsIn)&&void 0!==a?a:ji.b.UVKind,this.options.uvsOut=null!==(c=this.options.uvsOut)&&void 0!==c?c:ji.b.UVKind,this.options.layout=null!==(l=this.options.layout)&&void 0!==l?l:e.LAYOUT_STRIP,this.options.layout===e.LAYOUT_COLNUM&&(this.options.colnum=null!==(u=this.options.colnum)&&void 0!==u?u:8),this.options.updateInputMeshes=null===(h=this.options.updateInputMeshes)||void 0===h||h,this.options.disposeSources=null===(d=this.options.disposeSources)||void 0===d||d,this._expecting=0,this.options.fillBlanks=null===(f=this.options.fillBlanks)||void 0===f||f,!0===this.options.fillBlanks&&(this.options.customFillColor=null!==(p=this.options.customFillColor)&&void 0!==p?p:"black"),this.options.frameSize=null!==(_=this.options.frameSize)&&void 0!==_?_:256,this.options.paddingRatio=null!==(m=this.options.paddingRatio)&&void 0!==m?m:.0115,this._paddingValue=Math.ceil(this.options.frameSize*this.options.paddingRatio),this._paddingValue%2!=0&&this._paddingValue++,this.options.paddingMode=null!==(g=this.options.paddingMode)&&void 0!==g?g:e.SUBUV_WRAP,this.options.paddingMode===e.SUBUV_COLOR&&(this.options.paddingColor=null!==(v=this.options.paddingColor)&&void 0!==v?v:new s.b(0,0,0,1)),this.sets={},this.frames=[],this}return e.prototype._createFrames=function(e){for(var t=this,i=this._calculateSize(),n=new a.d(1,1).divide(i),r=0,o=this._expecting,c=this.meshes.length,l=Object.keys(this.sets),u=0;u<l.length;u++){var h=l[u],d=new Vi.a(this.name+".TexturePack."+h+"Set",{width:i.x,height:i.y},this.scene,!0,Ke.a.TRILINEAR_SAMPLINGMODE,Se.a.TEXTUREFORMAT_RGBA),f=d.getContext();f.fillStyle="rgba(0,0,0,0)",f.fillRect(0,0,i.x,i.y),d.update(!1),this.sets[h]=d}var p=this.options.frameSize||256,_=this._paddingValue,m=p+2*_;for(u=0;u<c;u++)for(var g=this.meshes[u].material,v=function(a){var c=new Vi.a("temp",m,b.scene,!0),h=c.getContext(),d=b._getFrameOffset(u),f=function(){r++,c.update(!1);var a=h.getImageData(0,0,m,m),s=t.sets[v];if(s.getContext().putImageData(a,i.x*d.x,i.y*d.y),c.dispose(),s.update(!1),r==o)return t._calculateMeshUVFrames(p,_,i,n,t.options.updateInputMeshes||!1),void e()},v=l[a]||"_blank";if(g&&null!==g[v]){var y=g[v],T=new Image;y instanceof Vi.a?T.src=y.getContext().canvas.toDataURL("image/png"):T.src=y.url,Ce.b.SetCorsBehavior(T.src,T),T.onload=function(){h.fillStyle="rgba(0,0,0,0)",h.fillRect(0,0,m,m),c.update(!1),h.setTransform(1,0,0,-1,0,0);var e=[0,0,1,0,1,1,0,1,-1,1,-1,0,-2,0,-1,1,-1];switch(t.options.paddingMode){case 0:for(var i=0;i<9;i++)h.drawImage(T,0,0,T.width,T.height,_+p*e[i],_+p*e[i+1]-m,p,p);break;case 1:for(var n=0;n<_;n++)h.drawImage(T,0,0,T.width,T.height,n+p*e[0],_-m,p,p),h.drawImage(T,0,0,T.width,T.height,2*_-n,_-m,p,p),h.drawImage(T,0,0,T.width,T.height,_,n-m,p,p),h.drawImage(T,0,0,T.width,T.height,_,2*_-n-m,p,p);h.drawImage(T,0,0,T.width,T.height,_+p*e[0],_+p*e[1]-m,p,p);break;case 2:h.fillStyle=(t.options.paddingColor||s.a.Black()).toHexString(),h.fillRect(0,0,m,-m),h.clearRect(_,_,p,p),h.drawImage(T,0,0,T.width,T.height,_+p*e[0],_+p*e[1]-m,p,p)}h.setTransform(1,0,0,1,0,0),f()}}else h.fillStyle="rgba(0,0,0,0)",b.options.fillBlanks&&(h.fillStyle=b.options.customFillColor),h.fillRect(0,0,m,m),f()},b=this,y=0;y<l.length;y++)v(y)},e.prototype._calculateSize=function(){var e=this.meshes.length||0,t=this.options.frameSize||0,i=this._paddingValue||0;switch(this.options.layout){case 0:return new a.d(t*e+2*i*e,t+2*i);case 1:var n=Math.max(2,Math.ceil(Math.sqrt(e))),r=t*n+2*i*n;return new a.d(r,r);case 2:var o=this.options.colnum||1,s=Math.max(1,Math.ceil(e/o));return new a.d(t*o+2*i*o,t*s+2*i*s)}return a.d.Zero()},e.prototype._calculateMeshUVFrames=function(e,t,i,n,r){for(var o=this.meshes.length,s=0;s<o;s++){var c=this.meshes[s],l=new a.d(e/i.x,e/i.y),u=n.clone().scale(t),h=this._getFrameOffset(s).add(u),d=new Ts(s,l,h);this.frames.push(d),r&&(this._updateMeshUV(c,s),this._updateTextureReferences(c))}},e.prototype._getFrameOffset=function(e){var t,i,n,r=this.meshes.length;switch(this.options.layout){case 0:return t=1/r,new a.d(e*t,0);case 1:var o=Math.max(2,Math.ceil(Math.sqrt(r)));return n=e-(i=Math.floor(e/o))*o,t=1/o,new a.d(n*t,i*t);case 2:var s=this.options.colnum||1,c=Math.max(1,Math.ceil(r/s));return i=e-(n=Math.floor(e/c))*c,t=new a.d(1/s,1/c),new a.d(n*t.x,i*t.y)}return a.d.Zero()},e.prototype._updateMeshUV=function(e,t){var i=this.frames[t],n=e.getVerticesData(this.options.uvsIn||ji.b.UVKind),r=[],o=0;n.length&&(o=n.length||0);for(var a=0;a<o;a+=2)r.push(n[a]*i.scale.x+i.offset.x,n[a+1]*i.scale.y+i.offset.y);e.setVerticesData(this.options.uvsOut||ji.b.UVKind,r)},e.prototype._updateTextureReferences=function(e,t){void 0===t&&(t=!1);for(var i=e.material,n=Object.keys(this.sets),r=function(e){e.dispose&&e.dispose()},o=0;o<n.length;o++){var a=n[o];if(t)null!==i[a]&&r(i[a]),i[a]=this.sets[a];else{if(!i)return;null!==i[a]&&(r(i[a]),i[a]=this.sets[a])}}},e.prototype.setMeshToFrame=function(e,t,i){void 0===i&&(i=!1),this._updateMeshUV(e,t),i&&this._updateTextureReferences(e,!0)},e.prototype.processAsync=function(){var e=this;return new Promise(function(t,i){try{if(0===e.meshes.length)return void t();for(var n=0,r=function(i){var r=e.meshes[i],o=r.material;if(!o)return++n===e.meshes.length?{value:e._createFrames(t)}:"continue";o.forceCompilationAsync(r).then(function(){!function(i){if(n++,e.options.map){for(var r=0;r<e.options.map.length;r++)null!==i[e.options.map[r]]&&(e.sets[e.options.map[r]]||(e.sets[e.options.map[r]]=!0),e._expecting++);n===e.meshes.length&&e._createFrames(t)}}(o)})},o=0;o<e.meshes.length;o++){var a=r(o);if("object"==typeof a)return a.value}}catch(e){return i(e)}})},e.prototype.dispose=function(){for(var e=Object.keys(this.sets),t=0;t<e.length;t++){var i=e[t];this.sets[i].dispose()}},e.prototype.download=function(e,t){var i=this;void 0===e&&(e="png"),void 0===t&&(t=1),setTimeout(function(){var n={name:i.name,sets:{},options:{},frames:[]},r=Object.keys(i.sets),o=Object.keys(i.options);try{for(var a=0;a<r.length;a++){var s=r[a],c=i.sets[s];n.sets[s]=c.getContext().canvas.toDataURL("image/"+e,t)}for(a=0;a<o.length;a++){var l=o[a];n.options[l]=i.options[l]}for(a=0;a<i.frames.length;a++){var u=i.frames[a];n.frames.push(u.scale.x,u.scale.y,u.offset.x,u.offset.y)}}catch(e){return void m.a.Warn("Unable to download: "+e)}var h="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(n,null,4)),d=document.createElement("a");d.setAttribute("href",h),d.setAttribute("download",i.name+"_texurePackage.json"),document.body.appendChild(d),d.click(),d.remove()},0)},e.prototype.updateFromJSON=function(e){try{var t=JSON.parse(e);this.name=t.name;for(var i=Object.keys(t.options),n=0;n<i.length;n++)this.options[i[n]]=t.options[i[n]];for(n=0;n<t.frames.length;n+=4){var r=new Ts(n/4,new a.d(t.frames[n],t.frames[n+1]),new a.d(t.frames[n+2],t.frames[n+3]));this.frames.push(r)}var o=Object.keys(t.sets);for(n=0;n<o.length;n++){var s=new Ke.a(t.sets[o[n]],this.scene,!1,!1);this.sets[o[n]]=s}}catch(e){m.a.Warn("Unable to update from JSON: "+e)}},e.LAYOUT_STRIP=0,e.LAYOUT_POWER2=1,e.LAYOUT_COLNUM=2,e.SUBUV_WRAP=0,e.SUBUV_EXTEND=1,e.SUBUV_COLOR=2,e}(),Ss=function(){function e(e){this.name=Me.a.NAME_PROCEDURALTEXTURE,this.scene=e,this.scene.proceduralTextures=new Array}return e.prototype.register=function(){this.scene._beforeClearStage.registerStep(Me.a.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype._beforeClear=function(){if(this.scene.proceduralTexturesEnabled){Ce.b.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(var e=0;e<this.scene.proceduralTextures.length;e++){var t=this.scene.proceduralTextures[e];t._shouldRender()&&t.render()}Ce.b.EndPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0)}},e}();ai.a.ShadersStore.proceduralVertexShader="\nattribute vec2 position;\n\nvarying vec2 vPosition;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvPosition=position;\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}";var As=function(e){function t(t,i,n,r,a,s,c,l){void 0===a&&(a=null),void 0===s&&(s=!0),void 0===c&&(c=!1),void 0===l&&(l=g.a.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,null,r,!s)||this;u.isEnabled=!0,u.autoClear=!0,u.onGeneratedObservable=new o.c,u.onBeforeGenerationObservable=new o.c,u.nodeMaterialSource=null,u._textures={},u._currentRefreshId=-1,u._frameId=-1,u._refreshRate=1,u._vertexBuffers={},u._uniforms=new Array,u._samplers=new Array,u._floats={},u._ints={},u._floatsArrays={},u._colors3={},u._colors4={},u._vectors2={},u._vectors3={},u._matrices={},u._fallbackTextureUsed=!1,u._cachedDefines="",u._contentUpdateId=-1;var h=(r=u.getScene()||x.a.LastCreatedScene)._getComponent(Me.a.NAME_PROCEDURALTEXTURE);h||(h=new Ss(r),r._addComponent(h)),r.proceduralTextures.push(u),u._fullEngine=r.getEngine(),u.name=t,u.isRenderTarget=!0,u._size=i,u._generateMipMaps=s,u.setFragment(n),u._fallbackTexture=a,c?(u._texture=u._fullEngine.createRenderTargetCubeTexture(i,{generateMipMaps:s,generateDepthBuffer:!1,generateStencilBuffer:!1,type:l}),u.setFloat("face",0)):u._texture=u._fullEngine.createRenderTargetTexture(i,{generateMipMaps:s,generateDepthBuffer:!1,generateStencilBuffer:!1,type:l});var d=[];return d.push(1,1),d.push(-1,1),d.push(-1,-1),d.push(1,-1),u._vertexBuffers[ji.b.PositionKind]=new ji.b(u._fullEngine,d,ji.b.PositionKind,!1,!1,2),u._createIndexBuffer(),u}return Object(h.d)(t,e),t.prototype.getEffect=function(){return this._effect},t.prototype.getContent=function(){return this._contentData&&this._frameId===this._contentUpdateId||(this._contentData=this.readPixels(0,0,this._contentData),this._contentUpdateId=this._frameId),this._contentData},t.prototype._createIndexBuffer=function(){var e=this._fullEngine,t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)},t.prototype._rebuild=function(){var e=this._vertexBuffers[ji.b.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this.refreshRate===Ri.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=Ri.REFRESHRATE_RENDER_ONCE)},t.prototype.reset=function(){void 0!==this._effect&&this._effect.dispose()},t.prototype._getDefines=function(){return""},t.prototype.isReady=function(){var e,t=this,i=this._fullEngine;if(this.nodeMaterialSource)return this._effect.isReady();if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;var n=this._getDefines();return!(!this._effect||n!==this._cachedDefines||!this._effect.isReady())||(e=void 0!==this._fragment.fragmentElement?{vertex:"procedural",fragmentElement:this._fragment.fragmentElement}:{vertex:"procedural",fragment:this._fragment},this._cachedDefines=n,this._effect=i.createEffect(e,[ji.b.PositionKind],this._uniforms,this._samplers,n,void 0,void 0,function(){t.releaseInternalTexture(),t._fallbackTexture&&(t._texture=t._fallbackTexture._texture,t._texture&&t._texture.incrementReferences()),t._fallbackTextureUsed=!0}),this._effect.isReady())},t.prototype.resetRefreshCounter=function(){this._currentRefreshId=-1},t.prototype.setFragment=function(e){this._fragment=e},Object.defineProperty(t.prototype,"refreshRate",{get:function(){return this._refreshRate},set:function(e){this._refreshRate=e,this.resetRefreshCounter()},enumerable:!1,configurable:!0}),t.prototype._shouldRender=function(){return this.isEnabled&&this.isReady()&&this._texture?!this._fallbackTextureUsed&&(-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,this._frameId++,!0):(this._currentRefreshId++,!1)):(this._texture&&(this._texture.isReady=!1),!1)},t.prototype.getRenderSize=function(){return this._size},t.prototype.resize=function(e,t){this._fallbackTextureUsed||(this.releaseInternalTexture(),this._texture=this._fullEngine.createRenderTargetTexture(e,t),this._size=e,this._generateMipMaps=t)},t.prototype._checkUniform=function(e){-1===this._uniforms.indexOf(e)&&this._uniforms.push(e)},t.prototype.setTexture=function(e,t){return-1===this._samplers.indexOf(e)&&this._samplers.push(e),this._textures[e]=t,this},t.prototype.setFloat=function(e,t){return this._checkUniform(e),this._floats[e]=t,this},t.prototype.setInt=function(e,t){return this._checkUniform(e),this._ints[e]=t,this},t.prototype.setFloats=function(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this},t.prototype.setColor3=function(e,t){return this._checkUniform(e),this._colors3[e]=t,this},t.prototype.setColor4=function(e,t){return this._checkUniform(e),this._colors4[e]=t,this},t.prototype.setVector2=function(e,t){return this._checkUniform(e),this._vectors2[e]=t,this},t.prototype.setVector3=function(e,t){return this._checkUniform(e),this._vectors3[e]=t,this},t.prototype.setMatrix=function(e,t){return this._checkUniform(e),this._matrices[e]=t,this},t.prototype.render=function(e){var t=this.getScene();if(t){var i=this._fullEngine;if(i.enableEffect(this._effect),this.onBeforeGenerationObservable.notifyObservers(this),i.setState(!1),!this.nodeMaterialSource){for(var n in this._textures)this._effect.setTexture(n,this._textures[n]);for(n in this._ints)this._effect.setInt(n,this._ints[n]);for(n in this._floats)this._effect.setFloat(n,this._floats[n]);for(n in this._floatsArrays)this._effect.setArray(n,this._floatsArrays[n]);for(n in this._colors3)this._effect.setColor3(n,this._colors3[n]);for(n in this._colors4){var r=this._colors4[n];this._effect.setFloat4(n,r.r,r.g,r.b,r.a)}for(n in this._vectors2)this._effect.setVector2(n,this._vectors2[n]);for(n in this._vectors3)this._effect.setVector3(n,this._vectors3[n]);for(n in this._matrices)this._effect.setMatrix(n,this._matrices[n])}if(this._texture){if(this.isCube)for(var o=0;o<6;o++)i.bindFramebuffer(this._texture,o,void 0,void 0,!0),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect),this._effect.setFloat("face",o),this.autoClear&&i.clear(t.clearColor,!0,!1,!1),i.drawElementsType(lo.a.TriangleFillMode,0,6),5===o&&i.generateMipMapsForCubemap(this._texture);else i.bindFramebuffer(this._texture,0,void 0,void 0,!0),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect),this.autoClear&&i.clear(t.clearColor,!0,!1,!1),i.drawElementsType(lo.a.TriangleFillMode,0,6);i.unBindFramebuffer(this._texture,this.isCube),this.onGenerated&&this.onGenerated(),this.onGeneratedObservable.notifyObservers(this)}}},t.prototype.clone=function(){var e=this.getSize(),i=new t(this.name,e.width,this._fragment,this.getScene(),this._fallbackTexture,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.coordinatesMode=this.coordinatesMode,i},t.prototype.dispose=function(){var t=this.getScene();if(t){var i=t.proceduralTextures.indexOf(this);i>=0&&t.proceduralTextures.splice(i,1);var n=this._vertexBuffers[ji.b.PositionKind];n&&(n.dispose(),this._vertexBuffers[ji.b.PositionKind]=null),this._indexBuffer&&this._fullEngine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),this.onGeneratedObservable.clear(),this.onBeforeGenerationObservable.clear(),e.prototype.dispose.call(this)}},Object(h.c)([Object(w.c)()],t.prototype,"isEnabled",void 0),Object(h.c)([Object(w.c)()],t.prototype,"autoClear",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_generateMipMaps",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_size",void 0),Object(h.c)([Object(w.c)()],t.prototype,"refreshRate",null),t}(Ke.a);c.a.RegisteredTypes["BABYLON.ProceduralTexture"]=As;var Ps=function(e){function t(t,i,n,r,o,a){var s=e.call(this,t,n,null,r,o,a)||this;return s._animate=!0,s._time=0,s._texturePath=i,s._loadJson(i),s.refreshRate=1,s}return Object(h.d)(t,e),t.prototype._loadJson=function(e){var t=this,i=function(){try{t.setFragment(t._texturePath)}catch(e){m.a.Error("No json or ShaderStore or DOM element found for CustomProceduralTexture")}},n=e+"/config.json",r=new V.a;r.open("GET",n),r.addEventListener("load",function(){if(200===r.status||r.responseText&&r.responseText.length>0)try{t._config=JSON.parse(r.response),t.updateShaderUniforms(),t.updateTextures(),t.setFragment(t._texturePath+"/custom"),t._animate=t._config.animate,t.refreshRate=t._config.refreshrate}catch(e){i()}else i()},!1),r.addEventListener("error",function(){i()},!1);try{r.send()}catch(e){m.a.Error("CustomProceduralTexture: Error on XHR send request.")}},t.prototype.isReady=function(){if(!e.prototype.isReady.call(this))return!1;for(var t in this._textures)if(!this._textures[t].isReady())return!1;return!0},t.prototype.render=function(t){var i=this.getScene();this._animate&&i&&(this._time+=.03*i.getAnimationRatio(),this.updateShaderUniforms()),e.prototype.render.call(this,t)},t.prototype.updateTextures=function(){for(var e=0;e<this._config.sampler2Ds.length;e++)this.setTexture(this._config.sampler2Ds[e].sample2Dname,new Ke.a(this._texturePath+"/"+this._config.sampler2Ds[e].textureRelativeUrl,this.getScene()))},t.prototype.updateShaderUniforms=function(){if(this._config)for(var e=0;e<this._config.uniforms.length;e++){var t=this._config.uniforms[e];switch(t.type){case"float":this.setFloat(t.name,t.value);break;case"color3":this.setColor3(t.name,new s.a(t.r,t.g,t.b));break;case"color4":this.setColor4(t.name,new s.b(t.r,t.g,t.b,t.a));break;case"vector2":this.setVector2(t.name,new a.d(t.x,t.y));break;case"vector3":this.setVector3(t.name,new a.e(t.x,t.y,t.z))}}this.setFloat("time",this._time)},Object.defineProperty(t.prototype,"animate",{get:function(){return this._animate},set:function(e){this._animate=e},enumerable:!1,configurable:!0}),t}(As);ai.a.ShadersStore.noisePixelShader="\n\nuniform float brightness;\nuniform float persistence;\nuniform float timeScale;\n\nvarying vec2 vUV;\n\nvec2 hash22(vec2 p)\n{\np=p*mat2(127.1,311.7,269.5,183.3);\np=-1.0+2.0*fract(sin(p)*43758.5453123);\nreturn sin(p*6.283+timeScale);\n}\nfloat interpolationNoise(vec2 p)\n{\nvec2 pi=floor(p);\nvec2 pf=p-pi;\nvec2 w=pf*pf*(3.-2.*pf);\nfloat f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));\nfloat f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));\nfloat f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));\nfloat f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));\nfloat xm1=mix(f00,f10,w.x);\nfloat xm2=mix(f01,f11,w.x);\nfloat ym=mix(xm1,xm2,w.y);\nreturn ym;\n}\nfloat perlinNoise2D(float x,float y)\n{\nfloat sum=0.0;\nfloat frequency=0.0;\nfloat amplitude=0.0;\nfor(int i=0; i<OCTAVES; i++)\n{\nfrequency=pow(2.0,float(i));\namplitude=pow(persistence,float(i));\nsum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;\n}\nreturn sum;\n}\n\nvoid main(void)\n{\nfloat x=abs(vUV.x);\nfloat y=abs(vUV.y);\nfloat noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);\ngl_FragColor=vec4(noise,noise,noise,1.0);\n}\n";var Cs=function(e){function t(t,i,n,r,o){void 0===i&&(i=256),void 0===n&&(n=x.a.LastCreatedScene);var a=e.call(this,t,i,"noise",n,r,o)||this;return a.time=0,a.brightness=.2,a.octaves=3,a.persistence=.8,a.animationSpeedFactor=1,a.autoClear=!1,a._updateShaderUniforms(),a}return Object(h.d)(t,e),t.prototype._updateShaderUniforms=function(){var e=this.getScene();e&&(this.time+=e.getAnimationRatio()*this.animationSpeedFactor*.01,this.setFloat("brightness",this.brightness),this.setFloat("persistence",this.persistence),this.setFloat("timeScale",this.time))},t.prototype._getDefines=function(){return"#define OCTAVES "+(0|this.octaves)},t.prototype.render=function(t){this._updateShaderUniforms(),e.prototype.render.call(this,t)},t.prototype.serialize=function(){var e={customType:"BABYLON.NoiseProceduralTexture"};return e.brightness=this.brightness,e.octaves=this.octaves,e.persistence=this.persistence,e.animationSpeedFactor=this.animationSpeedFactor,e.size=this.getSize().width,e.generateMipMaps=this._generateMipMaps,e.time=this.time,e},t.prototype.clone=function(){var e=this.getSize(),i=new t(this.name,e.width,this.getScene(),this._fallbackTexture?this._fallbackTexture:void 0,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.coordinatesMode=this.coordinatesMode,i.brightness=this.brightness,i.octaves=this.octaves,i.persistence=this.persistence,i.animationSpeedFactor=this.animationSpeedFactor,i.time=this.time,i},t.Parse=function(e,i){var n,r=new t(e.name,e.size,i,void 0,e.generateMipMaps);return r.brightness=e.brightness,r.octaves=e.octaves,r.persistence=e.persistence,r.animationSpeedFactor=e.animationSpeedFactor,r.time=null!==(n=e.time)&&void 0!==n?n:0,r},t}(As);c.a.RegisteredTypes["BABYLON.NoiseProceduralTexture"]=Cs;var Rs,xs,Os,Ms,Is,Ds,Ns,Ls=function(e){function t(t,i,n,r,o,a,s,c,l){void 0===r&&(r=g.a.TEXTUREFORMAT_RGBA),void 0===o&&(o=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===a&&(a=!1),void 0===s&&(s=!1),void 0===c&&(c=g.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===l&&(l=null);var u=e.call(this,"",t)||this;return u._texture=t.getEngine().createRawCubeTexture(i,n,r,o,a,s,c,l),u}return Object(h.d)(t,e),t.prototype.update=function(e,t,i,n,r){void 0===r&&(r=null),this._texture.getEngine().updateRawCubeTexture(this._texture,e,t,i,n,r)},t.prototype.updateRGBDAsync=function(e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=.8),void 0===r&&(r=0),t._UpdateRGBDAsync(this._texture,e,i,n,r)},t.prototype.clone=function(){var e=this;return w.a.Clone(function(){var i=e.getScene(),n=e._texture,r=new t(i,n._bufferViewArray,n.width,n.format,n.type,n.generateMipMaps,n.invertY,n.samplingMode,n._compression);return n.source===Qe.b.CubeRawRGBD&&r.updateRGBDAsync(n._bufferViewArrayArray,n._sphericalPolynomial,n._lodGenerationScale,n._lodGenerationOffset),r},this)},t._UpdateRGBDAsync=function(e,t,i,n,r){return e._source=Qe.b.CubeRawRGBD,e._bufferViewArrayArray=t,e._lodGenerationScale=n,e._lodGenerationOffset=r,e._sphericalPolynomial=i,Kn.UploadLevelsAsync(e,t).then(function(){e.isReady=!0})},t}(Wr),ws=function(e){function t(t,i,n,r,o,a,s,c,l,u){void 0===s&&(s=!0),void 0===c&&(c=!1),void 0===l&&(l=Ke.a.TRILINEAR_SAMPLINGMODE),void 0===u&&(u=g.a.TEXTURETYPE_UNSIGNED_INT);var h=e.call(this,null,a,!s,c)||this;return h.format=o,h._texture=a.getEngine().createRawTexture2DArray(t,i,n,r,o,s,c,l,null,u),h.is2DArray=!0,h}return Object(h.d)(t,e),t.prototype.update=function(e){this._texture&&this._getEngine().updateRawTexture2DArray(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t}(Ke.a),Fs=function(e){function t(t,i,n,r,o,a,s,c,l,u){void 0===s&&(s=!0),void 0===c&&(c=!1),void 0===l&&(l=Ke.a.TRILINEAR_SAMPLINGMODE),void 0===u&&(u=g.a.TEXTURETYPE_UNSIGNED_INT);var h=e.call(this,null,a,!s,c)||this;return h.format=o,h._texture=a.getEngine().createRawTexture3D(t,i,n,r,o,s,c,l,null,u),h.is3D=!0,h}return Object(h.d)(t,e),t.prototype.update=function(e){this._texture&&this._getEngine().updateRawTexture3D(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t}(Ke.a),Bs=function(e){function t(t,i,n,r){var o=e.call(this,t,i,n,r,!0)||this;return o.refractionPlane=new sn.a(0,1,0,1),o.depth=2,o.onBeforeRenderObservable.add(function(){n.clipPlane=o.refractionPlane}),o.onAfterRenderObservable.add(function(){n.clipPlane=null}),o}return Object(h.d)(t,e),t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var i=this.getSize(),n=new t(this.name,i.width,e,this._generateMipMaps);return n.hasAlpha=this.hasAlpha,n.level=this.level,n.refractionPlane=this.refractionPlane.clone(),this.renderList&&(n.renderList=this.renderList.slice(0)),n.depth=this.depth,n},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);return t.mirrorPlane=this.refractionPlane.asArray(),t.depth=this.depth,t},t}(Ri);!function(e){e[e.Vertex=1]="Vertex",e[e.Fragment=2]="Fragment",e[e.Neutral=4]="Neutral",e[e.VertexAndFragment=3]="VertexAndFragment"}(Rs||(Rs={})),function(e){e[e.Float=1]="Float",e[e.Int=2]="Int",e[e.Vector2=4]="Vector2",e[e.Vector3=8]="Vector3",e[e.Vector4=16]="Vector4",e[e.Color3=32]="Color3",e[e.Color4=64]="Color4",e[e.Matrix=128]="Matrix",e[e.Object=256]="Object",e[e.AutoDetect=1024]="AutoDetect",e[e.BasedOnInput=2048]="BasedOnInput"}(xs||(xs={})),function(e){e[e.Uniform=0]="Uniform",e[e.Attribute=1]="Attribute",e[e.Varying=2]="Varying",e[e.Undefined=3]="Undefined"}(Os||(Os={})),function(e){e[e.World=1]="World",e[e.View=2]="View",e[e.Projection=3]="Projection",e[e.ViewProjection=4]="ViewProjection",e[e.WorldView=5]="WorldView",e[e.WorldViewProjection=6]="WorldViewProjection",e[e.CameraPosition=7]="CameraPosition",e[e.FogColor=8]="FogColor",e[e.DeltaTime=9]="DeltaTime"}(Ms||(Ms={})),function(e){e[e.Material=0]="Material",e[e.PostProcess=1]="PostProcess",e[e.Particle=2]="Particle",e[e.ProceduralTexture=3]="ProceduralTexture"}(Is||(Is={})),function(e){e[e.Compatible=0]="Compatible",e[e.TypeIncompatible=1]="TypeIncompatible",e[e.TargetIncompatible=2]="TargetIncompatible"}(Ds||(Ds={})),function(e){e[e.Input=0]="Input",e[e.Output=1]="Output"}(Ns||(Ns={}));var Us=function(){function e(e,t,i){this._connectedPoint=null,this._endpoints=new Array,this._typeConnectionSource=null,this._linkedConnectionSource=null,this._acceptedConnectionPointType=null,this._type=xs.Float,this._enforceAssociatedVariableName=!1,this.needDualDirectionValidation=!1,this.acceptedConnectionPointTypes=new Array,this.excludedConnectionPointTypes=new Array,this.onConnectionObservable=new o.c,this.isExposedOnFrame=!1,this.exposedPortPosition=-1,this._prioritizeVertex=!1,this._target=Rs.VertexAndFragment,this._ownerBlock=t,this.name=e,this._direction=i}return e.AreEquivalentTypes=function(e,t){switch(e){case xs.Vector3:if(t===xs.Color3)return!0;break;case xs.Vector4:if(t===xs.Color4)return!0;break;case xs.Color3:if(t===xs.Vector3)return!0;break;case xs.Color4:if(t===xs.Vector4)return!0}return!1},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"associatedVariableName",{get:function(){return this._ownerBlock.isInput?this._ownerBlock.associatedVariableName:this._enforceAssociatedVariableName&&this._associatedVariableName||!this._connectedPoint?this._associatedVariableName:this._connectedPoint.associatedVariableName},set:function(e){this._associatedVariableName=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"innerType",{get:function(){return this._linkedConnectionSource&&this._linkedConnectionSource.isConnected?this.type:this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){if(this._type===xs.AutoDetect){if(this._ownerBlock.isInput)return this._ownerBlock.type;if(this._connectedPoint)return this._connectedPoint.type;if(this._linkedConnectionSource&&this._linkedConnectionSource.isConnected)return this._linkedConnectionSource.type}return this._type===xs.BasedOnInput&&this._typeConnectionSource?this._typeConnectionSource.type:this._type},set:function(e){this._type=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._prioritizeVertex&&this._ownerBlock?this._target!==Rs.VertexAndFragment?this._target:this._ownerBlock.target===Rs.Fragment?Rs.Fragment:Rs.Vertex:this._target},set:function(e){this._target=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnected",{get:function(){return null!==this.connectedPoint||this.hasEndpoints},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnectedToInputBlock",{get:function(){return null!==this.connectedPoint&&this.connectedPoint.ownerBlock.isInput},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectInputBlock",{get:function(){return this.isConnectedToInputBlock?this.connectedPoint.ownerBlock:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectedPoint",{get:function(){return this._connectedPoint},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownerBlock",{get:function(){return this._ownerBlock},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceBlock",{get:function(){return this._connectedPoint?this._connectedPoint.ownerBlock:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectedBlocks",{get:function(){return 0===this._endpoints.length?[]:this._endpoints.map(function(e){return e.ownerBlock})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"endpoints",{get:function(){return this._endpoints},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasEndpoints",{get:function(){return this._endpoints&&this._endpoints.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnectedInVertexShader",{get:function(){if(this.target===Rs.Vertex)return!0;if(!this.hasEndpoints)return!1;for(var e=0,t=this._endpoints;e<t.length;e++){var i=t[e];if(i.ownerBlock.target===Rs.Vertex)return!0;if(i.target===Rs.Vertex)return!0;if((i.ownerBlock.target===Rs.Neutral||i.ownerBlock.target===Rs.VertexAndFragment)&&i.ownerBlock.outputs.some(function(e){return e.isConnectedInVertexShader}))return!0}return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnectedInFragmentShader",{get:function(){if(this.target===Rs.Fragment)return!0;if(!this.hasEndpoints)return!1;for(var e=0,t=this._endpoints;e<t.length;e++){var i=t[e];if(i.ownerBlock.target===Rs.Fragment)return!0;if((i.ownerBlock.target===Rs.Neutral||i.ownerBlock.target===Rs.VertexAndFragment)&&i.ownerBlock.outputs.some(function(e){return e.isConnectedInFragmentShader}))return!0}return!1},enumerable:!1,configurable:!0}),e.prototype.createCustomInputBlock=function(){return null},e.prototype.getClassName=function(){return"NodeMaterialConnectionPoint"},e.prototype.canConnectTo=function(e){return this.checkCompatibilityState(e)===Ds.Compatible},e.prototype.checkCompatibilityState=function(t){if(this._ownerBlock.target===Rs.Fragment){var i=t.ownerBlock;if(i.target===Rs.Vertex)return Ds.TargetIncompatible;for(var n=0,r=i.outputs;n<r.length;n++)if(r[n].isConnectedInVertexShader)return Ds.TargetIncompatible}return this.type!==t.type&&t.innerType!==xs.AutoDetect?e.AreEquivalentTypes(this.type,t.type)||t.acceptedConnectionPointTypes&&-1!==t.acceptedConnectionPointTypes.indexOf(this.type)||t._acceptedConnectionPointType&&e.AreEquivalentTypes(t._acceptedConnectionPointType.type,this.type)?Ds.Compatible:Ds.TypeIncompatible:t.excludedConnectionPointTypes&&-1!==t.excludedConnectionPointTypes.indexOf(this.type)?1:Ds.Compatible},e.prototype.connectTo=function(e,t){if(void 0===t&&(t=!1),!t&&!this.canConnectTo(e))throw"Cannot connect these two connectors.";return this._endpoints.push(e),e._connectedPoint=this,this._enforceAssociatedVariableName=!1,this.onConnectionObservable.notifyObservers(e),e.onConnectionObservable.notifyObservers(this),this},e.prototype.disconnectFrom=function(e){var t=this._endpoints.indexOf(e);return-1===t||(this._endpoints.splice(t,1),e._connectedPoint=null,this._enforceAssociatedVariableName=!1,e._enforceAssociatedVariableName=!1),this},e.prototype.serialize=function(e){void 0===e&&(e=!0);var t={};return t.name=this.name,t.displayName=this.displayName,e&&this.connectedPoint&&(t.inputName=this.name,t.targetBlockId=this.connectedPoint.ownerBlock.uniqueId,t.targetConnectionName=this.connectedPoint.name,t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),(this.isExposedOnFrame||this.exposedPortPosition>=0)&&(t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),t},e.prototype.dispose=function(){this.onConnectionObservable.clear()},e}(),Vs=i(152),ks=function(){function e(e,t,i,n){void 0===t&&(t=Rs.Vertex),void 0===i&&(i=!1),void 0===n&&(n=!1),this._isFinalMerger=!1,this._isInput=!1,this._name="",this._isUnique=!1,this.inputsAreExclusive=!1,this._codeVariableName="",this._inputs=new Array,this._outputs=new Array,this.comments="",this.visibleInInspector=!1,this._target=t,this._isFinalMerger=i,this._isInput=n,this._name=e,this.uniqueId=Vs.a.UniqueId}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this.validateBlockName(e)&&(this._name=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUnique",{get:function(){return this._isUnique},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isFinalMerger",{get:function(){return this._isFinalMerger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInput",{get:function(){return this._isInput},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buildId",{get:function(){return this._buildId},set:function(e){this._buildId=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(e){0==(this._target&e)&&(this._target=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this._inputs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this._outputs},enumerable:!1,configurable:!0}),e.prototype.getInputByName=function(e){var t=this._inputs.filter(function(t){return t.name===e});return t.length?t[0]:null},e.prototype.getOutputByName=function(e){var t=this._outputs.filter(function(t){return t.name===e});return t.length?t[0]:null},e.prototype.initialize=function(e){},e.prototype.bind=function(e,t,i,n){},e.prototype._declareOutput=function(e,t){return t._getGLType(e.type)+" "+e.associatedVariableName},e.prototype._writeVariable=function(e){return e.connectedPoint?""+e.associatedVariableName:"0."},e.prototype._writeFloat=function(e){var t=e.toString();return-1===t.indexOf(".")&&(t+=".0"),""+t},e.prototype.getClassName=function(){return"NodeMaterialBlock"},e.prototype.registerInput=function(e,t,i,n,r){return void 0===i&&(i=!1),(r=null!=r?r:new Us(e,this,Ns.Input)).type=t,r.isOptional=i,n&&(r.target=n),this._inputs.push(r),this},e.prototype.registerOutput=function(e,t,i,n){return(n=null!=n?n:new Us(e,this,Ns.Output)).type=t,i&&(n.target=i),this._outputs.push(n),this},e.prototype.getFirstAvailableInput=function(e){void 0===e&&(e=null);for(var t=0,i=this._inputs;t<i.length;t++){var n=i[t];if(!(n.connectedPoint||e&&e.type!==n.type&&n.type!==xs.AutoDetect))return n}return null},e.prototype.getFirstAvailableOutput=function(e){void 0===e&&(e=null);for(var t=0,i=this._outputs;t<i.length;t++){var n=i[t];if(!e||!e.target||e.target===Rs.Neutral||0!=(e.target&n.target))return n}return null},e.prototype.getSiblingOutput=function(e){var t=this._outputs.indexOf(e);return-1===t||t>=this._outputs.length?null:this._outputs[t+1]},e.prototype.connectTo=function(e,t){if(0!==this._outputs.length){for(var i=t&&t.output?this.getOutputByName(t.output):this.getFirstAvailableOutput(e),n=!0;n;){var r=t&&t.input?e.getInputByName(t.input):e.getFirstAvailableInput(i);if(i&&r&&i.canConnectTo(r))i.connectTo(r),n=!1;else{if(!i)throw"Unable to find a compatible match";i=this.getSiblingOutput(i)}}return this}},e.prototype._buildBlock=function(e){},e.prototype.updateUniformsAndSamples=function(e,t,i,n){},e.prototype.provideFallbacks=function(e,t){},e.prototype.initializeDefines=function(e,t,i,n){void 0===n&&(n=!1)},e.prototype.prepareDefines=function(e,t,i,n,r){void 0===n&&(n=!1)},e.prototype.autoConfigure=function(e){},e.prototype.replaceRepeatableContent=function(e,t,i,n){},e.prototype.isReady=function(e,t,i,n){return void 0===n&&(n=!1),!0},e.prototype._linkConnectionTypes=function(e,t,i){void 0===i&&(i=!1),i?this._inputs[t]._acceptedConnectionPointType=this._inputs[e]:this._inputs[e]._linkedConnectionSource=this._inputs[t],this._inputs[t]._linkedConnectionSource=this._inputs[e]},e.prototype._processBuild=function(e,t,i,n){e.build(t,n);var r=null!=t._vertexState,o=e._buildTarget===Rs.Vertex&&e.target!==Rs.VertexAndFragment;if(r&&(0==(e.target&e._buildTarget)||0==(e.target&i.target)||this.target!==Rs.VertexAndFragment&&o)&&(!e.isInput&&t.target!==e._buildTarget||e.isInput&&e.isAttribute&&!e._noContextSwitch)){var a=i.connectedPoint;t._vertexState._emitVaryingFromString("v_"+a.associatedVariableName,t._getGLType(a.type))&&(t._vertexState.compilationString+="v_"+a.associatedVariableName+" = "+a.associatedVariableName+";\r\n"),i.associatedVariableName="v_"+a.associatedVariableName,i._enforceAssociatedVariableName=!0}},e.prototype.validateBlockName=function(e){for(var t=0,i=["position","normal","tangent","particle_positionw","uv","uv2","position2d","particle_uv","matricesIndices","matricesWeights","world0","world1","world2","world3","particle_color","particle_texturemask"];t<i.length;t++)if(e===i[t])return!1;return!0},e.prototype.build=function(e,t){if(this._buildId===e.sharedData.buildId)return!0;if(!this.isInput)for(var i=0,n=this._outputs;i<n.length;i++)(l=n[i]).associatedVariableName||(l.associatedVariableName=e._getFreeVariableName(l.name));for(var r=0,o=this._inputs;r<o.length;r++){var a=o[r];if(a.connectedPoint){if(this.target!==Rs.Neutral){if(0==(a.target&this.target))continue;if(0==(a.target&e.target))continue}(d=a.connectedPoint.ownerBlock)&&d!==this&&this._processBuild(d,e,a,t)}else a.isOptional||e.sharedData.checks.notConnectedNonOptionalInputs.push(a)}if(this._buildId===e.sharedData.buildId)return!0;if(e.sharedData.verbose&&console.log((e.target===Rs.Vertex?"Vertex shader":"Fragment shader")+": Building "+this.name+" ["+this.getClassName()+"]"),this.isFinalMerger)switch(e.target){case Rs.Vertex:e.sharedData.checks.emitVertex=!0;break;case Rs.Fragment:e.sharedData.checks.emitFragment=!0}!this.isInput&&e.sharedData.emitComments&&(e.compilationString+="\r\n//"+this.name+"\r\n"),this._buildBlock(e),this._buildId=e.sharedData.buildId,this._buildTarget=e.target;for(var s=0,c=this._outputs;s<c.length;s++){var l;if(0!=((l=c[s]).target&e.target))for(var u=0,h=l.endpoints;u<h.length;u++){var d,f=h[u];(d=f.ownerBlock)&&0!=(d.target&e.target)&&-1!==t.indexOf(d)&&this._processBuild(d,e,f,t)}}return!1},e.prototype._inputRename=function(e){return e},e.prototype._outputRename=function(e){return e},e.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".visibleInInspector = "+this.visibleInInspector+";\r\n"},e.prototype._dumpCode=function(e,t){var i;t.push(this);var n=this.name.replace(/[^A-Za-z_]+/g,"");if(this._codeVariableName=n||this.getClassName()+"_"+this.uniqueId,-1!==e.indexOf(this._codeVariableName)){var r=0;do{r++,this._codeVariableName=n+r}while(-1!==e.indexOf(this._codeVariableName))}e.push(this._codeVariableName),i="\r\n// "+this.getClassName()+"\r\n",this.comments&&(i+="// "+this.comments+"\r\n"),i+="var "+this._codeVariableName+" = new BABYLON."+this.getClassName()+'("'+this.name+'");\r\n',i+=this._dumpPropertiesCode();for(var o=0,a=this.inputs;o<a.length;o++){var s=a[o];if(s.isConnected){var c=s.connectedPoint.ownerBlock;-1===t.indexOf(c)&&(i+=c._dumpCode(e,t))}}for(var l=0,u=this.outputs;l<u.length;l++){var h=u[l];if(h.hasEndpoints)for(var d=0,f=h.endpoints;d<f.length;d++)(c=f[d].ownerBlock)&&-1===t.indexOf(c)&&(i+=c._dumpCode(e,t))}return i},e.prototype._dumpCodeForOutputConnections=function(e){var t="";if(-1!==e.indexOf(this))return t;e.push(this);for(var i=0,n=this.inputs;i<n.length;i++){var r=n[i];if(r.isConnected){var o=r.connectedPoint,a=o.ownerBlock;t+=a._dumpCodeForOutputConnections(e),t+=a._codeVariableName+"."+a._outputRename(o.name)+".connectTo("+this._codeVariableName+"."+this._inputRename(r.name)+");\r\n"}}return t},e.prototype.clone=function(e,t){void 0===t&&(t="");var i=this.serialize(),n=c.a.GetClass(i.customType);if(n){var r=new n;return r._deserialize(i,e,t),r}return null},e.prototype.serialize=function(){var e={};e.customType="BABYLON."+this.getClassName(),e.id=this.uniqueId,e.name=this.name,e.comments=this.comments,e.visibleInInspector=this.visibleInInspector,e.inputs=[],e.outputs=[];for(var t=0,i=this.inputs;t<i.length;t++){var n=i[t];e.inputs.push(n.serialize())}for(var r=0,o=this.outputs;r<o.length;r++){var a=o[r];e.outputs.push(a.serialize(!1))}return e},e.prototype._deserialize=function(e,t,i){this.name=e.name,this.comments=e.comments,this.visibleInInspector=!!e.visibleInInspector,this._deserializePortDisplayNamesAndExposedOnFrame(e)},e.prototype._deserializePortDisplayNamesAndExposedOnFrame=function(e){var t=this,i=e.inputs,n=e.outputs;i&&i.forEach(function(e,i){e.displayName&&(t.inputs[i].displayName=e.displayName),e.isExposedOnFrame&&(t.inputs[i].isExposedOnFrame=e.isExposedOnFrame,t.inputs[i].exposedPortPosition=e.exposedPortPosition)}),n&&n.forEach(function(e,i){e.displayName&&(t.outputs[i].displayName=e.displayName),e.isExposedOnFrame&&(t.outputs[i].isExposedOnFrame=e.isExposedOnFrame,t.outputs[i].exposedPortPosition=e.exposedPortPosition)})},e.prototype.dispose=function(){for(var e=0,t=this.inputs;e<t.length;e++)t[e].dispose();for(var i=0,n=this.outputs;i<n.length;i++)n[i].dispose()},e}(),Gs=function(){function e(){this.supportUniformBuffers=!1,this.attributes=new Array,this.uniforms=new Array,this.constants=new Array,this.samplers=new Array,this.functions={},this.extensions={},this.counters={},this._attributeDeclaration="",this._uniformDeclaration="",this._constantDeclaration="",this._samplerDeclaration="",this._varyingTransfer="",this._injectAtEnd="",this._repeatableContentAnchorIndex=0,this._builtCompilationString="",this.compilationString=""}return e.prototype.finalize=function(e){var t=e.sharedData.emitComments,i=this.target===Rs.Fragment;this.compilationString="\r\n"+(t?"//Entry point\r\n":"")+"void main(void) {\r\n"+this.compilationString,this._constantDeclaration&&(this.compilationString="\r\n"+(t?"//Constants\r\n":"")+this._constantDeclaration+"\r\n"+this.compilationString);var n="";for(var r in this.functions)n+=this.functions[r]+"\r\n";for(var o in this.compilationString="\r\n"+n+"\r\n"+this.compilationString,!i&&this._varyingTransfer&&(this.compilationString=this.compilationString+"\r\n"+this._varyingTransfer),this._injectAtEnd&&(this.compilationString=this.compilationString+"\r\n"+this._injectAtEnd),this.compilationString=this.compilationString+"\r\n}",this.sharedData.varyingDeclaration&&(this.compilationString="\r\n"+(t?"//Varyings\r\n":"")+this.sharedData.varyingDeclaration+"\r\n"+this.compilationString),this._samplerDeclaration&&(this.compilationString="\r\n"+(t?"//Samplers\r\n":"")+this._samplerDeclaration+"\r\n"+this.compilationString),this._uniformDeclaration&&(this.compilationString="\r\n"+(t?"//Uniforms\r\n":"")+this._uniformDeclaration+"\r\n"+this.compilationString),this._attributeDeclaration&&!i&&(this.compilationString="\r\n"+(t?"//Attributes\r\n":"")+this._attributeDeclaration+"\r\n"+this.compilationString),this.compilationString="precision highp float;\r\n"+this.compilationString,this.extensions){var a=this.extensions[o];this.compilationString="\r\n"+a+"\r\n"+this.compilationString}this._builtCompilationString=this.compilationString},Object.defineProperty(e.prototype,"_repeatableContentAnchor",{get:function(){return"###___ANCHOR"+this._repeatableContentAnchorIndex+++"___###"},enumerable:!1,configurable:!0}),e.prototype._getFreeVariableName=function(e){return e=e.replace(/[^a-zA-Z_]+/g,""),void 0===this.sharedData.variableNames[e]?(this.sharedData.variableNames[e]=0,"output"===e||"texture"===e?e+this.sharedData.variableNames[e]:e):(this.sharedData.variableNames[e]++,e+this.sharedData.variableNames[e])},e.prototype._getFreeDefineName=function(e){return void 0===this.sharedData.defineNames[e]?this.sharedData.defineNames[e]=0:this.sharedData.defineNames[e]++,e+this.sharedData.defineNames[e]},e.prototype._excludeVariableName=function(e){this.sharedData.variableNames[e]=0},e.prototype._emit2DSampler=function(e){this.samplers.indexOf(e)<0&&(this._samplerDeclaration+="uniform sampler2D "+e+";\r\n",this.samplers.push(e))},e.prototype._getGLType=function(e){switch(e){case xs.Float:return"float";case xs.Int:return"int";case xs.Vector2:return"vec2";case xs.Color3:case xs.Vector3:return"vec3";case xs.Color4:case xs.Vector4:return"vec4";case xs.Matrix:return"mat4"}return""},e.prototype._emitExtension=function(e,t,i){void 0===i&&(i=""),this.extensions[e]||(i&&(t="#if "+i+"\r\n"+t+"\r\n#endif"),this.extensions[e]=t)},e.prototype._emitFunction=function(e,t,i){this.functions[e]||(this.sharedData.emitComments&&(t=i+"\r\n"+t),this.functions[e]=t)},e.prototype._emitCodeFromInclude=function(e,t,i){if(i&&i.repeatKey)return"#include<"+e+">[0.."+i.repeatKey+"]\r\n";var n=ai.a.IncludesShadersStore[e]+"\r\n";if(this.sharedData.emitComments&&(n=t+"\r\n"+n),!i)return n;if(i.replaceStrings)for(var r=0;r<i.replaceStrings.length;r++){var o=i.replaceStrings[r];n=n.replace(o.search,o.replace)}return n},e.prototype._emitFunctionFromInclude=function(e,t,i,n){void 0===n&&(n="");var r=e+n;if(!this.functions[r]){if(!i||!(i.removeAttributes||i.removeUniforms||i.removeVaryings||i.removeIfDef||i.replaceStrings))return i&&i.repeatKey?this.functions[r]="#include<"+e+">[0.."+i.repeatKey+"]\r\n":this.functions[r]="#include<"+e+">\r\n",void(this.sharedData.emitComments&&(this.functions[r]=t+"\r\n"+this.functions[r]));if(this.functions[r]=ai.a.IncludesShadersStore[e],this.sharedData.emitComments&&(this.functions[r]=t+"\r\n"+this.functions[r]),i.removeIfDef&&(this.functions[r]=this.functions[r].replace(/^\s*?#ifdef.+$/gm,""),this.functions[r]=this.functions[r].replace(/^\s*?#endif.*$/gm,""),this.functions[r]=this.functions[r].replace(/^\s*?#else.*$/gm,""),this.functions[r]=this.functions[r].replace(/^\s*?#elif.*$/gm,"")),i.removeAttributes&&(this.functions[r]=this.functions[r].replace(/^\s*?attribute.+$/gm,"")),i.removeUniforms&&(this.functions[r]=this.functions[r].replace(/^\s*?uniform.+$/gm,"")),i.removeVaryings&&(this.functions[r]=this.functions[r].replace(/^\s*?varying.+$/gm,"")),i.replaceStrings)for(var o=0;o<i.replaceStrings.length;o++){var a=i.replaceStrings[o];this.functions[r]=this.functions[r].replace(a.search,a.replace)}}},e.prototype._registerTempVariable=function(e){return-1===this.sharedData.temps.indexOf(e)&&(this.sharedData.temps.push(e),!0)},e.prototype._emitVaryingFromString=function(e,t,i,n){return void 0===i&&(i=""),void 0===n&&(n=!1),-1===this.sharedData.varyings.indexOf(e)&&(this.sharedData.varyings.push(e),i&&(jr.a.StartsWith(i,"defined(")?this.sharedData.varyingDeclaration+="#if "+i+"\r\n":this.sharedData.varyingDeclaration+=(n?"#ifndef":"#ifdef")+" "+i+"\r\n"),this.sharedData.varyingDeclaration+="varying "+t+" "+e+";\r\n",i&&(this.sharedData.varyingDeclaration+="#endif\r\n"),!0)},e.prototype._emitUniformFromString=function(e,t,i,n){void 0===i&&(i=""),void 0===n&&(n=!1),-1===this.uniforms.indexOf(e)&&(this.uniforms.push(e),i&&(jr.a.StartsWith(i,"defined(")?this._uniformDeclaration+="#if "+i+"\r\n":this._uniformDeclaration+=(n?"#ifndef":"#ifdef")+" "+i+"\r\n"),this._uniformDeclaration+="uniform "+t+" "+e+";\r\n",i&&(this._uniformDeclaration+="#endif\r\n"))},e.prototype._emitFloat=function(e){return e.toString()===e.toFixed(0)?e+".0":e.toString()},e}(),zs=function(){function e(){this.temps=new Array,this.varyings=new Array,this.varyingDeclaration="",this.inputBlocks=new Array,this.textureBlocks=new Array,this.bindableBlocks=new Array,this.blocksWithFallbacks=new Array,this.blocksWithDefines=new Array,this.repeatableContentBlocks=new Array,this.dynamicUniformBlocks=new Array,this.blockingBlocks=new Array,this.animatedInputs=new Array,this.variableNames={},this.defineNames={},this.hints={needWorldViewMatrix:!1,needWorldViewProjectionMatrix:!1,needAlphaBlending:!1,needAlphaTesting:!1},this.checks={emitVertex:!1,emitFragment:!1,notConnectedNonOptionalInputs:new Array},this.allowEmptyVertexProgram=!1,this.variableNames.position=0,this.variableNames.normal=0,this.variableNames.tangent=0,this.variableNames.uv=0,this.variableNames.uv2=0,this.variableNames.uv3=0,this.variableNames.uv4=0,this.variableNames.uv4=0,this.variableNames.uv5=0,this.variableNames.uv6=0,this.variableNames.color=0,this.variableNames.matricesIndices=0,this.variableNames.matricesWeights=0,this.variableNames.matricesIndicesExtra=0,this.variableNames.matricesWeightsExtra=0,this.variableNames.diffuseBase=0,this.variableNames.specularBase=0,this.variableNames.worldPos=0,this.variableNames.shadow=0,this.variableNames.view=0,this.variableNames.vTBN=0,this.defineNames.MAINUV0=0,this.defineNames.MAINUV1=0,this.defineNames.MAINUV2=0,this.defineNames.MAINUV3=0,this.defineNames.MAINUV4=0,this.defineNames.MAINUV5=0,this.defineNames.MAINUV6=0,this.defineNames.MAINUV7=0}return e.prototype.emitErrors=function(){var e="";this.checks.emitVertex||this.allowEmptyVertexProgram||(e+="NodeMaterial does not have a vertex output. You need to at least add a block that generates a glPosition value.\r\n"),this.checks.emitFragment||(e+="NodeMaterial does not have a fragment output. You need to at least add a block that generates a glFragColor value.\r\n");for(var t=0,i=this.checks.notConnectedNonOptionalInputs;t<i.length;t++){var n=i[t];e+="input "+n.name+" from block "+n.ownerBlock.name+"["+n.ownerBlock.getClassName()+"] is not connected and is not optional.\r\n"}if(e)throw"Build of NodeMaterial failed:\r\n"+e},e}(),js=function(e){function t(t){var i=e.call(this,t,Rs.Vertex)||this;return i.complementW=1,i.complementZ=0,i.registerInput("vector",xs.AutoDetect),i.registerInput("transform",xs.Matrix),i.registerOutput("output",xs.Vector4),i.registerOutput("xyz",xs.Vector3),i._inputs[0].onConnectionObservable.add(function(e){if(e.ownerBlock.isInput){var t=e.ownerBlock;"normal"!==t.name&&"tangent"!==t.name||(i.complementW=0)}}),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"TransformBlock"},Object.defineProperty(t.prototype,"vector",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyz",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this.vector,n=this.transform;if(i.connectedPoint){if(0===this.complementW){var r="//"+this.name;t._emitFunctionFromInclude("helperFunctions",r),t.sharedData.blocksWithDefines.push(this);var o=t._getFreeVariableName(n.associatedVariableName+"_NUS");switch(t.compilationString+="mat3 "+o+" = mat3("+n.associatedVariableName+");\r\n",t.compilationString+="#ifdef NONUNIFORMSCALING\r\n",t.compilationString+=o+" = transposeMat3(inverseMat3("+o+"));\r\n",t.compilationString+="#endif\r\n",i.connectedPoint.type){case xs.Vector2:t.compilationString+=this._declareOutput(this.output,t)+" = vec4("+o+" * vec3("+i.associatedVariableName+", "+this._writeFloat(this.complementZ)+"), "+this._writeFloat(this.complementW)+");\r\n";break;case xs.Vector3:case xs.Color3:t.compilationString+=this._declareOutput(this.output,t)+" = vec4("+o+" * "+i.associatedVariableName+", "+this._writeFloat(this.complementW)+");\r\n";break;default:t.compilationString+=this._declareOutput(this.output,t)+" = vec4("+o+" * "+i.associatedVariableName+".xyz, "+this._writeFloat(this.complementW)+");\r\n"}}else switch(o=n.associatedVariableName,i.connectedPoint.type){case xs.Vector2:t.compilationString+=this._declareOutput(this.output,t)+" = "+o+" * vec4("+i.associatedVariableName+", "+this._writeFloat(this.complementZ)+", "+this._writeFloat(this.complementW)+");\r\n";break;case xs.Vector3:case xs.Color3:t.compilationString+=this._declareOutput(this.output,t)+" = "+o+" * vec4("+i.associatedVariableName+", "+this._writeFloat(this.complementW)+");\r\n";break;default:t.compilationString+=this._declareOutput(this.output,t)+" = "+o+" * "+i.associatedVariableName+";\r\n"}this.xyz.hasEndpoints&&(t.compilationString+=this._declareOutput(this.xyz,t)+" = "+this.output.associatedVariableName+".xyz;\r\n")}return this},t.prototype.prepareDefines=function(e,t,i,n,r){void 0===n&&(n=!1),e.nonUniformScaling&&i.setValue("NONUNIFORMSCALING",!0)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.complementZ=this.complementZ,t.complementW=this.complementW,t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.complementZ=void 0!==t.complementZ?t.complementZ:0,this.complementW=void 0!==t.complementW?t.complementW:1},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".complementZ = "+this.complementZ+";\r\n"+(this._codeVariableName+".complementW = ")+this.complementW+";\r\n"},t}(ks);c.a.RegisteredTypes["BABYLON.TransformBlock"]=js;var Ws=function(e){function t(t){var i=e.call(this,t,Rs.Vertex,!0)||this;return i.registerInput("vector",xs.Vector4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VertexOutputBlock"},Object.defineProperty(t.prototype,"vector",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this.vector;return t.compilationString+="gl_Position = "+i.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.VertexOutputBlock"]=Ws;var Hs,Xs=function(e){function t(t){var i=e.call(this,t,Rs.Fragment,!0)||this;return i.registerInput("rgba",xs.Color4,!0),i.registerInput("rgb",xs.Color3,!0),i.registerInput("a",xs.Float,!0),i.rgb.acceptedConnectionPointTypes.push(xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FragmentOutputBlock"},Object.defineProperty(t.prototype,"rgba",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this.rgba,n=this.rgb,r=this.a;if(t.sharedData.hints.needAlphaBlending=i.isConnected||r.isConnected,i.connectedPoint)r.isConnected?t.compilationString+="gl_FragColor = vec4("+i.associatedVariableName+".rgb, "+r.associatedVariableName+");\r\n":t.compilationString+="gl_FragColor = "+i.associatedVariableName+";\r\n";else if(n.connectedPoint){var o="1.0";r.connectedPoint&&(o=r.associatedVariableName),n.connectedPoint.type===xs.Float?t.compilationString+="gl_FragColor = vec4("+n.associatedVariableName+", "+n.associatedVariableName+", "+n.associatedVariableName+", "+o+");\r\n":t.compilationString+="gl_FragColor = vec4("+n.associatedVariableName+", "+o+");\r\n"}else t.sharedData.checks.notConnectedNonOptionalInputs.push(i);return this},t}(ks);c.a.RegisteredTypes["BABYLON.FragmentOutputBlock"]=Xs,function(e){e[e.None=0]="None",e[e.Time=1]="Time"}(Hs||(Hs={}));var Ys={position2d:"position",particle_uv:"vUV",particle_color:"vColor",particle_texturemask:"textureMask",particle_positionw:"vPositionW"},Ks={particle_uv:!0,particle_color:!0,particle_texturemask:!0,particle_positionw:!0},Qs={particle_texturemask:!0},qs=function(e){function t(t,i,n){void 0===i&&(i=Rs.Vertex),void 0===n&&(n=xs.AutoDetect);var r=e.call(this,t,i,!1,!0)||this;return r._mode=Os.Undefined,r._animationType=Hs.None,r.min=0,r.max=0,r.isBoolean=!1,r.matrixMode=0,r._systemValue=null,r.isConstant=!1,r.groupInInspector="",r.onValueChangedObservable=new o.c,r.convertToGammaSpace=!1,r.convertToLinearSpace=!1,r._type=n,r.setDefaultValue(),r.registerOutput("output",n),r}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"type",{get:function(){if(this._type===xs.AutoDetect){if(this.isUniform&&null!=this.value){if(!isNaN(this.value))return this._type=xs.Float,this._type;switch(this.value.getClassName()){case"Vector2":return this._type=xs.Vector2,this._type;case"Vector3":return this._type=xs.Vector3,this._type;case"Vector4":return this._type=xs.Vector4,this._type;case"Color3":return this._type=xs.Color3,this._type;case"Color4":return this._type=xs.Color4,this._type;case"Matrix":return this._type=xs.Matrix,this._type}}if(this.isAttribute)switch(this.name){case"position":case"normal":case"tangent":case"particle_positionw":return this._type=xs.Vector3,this._type;case"uv":case"uv2":case"position2d":case"particle_uv":return this._type=xs.Vector2,this._type;case"matricesIndices":case"matricesWeights":case"world0":case"world1":case"world2":case"world3":return this._type=xs.Vector4,this._type;case"color":case"particle_color":case"particle_texturemask":return this._type=xs.Color4,this._type}if(this.isSystemValue)switch(this._systemValue){case Ms.World:case Ms.WorldView:case Ms.WorldViewProjection:case Ms.View:case Ms.ViewProjection:case Ms.Projection:return this._type=xs.Matrix,this._type;case Ms.CameraPosition:return this._type=xs.Vector3,this._type;case Ms.FogColor:return this._type=xs.Color3,this._type;case Ms.DeltaTime:return this._type=xs.Float,this._type}}return this._type},enumerable:!1,configurable:!0}),t.prototype.validateBlockName=function(t){return!!this.isAttribute||e.prototype.validateBlockName.call(this,t)},Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.setAsAttribute=function(e){return this._mode=Os.Attribute,e&&(this.name=e),this},t.prototype.setAsSystemValue=function(e){return this.systemValue=e,this},Object.defineProperty(t.prototype,"value",{get:function(){return this._storedValue},set:function(e){this.type===xs.Float&&(this.isBoolean?e=e?1:0:this.min!==this.max&&(e=Math.max(this.min,e),e=Math.min(this.max,e))),this._storedValue=e,this._mode=Os.Uniform,this.onValueChangedObservable.notifyObservers(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valueCallback",{get:function(){return this._valueCallback},set:function(e){this._valueCallback=e,this._mode=Os.Uniform},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"associatedVariableName",{get:function(){return this._associatedVariableName},set:function(e){this._associatedVariableName=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationType",{get:function(){return this._animationType},set:function(e){this._animationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUndefined",{get:function(){return this._mode===Os.Undefined},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUniform",{get:function(){return this._mode===Os.Uniform},set:function(e){this._mode=e?Os.Uniform:Os.Undefined,this.associatedVariableName=""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAttribute",{get:function(){return this._mode===Os.Attribute},set:function(e){this._mode=e?Os.Attribute:Os.Undefined,this.associatedVariableName=""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVarying",{get:function(){return this._mode===Os.Varying},set:function(e){this._mode=e?Os.Varying:Os.Undefined,this.associatedVariableName=""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSystemValue",{get:function(){return null!=this._systemValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"systemValue",{get:function(){return this._systemValue},set:function(e){this._mode=Os.Uniform,this.associatedVariableName="",this._systemValue=e},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"InputBlock"},t.prototype.animate=function(e){switch(this._animationType){case Hs.Time:this.type===xs.Float&&(this.value+=.01*e.getAnimationRatio())}},t.prototype._emitDefine=function(e){return"!"===e[0]?"#ifndef "+e.substring(1)+"\r\n":"#ifdef "+e+"\r\n"},t.prototype.initialize=function(e){this.associatedVariableName=""},t.prototype.setDefaultValue=function(){switch(this.type){case xs.Float:this.value=0;break;case xs.Vector2:this.value=a.d.Zero();break;case xs.Vector3:this.value=a.e.Zero();break;case xs.Vector4:this.value=a.f.Zero();break;case xs.Color3:this.value=s.a.White();break;case xs.Color4:this.value=new s.b(1,1,1,1);break;case xs.Matrix:this.value=a.a.Identity()}},t.prototype._emitConstant=function(e){switch(this.type){case xs.Float:return""+e._emitFloat(this.value);case xs.Vector2:return"vec2("+this.value.x+", "+this.value.y+")";case xs.Vector3:return"vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")";case xs.Vector4:return"vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")";case xs.Color3:return s.c.Color3[0].set(this.value.r,this.value.g,this.value.b),this.convertToGammaSpace&&s.c.Color3[0].toGammaSpaceToRef(s.c.Color3[0]),this.convertToLinearSpace&&s.c.Color3[0].toLinearSpaceToRef(s.c.Color3[0]),"vec3("+s.c.Color3[0].r+", "+s.c.Color3[0].g+", "+s.c.Color3[0].b+")";case xs.Color4:return s.c.Color4[0].set(this.value.r,this.value.g,this.value.b,this.value.a),this.convertToGammaSpace&&s.c.Color4[0].toGammaSpaceToRef(s.c.Color4[0]),this.convertToLinearSpace&&s.c.Color4[0].toLinearSpaceToRef(s.c.Color4[0]),"vec4("+s.c.Color4[0].r+", "+s.c.Color4[0].g+", "+s.c.Color4[0].b+", "+s.c.Color4[0].a+")"}return""},Object.defineProperty(t.prototype,"_noContextSwitch",{get:function(){return Ks[this.name]},enumerable:!1,configurable:!0}),t.prototype._emit=function(e,t){var i;if(this.isUniform){if(this.associatedVariableName||(this.associatedVariableName=e._getFreeVariableName("u_"+this.name)),this.isConstant){if(-1!==e.constants.indexOf(this.associatedVariableName))return;return e.constants.push(this.associatedVariableName),void(e._constantDeclaration+=this._declareOutput(this.output,e)+" = "+this._emitConstant(e)+";\r\n")}if(-1!==e.uniforms.indexOf(this.associatedVariableName))return;e.uniforms.push(this.associatedVariableName),t&&(e._uniformDeclaration+=this._emitDefine(t)),e._uniformDeclaration+="uniform "+e._getGLType(this.type)+" "+this.associatedVariableName+";\r\n",t&&(e._uniformDeclaration+="#endif\r\n");var n=e.sharedData.hints;if(null!==this._systemValue&&void 0!==this._systemValue)switch(this._systemValue){case Ms.WorldView:n.needWorldViewMatrix=!0;break;case Ms.WorldViewProjection:n.needWorldViewProjectionMatrix=!0}else this._animationType!==Hs.None&&e.sharedData.animatedInputs.push(this)}else if(this.isAttribute){if(this.associatedVariableName=null!==(i=Ys[this.name])&&void 0!==i?i:this.name,this.target===Rs.Vertex&&e._vertexState)return void(Ks[this.name]?Qs[this.name]?e._emitUniformFromString(this.associatedVariableName,e._getGLType(this.type),t):e._emitVaryingFromString(this.associatedVariableName,e._getGLType(this.type),t):this._emit(e._vertexState,t));if(-1!==e.attributes.indexOf(this.associatedVariableName))return;e.attributes.push(this.associatedVariableName),Ks[this.name]?Qs[this.name]?e._emitUniformFromString(this.associatedVariableName,e._getGLType(this.type),t):e._emitVaryingFromString(this.associatedVariableName,e._getGLType(this.type),t):(t&&(e._attributeDeclaration+=this._emitDefine(t)),e._attributeDeclaration+="attribute "+e._getGLType(this.type)+" "+this.associatedVariableName+";\r\n",t&&(e._attributeDeclaration+="#endif\r\n"))}},t.prototype._transmitWorld=function(e,t,i,n){if(this._systemValue){var r=this.associatedVariableName;switch(this._systemValue){case Ms.World:e.setMatrix(r,t);break;case Ms.WorldView:e.setMatrix(r,i);break;case Ms.WorldViewProjection:e.setMatrix(r,n)}}},t.prototype._transmit=function(e,t){if(!this.isAttribute){var i=this.associatedVariableName;if(this._systemValue)switch(this._systemValue){case Ms.World:case Ms.WorldView:case Ms.WorldViewProjection:return;case Ms.View:e.setMatrix(i,t.getViewMatrix());break;case Ms.Projection:e.setMatrix(i,t.getProjectionMatrix());break;case Ms.ViewProjection:e.setMatrix(i,t.getTransformMatrix());break;case Ms.CameraPosition:Hr.a.BindEyePosition(e,t,i);break;case Ms.FogColor:e.setColor3(i,t.fogColor);break;case Ms.DeltaTime:e.setFloat(i,t.deltaTime/1e3)}else{var n=this._valueCallback?this._valueCallback():this._storedValue;if(null!==n)switch(this.type){case xs.Float:e.setFloat(i,n);break;case xs.Int:e.setInt(i,n);break;case xs.Color3:s.c.Color3[0].set(this.value.r,this.value.g,this.value.b),this.convertToGammaSpace&&s.c.Color3[0].toGammaSpaceToRef(s.c.Color3[0]),this.convertToLinearSpace&&s.c.Color3[0].toLinearSpaceToRef(s.c.Color3[0]),e.setColor3(i,s.c.Color3[0]);break;case xs.Color4:s.c.Color4[0].set(this.value.r,this.value.g,this.value.b,this.value.a),this.convertToGammaSpace&&s.c.Color4[0].toGammaSpaceToRef(s.c.Color4[0]),this.convertToLinearSpace&&s.c.Color4[0].toLinearSpaceToRef(s.c.Color4[0]),e.setDirectColor4(i,s.c.Color4[0]);break;case xs.Vector2:e.setVector2(i,n);break;case xs.Vector3:e.setVector3(i,n);break;case xs.Vector4:e.setVector4(i,n);break;case xs.Matrix:e.setMatrix(i,n)}}}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),(this.isUniform||this.isSystemValue)&&t.sharedData.inputBlocks.push(this),this._emit(t)},t.prototype._dumpPropertiesCode=function(){var e=this._codeVariableName;if(this.isAttribute)return e+'.setAsAttribute("'+this.name+'");\r\n';if(this.isSystemValue)return e+".setAsSystemValue(BABYLON.NodeMaterialSystemValues."+Ms[this._systemValue]+");\r\n";if(this.isUniform){var t=[],i="";switch(this.type){case xs.Float:i=""+this.value;break;case xs.Vector2:i="new BABYLON.Vector2("+this.value.x+", "+this.value.y+")";break;case xs.Vector3:i="new BABYLON.Vector3("+this.value.x+", "+this.value.y+", "+this.value.z+")";break;case xs.Vector4:i="new BABYLON.Vector4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")";break;case xs.Color3:i="new BABYLON.Color3("+this.value.r+", "+this.value.g+", "+this.value.b+")",this.convertToGammaSpace&&(i+=".toGammaSpace()"),this.convertToLinearSpace&&(i+=".toLinearSpace()");break;case xs.Color4:i="new BABYLON.Color4("+this.value.r+", "+this.value.g+", "+this.value.b+", "+this.value.a+")",this.convertToGammaSpace&&(i+=".toGammaSpace()"),this.convertToLinearSpace&&(i+=".toLinearSpace()");break;case xs.Matrix:i="BABYLON.Matrix.FromArray(["+this.value.m+"])"}return t.push(e+".value = "+i),this.type===xs.Float&&t.push(e+".min = "+this.min,e+".max = "+this.max,e+".isBoolean = "+this.isBoolean,e+".matrixMode = "+this.matrixMode,e+".animationType = BABYLON.AnimatedInputBlockTypes."+Hs[this.animationType]),t.push(e+".isConstant = "+this.isConstant),t.push(""),t.join(";\r\n")}return""},t.prototype.dispose=function(){this.onValueChangedObservable.clear(),e.prototype.dispose.call(this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.type=this.type,t.mode=this._mode,t.systemValue=this._systemValue,t.animationType=this._animationType,t.min=this.min,t.max=this.max,t.isBoolean=this.isBoolean,t.matrixMode=this.matrixMode,t.isConstant=this.isConstant,t.groupInInspector=this.groupInInspector,t.convertToGammaSpace=this.convertToGammaSpace,t.convertToLinearSpace=this.convertToLinearSpace,null!=this._storedValue&&this._mode===Os.Uniform&&(this._storedValue.asArray?(t.valueType="BABYLON."+this._storedValue.getClassName(),t.value=this._storedValue.asArray()):(t.valueType="number",t.value=this._storedValue)),t},t.prototype._deserialize=function(t,i,n){if(this._mode=t.mode,e.prototype._deserialize.call(this,t,i,n),this._type=t.type,this._systemValue=t.systemValue||t.wellKnownValue,this._animationType=t.animationType,this.min=t.min||0,this.max=t.max||0,this.isBoolean=!!t.isBoolean,this.matrixMode=t.matrixMode||0,this.isConstant=!!t.isConstant,this.groupInInspector=t.groupInInspector||"",this.convertToGammaSpace=!!t.convertToGammaSpace,this.convertToLinearSpace=!!t.convertToLinearSpace,t.valueType)if("number"===t.valueType)this._storedValue=t.value;else{var r=c.a.GetClass(t.valueType);r&&(this._storedValue=r.FromArray(t.value))}},t}(ks);c.a.RegisteredTypes["BABYLON.InputBlock"]=qs;var Zs=function(e){function t(t){var i=e.call(this,t,Rs.VertexAndFragment)||this;return i._samplerName="textureSampler",i.convertToGammaSpace=!1,i.convertToLinearSpace=!1,i._isUnique=!1,i.registerInput("uv",xs.Vector2,!1,Rs.VertexAndFragment),i.registerOutput("rgba",xs.Color4,Rs.Neutral),i.registerOutput("rgb",xs.Color3,Rs.Neutral),i.registerOutput("r",xs.Float,Rs.Neutral),i.registerOutput("g",xs.Float,Rs.Neutral),i.registerOutput("b",xs.Float,Rs.Neutral),i.registerOutput("a",xs.Float,Rs.Neutral),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),i._inputs[0]._prioritizeVertex=!1,i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"CurrentScreenBlock"},Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("textureSampler")},Object.defineProperty(t.prototype,"target",{get:function(){return this.uv.isConnected?this.uv.sourceBlock.isInput?Rs.VertexAndFragment:Rs.Fragment:Rs.VertexAndFragment},enumerable:!1,configurable:!0}),t.prototype.prepareDefines=function(e,t,i){i.setValue(this._linearDefineName,this.convertToGammaSpace,!0),i.setValue(this._gammaDefineName,this.convertToLinearSpace,!0)},t.prototype.isReady=function(){return!(this.texture&&!this.texture.isReadyOrNotBlocking())},t.prototype._injectVertexCode=function(e){var t=this.uv;if(t.connectedPoint.ownerBlock.isInput&&(t.connectedPoint.ownerBlock.isAttribute||e._emitUniformFromString(t.associatedVariableName,"vec2")),this._mainUVName="vMain"+t.associatedVariableName,e._emitVaryingFromString(this._mainUVName,"vec2"),e.compilationString+=this._mainUVName+" = "+t.associatedVariableName+".xy;\r\n",this._outputs.some(function(e){return e.isConnectedInVertexShader})){this._writeTextureRead(e,!0);for(var i=0,n=this._outputs;i<n.length;i++){var r=n[i];r.hasEndpoints&&this._writeOutput(e,r,r.name,!0)}}},t.prototype._writeTextureRead=function(e,t){void 0===t&&(t=!1);var i=this.uv;if(t){if(e.target===Rs.Fragment)return;e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+i.associatedVariableName+");\r\n"}else this.uv.ownerBlock.target!==Rs.Fragment?e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+this._mainUVName+");\r\n":e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+i.associatedVariableName+");\r\n"},t.prototype._writeOutput=function(e,t,i,n){if(void 0===n&&(n=!1),n){if(e.target===Rs.Fragment)return;e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+i+";\r\n"}else this.uv.ownerBlock.target!==Rs.Fragment?(e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+i+";\r\n",e.compilationString+="#ifdef "+this._linearDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toGammaSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef "+this._gammaDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toLinearSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n"):e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+i+";\r\n"},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),this._tempTextureRead=t._getFreeVariableName("tempTextureRead"),t.sharedData.blockingBlocks.indexOf(this)<0&&t.sharedData.blockingBlocks.push(this),t.sharedData.textureBlocks.indexOf(this)<0&&t.sharedData.textureBlocks.push(this),t.sharedData.blocksWithDefines.indexOf(this)<0&&t.sharedData.blocksWithDefines.push(this),t.target!==Rs.Fragment)return t._emit2DSampler(this._samplerName),void this._injectVertexCode(t);if(this._outputs.some(function(e){return e.isConnectedInFragmentShader})){t._emit2DSampler(this._samplerName),this._linearDefineName=t._getFreeDefineName("ISLINEAR"),this._gammaDefineName=t._getFreeDefineName("ISGAMMA");var i="//"+this.name;t._emitFunctionFromInclude("helperFunctions",i),this._writeTextureRead(t);for(var n=0,r=this._outputs;n<r.length;n++){var o=r[n];o.hasEndpoints&&this._writeOutput(t,o,o.name)}return this}},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.convertToGammaSpace=this.convertToGammaSpace,t.convertToLinearSpace=this.convertToLinearSpace,this.texture&&(t.texture=this.texture.serialize()),t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.convertToGammaSpace=t.convertToGammaSpace,this.convertToLinearSpace=!!t.convertToLinearSpace,t.texture&&(n=0===t.texture.url.indexOf("data:")?"":n,this.texture=Ke.a.Parse(t.texture,i,n))},t}(ks);c.a.RegisteredTypes["BABYLON.CurrentScreenBlock"]=Zs;var Js=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i._samplerName="diffuseSampler",i.convertToGammaSpace=!1,i.convertToLinearSpace=!1,i._isUnique=!1,i.registerInput("uv",xs.Vector2,!1,Rs.VertexAndFragment),i.registerOutput("rgba",xs.Color4,Rs.Neutral),i.registerOutput("rgb",xs.Color3,Rs.Neutral),i.registerOutput("r",xs.Float,Rs.Neutral),i.registerOutput("g",xs.Float,Rs.Neutral),i.registerOutput("b",xs.Float,Rs.Neutral),i.registerOutput("a",xs.Float,Rs.Neutral),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ParticleTextureBlock"},Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("diffuseSampler")},t.prototype.autoConfigure=function(e){if(!this.uv.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"particle_uv"===e.name});t||(t=new qs("uv")).setAsAttribute("particle_uv"),t.output.connectTo(this.uv)}},t.prototype.prepareDefines=function(e,t,i){i.setValue(this._linearDefineName,this.convertToGammaSpace,!0),i.setValue(this._gammaDefineName,this.convertToLinearSpace,!0)},t.prototype.isReady=function(){return!(this.texture&&!this.texture.isReadyOrNotBlocking())},t.prototype._writeOutput=function(e,t,i){e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+i+";\r\n",e.compilationString+="#ifdef "+this._linearDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toGammaSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef "+this._gammaDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toLinearSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n"},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target!==Rs.Vertex){this._tempTextureRead=t._getFreeVariableName("tempTextureRead"),t._emit2DSampler(this._samplerName),t.sharedData.blockingBlocks.push(this),t.sharedData.textureBlocks.push(this),t.sharedData.blocksWithDefines.push(this),this._linearDefineName=t._getFreeDefineName("ISLINEAR"),this._gammaDefineName=t._getFreeDefineName("ISGAMMA");var i="//"+this.name;t._emitFunctionFromInclude("helperFunctions",i),t.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+this.uv.associatedVariableName+");\r\n";for(var n=0,r=this._outputs;n<r.length;n++){var o=r[n];o.hasEndpoints&&this._writeOutput(t,o,o.name)}return this}},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.convertToGammaSpace=this.convertToGammaSpace,t.convertToLinearSpace=this.convertToLinearSpace,this.texture&&(t.texture=this.texture.serialize()),t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.convertToGammaSpace=t.convertToGammaSpace,this.convertToLinearSpace=!!t.convertToLinearSpace,t.texture&&(n=0===t.texture.url.indexOf("data:")?"":n,this.texture=Ke.a.Parse(t.texture,i,n))},t}(ks);c.a.RegisteredTypes["BABYLON.ParticleTextureBlock"]=Js;var $s=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i._isUnique=!0,i.registerInput("color",xs.Color4,!1,Rs.Fragment),i.registerOutput("rampColor",xs.Color4,Rs.Fragment),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ParticleRampGradientBlock"},Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rampColor",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("remapRanges"),e._excludeVariableName("rampSampler"),e._excludeVariableName("baseColor"),e._excludeVariableName("alpha"),e._excludeVariableName("remappedColorIndex"),e._excludeVariableName("rampColor"),e._excludeVariableName("finalAlpha")},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target!==Rs.Vertex)return t._emit2DSampler("rampSampler"),t._emitVaryingFromString("remapRanges","vec4","RAMPGRADIENT"),t.compilationString+="\n            #ifdef RAMPGRADIENT\n                vec4 baseColor = "+this.color.associatedVariableName+";\n                float alpha = "+this.color.associatedVariableName+".a;\n\n                float remappedColorIndex = clamp((alpha - remapRanges.x) / remapRanges.y, 0.0, 1.0);\n\n                vec4 rampColor = texture2D(rampSampler, vec2(1.0 - remappedColorIndex, 0.));\n                baseColor.rgb *= rampColor.rgb;\n\n                // Remapped alpha\n                float finalAlpha = baseColor.a;\n                baseColor.a = clamp((alpha * rampColor.a - remapRanges.z) / remapRanges.w, 0.0, 1.0);\n\n                "+this._declareOutput(this.rampColor,t)+" = baseColor;\n            #else\n                "+this._declareOutput(this.rampColor,t)+" = "+this.color.associatedVariableName+";\n            #endif\n        ",this},t}(ks);c.a.RegisteredTypes["BABYLON.ParticleRampGradientBlock"]=$s;var ec=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i._isUnique=!0,i.registerInput("color",xs.Color4,!1,Rs.Fragment),i.registerInput("alphaTexture",xs.Float,!1,Rs.Fragment),i.registerInput("alphaColor",xs.Float,!1,Rs.Fragment),i.registerOutput("blendColor",xs.Color4,Rs.Fragment),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ParticleBlendMultiplyBlock"},Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alphaTexture",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alphaColor",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendColor",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("sourceAlpha")},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target!==Rs.Vertex)return t.compilationString+="\n            #ifdef BLENDMULTIPLYMODE\n                "+this._declareOutput(this.blendColor,t)+";\n                float sourceAlpha = "+this.alphaColor.associatedVariableName+" * "+this.alphaTexture.associatedVariableName+";\n                "+this.blendColor.associatedVariableName+".rgb = "+this.color.associatedVariableName+".rgb * sourceAlpha + vec3(1.0) * (1.0 - sourceAlpha);\n                "+this.blendColor.associatedVariableName+".a = "+this.color.associatedVariableName+".a;\n            #else\n                "+this._declareOutput(this.blendColor,t)+" = "+this.color.associatedVariableName+";\n            #endif\n        ",this},t}(ks);c.a.RegisteredTypes["BABYLON.ParticleBlendMultiplyBlock"]=ec;var tc,ic=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("xyz ",xs.Vector3,!0),i.registerInput("xy ",xs.Vector2,!0),i.registerInput("x",xs.Float,!0),i.registerInput("y",xs.Float,!0),i.registerInput("z",xs.Float,!0),i.registerInput("w",xs.Float,!0),i.registerOutput("xyzw",xs.Vector4),i.registerOutput("xyz",xs.Vector3),i.registerOutput("xy",xs.Vector2),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VectorMergerBlock"},Object.defineProperty(t.prototype,"xyzIn",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyIn",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"w",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzw",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzOut",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyOut",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xy",{get:function(){return this.xyOut},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyz",{get:function(){return this.xyzOut},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this.x,n=this.y,r=this.z,o=this.w,a=this.xyIn,s=this.xyzIn,c=this._outputs[0],l=this._outputs[1],u=this._outputs[2];return s.isConnected?c.hasEndpoints?t.compilationString+=this._declareOutput(c,t)+" = vec4("+s.associatedVariableName+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":l.hasEndpoints?t.compilationString+=this._declareOutput(l,t)+" = "+s.associatedVariableName+";\r\n":u.hasEndpoints&&(t.compilationString+=this._declareOutput(u,t)+" = "+s.associatedVariableName+".xy;\r\n"):a.isConnected?c.hasEndpoints?t.compilationString+=this._declareOutput(c,t)+" = vec4("+a.associatedVariableName+", "+(r.isConnected?this._writeVariable(r):"0.0")+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":l.hasEndpoints?t.compilationString+=this._declareOutput(l,t)+" = vec3("+a.associatedVariableName+", "+(r.isConnected?this._writeVariable(r):"0.0")+");\r\n":u.hasEndpoints&&(t.compilationString+=this._declareOutput(u,t)+" = "+a.associatedVariableName+";\r\n"):c.hasEndpoints?t.compilationString+=this._declareOutput(c,t)+" = vec4("+(i.isConnected?this._writeVariable(i):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+", "+(r.isConnected?this._writeVariable(r):"0.0")+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":l.hasEndpoints?t.compilationString+=this._declareOutput(l,t)+" = vec3("+(i.isConnected?this._writeVariable(i):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+", "+(r.isConnected?this._writeVariable(r):"0.0")+");\r\n":u.hasEndpoints&&(t.compilationString+=this._declareOutput(u,t)+" = vec2("+(i.isConnected?this._writeVariable(i):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+");\r\n"),this},t}(ks);function nc(e,t,i,n){return void 0===t&&(t=tc.Boolean),void 0===i&&(i="PROPERTIES"),function(r,o){var a=r._propStore;a||(a=[],r._propStore=a),a.push({propertyName:o,displayName:e,type:t,groupName:i,options:null!=n?n:{}})}}c.a.RegisteredTypes["BABYLON.VectorMergerBlock"]=ic,function(e){e[e.Boolean=0]="Boolean",e[e.Float=1]="Float",e[e.Vector2=2]="Vector2",e[e.List=3]="List"}(tc||(tc={}));var rc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.sourceRange=new a.d(-1,1),i.targetRange=new a.d(0,1),i.registerInput("input",xs.AutoDetect),i.registerInput("sourceMin",xs.Float,!0),i.registerInput("sourceMax",xs.Float,!0),i.registerInput("targetMin",xs.Float,!0),i.registerInput("targetMax",xs.Float,!0),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"RemapBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceMin",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceMax",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetMin",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetMax",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0],n=this.sourceMin.isConnected?this.sourceMin.associatedVariableName:this._writeFloat(this.sourceRange.x),r=this.sourceMax.isConnected?this.sourceMax.associatedVariableName:this._writeFloat(this.sourceRange.y),o=this.targetMin.isConnected?this.targetMin.associatedVariableName:this._writeFloat(this.targetRange.x),a=this.targetMax.isConnected?this.targetMax.associatedVariableName:this._writeFloat(this.targetRange.y);return t.compilationString+=this._declareOutput(i,t)+" = "+o+" + ("+this._inputs[0].associatedVariableName+" - "+n+") * ("+a+" - "+o+") / ("+r+" - "+n+");\r\n",this},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".sourceRange = new BABYLON.Vector2("+this.sourceRange.x+", "+this.sourceRange.y+");\r\n"+(this._codeVariableName+".targetRange = new BABYLON.Vector2(")+this.targetRange.x+", "+this.targetRange.y+");\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.sourceRange=this.sourceRange.asArray(),t.targetRange=this.targetRange.asArray(),t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.sourceRange=a.d.FromArray(t.sourceRange),this.targetRange=a.d.FromArray(t.targetRange)},Object(h.c)([nc("From",tc.Vector2)],t.prototype,"sourceRange",void 0),Object(h.c)([nc("To",tc.Vector2)],t.prototype,"targetRange",void 0),t}(ks);c.a.RegisteredTypes["BABYLON.RemapBlock"]=rc;var oc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"MultiplyBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = "+this.left.associatedVariableName+" * "+this.right.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.MultiplyBlock"]=oc;var ac=function(){function e(){this.direction1=new a.e(0,1,0),this.direction2=new a.e(0,1,0),this.minEmitBox=new a.e(-.5,-.5,-.5),this.maxEmitBox=new a.e(.5,.5,.5)}return e.prototype.startDirectionFunction=function(e,t,i,n){var r=L.a.RandomRange(this.direction1.x,this.direction2.x),o=L.a.RandomRange(this.direction1.y,this.direction2.y),s=L.a.RandomRange(this.direction1.z,this.direction2.z);if(n)return t.x=r,t.y=o,void(t.z=s);a.e.TransformNormalFromFloatsToRef(r,o,s,e,t)},e.prototype.startPositionFunction=function(e,t,i,n){var r=L.a.RandomRange(this.minEmitBox.x,this.maxEmitBox.x),o=L.a.RandomRange(this.minEmitBox.y,this.maxEmitBox.y),s=L.a.RandomRange(this.minEmitBox.z,this.maxEmitBox.z);if(n)return t.x=r,t.y=o,void(t.z=s);a.e.TransformCoordinatesFromFloatsToRef(r,o,s,e,t)},e.prototype.clone=function(){var t=new e;return O.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2),e.setVector3("minEmitBox",this.minEmitBox),e.setVector3("maxEmitBox",this.maxEmitBox)},e.prototype.getEffectDefines=function(){return"#define BOXEMITTER"},e.prototype.getClassName=function(){return"BoxParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e.minEmitBox=this.minEmitBox.asArray(),e.maxEmitBox=this.maxEmitBox.asArray(),e},e.prototype.parse=function(e){a.e.FromArrayToRef(e.direction1,0,this.direction1),a.e.FromArrayToRef(e.direction2,0,this.direction2),a.e.FromArrayToRef(e.minEmitBox,0,this.minEmitBox),a.e.FromArrayToRef(e.maxEmitBox,0,this.maxEmitBox)},e}(),sc=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=Math.PI),void 0===i&&(i=0),this.directionRandomizer=i,this.radiusRange=1,this.heightRange=1,this.emitFromSpawnPointOnly=!1,this.angle=t,this.radius=e}return Object.defineProperty(e.prototype,"radius",{get:function(){return this._radius},set:function(e){this._radius=e,this._buildHeight()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._buildHeight()},enumerable:!1,configurable:!0}),e.prototype._buildHeight=function(){0!==this._angle?this._height=this._radius/Math.tan(this._angle/2):this._height=1},e.prototype.startDirectionFunction=function(e,t,i,n){n?a.c.Vector3[0].copyFrom(i._localPosition).normalize():i.position.subtractToRef(e.getTranslation(),a.c.Vector3[0]).normalize();var r=L.a.RandomRange(0,this.directionRandomizer),o=L.a.RandomRange(0,this.directionRandomizer),s=L.a.RandomRange(0,this.directionRandomizer);t.x=a.c.Vector3[0].x+r,t.y=a.c.Vector3[0].y+o,t.z=a.c.Vector3[0].z+s,t.normalize()},e.prototype.startPositionFunction=function(e,t,i,n){var r,o=L.a.RandomRange(0,2*Math.PI);r=this.emitFromSpawnPointOnly?1e-4:1-(r=L.a.RandomRange(0,this.heightRange))*r;var s=this._radius-L.a.RandomRange(0,this._radius*this.radiusRange),c=(s*=r)*Math.sin(o),l=s*Math.cos(o),u=r*this._height;if(n)return t.x=c,t.y=u,void(t.z=l);a.e.TransformCoordinatesFromFloatsToRef(c,u,l,e,t)},e.prototype.clone=function(){var t=new e(this._radius,this._angle,this.directionRandomizer);return O.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat2("radius",this._radius,this.radiusRange),e.setFloat("coneAngle",this._angle),e.setFloat2("height",this._height,this.heightRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){var e="#define CONEEMITTER";return this.emitFromSpawnPointOnly&&(e+="\n#define CONEEMITTERSPAWNPOINT"),e},e.prototype.getClassName=function(){return"ConeParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this._radius,e.angle=this._angle,e.directionRandomizer=this.directionRandomizer,e.radiusRange=this.radiusRange,e.heightRange=this.heightRange,e.emitFromSpawnPointOnly=this.emitFromSpawnPointOnly,e},e.prototype.parse=function(e){this.radius=e.radius,this.angle=e.angle,this.directionRandomizer=e.directionRandomizer,this.radiusRange=void 0!==e.radiusRange?e.radiusRange:1,this.heightRange=void 0!==e.radiusRange?e.heightRange:1,this.emitFromSpawnPointOnly=void 0!==e.emitFromSpawnPointOnly&&e.emitFromSpawnPointOnly},e}(),cc=function(){function e(e,t,i,n){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=1),void 0===n&&(n=0),this.radius=e,this.height=t,this.radiusRange=i,this.directionRandomizer=n}return e.prototype.startDirectionFunction=function(e,t,i,n){var r=i.position.subtract(e.getTranslation()).normalize(),o=L.a.RandomRange(-this.directionRandomizer/2,this.directionRandomizer/2),s=Math.atan2(r.x,r.z);s+=L.a.RandomRange(-Math.PI/2,Math.PI/2)*this.directionRandomizer,r.y=o,r.x=Math.sin(s),r.z=Math.cos(s),r.normalize(),n?t.copyFrom(r):a.e.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i,n){var r=L.a.RandomRange(-this.height/2,this.height/2),o=L.a.RandomRange(0,2*Math.PI),s=L.a.RandomRange((1-this.radiusRange)*(1-this.radiusRange),1),c=Math.sqrt(s)*this.radius,l=c*Math.cos(o),u=c*Math.sin(o);n?t.copyFromFloats(l,r,u):a.e.TransformCoordinatesFromFloatsToRef(l,r,u,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return O.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("height",this.height),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){return"#define CYLINDEREMITTER"},e.prototype.getClassName=function(){return"CylinderParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this.radius,e.height=this.height,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e},e.prototype.parse=function(e){this.radius=e.radius,this.height=e.height,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer},e}(),lc=function(e){function t(t,i,n,r,o){void 0===t&&(t=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=new a.e(0,1,0)),void 0===o&&(o=new a.e(0,1,0));var s=e.call(this,t,i,n)||this;return s.direction1=r,s.direction2=o,s}return Object(h.d)(t,e),t.prototype.startDirectionFunction=function(e,t,i){var n=L.a.RandomRange(this.direction1.x,this.direction2.x),r=L.a.RandomRange(this.direction1.y,this.direction2.y),o=L.a.RandomRange(this.direction1.z,this.direction2.z);a.e.TransformNormalFromFloatsToRef(n,r,o,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.height,this.radiusRange,this.direction1,this.direction2);return O.a.DeepCopy(this,e),e},t.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("height",this.height),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},t.prototype.getEffectDefines=function(){return"#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER"},t.prototype.getClassName=function(){return"CylinderDirectedParticleEmitter"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t},t.prototype.parse=function(t){e.prototype.parse.call(this,t),this.direction1.copyFrom(t.direction1),this.direction2.copyFrom(t.direction2)},t}(cc),uc=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=i}return e.prototype.startDirectionFunction=function(e,t,i,n){var r=i.position.subtract(e.getTranslation()).normalize(),o=L.a.RandomRange(0,this.directionRandomizer),s=L.a.RandomRange(0,this.directionRandomizer),c=L.a.RandomRange(0,this.directionRandomizer);r.x+=o,r.y+=s,r.z+=c,r.normalize(),n?t.copyFrom(r):a.e.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i,n){var r=this.radius-L.a.RandomRange(0,this.radius*this.radiusRange),o=L.a.RandomRange(0,1),s=L.a.RandomRange(0,2*Math.PI),c=Math.acos(2*o-1),l=r*Math.cos(s)*Math.sin(c),u=r*Math.cos(c),h=r*Math.sin(s)*Math.sin(c);n?t.copyFromFloats(l,Math.abs(u),h):a.e.TransformCoordinatesFromFloatsToRef(l,Math.abs(u),h,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return O.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){return"#define HEMISPHERICEMITTER"},e.prototype.getClassName=function(){return"HemisphericParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this.radius,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e},e.prototype.parse=function(e){this.radius=e.radius,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer},e}(),hc=function(){function e(){this.direction1=new a.e(0,1,0),this.direction2=new a.e(0,1,0)}return e.prototype.startDirectionFunction=function(e,t,i,n){var r=L.a.RandomRange(this.direction1.x,this.direction2.x),o=L.a.RandomRange(this.direction1.y,this.direction2.y),s=L.a.RandomRange(this.direction1.z,this.direction2.z);n?t.copyFromFloats(r,o,s):a.e.TransformNormalFromFloatsToRef(r,o,s,e,t)},e.prototype.startPositionFunction=function(e,t,i,n){n?t.copyFromFloats(0,0,0):a.e.TransformCoordinatesFromFloatsToRef(0,0,0,e,t)},e.prototype.clone=function(){var t=new e;return O.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},e.prototype.getEffectDefines=function(){return"#define POINTEMITTER"},e.prototype.getClassName=function(){return"PointParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e},e.prototype.parse=function(e){a.e.FromArrayToRef(e.direction1,0,this.direction1),a.e.FromArrayToRef(e.direction2,0,this.direction2)},e}(),dc=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=i}return e.prototype.startDirectionFunction=function(e,t,i,n){var r=i.position.subtract(e.getTranslation()).normalize(),o=L.a.RandomRange(0,this.directionRandomizer),s=L.a.RandomRange(0,this.directionRandomizer),c=L.a.RandomRange(0,this.directionRandomizer);r.x+=o,r.y+=s,r.z+=c,r.normalize(),n?t.copyFrom(r):a.e.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i,n){var r=this.radius-L.a.RandomRange(0,this.radius*this.radiusRange),o=L.a.RandomRange(0,1),s=L.a.RandomRange(0,2*Math.PI),c=Math.acos(2*o-1),l=r*Math.cos(s)*Math.sin(c),u=r*Math.cos(c),h=r*Math.sin(s)*Math.sin(c);n?t.copyFromFloats(l,u,h):a.e.TransformCoordinatesFromFloatsToRef(l,u,h,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return O.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){return"#define SPHEREEMITTER"},e.prototype.getClassName=function(){return"SphereParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this.radius,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e},e.prototype.parse=function(e){this.radius=e.radius,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer},e}(),fc=function(e){function t(t,i,n){void 0===t&&(t=1),void 0===i&&(i=new a.e(0,1,0)),void 0===n&&(n=new a.e(0,1,0));var r=e.call(this,t)||this;return r.direction1=i,r.direction2=n,r}return Object(h.d)(t,e),t.prototype.startDirectionFunction=function(e,t,i){var n=L.a.RandomRange(this.direction1.x,this.direction2.x),r=L.a.RandomRange(this.direction1.y,this.direction2.y),o=L.a.RandomRange(this.direction1.z,this.direction2.z);a.e.TransformNormalFromFloatsToRef(n,r,o,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.direction1,this.direction2);return O.a.DeepCopy(this,e),e},t.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},t.prototype.getEffectDefines=function(){return"#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER"},t.prototype.getClassName=function(){return"SphereDirectedParticleEmitter"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t},t.prototype.parse=function(t){e.prototype.parse.call(this,t),this.direction1.copyFrom(t.direction1),this.direction2.copyFrom(t.direction2)},t}(dc),pc=function(){function e(){this.particlePositionGenerator=function(){},this.particleDestinationGenerator=function(){}}return e.prototype.startDirectionFunction=function(e,t,i,n){var r=a.c.Vector3[0];if(this.particleDestinationGenerator){this.particleDestinationGenerator(-1,i,r);var o=a.c.Vector3[1];r.subtractToRef(i.position,o),o.scaleToRef(1/i.lifeTime,r)}else r.set(0,0,0);n?t.copyFrom(r):a.e.TransformNormalToRef(r,e,t)},e.prototype.startPositionFunction=function(e,t,i,n){var r=a.c.Vector3[0];this.particlePositionGenerator?this.particlePositionGenerator(-1,i,r):r.set(0,0,0),n?t.copyFrom(r):a.e.TransformCoordinatesToRef(r,e,t)},e.prototype.clone=function(){var t=new e;return O.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){},e.prototype.getEffectDefines=function(){return"#define CUSTOMEMITTER"},e.prototype.getClassName=function(){return"CustomParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e},e.prototype.parse=function(e){},e}(),_c=function(){function e(e){void 0===e&&(e=null),this._indices=null,this._positions=null,this._normals=null,this._storedNormal=a.e.Zero(),this._mesh=null,this.direction1=new a.e(0,1,0),this.direction2=new a.e(0,1,0),this.useMeshNormalsForDirection=!0,this.mesh=e}return Object.defineProperty(e.prototype,"mesh",{get:function(){return this._mesh},set:function(e){this._mesh!==e&&(this._mesh=e,e?(this._indices=e.getIndices(),this._positions=e.getVerticesData(ji.b.PositionKind),this._normals=e.getVerticesData(ji.b.NormalKind)):(this._indices=null,this._positions=null,this._normals=null))},enumerable:!1,configurable:!0}),e.prototype.startDirectionFunction=function(e,t,i,n){if(this.useMeshNormalsForDirection&&this._normals)a.e.TransformNormalToRef(this._storedNormal,e,t);else{var r=L.a.RandomRange(this.direction1.x,this.direction2.x),o=L.a.RandomRange(this.direction1.y,this.direction2.y),s=L.a.RandomRange(this.direction1.z,this.direction2.z);n?t.copyFromFloats(r,o,s):a.e.TransformNormalFromFloatsToRef(r,o,s,e,t)}},e.prototype.startPositionFunction=function(e,t,i,n){if(this._indices&&this._positions){var r=3*Math.random()*(this._indices.length/3)|0,o=Math.random(),s=Math.random()*(1-o),c=1-o-s,l=this._indices[r],u=this._indices[r+1],h=this._indices[r+2],d=a.c.Vector3[0],f=a.c.Vector3[1],p=a.c.Vector3[2],_=a.c.Vector3[3];a.e.FromArrayToRef(this._positions,3*l,d),a.e.FromArrayToRef(this._positions,3*u,f),a.e.FromArrayToRef(this._positions,3*h,p),_.x=o*d.x+s*f.x+c*p.x,_.y=o*d.y+s*f.y+c*p.y,_.z=o*d.z+s*f.z+c*p.z,n?t.copyFromFloats(_.x,_.y,_.z):a.e.TransformCoordinatesFromFloatsToRef(_.x,_.y,_.z,e,t),this.useMeshNormalsForDirection&&this._normals&&(a.e.FromArrayToRef(this._normals,3*l,d),a.e.FromArrayToRef(this._normals,3*u,f),a.e.FromArrayToRef(this._normals,3*h,p),this._storedNormal.x=o*d.x+s*f.x+c*p.x,this._storedNormal.y=o*d.y+s*f.y+c*p.y,this._storedNormal.z=o*d.z+s*f.z+c*p.z)}},e.prototype.clone=function(){var t=new e(this.mesh);return O.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},e.prototype.getEffectDefines=function(){return""},e.prototype.getClassName=function(){return"MeshParticleEmitter"},e.prototype.serialize=function(){var e,t={};return t.type=this.getClassName(),t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t.meshId=null===(e=this.mesh)||void 0===e?void 0:e.id,t.useMeshNormalsForDirection=this.useMeshNormalsForDirection,t},e.prototype.parse=function(e,t){a.e.FromArrayToRef(e.direction1,0,this.direction1),a.e.FromArrayToRef(e.direction2,0,this.direction2),e.meshId&&t&&(this.mesh=t.getLastMeshByID(e.meshId)),this.useMeshNormalsForDirection=e.useMeshNormalsForDirection},e}(),mc=function(){function e(t){this.animations=[],this.renderingGroupId=0,this.emitter=a.e.Zero(),this.emitRate=10,this.manualEmitCount=-1,this.updateSpeed=.01,this.targetStopDuration=0,this.disposeOnStop=!1,this.minEmitPower=1,this.maxEmitPower=1,this.minLifeTime=1,this.maxLifeTime=1,this.minSize=1,this.maxSize=1,this.minScaleX=1,this.maxScaleX=1,this.minScaleY=1,this.maxScaleY=1,this.minInitialRotation=0,this.maxInitialRotation=0,this.minAngularSpeed=0,this.maxAngularSpeed=0,this.layerMask=268435455,this.customShader=null,this.preventAutoStart=!1,this.noiseStrength=new a.e(10,10,10),this.onAnimationEnd=null,this.blendMode=e.BLENDMODE_ONEONE,this.forceDepthWrite=!1,this.preWarmCycles=0,this.preWarmStepOffset=1,this.spriteCellChangeSpeed=1,this.startSpriteCellID=0,this.endSpriteCellID=0,this.spriteCellWidth=0,this.spriteCellHeight=0,this.spriteRandomStartCell=!1,this.translationPivot=new a.d(0,0),this.beginAnimationOnStart=!1,this.beginAnimationFrom=0,this.beginAnimationTo=60,this.beginAnimationLoop=!1,this.worldOffset=new a.e(0,0,0),this.gravity=a.e.Zero(),this._colorGradients=null,this._sizeGradients=null,this._lifeTimeGradients=null,this._angularSpeedGradients=null,this._velocityGradients=null,this._limitVelocityGradients=null,this._dragGradients=null,this._emitRateGradients=null,this._startSizeGradients=null,this._rampGradients=null,this._colorRemapGradients=null,this._alphaRemapGradients=null,this.startDelay=0,this.limitVelocityDamping=.4,this.color1=new s.b(1,1,1,1),this.color2=new s.b(1,1,1,1),this.colorDead=new s.b(0,0,0,1),this.textureMask=new s.b(1,1,1,1),this._isSubEmitter=!1,this.billboardMode=g.a.PARTICLES_BILLBOARDMODE_ALL,this._isBillboardBased=!0,this._imageProcessingConfigurationDefines=new Bi.b,this.id=t,this.name=t}return Object.defineProperty(e.prototype,"noiseTexture",{get:function(){return this._noiseTexture},set:function(e){this._noiseTexture!==e&&(this._noiseTexture=e,this._reset())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAnimationSheetEnabled",{get:function(){return this._isAnimationSheetEnabled},set:function(e){this._isAnimationSheetEnabled!=e&&(this._isAnimationSheetEnabled=e,this._reset())},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype._hasTargetStopDurationDependantGradient=function(){return this._startSizeGradients&&this._startSizeGradients.length>0||this._emitRateGradients&&this._emitRateGradients.length>0||this._lifeTimeGradients&&this._lifeTimeGradients.length>0},e.prototype.getDragGradients=function(){return this._dragGradients},e.prototype.getLimitVelocityGradients=function(){return this._limitVelocityGradients},e.prototype.getColorGradients=function(){return this._colorGradients},e.prototype.getSizeGradients=function(){return this._sizeGradients},e.prototype.getColorRemapGradients=function(){return this._colorRemapGradients},e.prototype.getAlphaRemapGradients=function(){return this._alphaRemapGradients},e.prototype.getLifeTimeGradients=function(){return this._lifeTimeGradients},e.prototype.getAngularSpeedGradients=function(){return this._angularSpeedGradients},e.prototype.getVelocityGradients=function(){return this._velocityGradients},e.prototype.getStartSizeGradients=function(){return this._startSizeGradients},e.prototype.getEmitRateGradients=function(){return this._emitRateGradients},Object.defineProperty(e.prototype,"direction1",{get:function(){return this.particleEmitterType.direction1?this.particleEmitterType.direction1:a.e.Zero()},set:function(e){this.particleEmitterType.direction1&&(this.particleEmitterType.direction1=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"direction2",{get:function(){return this.particleEmitterType.direction2?this.particleEmitterType.direction2:a.e.Zero()},set:function(e){this.particleEmitterType.direction2&&(this.particleEmitterType.direction2=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minEmitBox",{get:function(){return this.particleEmitterType.minEmitBox?this.particleEmitterType.minEmitBox:a.e.Zero()},set:function(e){this.particleEmitterType.minEmitBox&&(this.particleEmitterType.minEmitBox=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxEmitBox",{get:function(){return this.particleEmitterType.maxEmitBox?this.particleEmitterType.maxEmitBox:a.e.Zero()},set:function(e){this.particleEmitterType.maxEmitBox&&(this.particleEmitterType.maxEmitBox=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBillboardBased",{get:function(){return this._isBillboardBased},set:function(e){this._isBillboardBased!==e&&(this._isBillboardBased=e,this._reset())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e)},enumerable:!1,configurable:!0}),e.prototype._attachImageProcessingConfiguration=function(e){e!==this._imageProcessingConfiguration&&(!e&&this._scene?this._imageProcessingConfiguration=this._scene.imageProcessingConfiguration:this._imageProcessingConfiguration=e)},e.prototype._reset=function(){},e.prototype._removeGradientAndTexture=function(e,t,i){if(!t)return this;for(var n=0,r=0,o=t;r<o.length;r++){if(o[r].gradient===e){t.splice(n,1);break}n++}return i&&i.dispose(),this},e.prototype.createPointEmitter=function(e,t){var i=new hc;return i.direction1=e,i.direction2=t,this.particleEmitterType=i,i},e.prototype.createHemisphericEmitter=function(e,t){void 0===e&&(e=1),void 0===t&&(t=1);var i=new uc(e,t);return this.particleEmitterType=i,i},e.prototype.createSphereEmitter=function(e,t){void 0===e&&(e=1),void 0===t&&(t=1);var i=new dc(e,t);return this.particleEmitterType=i,i},e.prototype.createDirectedSphereEmitter=function(e,t,i){void 0===e&&(e=1),void 0===t&&(t=new a.e(0,1,0)),void 0===i&&(i=new a.e(0,1,0));var n=new fc(e,t,i);return this.particleEmitterType=n,n},e.prototype.createCylinderEmitter=function(e,t,i,n){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=1),void 0===n&&(n=0);var r=new cc(e,t,i,n);return this.particleEmitterType=r,r},e.prototype.createDirectedCylinderEmitter=function(e,t,i,n,r){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=1),void 0===n&&(n=new a.e(0,1,0)),void 0===r&&(r=new a.e(0,1,0));var o=new lc(e,t,i,n,r);return this.particleEmitterType=o,o},e.prototype.createConeEmitter=function(e,t){void 0===e&&(e=1),void 0===t&&(t=Math.PI/4);var i=new sc(e,t);return this.particleEmitterType=i,i},e.prototype.createBoxEmitter=function(e,t,i,n){var r=new ac;return this.particleEmitterType=r,this.direction1=e,this.direction2=t,this.minEmitBox=i,this.maxEmitBox=n,r},e.BLENDMODE_ONEONE=0,e.BLENDMODE_STANDARD=1,e.BLENDMODE_ADD=2,e.BLENDMODE_MULTIPLY=3,e.BLENDMODE_MULTIPLYADD=4,e}(),gc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("rgba",xs.Color4,!0),i.registerInput("rgb ",xs.Color3,!0),i.registerOutput("rgb",xs.Color3),i.registerOutput("r",xs.Float),i.registerOutput("g",xs.Float),i.registerOutput("b",xs.Float),i.registerOutput("a",xs.Float),i.inputsAreExclusive=!0,i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ColorSplitterBlock"},Object.defineProperty(t.prototype,"rgba",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgbIn",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgbOut",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),t.prototype._inputRename=function(e){return"rgb "===e?"rgbIn":e},t.prototype._outputRename=function(e){return"rgb"===e?"rgbOut":e},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this.rgba.isConnected?this.rgba:this.rgbIn;if(i.isConnected){var n=this._outputs[0],r=this._outputs[1],o=this._outputs[2],a=this._outputs[3],s=this._outputs[4];return n.hasEndpoints&&(t.compilationString+=this._declareOutput(n,t)+" = "+i.associatedVariableName+".rgb;\r\n"),r.hasEndpoints&&(t.compilationString+=this._declareOutput(r,t)+" = "+i.associatedVariableName+".r;\r\n"),o.hasEndpoints&&(t.compilationString+=this._declareOutput(o,t)+" = "+i.associatedVariableName+".g;\r\n"),a.hasEndpoints&&(t.compilationString+=this._declareOutput(a,t)+" = "+i.associatedVariableName+".b;\r\n"),s.hasEndpoints&&(t.compilationString+=this._declareOutput(s,t)+" = "+i.associatedVariableName+".a;\r\n"),this}},t}(ks);c.a.RegisteredTypes["BABYLON.ColorSplitterBlock"]=gc;var vc,bc=i(104);!function(e){e[e.Cos=0]="Cos",e[e.Sin=1]="Sin",e[e.Abs=2]="Abs",e[e.Exp=3]="Exp",e[e.Exp2=4]="Exp2",e[e.Round=5]="Round",e[e.Floor=6]="Floor",e[e.Ceiling=7]="Ceiling",e[e.Sqrt=8]="Sqrt",e[e.Log=9]="Log",e[e.Tan=10]="Tan",e[e.ArcTan=11]="ArcTan",e[e.ArcCos=12]="ArcCos",e[e.ArcSin=13]="ArcSin",e[e.Fract=14]="Fract",e[e.Sign=15]="Sign",e[e.Radians=16]="Radians",e[e.Degrees=17]="Degrees"}(vc||(vc={}));var yc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.operation=vc.Cos,i.registerInput("input",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"TrigonometryBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0],n="";switch(this.operation){case vc.Cos:n="cos";break;case vc.Sin:n="sin";break;case vc.Abs:n="abs";break;case vc.Exp:n="exp";break;case vc.Exp2:n="exp2";break;case vc.Round:n="round";break;case vc.Floor:n="floor";break;case vc.Ceiling:n="ceil";break;case vc.Sqrt:n="sqrt";break;case vc.Log:n="log";break;case vc.Tan:n="tan";break;case vc.ArcTan:n="atan";break;case vc.ArcCos:n="acos";break;case vc.ArcSin:n="asin";break;case vc.Fract:n="fract";break;case vc.Sign:n="sign";break;case vc.Radians:n="radians";break;case vc.Degrees:n="degrees"}return t.compilationString+=this._declareOutput(i,t)+" = "+n+"("+this.input.associatedVariableName+");\r\n",this},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.operation=this.operation,t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.operation=t.operation},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".operation = BABYLON.TrigonometryBlockOperations."+vc[this.operation]+";\r\n"},t}(ks);c.a.RegisteredTypes["BABYLON.TrigonometryBlock"]=yc;var Tc={effect:null,subMesh:null},Ec=function(e){function t(){var t=e.call(this)||this;return t.NORMAL=!1,t.TANGENT=!1,t.UV1=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.BONETEXTURE=!1,t.MORPHTARGETS=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_UV=!1,t.NUM_MORPH_INFLUENCERS=0,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.EXPOSURE=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.BUMPDIRECTUV=0,t.rebuild(),t}return Object(h.d)(t,e),t.prototype.setValue=function(e,t,i){void 0===i&&(i=!1),void 0===this[e]&&this._keys.push(e),i&&this[e]!==t&&this.markAsUnprocessed(),this[e]=t},t}(Xr.a),Sc=function(e){function t(i,n,r){void 0===r&&(r={});var s=e.call(this,i,n||Se.a.LastCreatedScene)||this;return s._buildId=t._BuildIdGenerator++,s._buildWasSuccessful=!1,s._cachedWorldViewMatrix=new a.a,s._cachedWorldViewProjectionMatrix=new a.a,s._optimizers=new Array,s._animationFrame=-1,s.BJSNODEMATERIALEDITOR=s._getGlobalNodeMaterialEditor(),s.editorData=null,s.ignoreAlpha=!1,s.maxSimultaneousLights=4,s.onBuildObservable=new o.c,s._vertexOutputNodes=new Array,s._fragmentOutputNodes=new Array,s.attachedBlocks=new Array,s._mode=Is.Material,s._options=Object(h.a)({emitComments:!1},r),s._attachImageProcessingConfiguration(null),s}return Object(h.d)(t,e),t.prototype._getGlobalNodeMaterialEditor=function(){return"undefined"!=typeof NODEEDITOR?NODEEDITOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.NodeEditor?BABYLON:void 0},Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"NodeMaterial"},t.prototype._attachImageProcessingConfiguration=function(e){var t=this;e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(function(){t._markAllSubMeshesAsImageProcessingDirty()})))},t.prototype.getBlockByName=function(e){for(var t=null,i=0,n=this.attachedBlocks;i<n.length;i++){var r=n[i];if(r.name===e){if(t)return Ce.b.Warn("More than one block was found with the name `"+e+"`"),t;t=r}}return t},t.prototype.getBlockByPredicate=function(e){for(var t=0,i=this.attachedBlocks;t<i.length;t++){var n=i[t];if(e(n))return n}return null},t.prototype.getInputBlockByPredicate=function(e){for(var t=0,i=this.attachedBlocks;t<i.length;t++){var n=i[t];if(n.isInput&&e(n))return n}return null},t.prototype.getInputBlocks=function(){for(var e=[],t=0,i=this.attachedBlocks;t<i.length;t++){var n=i[t];n.isInput&&e.push(n)}return e},t.prototype.registerOptimizer=function(e){if(!(this._optimizers.indexOf(e)>-1))return this._optimizers.push(e),this},t.prototype.unregisterOptimizer=function(e){var t=this._optimizers.indexOf(e);if(-1!==t)return this._optimizers.splice(t,1),this},t.prototype.addOutputNode=function(e){if(null===e.target)throw"This node is not meant to be an output node. You may want to explicitly set its target value.";return 0!=(e.target&Rs.Vertex)&&this._addVertexOutputNode(e),0!=(e.target&Rs.Fragment)&&this._addFragmentOutputNode(e),this},t.prototype.removeOutputNode=function(e){return null===e.target||(0!=(e.target&Rs.Vertex)&&this._removeVertexOutputNode(e),0!=(e.target&Rs.Fragment)&&this._removeFragmentOutputNode(e)),this},t.prototype._addVertexOutputNode=function(e){if(-1===this._vertexOutputNodes.indexOf(e))return e.target=Rs.Vertex,this._vertexOutputNodes.push(e),this},t.prototype._removeVertexOutputNode=function(e){var t=this._vertexOutputNodes.indexOf(e);if(-1!==t)return this._vertexOutputNodes.splice(t,1),this},t.prototype._addFragmentOutputNode=function(e){if(-1===this._fragmentOutputNodes.indexOf(e))return e.target=Rs.Fragment,this._fragmentOutputNodes.push(e),this},t.prototype._removeFragmentOutputNode=function(e){var t=this._fragmentOutputNodes.indexOf(e);if(-1!==t)return this._fragmentOutputNodes.splice(t,1),this},t.prototype.needAlphaBlending=function(){return!this.ignoreAlpha&&(this.alpha<1||this._sharedData&&this._sharedData.hints.needAlphaBlending)},t.prototype.needAlphaTesting=function(){return this._sharedData&&this._sharedData.hints.needAlphaTesting},t.prototype._initializeBlock=function(e,t,i){if(e.initialize(t),e.autoConfigure(this),e._preparationId=this._buildId,-1===this.attachedBlocks.indexOf(e)){if(e.isUnique)for(var n=e.getClassName(),r=0,o=this.attachedBlocks;r<o.length;r++)if(o[r].getClassName()===n)throw"Cannot have multiple blocks of type "+n+" in the same NodeMaterial";this.attachedBlocks.push(e)}for(var a=0,s=e.inputs;a<s.length;a++){var c=s[a];c.associatedVariableName="";var l=c.connectedPoint;if(l){var u=l.ownerBlock;u!==e&&((u.target===Rs.VertexAndFragment||t.target===Rs.Fragment&&u.target===Rs.Vertex&&u._preparationId!==this._buildId)&&i.push(u),this._initializeBlock(u,t,i))}}for(var h=0,d=e.outputs;h<d.length;h++)d[h].associatedVariableName=""},t.prototype._resetDualBlocks=function(e,t){e.target===Rs.VertexAndFragment&&(e.buildId=t);for(var i=0,n=e.inputs;i<n.length;i++){var r=n[i].connectedPoint;if(r){var o=r.ownerBlock;o!==e&&this._resetDualBlocks(o,t)}}},t.prototype.removeBlock=function(e){var t=this.attachedBlocks.indexOf(e);t>-1&&this.attachedBlocks.splice(t,1),e.isFinalMerger&&this.removeOutputNode(e)},t.prototype.build=function(e){void 0===e&&(e=!1),this._buildWasSuccessful=!1;var i=this.getScene().getEngine(),n=this._mode===Is.Particle;if(0===this._vertexOutputNodes.length&&!n)throw"You must define at least one vertexOutputNode";if(0===this._fragmentOutputNodes.length)throw"You must define at least one fragmentOutputNode";this._vertexCompilationState=new Gs,this._vertexCompilationState.supportUniformBuffers=i.supportsUniformBuffers,this._vertexCompilationState.target=Rs.Vertex,this._fragmentCompilationState=new Gs,this._fragmentCompilationState.supportUniformBuffers=i.supportsUniformBuffers,this._fragmentCompilationState.target=Rs.Fragment,this._sharedData=new zs,this._vertexCompilationState.sharedData=this._sharedData,this._fragmentCompilationState.sharedData=this._sharedData,this._sharedData.buildId=this._buildId,this._sharedData.emitComments=this._options.emitComments,this._sharedData.verbose=e,this._sharedData.scene=this.getScene(),this._sharedData.allowEmptyVertexProgram=n;for(var r=[],o=[],a=0,s=this._vertexOutputNodes;a<s.length;a++){var c=s[a];r.push(c),this._initializeBlock(c,this._vertexCompilationState,o)}for(var l=0,u=this._fragmentOutputNodes;l<u.length;l++){var h=u[l];o.push(h),this._initializeBlock(h,this._fragmentCompilationState,r)}this.optimize();for(var d=0,f=r;d<f.length;d++)(c=f[d]).build(this._vertexCompilationState,r);this._fragmentCompilationState.uniforms=this._vertexCompilationState.uniforms.slice(0),this._fragmentCompilationState._uniformDeclaration=this._vertexCompilationState._uniformDeclaration,this._fragmentCompilationState._constantDeclaration=this._vertexCompilationState._constantDeclaration,this._fragmentCompilationState._vertexState=this._vertexCompilationState;for(var p=0,_=o;p<_.length;p++)h=_[p],this._resetDualBlocks(h,this._buildId-1);for(var m=0,g=o;m<g.length;m++)(h=g[m]).build(this._fragmentCompilationState,o);this._vertexCompilationState.finalize(this._vertexCompilationState),this._fragmentCompilationState.finalize(this._fragmentCompilationState),this._buildId=t._BuildIdGenerator++,this._sharedData.emitErrors(),e&&(console.log("Vertex shader:"),console.log(this._vertexCompilationState.compilationString),console.log("Fragment shader:"),console.log(this._fragmentCompilationState.compilationString)),this._buildWasSuccessful=!0,this.onBuildObservable.notifyObservers(this);for(var v=0,b=this.getScene().meshes;v<b.length;v++){var y=b[v];if(y.subMeshes)for(var T=0,E=y.subMeshes;T<E.length;T++){var S=E[T];if(S.getMaterial()===this&&S._materialDefines){var A=S._materialDefines;A.markAllAsDirty(),A.reset()}}}},t.prototype.optimize=function(){for(var e=0,t=this._optimizers;e<t.length;e++)t[e].optimize(this._vertexOutputNodes,this._fragmentOutputNodes)},t.prototype._prepareDefinesForAttributes=function(e,t){var i=t.NORMAL,n=t.TANGENT,r=t.UV1;t.NORMAL=e.isVerticesDataPresent(ji.b.NormalKind),t.TANGENT=e.isVerticesDataPresent(ji.b.TangentKind),t.UV1=e.isVerticesDataPresent(ji.b.UVKind),i===t.NORMAL&&n===t.TANGENT&&r===t.UV1||t.markAsAttributesDirty()},t.prototype.createPostProcess=function(e,t,i,n,r,o,a){return void 0===t&&(t=1),void 0===i&&(i=g.a.TEXTURE_NEAREST_SAMPLINGMODE),void 0===o&&(o=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===a&&(a=g.a.TEXTUREFORMAT_RGBA),this.mode!==Is.PostProcess?(console.log("Incompatible material mode"),null):this._createEffectForPostProcess(null,e,t,i,n,r,o,a)},t.prototype.createEffectForPostProcess=function(e){this._createEffectForPostProcess(e)},t.prototype._createEffectForPostProcess=function(e,t,i,n,r,o,a,s){var c=this;void 0===i&&(i=1),void 0===n&&(n=g.a.TEXTURE_NEAREST_SAMPLINGMODE),void 0===a&&(a=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===s&&(s=g.a.TEXTUREFORMAT_RGBA);var l=this.name+this._buildId,u=new Ec,h=new ze.a(l+"PostProcess",this.getScene()),d=this._buildId;return this._processDefines(h,u),ai.a.RegisterShader(l,this._fragmentCompilationState._builtCompilationString,this._vertexCompilationState._builtCompilationString),e?e.updateEffect(u.toString(),this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,{maxSimultaneousLights:this.maxSimultaneousLights},void 0,void 0,l,l):e=new ci(this.name+"PostProcess",l,this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,i,t,n,r,o,u.toString(),a,l,{maxSimultaneousLights:this.maxSimultaneousLights},!1,s),e.nodeMaterialSource=this,e.onApplyObservable.add(function(t){d!==c._buildId&&(delete ai.a.ShadersStore[l+"VertexShader"],delete ai.a.ShadersStore[l+"PixelShader"],l=c.name+c._buildId,u.markAsUnprocessed(),d=c._buildId),c._processDefines(h,u)&&(ai.a.RegisterShader(l,c._fragmentCompilationState._builtCompilationString,c._vertexCompilationState._builtCompilationString),bc.a.SetImmediate(function(){return e.updateEffect(u.toString(),c._fragmentCompilationState.uniforms,c._fragmentCompilationState.samplers,{maxSimultaneousLights:c.maxSimultaneousLights},void 0,void 0,l,l)})),c._checkInternals(t)}),e},t.prototype.createProceduralTexture=function(e,t){var i=this;if(this.mode!==Is.ProceduralTexture)return console.log("Incompatible material mode"),null;var n=this.name+this._buildId,r=new As(n,e,null,t),o=new ze.a(n+"Procedural",this.getScene());o.reservedDataStore={hidden:!0};var a=new Ec,s=this._processDefines(o,a);ai.a.RegisterShader(n,this._fragmentCompilationState._builtCompilationString,this._vertexCompilationState._builtCompilationString);var c=this.getScene().getEngine().createEffect({vertexElement:n,fragmentElement:n},[ji.b.PositionKind],this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,a.toString(),null==s?void 0:s.fallbacks,void 0);r.nodeMaterialSource=this,r._effect=c;var l=this._buildId;return r.onBeforeGenerationObservable.add(function(){l!==i._buildId&&(delete ai.a.ShadersStore[n+"VertexShader"],delete ai.a.ShadersStore[n+"PixelShader"],n=i.name+i._buildId,a.markAsUnprocessed(),l=i._buildId);var e=i._processDefines(o,a);e&&(ai.a.RegisterShader(n,i._fragmentCompilationState._builtCompilationString,i._vertexCompilationState._builtCompilationString),bc.a.SetImmediate(function(){c=i.getScene().getEngine().createEffect({vertexElement:n,fragmentElement:n},[ji.b.PositionKind],i._fragmentCompilationState.uniforms,i._fragmentCompilationState.samplers,a.toString(),null==e?void 0:e.fallbacks,void 0),r._effect=c})),i._checkInternals(c)}),r},t.prototype._createEffectForParticles=function(e,t,i,n,r,o,a,s){var c=this;void 0===s&&(s="");var l=this.name+this._buildId+"_"+t;o||(o=new Ec),a||(a=this.getScene().getMeshByName(this.name+"Particle"))||((a=new ze.a(this.name+"Particle",this.getScene())).reservedDataStore={hidden:!0});var u=this._buildId,h=[],d=s;if(!r){var f=this._processDefines(a,o);ai.a.RegisterShader(l,this._fragmentCompilationState._builtCompilationString),e.fillDefines(h,t),d=h.join("\n"),r=this.getScene().getEngine().createEffectForParticles(l,this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,o.toString()+"\n"+d,null==f?void 0:f.fallbacks,i,n,e),e.setCustomEffect(r,t)}r.onBindObservable.add(function(r){u!==c._buildId&&(delete ai.a.ShadersStore[l+"PixelShader"],l=c.name+c._buildId+"_"+t,o.markAsUnprocessed(),u=c._buildId),h.length=0,e.fillDefines(h,t);var s=h.join("\n");s!==d&&(o.markAsUnprocessed(),d=s);var f=c._processDefines(a,o);if(f)return ai.a.RegisterShader(l,c._fragmentCompilationState._builtCompilationString),r=c.getScene().getEngine().createEffectForParticles(l,c._fragmentCompilationState.uniforms,c._fragmentCompilationState.samplers,o.toString()+"\n"+d,null==f?void 0:f.fallbacks,i,n,e),e.setCustomEffect(r,t),void c._createEffectForParticles(e,t,i,n,r,o,a,d);c._checkInternals(r)})},t.prototype._checkInternals=function(e){if(this._sharedData.animatedInputs){var t=this.getScene(),i=t.getFrameId();if(this._animationFrame!==i){for(var n=0,r=this._sharedData.animatedInputs;n<r.length;n++)r[n].animate(t);this._animationFrame=i}}for(var o=0,a=this._sharedData.bindableBlocks;o<a.length;o++)a[o].bind(e,this);for(var s=0,c=this._sharedData.inputBlocks;s<c.length;s++)c[s]._transmit(e,this.getScene())},t.prototype.createEffectForParticles=function(e,t,i){this.mode===Is.Particle?(this._createEffectForParticles(e,mc.BLENDMODE_ONEONE,t,i),this._createEffectForParticles(e,mc.BLENDMODE_MULTIPLY,t,i)):console.log("Incompatible material mode")},t.prototype._processDefines=function(e,t,i,n){var r=this;void 0===i&&(i=!1);var o=null;if(this._sharedData.blocksWithDefines.forEach(function(n){n.initializeDefines(e,r,t,i)}),this._sharedData.blocksWithDefines.forEach(function(o){o.prepareDefines(e,r,t,i,n)}),t.isDirty){var a=t._areLightsDisposed;t.markAsProcessed(),this._vertexCompilationState.compilationString=this._vertexCompilationState._builtCompilationString,this._fragmentCompilationState.compilationString=this._fragmentCompilationState._builtCompilationString,this._sharedData.repeatableContentBlocks.forEach(function(i){i.replaceRepeatableContent(r._vertexCompilationState,r._fragmentCompilationState,e,t)});var s=[];this._sharedData.dynamicUniformBlocks.forEach(function(e){e.updateUniformsAndSamples(r._vertexCompilationState,r,t,s)});var c=this._vertexCompilationState.uniforms;this._fragmentCompilationState.uniforms.forEach(function(e){-1===c.indexOf(e)&&c.push(e)});var l=this._vertexCompilationState.samplers;this._fragmentCompilationState.samplers.forEach(function(e){-1===l.indexOf(e)&&l.push(e)});var u=new Qr.a;this._sharedData.blocksWithFallbacks.forEach(function(t){t.provideFallbacks(e,u)}),o={lightDisposed:a,uniformBuffers:s,mergedUniforms:c,mergedSamplers:l,fallbacks:u}}return o},t.prototype.isReadyForSubMesh=function(e,t,i){var n=this;if(void 0===i&&(i=!1),!this._buildWasSuccessful)return!1;var r=this.getScene();if(this._sharedData.animatedInputs){var o=r.getFrameId();if(this._animationFrame!==o){for(var a=0,s=this._sharedData.animatedInputs;a<s.length;a++)s[a].animate(r);this._animationFrame=o}}if(t.effect&&this.isFrozen&&t.effect._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new Ec);var c=t._materialDefines;if(this._isReadyForSubMesh(t))return!0;var l=r.getEngine();if(this._prepareDefinesForAttributes(e,c),this._sharedData.blockingBlocks.some(function(t){return!t.isReady(e,n,c,i)}))return!1;var u=this._processDefines(e,c,i,t);if(u){var h=t.effect,d=c.toString(),f=l.createEffect({vertex:"nodeMaterial"+this._buildId,fragment:"nodeMaterial"+this._buildId,vertexSource:this._vertexCompilationState.compilationString,fragmentSource:this._fragmentCompilationState.compilationString},{attributes:this._vertexCompilationState.attributes,uniformsNames:u.mergedUniforms,uniformBuffersNames:u.uniformBuffers,samplers:u.mergedSamplers,defines:d,fallbacks:u.fallbacks,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights,maxSimultaneousMorphTargets:c.NUM_MORPH_INFLUENCERS}},l);if(f)if(this._onEffectCreatedObservable&&(Tc.effect=f,Tc.subMesh=t,this._onEffectCreatedObservable.notifyObservers(Tc)),this.allowShaderHotSwapping&&h&&!f.isReady()){if(f=h,c.markAsUnprocessed(),u.lightDisposed)return c._areLightsDisposed=!0,!1}else r.resetCachedMaterial(),t.setEffect(f,c)}return!(!t.effect||!t.effect.isReady()||(c._renderId=r.getRenderId(),t.effect._wasPreviouslyReady=!0,0))},Object.defineProperty(t.prototype,"compiledShaders",{get:function(){return"// Vertex shader\r\n"+this._vertexCompilationState.compilationString+"\r\n\r\n// Fragment shader\r\n"+this._fragmentCompilationState.compilationString},enumerable:!1,configurable:!0}),t.prototype.bindOnlyWorldMatrix=function(e){var t=this.getScene();if(this._activeEffect){var i=this._sharedData.hints;i.needWorldViewMatrix&&e.multiplyToRef(t.getViewMatrix(),this._cachedWorldViewMatrix),i.needWorldViewProjectionMatrix&&e.multiplyToRef(t.getTransformMatrix(),this._cachedWorldViewProjectionMatrix);for(var n=0,r=this._sharedData.inputBlocks;n<r.length;n++)r[n]._transmitWorld(this._activeEffect,e,this._cachedWorldViewMatrix,this._cachedWorldViewProjectionMatrix)}},t.prototype.bindForSubMesh=function(e,t,i){var n=this.getScene(),r=i.effect;if(r){if(this._activeEffect=r,this.bindOnlyWorldMatrix(e),this._mustRebind(n,r,t.visibility)){var o=this._sharedData;if(r&&n.getCachedEffect()!==r){for(var a=0,s=o.bindableBlocks;a<s.length;a++)s[a].bind(r,this,t,i);for(var c=0,l=o.inputBlocks;c<l.length;c++)l[c]._transmit(r,n)}}this._afterBind(t,this._activeEffect)}},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._sharedData&&t.push.apply(t,this._sharedData.textureBlocks.filter(function(e){return e.texture}).map(function(e){return e.texture})),t},t.prototype.getTextureBlocks=function(){return this._sharedData?this._sharedData.textureBlocks:[]},t.prototype.hasTexture=function(t){if(e.prototype.hasTexture.call(this,t))return!0;if(!this._sharedData)return!1;for(var i=0,n=this._sharedData.textureBlocks;i<n.length;i++)if(n[i].texture===t)return!0;return!1},t.prototype.dispose=function(t,i,n){if(i)for(var r=0,o=this._sharedData.textureBlocks.filter(function(e){return e.texture}).map(function(e){return e.texture});r<o.length;r++)o[r].dispose();for(var a=0,s=this.attachedBlocks;a<s.length;a++)s[a].dispose();this.onBuildObservable.clear(),e.prototype.dispose.call(this,t,i,n)},t.prototype._createNodeEditor=function(){this.BJSNODEMATERIALEDITOR=this.BJSNODEMATERIALEDITOR||this._getGlobalNodeMaterialEditor(),this.BJSNODEMATERIALEDITOR.NodeEditor.Show({nodeMaterial:this})},t.prototype.edit=function(e){var i=this;return new Promise(function(n,r){if(void 0===i.BJSNODEMATERIALEDITOR){var o=e&&e.editorURL?e.editorURL:t.EditorURL;Ce.b.LoadScript(o,function(){i._createNodeEditor(),n()})}else i._createNodeEditor(),n()})},t.prototype.clear=function(){this._vertexOutputNodes=[],this._fragmentOutputNodes=[],this.attachedBlocks=[]},t.prototype.setToDefault=function(){this.clear(),this.editorData=null;var e=new qs("Position");e.setAsAttribute("position");var t=new qs("World");t.setAsSystemValue(BABYLON.NodeMaterialSystemValues.World);var i=new js("WorldPos");e.connectTo(i),t.connectTo(i);var n=new qs("ViewProjection");n.setAsSystemValue(BABYLON.NodeMaterialSystemValues.ViewProjection);var r=new js("WorldPos * ViewProjectionTransform");i.connectTo(r),n.connectTo(r);var o=new Ws("VertexOutput");r.connectTo(o);var a=new qs("color");a.value=new s.b(.8,.8,.8,1);var c=new Xs("FragmentOutput");a.connectTo(c),this.addOutputNode(o),this.addOutputNode(c),this._mode=Is.Material},t.prototype.setToDefaultPostProcess=function(){this.clear(),this.editorData=null;var e=new qs("Position");e.setAsAttribute("position2d");var t=new qs("Constant1");t.isConstant=!0,t.value=1;var i=new ic("Position3D");e.connectTo(i),t.connectTo(i,{input:"w"});var n=new Ws("VertexOutput");i.connectTo(n);var r=new qs("Scale");r.visibleInInspector=!0,r.value=new a.d(1,1);var o=new rc("uv0");e.connectTo(o);var s=new oc("UV scale");o.connectTo(s),r.connectTo(s);var c=new Zs("CurrentScreen");s.connectTo(c),c.texture=new Ke.a("https://assets.babylonjs.com/nme/currentScreenPostProcess.png",this.getScene());var l=new Xs("FragmentOutput");c.connectTo(l,{output:"rgba"}),this.addOutputNode(n),this.addOutputNode(l),this._mode=Is.PostProcess},t.prototype.setToDefaultProceduralTexture=function(){this.clear(),this.editorData=null;var e=new qs("Position");e.setAsAttribute("position2d");var t=new qs("Constant1");t.isConstant=!0,t.value=1;var i=new ic("Position3D");e.connectTo(i),t.connectTo(i,{input:"w"});var n=new Ws("VertexOutput");i.connectTo(n);var r=new qs("Time");r.value=0,r.min=0,r.max=0,r.isBoolean=!1,r.matrixMode=0,r.animationType=Hs.Time,r.isConstant=!1;var o=new qs("Color3");o.value=new s.a(1,1,1),o.isConstant=!1;var a=new Xs("FragmentOutput"),c=new ic("VectorMerger");c.visibleInInspector=!1;var l=new yc("Cos");l.operation=vc.Cos,e.connectTo(c),r.output.connectTo(l.input),l.output.connectTo(c.z),c.xyzOut.connectTo(a.rgb),this.addOutputNode(n),this.addOutputNode(a),this._mode=Is.ProceduralTexture},t.prototype.setToDefaultParticle=function(){this.clear(),this.editorData=null;var e=new qs("uv");e.setAsAttribute("particle_uv");var t=new Js("ParticleTexture");e.connectTo(t);var i=new qs("Color");i.setAsAttribute("particle_color");var n=new oc("Texture * Color");t.connectTo(n),i.connectTo(n);var r=new $s("ParticleRampGradient");n.connectTo(r);var o=new gc("ColorSplitter");i.connectTo(o);var a=new ec("ParticleBlendMultiply");r.connectTo(a),t.connectTo(a,{output:"a"}),o.connectTo(a,{output:"a"});var s=new Xs("FragmentOutput");a.connectTo(s),this.addOutputNode(s),this._mode=Is.Particle},t.prototype.loadAsync=function(e){var t=this;return this.getScene()._loadFileAsync(e).then(function(e){var i=JSON.parse(e);t.loadFromSerialization(i,"")})},t.prototype._gatherBlocks=function(e,t){if(-1===t.indexOf(e)){t.push(e);for(var i=0,n=e.inputs;i<n.length;i++){var r=n[i].connectedPoint;if(r){var o=r.ownerBlock;o!==e&&this._gatherBlocks(o,t)}}}},t.prototype.generateCode=function(){for(var e=[],t=[],i=[],n=0,r=this._vertexOutputNodes;n<r.length;n++){var o=r[n];this._gatherBlocks(o,t)}for(var a=[],s=0,c=this._fragmentOutputNodes;s<c.length;s++)o=c[s],this._gatherBlocks(o,a);for(var l='var nodeMaterial = new BABYLON.NodeMaterial("'+(this.name||"node material")+'");\r\n',u=0,h=t;u<h.length;u++)(E=h[u]).isInput&&-1===e.indexOf(E)&&(l+=E._dumpCode(i,e));for(var d=0,f=a;d<f.length;d++)(E=f[d]).isInput&&-1===e.indexOf(E)&&(l+=E._dumpCode(i,e));e=[],l+="\r\n// Connections\r\n";for(var p=0,_=this._vertexOutputNodes;p<_.length;p++)l+=(E=_[p])._dumpCodeForOutputConnections(e);for(var m=0,g=this._fragmentOutputNodes;m<g.length;m++)l+=(E=g[m])._dumpCodeForOutputConnections(e);l+="\r\n// Output nodes\r\n";for(var v=0,b=this._vertexOutputNodes;v<b.length;v++)l+="nodeMaterial.addOutputNode("+(E=b[v])._codeVariableName+");\r\n";for(var y=0,T=this._fragmentOutputNodes;y<T.length;y++){var E;l+="nodeMaterial.addOutputNode("+(E=T[y])._codeVariableName+");\r\n"}return l+"nodeMaterial.build();\r\n"},t.prototype.serialize=function(e){var t=e?{}:w.a.Serialize(this);t.editorData=JSON.parse(JSON.stringify(this.editorData));var i=[];if(e)i=e;else{t.customType="BABYLON.NodeMaterial",t.outputNodes=[];for(var n=0,r=this._vertexOutputNodes;n<r.length;n++){var o=r[n];this._gatherBlocks(o,i),t.outputNodes.push(o.uniqueId)}for(var a=0,s=this._fragmentOutputNodes;a<s.length;a++)o=s[a],this._gatherBlocks(o,i),-1===t.outputNodes.indexOf(o.uniqueId)&&t.outputNodes.push(o.uniqueId)}t.blocks=[];for(var c=0,l=i;c<l.length;c++){var u=l[c];t.blocks.push(u.serialize())}if(!e)for(var h=0,d=this.attachedBlocks;h<d.length;h++)u=d[h],-1===i.indexOf(u)&&t.blocks.push(u.serialize());return t},t.prototype._restoreConnections=function(e,t,i){for(var n=0,r=e.outputs;n<r.length;n++)for(var o=r[n],a=0,s=t.blocks;a<s.length;a++){var c=s[a],l=i[c.id];if(l)for(var u=0,h=c.inputs;u<h.length;u++){var d=h[u];if(i[d.targetBlockId]!==e||d.targetConnectionName!==o.name);else{var f=l.getInputByName(d.inputName);if(!f||f.isConnected)continue;o.connectTo(f,!0),this._restoreConnections(l,t,i)}}}},t.prototype.loadFromSerialization=function(e,t,i){var n;void 0===t&&(t=""),void 0===i&&(i=!1),i||this.clear();for(var r={},o=0,a=e.blocks;o<a.length;o++){var s=a[o],l=c.a.GetClass(s.customType);l&&((h=new l)._deserialize(s,this.getScene(),t),r[s.id]=h,this.attachedBlocks.push(h))}for(var u=0;u<e.blocks.length;u++){var h;(h=r[e.blocks[u].id])&&(h.inputs.length&&!i||this._restoreConnections(h,e,r))}if(e.outputNodes)for(var d=0,f=e.outputNodes;d<f.length;d++){var p=f[d];this.addOutputNode(r[p])}if(e.locations||e.editorData&&e.editorData.locations){for(var _=e.locations||e.editorData.locations,m=0,g=_;m<g.length;m++){var v=g[m];r[v.blockId]&&(v.blockId=r[v.blockId].uniqueId)}i&&this.editorData&&this.editorData.locations&&_.concat(this.editorData.locations),e.locations?this.editorData={locations:_}:(this.editorData=e.editorData,this.editorData.locations=_);var b=[];for(var y in r)b[y]=r[y].uniqueId;this.editorData.map=b}this.comment=e.comment,i||(this._mode=null!==(n=e.mode)&&void 0!==n?n:Is.Material)},t.prototype.clone=function(e){var i=this,n=this.serialize(),r=w.a.Clone(function(){return new t(e,i.getScene(),i.options)},this);return r.id=e,r.name=e,r.loadFromSerialization(n),r.build(),r},t.Parse=function(e,i,n){void 0===n&&(n="");var r=w.a.Parse(function(){return new t(e.name,i)},e,i,n);return r.loadFromSerialization(e,n),r.build(),r},t.ParseFromFileAsync=function(e,i,n){var r=new t(e,n);return new Promise(function(e,t){return r.loadAsync(i).then(function(){r.build(),e(r)}).catch(t)})},t.ParseFromSnippetAsync=function(e,i,n,r){var o=this;return void 0===n&&(n=""),"_BLANK"===e?Promise.resolve(this.CreateDefault("blank",i)):new Promise(function(a,s){var c=new V.a;c.addEventListener("readystatechange",function(){if(4==c.readyState)if(200==c.status){var o=JSON.parse(JSON.parse(c.responseText).jsonPayload),l=JSON.parse(o.nodeMaterial);r||((r=w.a.Parse(function(){return new t(e,i)},l,i,n)).uniqueId=i.getUniqueId()),r.loadFromSerialization(l),r.snippetId=e;try{r.build(),a(r)}catch(e){s(e)}}else s("Unable to load the snippet "+e)}),c.open("GET",o.SnippetUrl+"/"+e.replace(/#/g,"/")),c.send()})},t.CreateDefault=function(e,i){var n=new t(e,i);return n.setToDefault(),n.build(),n},t._BuildIdGenerator=0,t.EditorURL="https://unpkg.com/babylonjs-node-editor@"+Se.a.Version+"/babylon.nodeEditor.js",t.SnippetUrl="https://snippet.babylonjs.com",t.IgnoreTexturesAtLoadTime=!1,Object(h.c)([Object(w.c)("mode")],t.prototype,"_mode",void 0),Object(h.c)([Object(w.c)("comment")],t.prototype,"comment",void 0),t}(Yr.a);c.a.RegisteredTypes["BABYLON.NodeMaterial"]=Sc;var Ac=function(e){function t(t){var i=e.call(this,t,Rs.Vertex)||this;return i.registerInput("matricesIndices",xs.Vector4),i.registerInput("matricesWeights",xs.Vector4),i.registerInput("matricesIndicesExtra",xs.Vector4,!0),i.registerInput("matricesWeightsExtra",xs.Vector4,!0),i.registerInput("world",xs.Matrix),i.registerOutput("output",xs.Matrix),i}return Object(h.d)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("boneSampler"),e._excludeVariableName("boneTextureWidth"),e._excludeVariableName("mBones"),e._excludeVariableName("BonesPerMesh")},t.prototype.getClassName=function(){return"BonesBlock"},Object.defineProperty(t.prototype,"matricesIndices",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matricesWeights",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matricesIndicesExtra",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matricesWeightsExtra",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.matricesIndices.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"matricesIndices"===e.name});t||(t=new qs("matricesIndices")).setAsAttribute("matricesIndices"),t.output.connectTo(this.matricesIndices)}if(!this.matricesWeights.isConnected){var i=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"matricesWeights"===e.name});i||(i=new qs("matricesWeights")).setAsAttribute("matricesWeights"),i.output.connectTo(this.matricesWeights)}if(!this.world.isConnected){var n=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.World});n||(n=new qs("world")).setAsSystemValue(Ms.World),n.output.connectTo(this.world)}},t.prototype.provideFallbacks=function(e,t){e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton&&t.addCPUSkinningFallback(0,e)},t.prototype.bind=function(e,t,i){Hr.a.BindBonesParameters(i,e)},t.prototype.prepareDefines=function(e,t,i){i._areAttributesDirty&&Hr.a.PrepareDefinesForBones(e,i)},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.blocksWithFallbacks.push(this),t.sharedData.bindableBlocks.push(this),t.sharedData.blocksWithDefines.push(this),t.uniforms.push("boneTextureWidth"),t.uniforms.push("mBones"),t.samplers.push("boneSampler");var i="//"+this.name;t._emitFunctionFromInclude("bonesDeclaration",i,{removeAttributes:!0,removeUniforms:!1,removeVaryings:!0,removeIfDef:!1});var n=t._getFreeVariableName("influence");t.compilationString+=t._emitCodeFromInclude("bonesVertex",i,{replaceStrings:[{search:/finalWorld=finalWorld\*influence;/,replace:""},{search:/influence/gm,replace:n}]});var r=this._outputs[0],o=this.world;return t.compilationString+="#if NUM_BONE_INFLUENCERS>0\r\n",t.compilationString+=this._declareOutput(r,t)+" = "+o.associatedVariableName+" * "+n+";\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(r,t)+" = "+o.associatedVariableName+";\r\n",t.compilationString+="#endif\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.BonesBlock"]=Ac;var Pc=function(e){function t(t){var i=e.call(this,t,Rs.Vertex)||this;return i.registerInput("world0",xs.Vector4),i.registerInput("world1",xs.Vector4),i.registerInput("world2",xs.Vector4),i.registerInput("world3",xs.Vector4),i.registerInput("world",xs.Matrix,!0),i.registerOutput("output",xs.Matrix),i.registerOutput("instanceID",xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"InstancesBlock"},Object.defineProperty(t.prototype,"world0",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world1",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world2",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world3",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instanceID",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.world0.connectedPoint){var t=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"world0"===e.name});t||(t=new qs("world0")).setAsAttribute("world0"),t.output.connectTo(this.world0)}if(!this.world1.connectedPoint){var i=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"world1"===e.name});i||(i=new qs("world1")).setAsAttribute("world1"),i.output.connectTo(this.world1)}if(!this.world2.connectedPoint){var n=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"world2"===e.name});n||(n=new qs("world2")).setAsAttribute("world2"),n.output.connectTo(this.world2)}if(!this.world3.connectedPoint){var r=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"world3"===e.name});r||(r=new qs("world3")).setAsAttribute("world3"),r.output.connectTo(this.world3)}if(!this.world.connectedPoint){var o=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"world"===e.name});o||(o=new qs("world")).setAsSystemValue(Ms.World),o.output.connectTo(this.world)}this.world.define="!INSTANCES || THIN_INSTANCES"},t.prototype.prepareDefines=function(e,t,i,n,r){void 0===n&&(n=!1);var o=!1;i.INSTANCES!==n&&(i.setValue("INSTANCES",n),o=!0),r&&i.THIN_INSTANCES!==!!(null==r?void 0:r.getRenderingMesh().hasThinInstances)&&(i.setValue("THIN_INSTANCES",!!(null==r?void 0:r.getRenderingMesh().hasThinInstances)),o=!0),o&&i.markAsUnprocessed()},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.blocksWithDefines.push(this);var i=this._outputs[0],n=this._outputs[1],r=this.world0,o=this.world1,a=this.world2,s=this.world3;return t.compilationString+="#ifdef INSTANCES\r\n",t.compilationString+=this._declareOutput(i,t)+" = mat4("+r.associatedVariableName+", "+o.associatedVariableName+", "+a.associatedVariableName+", "+s.associatedVariableName+");\r\n",t.compilationString+="#ifdef THIN_INSTANCES\r\n",t.compilationString+=i.associatedVariableName+" = "+this.world.associatedVariableName+" * "+i.associatedVariableName+";\r\n",t.compilationString+="#endif\r\n",t.compilationString+=this._declareOutput(n,t)+" = float(gl_InstanceID);\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(i,t)+" = "+this.world.associatedVariableName+";\r\n",t.compilationString+=this._declareOutput(n,t)+" = 0.0;\r\n",t.compilationString+="#endif\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.InstancesBlock"]=Pc;var Cc=function(e){function t(t){var i=e.call(this,t,Rs.Vertex)||this;return i.registerInput("position",xs.Vector3),i.registerInput("normal",xs.Vector3),i.registerInput("tangent",xs.Vector3),i.registerInput("uv",xs.Vector2),i.registerOutput("positionOutput",xs.Vector3),i.registerOutput("normalOutput",xs.Vector3),i.registerOutput("tangentOutput",xs.Vector3),i.registerOutput("uvOutput",xs.Vector2),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"MorphTargetsBlock"},Object.defineProperty(t.prototype,"position",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tangent",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"positionOutput",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normalOutput",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tangentOutput",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uvOutput",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("morphTargetInfluences")},t.prototype.autoConfigure=function(e){if(!this.position.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"position"===e.name});t||(t=new qs("position")).setAsAttribute(),t.output.connectTo(this.position)}if(!this.normal.isConnected){var i=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"normal"===e.name});i||(i=new qs("normal")).setAsAttribute("normal"),i.output.connectTo(this.normal)}if(!this.tangent.isConnected){var n=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"tangent"===e.name});n||(n=new qs("tangent")).setAsAttribute("tangent"),n.output.connectTo(this.tangent)}if(!this.uv.isConnected){var r=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"uv"===e.name});r||(r=new qs("uv")).setAsAttribute("uv"),r.output.connectTo(this.uv)}},t.prototype.prepareDefines=function(e,t,i){i._areAttributesDirty&&Hr.a.PrepareDefinesForMorphTargets(e,i)},t.prototype.bind=function(e,t,i){i&&i.morphTargetManager&&i.morphTargetManager.numInfluencers>0&&Hr.a.BindMorphTargetParameters(i,e)},t.prototype.replaceRepeatableContent=function(e,t,i,n){for(var r=this.position,o=this.normal,a=this.tangent,s=this.uv,c=this.positionOutput,l=this.normalOutput,u=this.tangentOutput,h=this.uvOutput,d=e,f=n.NUM_MORPH_INFLUENCERS,p=i.morphTargetManager,_=p&&p.supportsNormals&&n.NORMAL,m=p&&p.supportsTangents&&n.TANGENT,g=p&&p.supportsUVs&&n.UV1,v="",b=0;b<f;b++)v+="#ifdef MORPHTARGETS\r\n",v+=c.associatedVariableName+" += (position"+b+" - "+r.associatedVariableName+") * morphTargetInfluences["+b+"];\r\n",_&&(v+="#ifdef MORPHTARGETS_NORMAL\r\n",v+=l.associatedVariableName+" += (normal"+b+" - "+o.associatedVariableName+") * morphTargetInfluences["+b+"];\r\n",v+="#endif\r\n"),m&&(v+="#ifdef MORPHTARGETS_TANGENT\r\n",v+=u.associatedVariableName+".xyz += (tangent"+b+" - "+a.associatedVariableName+".xyz) * morphTargetInfluences["+b+"];\r\n",v+="#endif\r\n"),g&&(v+="#ifdef MORPHTARGETS_UV\r\n",v+=h.associatedVariableName+".xy += (uv_"+b+" - "+s.associatedVariableName+".xy) * morphTargetInfluences["+b+"];\r\n",v+="#endif\r\n"),v+="#endif\r\n";if(d.compilationString=d.compilationString.replace(this._repeatableContentAnchor,v),f>0)for(b=0;b<f;b++)d.attributes.push(ji.b.PositionKind+b),_&&d.attributes.push(ji.b.NormalKind+b),m&&d.attributes.push(ji.b.TangentKind+b),g&&d.attributes.push(ji.b.UVKind+"_"+b)},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this),t.sharedData.repeatableContentBlocks.push(this);var i=this.position,n=this.normal,r=this.tangent,o=this.uv,a=this.positionOutput,s=this.normalOutput,c=this.tangentOutput,l=this.uvOutput,u="//"+this.name;return t.uniforms.push("morphTargetInfluences"),t._emitFunctionFromInclude("morphTargetsVertexGlobalDeclaration",u),t._emitFunctionFromInclude("morphTargetsVertexDeclaration",u,{repeatKey:"maxSimultaneousMorphTargets"}),t.compilationString+=this._declareOutput(a,t)+" = "+i.associatedVariableName+";\r\n",t.compilationString+="#ifdef NORMAL\r\n",t.compilationString+=this._declareOutput(s,t)+" = "+n.associatedVariableName+";\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(s,t)+" = vec3(0., 0., 0.);\r\n",t.compilationString+="#endif\r\n",t.compilationString+="#ifdef TANGENT\r\n",t.compilationString+=this._declareOutput(c,t)+" = "+r.associatedVariableName+";\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(c,t)+" = vec3(0., 0., 0.);\r\n",t.compilationString+="#endif\r\n",t.compilationString+="#ifdef UV1\r\n",t.compilationString+=this._declareOutput(l,t)+" = "+o.associatedVariableName+";\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(l,t)+" = vec2(0., 0.);\r\n",t.compilationString+="#endif\r\n",this._repeatableContentAnchor=t._repeatableContentAnchor,t.compilationString+=this._repeatableContentAnchor,this},t}(ks);c.a.RegisteredTypes["BABYLON.MorphTargetsBlock"]=Cc;var Rc=function(e){function t(t){var i=e.call(this,t,Rs.Vertex)||this;return i.registerInput("worldPosition",xs.Vector4,!1,Rs.Vertex),i.registerOutput("direction",xs.Vector3),i.registerOutput("color",xs.Color3),i.registerOutput("intensity",xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"LightInformationBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intensity",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),t.prototype.bind=function(e,t,i){if(i){this.light&&this.light.isDisposed&&(this.light=null);var n=this.light,r=t.getScene();if(!n&&r.lights.length&&(n=r.lights[0]),!n||!n.isEnabled)return e.setFloat3(this._lightDataUniformName,0,0,0),void e.setFloat4(this._lightColorUniformName,0,0,0,0);n.transferToNodeMaterialEffect(e,this._lightDataUniformName),e.setColor4(this._lightColorUniformName,n.diffuse,n.intensity)}},t.prototype.prepareDefines=function(e,t,i){if(i._areLightsDirty){var n=this.light;i.setValue(this._lightTypeDefineName,!!(n&&n instanceof Oa))}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.bindableBlocks.push(this),t.sharedData.blocksWithDefines.push(this);var i=this.direction,n=this.color,r=this.intensity;return this._lightDataUniformName=t._getFreeVariableName("lightData"),this._lightColorUniformName=t._getFreeVariableName("lightColor"),this._lightTypeDefineName=t._getFreeDefineName("LIGHTPOINTTYPE"),t._emitUniformFromString(this._lightDataUniformName,"vec3"),t._emitUniformFromString(this._lightColorUniformName,"vec4"),t.compilationString+="#ifdef "+this._lightTypeDefineName+"\r\n",t.compilationString+=this._declareOutput(i,t)+" = normalize("+this.worldPosition.associatedVariableName+".xyz - "+this._lightDataUniformName+");\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(i,t)+" = "+this._lightDataUniformName+";\r\n",t.compilationString+="#endif\r\n",t.compilationString+=this._declareOutput(n,t)+" = "+this._lightColorUniformName+".rgb;\r\n",t.compilationString+=this._declareOutput(r,t)+" = "+this._lightColorUniformName+".a;\r\n",this},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.light&&(t.lightId=this.light.id),t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),t.lightId&&(this.light=i.getLightByID(t.lightId))},t}(ks);c.a.RegisteredTypes["BABYLON.LightInformationBlock"]=Rc;var xc=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i.registerInput("color",xs.Color4),i.registerOutput("output",xs.Color4),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color3),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ImageProcessingBlock"},Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("exposureLinear"),e._excludeVariableName("contrast"),e._excludeVariableName("vInverseScreenSize"),e._excludeVariableName("vignetteSettings1"),e._excludeVariableName("vignetteSettings2"),e._excludeVariableName("vCameraColorCurveNegative"),e._excludeVariableName("vCameraColorCurveNeutral"),e._excludeVariableName("vCameraColorCurvePositive"),e._excludeVariableName("txColorTransform"),e._excludeVariableName("colorTransformSettings")},t.prototype.isReady=function(e,t,i){return!(i._areImageProcessingDirty&&t.imageProcessingConfiguration&&!t.imageProcessingConfiguration.isReady())},t.prototype.prepareDefines=function(e,t,i){i._areImageProcessingDirty&&t.imageProcessingConfiguration&&t.imageProcessingConfiguration.prepareDefines(i)},t.prototype.bind=function(e,t,i){i&&t.imageProcessingConfiguration&&t.imageProcessingConfiguration.bind(e)},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.blocksWithDefines.push(this),t.sharedData.blockingBlocks.push(this),t.sharedData.bindableBlocks.push(this),t.uniforms.push("exposureLinear"),t.uniforms.push("contrast"),t.uniforms.push("vInverseScreenSize"),t.uniforms.push("vignetteSettings1"),t.uniforms.push("vignetteSettings2"),t.uniforms.push("vCameraColorCurveNegative"),t.uniforms.push("vCameraColorCurveNeutral"),t.uniforms.push("vCameraColorCurvePositive"),t.uniforms.push("txColorTransform"),t.uniforms.push("colorTransformSettings");var i=this.color,n=this._outputs[0],r="//"+this.name;return t._emitFunctionFromInclude("helperFunctions",r),t._emitFunctionFromInclude("imageProcessingDeclaration",r),t._emitFunctionFromInclude("imageProcessingFunctions",r),i.connectedPoint.type===xs.Color4||i.connectedPoint.type===xs.Vector4?t.compilationString+=this._declareOutput(n,t)+" = "+i.associatedVariableName+";\r\n":t.compilationString+=this._declareOutput(n,t)+" = vec4("+i.associatedVariableName+", 1.0);\r\n",t.compilationString+="#ifdef IMAGEPROCESSINGPOSTPROCESS\r\n",t.compilationString+=n.associatedVariableName+".rgb = toLinearSpace("+i.associatedVariableName+".rgb);\r\n",t.compilationString+="#else\r\n",t.compilationString+="#ifdef IMAGEPROCESSING\r\n",t.compilationString+=n.associatedVariableName+".rgb = toLinearSpace("+i.associatedVariableName+".rgb);\r\n",t.compilationString+=n.associatedVariableName+" = applyImageProcessing("+n.associatedVariableName+");\r\n",t.compilationString+="#endif\r\n",t.compilationString+="#endif\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.ImageProcessingBlock"]=xc;var Oc=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i._tangentSpaceParameterName="",i.invertX=!1,i.invertY=!1,i.registerInput("worldPosition",xs.Vector4,!1),i.registerInput("worldNormal",xs.Vector4,!1),i.registerInput("worldTangent",xs.Vector4,!0),i.registerInput("uv",xs.Vector2,!1),i.registerInput("normalMapColor",xs.Color3,!1),i.registerInput("strength",xs.Float,!1),i.registerOutput("output",xs.Vector4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"PerturbNormalBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldTangent",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normalMapColor",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.prepareDefines=function(e,t,i){i.setValue("BUMP",!0)},t.prototype.bind=function(e,t,i){t.getScene()._mirroredCameraPosition?e.setFloat2(this._tangentSpaceParameterName,this.invertX?1:-1,this.invertY?1:-1):e.setFloat2(this._tangentSpaceParameterName,this.invertX?-1:1,this.invertY?-1:1)},t.prototype.autoConfigure=function(e){if(!this.uv.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"uv"===e.name});t||(t=new qs("uv")).setAsAttribute(),t.output.connectTo(this.uv)}if(!this.strength.isConnected){var i=new qs("strength");i.value=1,i.output.connectTo(this.strength)}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i="//"+this.name,n=this.uv,r=this.worldPosition,o=this.worldNormal,a=this.worldTangent;t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this),this._tangentSpaceParameterName=t._getFreeDefineName("tangentSpaceParameter"),t._emitUniformFromString(this._tangentSpaceParameterName,"vec2");var s=this.strength.isConnectedToInputBlock&&this.strength.connectInputBlock.isConstant?""+t._emitFloat(1/this.strength.connectInputBlock.value):"1.0 / "+this.strength.associatedVariableName;t._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");var c={search:/defined\(TANGENT\)/g,replace:a.isConnected?"defined(TANGENT)":"defined(IGNORE)"};return a.isConnected&&(t.compilationString+="vec3 tbnNormal = normalize("+o.associatedVariableName+".xyz);\r\n",t.compilationString+="vec3 tbnTangent = normalize("+a.associatedVariableName+".xyz);\r\n",t.compilationString+="vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\r\n",t.compilationString+="mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n"),t._emitFunctionFromInclude("bumpFragmentMainFunctions",i,{replaceStrings:[c]}),t._emitFunctionFromInclude("bumpFragmentFunctions",i,{replaceStrings:[{search:/vBumpInfos.y/g,replace:s},{search:/vTangentSpaceParams/g,replace:this._tangentSpaceParameterName},{search:/vPositionW/g,replace:r.associatedVariableName+".xyz"}]}),t.compilationString+=this._declareOutput(this.output,t)+" = vec4(0.);\r\n",t.compilationString+=t._emitCodeFromInclude("bumpFragment",i,{replaceStrings:[{search:/perturbNormal\(TBN,vBumpUV\+uvOffset\)/g,replace:"perturbNormal(TBN, "+this.normalMapColor.associatedVariableName+")"},{search:/vBumpInfos.y/g,replace:s},{search:/vBumpUV/g,replace:n.associatedVariableName},{search:/vPositionW/g,replace:r.associatedVariableName+".xyz"},{search:/normalW=/g,replace:this.output.associatedVariableName+".xyz = "},{search:/mat3\(normalMatrix\)\*normalW/g,replace:"mat3(normalMatrix) * "+this.output.associatedVariableName+".xyz"},{search:/normalW/g,replace:o.associatedVariableName+".xyz"},c]}),this},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".invertX = "+this.invertX+";\r\n"+(this._codeVariableName+".invertY = ")+this.invertY+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.invertX=this.invertX,t.invertY=this.invertY,t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.invertX=t.invertX,this.invertY=t.invertY},Object(h.c)([nc("Invert X axis",tc.Boolean,"PROPERTIES",{notifiers:{update:!1}})],t.prototype,"invertX",void 0),Object(h.c)([nc("Invert Y axis",tc.Boolean,"PROPERTIES",{notifiers:{update:!1}})],t.prototype,"invertY",void 0),t}(ks);c.a.RegisteredTypes["BABYLON.PerturbNormalBlock"]=Oc;var Mc=function(e){function t(t){var i=e.call(this,t,Rs.Fragment,!0)||this;return i.registerInput("value",xs.Float,!0),i.registerInput("cutoff",xs.Float,!0),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DiscardBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cutoff",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.sharedData.hints.needAlphaTesting=!0,this.cutoff.isConnected&&this.value.isConnected)return t.compilationString+="if ("+this.value.associatedVariableName+" < "+this.cutoff.associatedVariableName+") discard;\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.DiscardBlock"]=Mc;var Ic=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i.registerOutput("output",xs.Float,Rs.Fragment),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FrontFacingBlock"},Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===Rs.Vertex)throw"FrontFacingBlock must only be used in a fragment shader";var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = gl_FrontFacing ? 1.0 : 0.0;\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.FrontFacingBlock"]=Ic;var Dc=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i.registerInput("input",xs.AutoDetect,!1),i.registerOutput("dx",xs.BasedOnInput),i.registerOutput("dy",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._outputs[1]._typeConnectionSource=i._inputs[0],i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DerivativeBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dx",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dy",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0],n=this._outputs[1];return t._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable"),i.hasEndpoints&&(t.compilationString+=this._declareOutput(i,t)+" = dFdx("+this.input.associatedVariableName+");\r\n"),n.hasEndpoints&&(t.compilationString+=this._declareOutput(n,t)+" = dFdy("+this.input.associatedVariableName+");\r\n"),this},t}(ks);c.a.RegisteredTypes["BABYLON.DerivativeBlock"]=Dc;var Nc=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i.registerOutput("xy",xs.Vector2,Rs.Fragment),i.registerOutput("xyz",xs.Vector3,Rs.Fragment),i.registerOutput("xyzw",xs.Vector4,Rs.Fragment),i.registerOutput("x",xs.Float,Rs.Fragment),i.registerOutput("y",xs.Float,Rs.Fragment),i.registerOutput("z",xs.Float,Rs.Fragment),i.registerOutput("w",xs.Float,Rs.Fragment),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FragCoordBlock"},Object.defineProperty(t.prototype,"xy",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyz",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzw",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[6]},enumerable:!1,configurable:!0}),t.prototype.writeOutputs=function(e){for(var t="",i=0,n=this._outputs;i<n.length;i++){var r=n[i];r.hasEndpoints&&(t+=this._declareOutput(r,e)+" = gl_FragCoord."+r.name+";\r\n")}return t},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===Rs.Vertex)throw"FragCoordBlock must only be used in a fragment shader";return t.compilationString+=this.writeOutputs(t),this},t}(ks);c.a.RegisteredTypes["BABYLON.FragCoordBlock"]=Nc;var Lc=function(e){function t(t){var i=e.call(this,t,Rs.Fragment)||this;return i.registerOutput("xy",xs.Vector2,Rs.Fragment),i.registerOutput("x",xs.Float,Rs.Fragment),i.registerOutput("y",xs.Float,Rs.Fragment),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ScreenSizeBlock"},Object.defineProperty(t.prototype,"xy",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),t.prototype.bind=function(e,t,i){var n=this._scene.getEngine();e.setFloat2(this._varName,n.getRenderWidth(),n.getRenderWidth())},t.prototype.writeOutputs=function(e,t){for(var i="",n=0,r=this._outputs;n<r.length;n++){var o=r[n];o.hasEndpoints&&(i+=this._declareOutput(o,e)+" = "+t+"."+o.name+";\r\n")}return i},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),this._scene=t.sharedData.scene,t.target===Rs.Vertex)throw"ScreenSizeBlock must only be used in a fragment shader";return t.sharedData.bindableBlocks.push(this),this._varName=t._getFreeVariableName("screenSize"),t._emitUniformFromString(this._varName,"vec2"),t.compilationString+=this.writeOutputs(t,this._varName),this},t}(ks);c.a.RegisteredTypes["BABYLON.ScreenSizeBlock"]=Lc;var wc=function(e){function t(t){var i=e.call(this,t,Rs.VertexAndFragment,!0)||this;return i.registerInput("worldPosition",xs.Vector4,!1,Rs.Vertex),i.registerInput("view",xs.Matrix,!1,Rs.Vertex),i.registerInput("input",xs.Color3,!1,Rs.Fragment),i.registerInput("fogColor",xs.Color3,!1,Rs.Fragment),i.registerOutput("output",xs.Color3,Rs.Fragment),i.input.acceptedConnectionPointTypes.push(xs.Color4),i.fogColor.acceptedConnectionPointTypes.push(xs.Color4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FogBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fogColor",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.view.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.View});t||(t=new qs("view")).setAsSystemValue(Ms.View),t.output.connectTo(this.view)}if(!this.fogColor.isConnected){var i=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.FogColor});i||(i=new qs("fogColor",void 0,xs.Color3)).setAsSystemValue(Ms.FogColor),i.output.connectTo(this.fogColor)}},t.prototype.prepareDefines=function(e,t,i){var n=e.getScene();i.setValue("FOG",t.fogEnabled&&Hr.a.GetFogState(e,n))},t.prototype.bind=function(e,t,i){if(i){var n=i.getScene();e.setFloat4(this._fogParameters,n.fogMode,n.fogStart,n.fogEnd,n.fogDensity)}},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===Rs.Fragment){t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this),t._emitFunctionFromInclude("fogFragmentDeclaration","//"+this.name,{removeUniforms:!0,removeVaryings:!0,removeIfDef:!1,replaceStrings:[{search:/float CalcFogFactor\(\)/,replace:"float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)"}]});var i=t._getFreeVariableName("fog"),n=this.input,r=this.fogColor;this._fogParameters=t._getFreeVariableName("fogParameters");var o=this._outputs[0];t._emitUniformFromString(this._fogParameters,"vec4"),t.compilationString+="#ifdef FOG\r\n",t.compilationString+="float "+i+" = CalcFogFactor("+this._fogDistanceName+", "+this._fogParameters+");\r\n",t.compilationString+=this._declareOutput(o,t)+" = "+i+" * "+n.associatedVariableName+".rgb + (1.0 - "+i+") * "+r.associatedVariableName+".rgb;\r\n",t.compilationString+="#else\r\n"+this._declareOutput(o,t)+" =  "+n.associatedVariableName+".rgb;\r\n",t.compilationString+="#endif\r\n"}else{var a=this.worldPosition,s=this.view;this._fogDistanceName=t._getFreeVariableName("vFogDistance"),t._emitVaryingFromString(this._fogDistanceName,"vec3"),t.compilationString+=this._fogDistanceName+" = ("+s.associatedVariableName+" * "+a.associatedVariableName+").xyz;\r\n"}return this},t}(ks);c.a.RegisteredTypes["BABYLON.FogBlock"]=wc;var Fc=function(e){function t(t){var i=e.call(this,t,Rs.VertexAndFragment)||this;return i._isUnique=!0,i.registerInput("worldPosition",xs.Vector4,!1,Rs.Vertex),i.registerInput("worldNormal",xs.Vector4,!1,Rs.Fragment),i.registerInput("cameraPosition",xs.Vector3,!1,Rs.Fragment),i.registerInput("glossiness",xs.Float,!0,Rs.Fragment),i.registerInput("glossPower",xs.Float,!0,Rs.Fragment),i.registerInput("diffuseColor",xs.Color3,!0,Rs.Fragment),i.registerInput("specularColor",xs.Color3,!0,Rs.Fragment),i.registerInput("view",xs.Matrix,!0),i.registerOutput("diffuseOutput",xs.Color3,Rs.Fragment),i.registerOutput("specularOutput",xs.Color3,Rs.Fragment),i.registerOutput("shadow",xs.Float,Rs.Fragment),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"LightBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossiness",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossPower",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diffuseColor",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"specularColor",{get:function(){return this._inputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[7]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diffuseOutput",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"specularOutput",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadow",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.cameraPosition.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.CameraPosition});t||(t=new qs("cameraPosition")).setAsSystemValue(Ms.CameraPosition),t.output.connectTo(this.cameraPosition)}},t.prototype.prepareDefines=function(e,t,i){if(i._areLightsDirty){var n=e.getScene();if(this.light){var r={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};Hr.a.PrepareDefinesForLight(n,e,this.light,this._lightId,i,!0,r),r.needRebuild&&i.rebuild()}else Hr.a.PrepareDefinesForLights(n,e,i,!0,t.maxSimultaneousLights)}},t.prototype.updateUniformsAndSamples=function(e,t,i,n){for(var r=0;r<t.maxSimultaneousLights&&i["LIGHT"+r];r++){var o=e.uniforms.indexOf("vLightData"+r)>=0;Hr.a.PrepareUniformsAndSamplersForLight(r,e.uniforms,e.samplers,i["PROJECTEDLIGHTTEXTURE"+r],n,o)}},t.prototype.bind=function(e,t,i){if(i){var n=i.getScene();this.light?Hr.a.BindLight(this.light,this._lightId,n,e,!0):Hr.a.BindLights(n,i,e,!0,t.maxSimultaneousLights)}},t.prototype._injectVertexCode=function(e){var t=this.worldPosition,i="//"+this.name;this.light?(this._lightId=(void 0!==e.counters.lightCounter?e.counters.lightCounter:-1)+1,e.counters.lightCounter=this._lightId,e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",i,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString())):(e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",i,{repeatKey:"maxSimultaneousLights"}),this._lightId=0,e.sharedData.dynamicUniformBlocks.push(this));var n="v_"+t.associatedVariableName;e._emitVaryingFromString(n,"vec4")&&(e.compilationString+=n+" = "+t.associatedVariableName+";\r\n"),this.light?e.compilationString+=e._emitCodeFromInclude("shadowsVertex",i,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()},{search:/worldPos/g,replace:t.associatedVariableName}]}):(e.compilationString+="vec4 worldPos = "+t.associatedVariableName+";\r\n",this.view.isConnected&&(e.compilationString+="mat4 view = "+this.view.associatedVariableName+";\r\n"),e.compilationString+=e._emitCodeFromInclude("shadowsVertex",i,{repeatKey:"maxSimultaneousLights"}))},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===Rs.Fragment){t.sharedData.bindableBlocks.push(this),t.sharedData.blocksWithDefines.push(this);var i="//"+this.name,n=this.worldPosition;t._emitFunctionFromInclude("helperFunctions",i),t._emitFunctionFromInclude("lightsFragmentFunctions",i,{replaceStrings:[{search:/vPositionW/g,replace:"v_"+n.associatedVariableName+".xyz"}]}),t._emitFunctionFromInclude("shadowsFragmentFunctions",i,{replaceStrings:[{search:/vPositionW/g,replace:"v_"+n.associatedVariableName+".xyz"}]}),this.light?t._emitFunctionFromInclude(t.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",i,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString()):t._emitFunctionFromInclude(t.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",i,{repeatKey:"maxSimultaneousLights"}),0===this._lightId&&(t._registerTempVariable("viewDirectionW")&&(t.compilationString+="vec3 viewDirectionW = normalize("+this.cameraPosition.associatedVariableName+" - v_"+n.associatedVariableName+".xyz);\r\n"),t.compilationString+="lightingInfo info;\r\n",t.compilationString+="float shadow = 1.;\r\n",t.compilationString+="float glossiness = "+(this.glossiness.isConnected?this.glossiness.associatedVariableName:"1.0")+" * "+(this.glossPower.isConnected?this.glossPower.associatedVariableName:"1024.0")+";\r\n",t.compilationString+="vec3 diffuseBase = vec3(0., 0., 0.);\r\n",t.compilationString+="vec3 specularBase = vec3(0., 0., 0.);\r\n",t.compilationString+="vec3 normalW = "+this.worldNormal.associatedVariableName+".xyz;\r\n"),this.light?t.compilationString+=t._emitCodeFromInclude("lightFragment",i,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]}):t.compilationString+=t._emitCodeFromInclude("lightFragment",i,{repeatKey:"maxSimultaneousLights"});var r=this.diffuseOutput,o=this.specularOutput;return t.compilationString+=this._declareOutput(r,t)+" = diffuseBase"+(this.diffuseColor.isConnected?" * "+this.diffuseColor.associatedVariableName:"")+";\r\n",o.hasEndpoints&&(t.compilationString+=this._declareOutput(o,t)+" = specularBase"+(this.specularColor.isConnected?" * "+this.specularColor.associatedVariableName:"")+";\r\n"),this.shadow.hasEndpoints&&(t.compilationString+=this._declareOutput(this.shadow,t)+" = shadow;\r\n"),this}this._injectVertexCode(t)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.light&&(t.lightId=this.light.id),t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),t.lightId&&(this.light=i.getLightByID(t.lightId))},t}(ks);c.a.RegisteredTypes["BABYLON.LightBlock"]=Fc;var Bc=function(e){function t(t,i){void 0===i&&(i=!1);var n=e.call(this,t,i?Rs.Fragment:Rs.VertexAndFragment)||this;return n.convertToGammaSpace=!1,n.convertToLinearSpace=!1,n._fragmentOnly=i,n.registerInput("uv",xs.Vector2,!1,Rs.VertexAndFragment),n.registerOutput("rgba",xs.Color4,Rs.Neutral),n.registerOutput("rgb",xs.Color3,Rs.Neutral),n.registerOutput("r",xs.Float,Rs.Neutral),n.registerOutput("g",xs.Float,Rs.Neutral),n.registerOutput("b",xs.Float,Rs.Neutral),n.registerOutput("a",xs.Float,Rs.Neutral),n._inputs[0].acceptedConnectionPointTypes.push(xs.Vector3),n._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),n._inputs[0]._prioritizeVertex=!i,n}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"TextureBlock"},Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){if(this._fragmentOnly)return Rs.Fragment;if(!this.uv.isConnected)return Rs.VertexAndFragment;if(this.uv.sourceBlock.isInput)return Rs.VertexAndFragment;for(var e=this.uv.connectedPoint;e;){if(e.target===Rs.Fragment)return Rs.Fragment;if(e.target===Rs.Vertex)return Rs.VertexAndFragment;if(e.target===Rs.Neutral||e.target===Rs.VertexAndFragment){var t=e.ownerBlock;e=null;for(var i=0,n=t.inputs;i<n.length;i++){var r=n[i];if(r.connectedPoint){e=r.connectedPoint;break}}}}return Rs.VertexAndFragment},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.uv.isConnected)if(e.mode===Is.PostProcess)(t=e.getBlockByPredicate(function(e){return"uv"===e.name}))&&t.connectTo(this);else{var t,i=e.mode===Is.Particle?"particle_uv":"uv";(t=e.getInputBlockByPredicate(function(e){return e.isAttribute&&e.name===i}))||(t=new qs("uv")).setAsAttribute(i),t.output.connectTo(this.uv)}},t.prototype.initializeDefines=function(e,t,i,n){void 0===n&&(n=!1),i._areTexturesDirty&&i.setValue(this._mainUVDefineName,!1)},t.prototype.prepareDefines=function(e,t,i){if(i._areTexturesDirty){if(!this.texture||!this.texture.getTextureMatrix)return i.setValue(this._defineName,!1),void i.setValue(this._mainUVDefineName,!0);i.setValue(this._linearDefineName,this.convertToGammaSpace),i.setValue(this._gammaDefineName,this.convertToLinearSpace),this._isMixed&&(this.texture.getTextureMatrix().isIdentityAs3x2()?(i.setValue(this._defineName,!1),i.setValue(this._mainUVDefineName,!0)):i.setValue(this._defineName,!0))}},t.prototype.isReady=function(){return!(this.texture&&!this.texture.isReadyOrNotBlocking())},t.prototype.bind=function(e,t,i){this.texture&&(this._isMixed&&(e.setFloat(this._textureInfoName,this.texture.level),e.setMatrix(this._textureTransformName,this.texture.getTextureMatrix())),e.setTexture(this._samplerName,this.texture))},Object.defineProperty(t.prototype,"_isMixed",{get:function(){return this.target!==Rs.Fragment},enumerable:!1,configurable:!0}),t.prototype._injectVertexCode=function(e){var t=this.uv;if(this._defineName=e._getFreeDefineName("UVTRANSFORM"),this._mainUVDefineName="VMAIN"+t.associatedVariableName.toUpperCase(),t.connectedPoint.ownerBlock.isInput&&(t.connectedPoint.ownerBlock.isAttribute||e._emitUniformFromString(t.associatedVariableName,"vec2")),this._mainUVName="vMain"+t.associatedVariableName,this._transformedUVName=e._getFreeVariableName("transformedUV"),this._textureTransformName=e._getFreeVariableName("textureTransform"),this._textureInfoName=e._getFreeVariableName("textureInfoName"),e._emitVaryingFromString(this._transformedUVName,"vec2",this._defineName),e._emitVaryingFromString(this._mainUVName,"vec2",this._mainUVDefineName),e._emitUniformFromString(this._textureTransformName,"mat4",this._defineName),e.compilationString+="#ifdef "+this._defineName+"\r\n",e.compilationString+=this._transformedUVName+" = vec2("+this._textureTransformName+" * vec4("+t.associatedVariableName+".xy, 1.0, 0.0));\r\n",e.compilationString+="#elif defined("+this._mainUVDefineName+")\r\n",e.compilationString+=this._mainUVName+" = "+t.associatedVariableName+".xy;\r\n",e.compilationString+="#endif\r\n",this._outputs.some(function(e){return e.isConnectedInVertexShader})){this._writeTextureRead(e,!0);for(var i=0,n=this._outputs;i<n.length;i++){var r=n[i];r.hasEndpoints&&this._writeOutput(e,r,r.name,!0)}}},t.prototype._writeTextureRead=function(e,t){void 0===t&&(t=!1);var i=this.uv;if(t){if(e.target===Rs.Fragment)return;e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+i.associatedVariableName+");\r\n"}else this.uv.ownerBlock.target!==Rs.Fragment?(e.compilationString+="#ifdef "+this._defineName+"\r\n",e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+this._transformedUVName+");\r\n",e.compilationString+="#elif defined("+this._mainUVDefineName+")\r\n",e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+this._mainUVName+");\r\n",e.compilationString+="#endif\r\n"):e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+i.associatedVariableName+");\r\n"},t.prototype._writeOutput=function(e,t,i,n){if(void 0===n&&(n=!1),n){if(e.target===Rs.Fragment)return;e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+i+";\r\n"}else if(this.uv.ownerBlock.target!==Rs.Fragment){var r=" * "+this._textureInfoName;e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+i+r+";\r\n","a"!==i&&(e.compilationString+="#ifdef "+this._linearDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toGammaSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef "+this._gammaDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toLinearSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n")}else e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+i+";\r\n"},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),(t.target===Rs.Vertex||this._fragmentOnly)&&(this._tempTextureRead=t._getFreeVariableName("tempTextureRead")),(!this._isMixed&&t.target===Rs.Fragment||this._isMixed&&t.target===Rs.Vertex)&&(this._samplerName=t._getFreeVariableName(this.name+"Sampler"),t._emit2DSampler(this._samplerName),t.sharedData.blockingBlocks.push(this),t.sharedData.textureBlocks.push(this),t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this)),t.target===Rs.Fragment){if(this._outputs.some(function(e){return e.isConnectedInFragmentShader})){this._isMixed&&t._emit2DSampler(this._samplerName),this._linearDefineName=t._getFreeDefineName("ISLINEAR"),this._gammaDefineName=t._getFreeDefineName("ISGAMMA");var i="//"+this.name;t._emitFunctionFromInclude("helperFunctions",i),this._isMixed&&t._emitUniformFromString(this._textureInfoName,"float"),this._writeTextureRead(t);for(var n=0,r=this._outputs;n<r.length;n++){var o=r[n];o.hasEndpoints&&this._writeOutput(t,o,o.name)}return this}}else this._injectVertexCode(t)},t.prototype._dumpPropertiesCode=function(){if(!this.texture)return"";var e=this._codeVariableName+'.texture = new BABYLON.Texture("'+this.texture.name+'", null);\r\n';return e+=this._codeVariableName+".texture.wrapU = "+this.texture.wrapU+";\r\n",e+=this._codeVariableName+".texture.wrapV = "+this.texture.wrapV+";\r\n",e+=this._codeVariableName+".texture.uAng = "+this.texture.uAng+";\r\n",e+=this._codeVariableName+".texture.vAng = "+this.texture.vAng+";\r\n",e+=this._codeVariableName+".texture.wAng = "+this.texture.wAng+";\r\n",e+=this._codeVariableName+".texture.uOffset = "+this.texture.uOffset+";\r\n",e+=this._codeVariableName+".texture.vOffset = "+this.texture.vOffset+";\r\n",e+=this._codeVariableName+".texture.uScale = "+this.texture.uScale+";\r\n",e+=this._codeVariableName+".texture.vScale = "+this.texture.vScale+";\r\n",(e+=this._codeVariableName+".convertToGammaSpace = "+this.convertToGammaSpace+";\r\n")+(this._codeVariableName+".convertToLinearSpace = ")+this.convertToLinearSpace+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.convertToGammaSpace=this.convertToGammaSpace,t.convertToLinearSpace=this.convertToLinearSpace,t.fragmentOnly=this._fragmentOnly,this.texture&&!this.texture.isRenderTarget&&(t.texture=this.texture.serialize()),t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.convertToGammaSpace=t.convertToGammaSpace,this.convertToLinearSpace=!!t.convertToLinearSpace,this._fragmentOnly=!!t.fragmentOnly,t.texture&&!Sc.IgnoreTexturesAtLoadTime&&(n=0===t.texture.url.indexOf("data:")?"":n,this.texture=Ke.a.Parse(t.texture,i,n))},t}(ks);c.a.RegisteredTypes["BABYLON.TextureBlock"]=Bc;var Uc=function(e){function t(t){return e.call(this,t,Rs.VertexAndFragment)||this}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ReflectionTextureBaseBlock"},t.prototype._getTexture=function(){return this.texture},t.prototype.autoConfigure=function(e){if(!this.position.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.isAttribute&&"position"===e.name});t||(t=new qs("position")).setAsAttribute(),t.output.connectTo(this.position)}if(!this.world.isConnected){var i=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.World});i||(i=new qs("world")).setAsSystemValue(Ms.World),i.output.connectTo(this.world)}if(this.view&&!this.view.isConnected){var n=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.View});n||(n=new qs("view")).setAsSystemValue(Ms.View),n.output.connectTo(this.view)}},t.prototype.prepareDefines=function(e,t,i){if(i._areTexturesDirty){var n=this._getTexture();n&&n.getTextureMatrix&&(i.setValue(this._define3DName,n.isCube,!0),i.setValue(this._defineLocalCubicName,!!n.boundingBoxSize,!0),i.setValue(this._defineExplicitName,n.coordinatesMode===g.a.TEXTURE_EXPLICIT_MODE,!0),i.setValue(this._defineSkyboxName,n.coordinatesMode===g.a.TEXTURE_SKYBOX_MODE,!0),i.setValue(this._defineCubicName,n.coordinatesMode===g.a.TEXTURE_CUBIC_MODE||n.coordinatesMode===g.a.TEXTURE_INVCUBIC_MODE,!0),i.setValue("INVERTCUBICMAP",n.coordinatesMode===g.a.TEXTURE_INVCUBIC_MODE,!0),i.setValue(this._defineSphericalName,n.coordinatesMode===g.a.TEXTURE_SPHERICAL_MODE,!0),i.setValue(this._definePlanarName,n.coordinatesMode===g.a.TEXTURE_PLANAR_MODE,!0),i.setValue(this._defineProjectionName,n.coordinatesMode===g.a.TEXTURE_PROJECTION_MODE,!0),i.setValue(this._defineEquirectangularName,n.coordinatesMode===g.a.TEXTURE_EQUIRECTANGULAR_MODE,!0),i.setValue(this._defineEquirectangularFixedName,n.coordinatesMode===g.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,!0),i.setValue(this._defineMirroredEquirectangularFixedName,n.coordinatesMode===g.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,!0))}},t.prototype.isReady=function(){var e=this._getTexture();return!(e&&!e.isReadyOrNotBlocking())},t.prototype.bind=function(e,t,i){var n=this._getTexture();i&&n&&(e.setMatrix(this._reflectionMatrixName,n.getReflectionTextureMatrix()),n.isCube?e.setTexture(this._cubeSamplerName,n):e.setTexture(this._2DSamplerName,n))},t.prototype.handleVertexSide=function(e){this._define3DName=e._getFreeDefineName("REFLECTIONMAP_3D"),this._defineCubicName=e._getFreeDefineName("REFLECTIONMAP_CUBIC"),this._defineSphericalName=e._getFreeDefineName("REFLECTIONMAP_SPHERICAL"),this._definePlanarName=e._getFreeDefineName("REFLECTIONMAP_PLANAR"),this._defineProjectionName=e._getFreeDefineName("REFLECTIONMAP_PROJECTION"),this._defineExplicitName=e._getFreeDefineName("REFLECTIONMAP_EXPLICIT"),this._defineEquirectangularName=e._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR"),this._defineLocalCubicName=e._getFreeDefineName("USE_LOCAL_REFLECTIONMAP_CUBIC"),this._defineMirroredEquirectangularFixedName=e._getFreeDefineName("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"),this._defineEquirectangularFixedName=e._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR_FIXED"),this._defineSkyboxName=e._getFreeDefineName("REFLECTIONMAP_SKYBOX"),this._defineOppositeZ=e._getFreeDefineName("REFLECTIONMAP_OPPOSITEZ"),this._reflectionMatrixName=e._getFreeVariableName("reflectionMatrix"),e._emitUniformFromString(this._reflectionMatrixName,"mat4");var t="",i="v_"+this.worldPosition.associatedVariableName;return e._emitVaryingFromString(i,"vec4")&&(t+=i+" = "+this.worldPosition.associatedVariableName+";\r\n"),this._positionUVWName=e._getFreeVariableName("positionUVW"),this._directionWName=e._getFreeVariableName("directionW"),e._emitVaryingFromString(this._positionUVWName,"vec3",this._defineSkyboxName)&&(t+="#ifdef "+this._defineSkyboxName+"\r\n",t+=this._positionUVWName+" = "+this.position.associatedVariableName+".xyz;\r\n",t+="#endif\r\n"),e._emitVaryingFromString(this._directionWName,"vec3","defined("+this._defineEquirectangularFixedName+") || defined("+this._defineMirroredEquirectangularFixedName+")")&&(t+="#if defined("+this._defineEquirectangularFixedName+") || defined("+this._defineMirroredEquirectangularFixedName+")\r\n",t+=this._directionWName+" = normalize(vec3("+this.world.associatedVariableName+" * vec4("+this.position.associatedVariableName+".xyz, 0.0)));\r\n",t+="#endif\r\n"),t},t.prototype.handleFragmentSideInits=function(e){e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),this._cubeSamplerName=e._getFreeVariableName(this.name+"CubeSampler"),e.samplers.push(this._cubeSamplerName),this._2DSamplerName=e._getFreeVariableName(this.name+"2DSampler"),e.samplers.push(this._2DSamplerName),e._samplerDeclaration+="#ifdef "+this._define3DName+"\r\n",e._samplerDeclaration+="uniform samplerCube "+this._cubeSamplerName+";\r\n",e._samplerDeclaration+="#else\r\n",e._samplerDeclaration+="uniform sampler2D "+this._2DSamplerName+";\r\n",e._samplerDeclaration+="#endif\r\n",e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this);var t="//"+this.name;e._emitFunction("ReciprocalPI","#define RECIPROCAL_PI2 0.15915494",""),e._emitFunctionFromInclude("reflectionFunction",t,{replaceStrings:[{search:/vec3 computeReflectionCoords/g,replace:"void DUMMYFUNC"}]}),this._reflectionColorName=e._getFreeVariableName("reflectionColor"),this._reflectionVectorName=e._getFreeVariableName("reflectionUVW"),this._reflectionCoordsName=e._getFreeVariableName("reflectionCoords")},t.prototype.handleFragmentSideCodeReflectionCoords=function(e,t,i){void 0===i&&(i=!1),t||(t="v_"+this.worldPosition.associatedVariableName);var n=this._reflectionMatrixName,r="normalize("+this._directionWName+")",o=""+this._positionUVWName,a=""+this.cameraPosition.associatedVariableName,s=""+this.view.associatedVariableName;e+=".xyz";var c="\n            #ifdef "+this._defineMirroredEquirectangularFixedName+"\n                vec3 "+this._reflectionVectorName+" = computeMirroredFixedEquirectangularCoords("+t+", "+e+", "+r+");\n            #endif\n\n            #ifdef "+this._defineEquirectangularFixedName+"\n                vec3 "+this._reflectionVectorName+" = computeFixedEquirectangularCoords("+t+", "+e+", "+r+");\n            #endif\n\n            #ifdef "+this._defineEquirectangularName+"\n                vec3 "+this._reflectionVectorName+" = computeEquirectangularCoords("+t+", "+e+", "+a+".xyz, "+n+");\n            #endif\n\n            #ifdef "+this._defineSphericalName+"\n                vec3 "+this._reflectionVectorName+" = computeSphericalCoords("+t+", "+e+", "+s+", "+n+");\n            #endif\n\n            #ifdef "+this._definePlanarName+"\n                vec3 "+this._reflectionVectorName+" = computePlanarCoords("+t+", "+e+", "+a+".xyz, "+n+");\n            #endif\n\n            #ifdef "+this._defineCubicName+"\n                #ifdef "+this._defineLocalCubicName+"\n                    vec3 "+this._reflectionVectorName+" = computeCubicLocalCoords("+t+", "+e+", "+a+".xyz, "+n+", vReflectionSize, vReflectionPosition);\n                #else\n                vec3 "+this._reflectionVectorName+" = computeCubicCoords("+t+", "+e+", "+a+".xyz, "+n+");\n                #endif\n            #endif\n\n            #ifdef "+this._defineProjectionName+"\n                vec3 "+this._reflectionVectorName+" = computeProjectionCoords("+t+", "+s+", "+n+");\n            #endif\n\n            #ifdef "+this._defineSkyboxName+"\n                vec3 "+this._reflectionVectorName+" = computeSkyBoxCoords("+o+", "+n+");\n            #endif\n\n            #ifdef "+this._defineExplicitName+"\n                vec3 "+this._reflectionVectorName+" = vec3(0, 0, 0);\n            #endif\n\n            #ifdef "+this._defineOppositeZ+"\n                "+this._reflectionVectorName+".z *= -1.0;\n            #endif\r\n";return i||(c+="\n                #ifdef "+this._define3DName+"\n                    vec3 "+this._reflectionCoordsName+" = "+this._reflectionVectorName+";\n                #else\n                    vec2 "+this._reflectionCoordsName+" = "+this._reflectionVectorName+".xy;\n                    #ifdef "+this._defineProjectionName+"\n                        "+this._reflectionCoordsName+" /= "+this._reflectionVectorName+".z;\n                    #endif\n                    "+this._reflectionCoordsName+".y = 1.0 - "+this._reflectionCoordsName+".y;\n                #endif\r\n"),c},t.prototype.handleFragmentSideCodeReflectionColor=function(e,t){void 0===t&&(t=".rgb");var i="vec"+(0===t.length?"4":t.length-1)+" "+this._reflectionColorName+";\n            #ifdef "+this._define3DName+"\r\n";return i+=e?this._reflectionColorName+" = textureCubeLodEXT("+this._cubeSamplerName+", "+this._reflectionVectorName+", "+e+")"+t+";\r\n":this._reflectionColorName+" = textureCube("+this._cubeSamplerName+", "+this._reflectionVectorName+")"+t+";\r\n",i+="\n            #else\r\n",(i+=e?this._reflectionColorName+" = texture2DLodEXT("+this._2DSamplerName+", "+this._reflectionCoordsName+", "+e+")"+t+";\r\n":this._reflectionColorName+" = texture2D("+this._2DSamplerName+", "+this._reflectionCoordsName+")"+t+";\r\n")+"#endif\r\n"},t.prototype.writeOutputs=function(e,t){var i="";if(e.target===Rs.Fragment)for(var n=0,r=this._outputs;n<r.length;n++){var o=r[n];o.hasEndpoints&&(i+=this._declareOutput(o,e)+" = "+t+"."+o.name+";\r\n")}return i},t.prototype._buildBlock=function(t){return e.prototype._buildBlock.call(this,t),this},t.prototype._dumpPropertiesCode=function(){return this.texture?(e=this.texture.isCube?this._codeVariableName+'.texture = new BABYLON.CubeTexture("'+this.texture.name+'");\r\n':this._codeVariableName+'.texture = new BABYLON.Texture("'+this.texture.name+'");\r\n',e+=this._codeVariableName+".texture.coordinatesMode = "+this.texture.coordinatesMode+";\r\n"):"";var e},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.texture&&(t.texture=this.texture.serialize()),t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),t.texture&&(n=0===t.texture.url.indexOf("data:")?"":n,t.texture.isCube?this.texture=Wr.Parse(t.texture,i,n):this.texture=Ke.a.Parse(t.texture,i,n))},t}(ks);c.a.RegisteredTypes["BABYLON.ReflectionTextureBaseBlock"]=Uc;var Vc=function(e){function t(t){var i=e.call(this,t)||this;return i.registerInput("position",xs.Vector3,!1,Rs.Vertex),i.registerInput("worldPosition",xs.Vector4,!1,Rs.Vertex),i.registerInput("worldNormal",xs.Vector4,!1,Rs.Fragment),i.registerInput("world",xs.Matrix,!1,Rs.Vertex),i.registerInput("cameraPosition",xs.Vector3,!1,Rs.Fragment),i.registerInput("view",xs.Matrix,!1,Rs.Fragment),i.registerOutput("rgb",xs.Color3,Rs.Fragment),i.registerOutput("rgba",xs.Color4,Rs.Fragment),i.registerOutput("r",xs.Float,Rs.Fragment),i.registerOutput("g",xs.Float,Rs.Fragment),i.registerOutput("b",xs.Float,Rs.Fragment),i.registerOutput("a",xs.Float,Rs.Fragment),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ReflectionTextureBlock"},Object.defineProperty(t.prototype,"position",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(t){if(e.prototype.autoConfigure.call(this,t),!this.cameraPosition.isConnected){var i=t.getInputBlockByPredicate(function(e){return e.systemValue===Ms.CameraPosition});i||(i=new qs("cameraPosition")).setAsSystemValue(Ms.CameraPosition),i.output.connectTo(this.cameraPosition)}},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),!this.texture)return t.compilationString+=this.writeOutputs(t,"vec3(0.)"),this;if(t.target!==Rs.Fragment)return t.compilationString+=this.handleVertexSide(t),this;this.handleFragmentSideInits(t);var i=t._getFreeVariableName("normalWUnit");return t.compilationString+="vec4 "+i+" = normalize("+this.worldNormal.associatedVariableName+");\r\n",t.compilationString+=this.handleFragmentSideCodeReflectionCoords(i),t.compilationString+=this.handleFragmentSideCodeReflectionColor(void 0,""),t.compilationString+=this.writeOutputs(t,this._reflectionColorName),this},t}(Uc);c.a.RegisteredTypes["BABYLON.ReflectionTextureBlock"]=Vc;var kc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"AddBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = "+this.left.associatedVariableName+" + "+this.right.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.AddBlock"]=kc;var Gc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("input",xs.AutoDetect),i.registerInput("factor",xs.Float),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ScaleBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factor",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = "+this.input.associatedVariableName+" * "+this.factor.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.ScaleBlock"]=Gc;var zc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.minimum=0,i.maximum=1,i.registerInput("value",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ClampBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = clamp("+this.value.associatedVariableName+", "+this._writeFloat(this.minimum)+", "+this._writeFloat(this.maximum)+");\r\n",this},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".minimum = "+this.minimum+";\r\n"+(this._codeVariableName+".maximum = ")+this.maximum+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.minimum=this.minimum,t.maximum=this.maximum,t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.minimum=t.minimum,this.maximum=t.maximum},Object(h.c)([nc("Minimum",tc.Float)],t.prototype,"minimum",void 0),Object(h.c)([nc("Maximum",tc.Float)],t.prototype,"maximum",void 0),t}(ks);c.a.RegisteredTypes["BABYLON.ClampBlock"]=zc;var jc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.Vector3),i._linkConnectionTypes(0,1),i._inputs[0].excludedConnectionPointTypes.push(xs.Float),i._inputs[0].excludedConnectionPointTypes.push(xs.Matrix),i._inputs[0].excludedConnectionPointTypes.push(xs.Vector2),i._inputs[1].excludedConnectionPointTypes.push(xs.Float),i._inputs[1].excludedConnectionPointTypes.push(xs.Matrix),i._inputs[1].excludedConnectionPointTypes.push(xs.Vector2),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"CrossBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = cross("+this.left.associatedVariableName+".xyz, "+this.right.associatedVariableName+".xyz);\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.CrossBlock"]=jc;var Wc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.Float),i._linkConnectionTypes(0,1),i._inputs[0].excludedConnectionPointTypes.push(xs.Float),i._inputs[0].excludedConnectionPointTypes.push(xs.Matrix),i._inputs[1].excludedConnectionPointTypes.push(xs.Float),i._inputs[1].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DotBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = dot("+this.left.associatedVariableName+", "+this.right.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.DotBlock"]=Wc;var Hc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("input",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._inputs[0].excludedConnectionPointTypes.push(xs.Float),i._inputs[0].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"NormalizeBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0],n=this._inputs[0];return t.compilationString+=this._declareOutput(i,t)+" = normalize("+n.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.NormalizeBlock"]=Hc;var Xc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("rgb ",xs.Color3,!0),i.registerInput("r",xs.Float,!0),i.registerInput("g",xs.Float,!0),i.registerInput("b",xs.Float,!0),i.registerInput("a",xs.Float,!0),i.registerOutput("rgba",xs.Color4),i.registerOutput("rgb",xs.Color3),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ColorMergerBlock"},Object.defineProperty(t.prototype,"rgbIn",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgbOut",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this.rgbOut},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this.r,n=this.g,r=this.b,o=this.a,a=this.rgbIn,s=this._outputs[0],c=this._outputs[1];return a.isConnected?s.hasEndpoints?t.compilationString+=this._declareOutput(s,t)+" = vec4("+a.associatedVariableName+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":c.hasEndpoints&&(t.compilationString+=this._declareOutput(c,t)+" = "+a.associatedVariableName+";\r\n"):s.hasEndpoints?t.compilationString+=this._declareOutput(s,t)+" = vec4("+(i.isConnected?this._writeVariable(i):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+", "+(r.isConnected?this._writeVariable(r):"0.0")+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":c.hasEndpoints&&(t.compilationString+=this._declareOutput(c,t)+" = vec3("+(i.isConnected?this._writeVariable(i):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+", "+(r.isConnected?this._writeVariable(r):"0.0")+");\r\n"),this},t}(ks);c.a.RegisteredTypes["BABYLON.ColorMergerBlock"]=Xc;var Yc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("xyzw",xs.Vector4,!0),i.registerInput("xyz ",xs.Vector3,!0),i.registerInput("xy ",xs.Vector2,!0),i.registerOutput("xyz",xs.Vector3),i.registerOutput("xy",xs.Vector2),i.registerOutput("x",xs.Float),i.registerOutput("y",xs.Float),i.registerOutput("z",xs.Float),i.registerOutput("w",xs.Float),i.inputsAreExclusive=!0,i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"VectorSplitterBlock"},Object.defineProperty(t.prototype,"xyzw",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzIn",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyIn",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzOut",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyOut",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"w",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),t.prototype._inputRename=function(e){switch(e){case"xy ":return"xyIn";case"xyz ":return"xyzIn";default:return e}},t.prototype._outputRename=function(e){switch(e){case"xy":return"xyOut";case"xyz":return"xyzOut";default:return e}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this.xyzw.isConnected?this.xyzw:this.xyzIn.isConnected?this.xyzIn:this.xyIn,n=this._outputs[0],r=this._outputs[1],o=this._outputs[2],a=this._outputs[3],s=this._outputs[4],c=this._outputs[5];return n.hasEndpoints&&(i===this.xyIn?t.compilationString+=this._declareOutput(n,t)+" = vec3("+i.associatedVariableName+", 0.0);\r\n":t.compilationString+=this._declareOutput(n,t)+" = "+i.associatedVariableName+".xyz;\r\n"),r.hasEndpoints&&(t.compilationString+=this._declareOutput(r,t)+" = "+i.associatedVariableName+".xy;\r\n"),o.hasEndpoints&&(t.compilationString+=this._declareOutput(o,t)+" = "+i.associatedVariableName+".x;\r\n"),a.hasEndpoints&&(t.compilationString+=this._declareOutput(a,t)+" = "+i.associatedVariableName+".y;\r\n"),s.hasEndpoints&&(t.compilationString+=this._declareOutput(s,t)+" = "+i.associatedVariableName+".z;\r\n"),c.hasEndpoints&&(t.compilationString+=this._declareOutput(c,t)+" = "+i.associatedVariableName+".w;\r\n"),this},t}(ks);c.a.RegisteredTypes["BABYLON.VectorSplitterBlock"]=Yc;var Kc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerInput("gradient",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i._linkConnectionTypes(1,2,!0),i._inputs[2].acceptedConnectionPointTypes.push(xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"LerpBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradient",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = mix("+this.left.associatedVariableName+" , "+this.right.associatedVariableName+", "+this.gradient.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.LerpBlock"]=Kc;var Qc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DivideBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = "+this.left.associatedVariableName+" / "+this.right.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.DivideBlock"]=Qc;var qc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"SubtractBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = "+this.left.associatedVariableName+" - "+this.right.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.SubtractBlock"]=qc;var Zc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("value",xs.Float),i.registerInput("edge",xs.Float),i.registerOutput("output",xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"StepBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = step("+this.edge.associatedVariableName+", "+this.value.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.StepBlock"]=Zc;var Jc=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("input",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._outputs[0].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"OneMinusBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = 1. - "+this.input.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.OneMinusBlock"]=Jc,c.a.RegisteredTypes["BABYLON.OppositeBlock"]=Jc;var $c=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("worldPosition",xs.Vector4),i.registerInput("cameraPosition",xs.Vector3),i.registerOutput("output",xs.Vector3),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ViewDirectionBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.cameraPosition.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.CameraPosition});t||(t=new qs("cameraPosition")).setAsSystemValue(Ms.CameraPosition),t.output.connectTo(this.cameraPosition)}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = normalize("+this.cameraPosition.associatedVariableName+" - "+this.worldPosition.associatedVariableName+".xyz);\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.ViewDirectionBlock"]=$c,i(161);var el=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("worldNormal",xs.Vector4),i.registerInput("viewDirection",xs.Vector3),i.registerInput("bias",xs.Float),i.registerInput("power",xs.Float),i.registerOutput("fresnel",xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FresnelBlock"},Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewDirection",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bias",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"power",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fresnel",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.viewDirection.isConnected){var t=new $c("View direction");t.output.connectTo(this.viewDirection),t.autoConfigure(e)}if(!this.bias.isConnected){var i=new qs("bias");i.value=0,i.output.connectTo(this.bias)}if(!this.power.isConnected){var n=new qs("power");n.value=1,n.output.connectTo(this.power)}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i="//"+this.name;return t._emitFunctionFromInclude("fresnelFunction",i,{removeIfDef:!0}),t.compilationString+=this._declareOutput(this.fresnel,t)+" = computeFresnelTerm("+this.viewDirection.associatedVariableName+".xyz, "+this.worldNormal.associatedVariableName+".xyz, "+this.bias.associatedVariableName+", "+this.power.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.FresnelBlock"]=el;var tl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"MaxBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = max("+this.left.associatedVariableName+", "+this.right.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.MaxBlock"]=tl;var il=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"MinBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = min("+this.left.associatedVariableName+", "+this.right.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.MinBlock"]=il;var nl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.Float),i._linkConnectionTypes(0,1),i._inputs[0].excludedConnectionPointTypes.push(xs.Float),i._inputs[0].excludedConnectionPointTypes.push(xs.Matrix),i._inputs[1].excludedConnectionPointTypes.push(xs.Float),i._inputs[1].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DistanceBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = length("+this.left.associatedVariableName+" - "+this.right.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.DistanceBlock"]=nl;var rl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("value",xs.AutoDetect),i.registerOutput("output",xs.Float),i._inputs[0].excludedConnectionPointTypes.push(xs.Float),i._inputs[0].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"LengthBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = length("+this.value.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.LengthBlock"]=rl;var ol=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("value",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"NegateBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = -1.0 * "+this.value.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.NegateBlock"]=ol;var al=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("value",xs.AutoDetect),i.registerInput("power",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"PowBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"power",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = pow("+this.value.associatedVariableName+", "+this.power.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.PowBlock"]=al;var sl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("seed",xs.Vector2),i.registerOutput("output",xs.Float),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"RandomNumberBlock"},Object.defineProperty(t.prototype,"seed",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0],n="//"+this.name;return t._emitFunctionFromInclude("helperFunctions",n),t.compilationString+=this._declareOutput(i,t)+" = getRand("+this.seed.associatedVariableName+".xy);\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.RandomNumberBlock"]=sl;var cl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("x",xs.Float),i.registerInput("y",xs.Float),i.registerOutput("output",xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ArcTan2Block"},Object.defineProperty(t.prototype,"x",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = atan("+this.x.associatedVariableName+", "+this.y.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.ArcTan2Block"]=cl;var ll=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("value",xs.AutoDetect),i.registerInput("edge0",xs.Float),i.registerInput("edge1",xs.Float),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"SmoothStepBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge0",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge1",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = smoothstep("+this.edge0.associatedVariableName+", "+this.edge1.associatedVariableName+", "+this.value.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.SmoothStepBlock"]=ll;var ul=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("input",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._outputs[0].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ReciprocalBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = 1. / "+this.input.associatedVariableName+";\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.ReciprocalBlock"]=ul;var hl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("value",xs.AutoDetect),i.registerInput("reference",xs.AutoDetect),i.registerInput("distance",xs.Float),i.registerInput("replacement",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i._linkConnectionTypes(0,3),i._inputs[0].excludedConnectionPointTypes.push(xs.Float),i._inputs[0].excludedConnectionPointTypes.push(xs.Matrix),i._inputs[1].excludedConnectionPointTypes.push(xs.Float),i._inputs[1].excludedConnectionPointTypes.push(xs.Matrix),i._inputs[3].excludedConnectionPointTypes.push(xs.Float),i._inputs[3].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ReplaceColorBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"distance",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"replacement",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+";\r\n",t.compilationString+="if (length("+this.value.associatedVariableName+" - "+this.reference.associatedVariableName+") < "+this.distance.associatedVariableName+") {\r\n",t.compilationString+=i.associatedVariableName+" = "+this.replacement.associatedVariableName+";\r\n",t.compilationString+="} else {\r\n",t.compilationString+=i.associatedVariableName+" = "+this.value.associatedVariableName+";\r\n",t.compilationString+="}\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.ReplaceColorBlock"]=hl;var dl,fl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("value",xs.AutoDetect),i.registerInput("steps",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i._inputs[0].excludedConnectionPointTypes.push(xs.Matrix),i._inputs[1].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"PosterizeBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"steps",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = floor("+this.value.associatedVariableName+" / (1.0 / "+this.steps.associatedVariableName+")) * (1.0 / "+this.steps.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.PosterizeBlock"]=fl,function(e){e[e.SawTooth=0]="SawTooth",e[e.Square=1]="Square",e[e.Triangle=2]="Triangle"}(dl||(dl={}));var pl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.kind=dl.SawTooth,i.registerInput("input",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._inputs[0].excludedConnectionPointTypes.push(xs.Matrix),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"WaveBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];switch(this.kind){case dl.SawTooth:t.compilationString+=this._declareOutput(i,t)+" = "+this.input.associatedVariableName+" - floor(0.5 + "+this.input.associatedVariableName+");\r\n";break;case dl.Square:t.compilationString+=this._declareOutput(i,t)+" = 1.0 - 2.0 * round(fract("+this.input.associatedVariableName+"));\r\n";break;case dl.Triangle:t.compilationString+=this._declareOutput(i,t)+" = 2.0 * abs(2.0 * ("+this.input.associatedVariableName+" - floor(0.5 + "+this.input.associatedVariableName+"))) - 1.0;\r\n"}return this},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.kind=this.kind,t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.kind=t.kind},t}(ks);c.a.RegisteredTypes["BABYLON.WaveBlock"]=pl;var _l=function(){function e(e,t){this.step=e,this.color=t}return Object.defineProperty(e.prototype,"step",{get:function(){return this._step},set:function(e){this._step=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(e){this._color=e},enumerable:!1,configurable:!0}),e}(),ml=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.colorSteps=[new _l(0,s.a.Black()),new _l(1,s.a.White())],i.onValueChangedObservable=new o.c,i.registerInput("gradient",xs.Float),i.registerOutput("output",xs.Color3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector2),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color4),i}return Object(h.d)(t,e),t.prototype.colorStepsUpdated=function(){this.onValueChangedObservable.notifyObservers(this)},t.prototype.getClassName=function(){return"GradientBlock"},Object.defineProperty(t.prototype,"gradient",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._writeColorConstant=function(e){var t=this.colorSteps[e];return"vec3("+t.color.r+", "+t.color.g+", "+t.color.b+")"},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];if(this.colorSteps.length&&this.gradient.connectedPoint){var n=t._getFreeVariableName("gradientTempColor"),r=t._getFreeVariableName("gradientTempPosition");t.compilationString+="vec3 "+n+" = "+this._writeColorConstant(0)+";\r\n",t.compilationString+="float "+r+";\r\n";var o=this.gradient.associatedVariableName;this.gradient.connectedPoint.type!==xs.Float&&(o+=".x");for(var a=1;a<this.colorSteps.length;a++){var s=this.colorSteps[a],c=this.colorSteps[a-1];t.compilationString+=r+" = clamp(("+o+" - "+t._emitFloat(c.step)+") / ("+t._emitFloat(s.step)+" -  "+t._emitFloat(c.step)+"), 0.0, 1.0) * step("+t._emitFloat(a)+", "+t._emitFloat(this.colorSteps.length-1)+");\r\n",t.compilationString+=n+" = mix("+n+", "+this._writeColorConstant(a)+", "+r+");\r\n"}return t.compilationString+=this._declareOutput(i,t)+" = "+n+";\r\n",this}t.compilationString+=this._declareOutput(i,t)+" = vec3(0., 0., 0.);\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);t.colorSteps=[];for(var i=0,n=this.colorSteps;i<n.length;i++){var r=n[i];t.colorSteps.push({step:r.step,color:{r:r.color.r,g:r.color.g,b:r.color.b}})}return t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.colorSteps=[];for(var r=0,o=t.colorSteps;r<o.length;r++){var a=o[r];this.colorSteps.push(new _l(a.step,new s.a(a.color.r,a.color.g,a.color.b)))}},t.prototype._dumpPropertiesCode=function(){for(var e="",t=0,i=this.colorSteps;t<i.length;t++){var n=i[t];e+=this._codeVariableName+".colorSteps.push(new BABYLON.GradientBlockColorStep("+n.step+", new BABYLON.Color3("+n.color.r+", "+n.color.g+", "+n.color.b+")));\r\n"}return e},t}(ks);c.a.RegisteredTypes["BABYLON.GradientBlock"]=ml;var gl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerInput("gradient",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i._linkConnectionTypes(1,2,!0),i._inputs[2].acceptedConnectionPointTypes.push(xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"NLerpBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradient",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = normalize(mix("+this.left.associatedVariableName+" , "+this.right.associatedVariableName+", "+this.gradient.associatedVariableName+"));\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.NLerpBlock"]=gl;var vl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.manhattanDistance=!1,i.registerInput("seed",xs.Vector3),i.registerInput("jitter",xs.Float),i.registerOutput("output",xs.Vector2),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"WorleyNoise3DBlock"},Object.defineProperty(t.prototype,"seed",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jitter",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),this.seed.isConnected&&this._outputs[0].hasEndpoints)return t._emitFunction("worley3D","vec3 permute(vec3 x){\r\n    return mod((34.0 * x + 1.0) * x, 289.0);\r\n}\r\n\r\nvec3 dist(vec3 x, vec3 y, vec3 z,  bool manhattanDistance){\r\n    return manhattanDistance ?  abs(x) + abs(y) + abs(z) :  (x * x + y * y + z * z);\r\n}\r\n\r\nvec2 worley(vec3 P, float jitter, bool manhattanDistance){\r\n    float K = 0.142857142857; // 1/7\r\n    float Ko = 0.428571428571; // 1/2-K/2\r\n    float  K2 = 0.020408163265306; // 1/(7*7)\r\n    float Kz = 0.166666666667; // 1/6\r\n    float Kzo = 0.416666666667; // 1/2-1/6*2\r\n\r\n    vec3 Pi = mod(floor(P), 289.0);\r\n    vec3 Pf = fract(P) - 0.5;\r\n\r\n    vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);\r\n    vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);\r\n    vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);\r\n\r\n    vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));\r\n    vec3 p1 = permute(p + Pi.y - 1.0);\r\n    vec3 p2 = permute(p + Pi.y);\r\n    vec3 p3 = permute(p + Pi.y + 1.0);\r\n\r\n    vec3 p11 = permute(p1 + Pi.z - 1.0);\r\n    vec3 p12 = permute(p1 + Pi.z);\r\n    vec3 p13 = permute(p1 + Pi.z + 1.0);\r\n\r\n    vec3 p21 = permute(p2 + Pi.z - 1.0);\r\n    vec3 p22 = permute(p2 + Pi.z);\r\n    vec3 p23 = permute(p2 + Pi.z + 1.0);\r\n\r\n    vec3 p31 = permute(p3 + Pi.z - 1.0);\r\n    vec3 p32 = permute(p3 + Pi.z);\r\n    vec3 p33 = permute(p3 + Pi.z + 1.0);\r\n\r\n    vec3 ox11 = fract(p11*K) - Ko;\r\n    vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;\r\n    vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed\r\n\r\n    vec3 ox12 = fract(p12*K) - Ko;\r\n    vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;\r\n    vec3 oz12 = floor(p12*K2)*Kz - Kzo;\r\n\r\n    vec3 ox13 = fract(p13*K) - Ko;\r\n    vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;\r\n    vec3 oz13 = floor(p13*K2)*Kz - Kzo;\r\n\r\n    vec3 ox21 = fract(p21*K) - Ko;\r\n    vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;\r\n    vec3 oz21 = floor(p21*K2)*Kz - Kzo;\r\n\r\n    vec3 ox22 = fract(p22*K) - Ko;\r\n    vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;\r\n    vec3 oz22 = floor(p22*K2)*Kz - Kzo;\r\n\r\n    vec3 ox23 = fract(p23*K) - Ko;\r\n    vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;\r\n    vec3 oz23 = floor(p23*K2)*Kz - Kzo;\r\n\r\n    vec3 ox31 = fract(p31*K) - Ko;\r\n    vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;\r\n    vec3 oz31 = floor(p31*K2)*Kz - Kzo;\r\n\r\n    vec3 ox32 = fract(p32*K) - Ko;\r\n    vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;\r\n    vec3 oz32 = floor(p32*K2)*Kz - Kzo;\r\n\r\n    vec3 ox33 = fract(p33*K) - Ko;\r\n    vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;\r\n    vec3 oz33 = floor(p33*K2)*Kz - Kzo;\r\n\r\n    vec3 dx11 = Pfx + jitter*ox11;\r\n    vec3 dy11 = Pfy.x + jitter*oy11;\r\n    vec3 dz11 = Pfz.x + jitter*oz11;\r\n\r\n    vec3 dx12 = Pfx + jitter*ox12;\r\n    vec3 dy12 = Pfy.x + jitter*oy12;\r\n    vec3 dz12 = Pfz.y + jitter*oz12;\r\n\r\n    vec3 dx13 = Pfx + jitter*ox13;\r\n    vec3 dy13 = Pfy.x + jitter*oy13;\r\n    vec3 dz13 = Pfz.z + jitter*oz13;\r\n\r\n    vec3 dx21 = Pfx + jitter*ox21;\r\n    vec3 dy21 = Pfy.y + jitter*oy21;\r\n    vec3 dz21 = Pfz.x + jitter*oz21;\r\n\r\n    vec3 dx22 = Pfx + jitter*ox22;\r\n    vec3 dy22 = Pfy.y + jitter*oy22;\r\n    vec3 dz22 = Pfz.y + jitter*oz22;\r\n\r\n    vec3 dx23 = Pfx + jitter*ox23;\r\n    vec3 dy23 = Pfy.y + jitter*oy23;\r\n    vec3 dz23 = Pfz.z + jitter*oz23;\r\n\r\n    vec3 dx31 = Pfx + jitter*ox31;\r\n    vec3 dy31 = Pfy.z + jitter*oy31;\r\n    vec3 dz31 = Pfz.x + jitter*oz31;\r\n\r\n    vec3 dx32 = Pfx + jitter*ox32;\r\n    vec3 dy32 = Pfy.z + jitter*oy32;\r\n    vec3 dz32 = Pfz.y + jitter*oz32;\r\n\r\n    vec3 dx33 = Pfx + jitter*ox33;\r\n    vec3 dy33 = Pfy.z + jitter*oy33;\r\n    vec3 dz33 = Pfz.z + jitter*oz33;\r\n\r\n    vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);\r\n    vec3 d12 =dist(dx12, dy12, dz12, manhattanDistance);\r\n    vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);\r\n    vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);\r\n    vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);\r\n    vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);\r\n    vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);\r\n    vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);\r\n    vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);\r\n\r\n    vec3 d1a = min(d11, d12);\r\n    d12 = max(d11, d12);\r\n    d11 = min(d1a, d13); // Smallest now not in d12 or d13\r\n    d13 = max(d1a, d13);\r\n    d12 = min(d12, d13); // 2nd smallest now not in d13\r\n    vec3 d2a = min(d21, d22);\r\n    d22 = max(d21, d22);\r\n    d21 = min(d2a, d23); // Smallest now not in d22 or d23\r\n    d23 = max(d2a, d23);\r\n    d22 = min(d22, d23); // 2nd smallest now not in d23\r\n    vec3 d3a = min(d31, d32);\r\n    d32 = max(d31, d32);\r\n    d31 = min(d3a, d33); // Smallest now not in d32 or d33\r\n    d33 = max(d3a, d33);\r\n    d32 = min(d32, d33); // 2nd smallest now not in d33\r\n    vec3 da = min(d11, d21);\r\n    d21 = max(d11, d21);\r\n    d11 = min(da, d31); // Smallest now in d11\r\n    d31 = max(da, d31); // 2nd smallest now not in d31\r\n    d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx;\r\n    d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest\r\n    d12 = min(d12, d21); // 2nd smallest now not in d21\r\n    d12 = min(d12, d22); // nor in d22\r\n    d12 = min(d12, d31); // nor in d31\r\n    d12 = min(d12, d32); // nor in d32\r\n    d11.yz = min(d11.yz,d12.xy); // nor in d12.yz\r\n    d11.y = min(d11.y,d12.z); // Only two more to go\r\n    d11.y = min(d11.y,d11.z); // Done! (Phew!)\r\n    return sqrt(d11.xy); // F1, F2\r\n}\r\n\r\n","// Worley3D"),t.compilationString+=this._declareOutput(this._outputs[0],t)+" = worley("+this.seed.associatedVariableName+", "+this.jitter.associatedVariableName+", "+this.manhattanDistance+");\r\n",this},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".manhattanDistance = "+this.manhattanDistance+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.manhattanDistance=this.manhattanDistance,t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.manhattanDistance=t.manhattanDistance},Object(h.c)([nc("Use Manhattan Distance",tc.Boolean,"PROPERTIES",{notifiers:{update:!1}})],t.prototype,"manhattanDistance",void 0),t}(ks);c.a.RegisteredTypes["BABYLON.WorleyNoise3DBlock"]=vl;var bl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("seed",xs.Vector3),i.registerOutput("output",xs.Float),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"SimplexPerlin3DBlock"},Object.defineProperty(t.prototype,"seed",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),this.seed.isConnected&&this._outputs[0].hasEndpoints)return t._emitFunction("SimplexPerlin3D","const float SKEWFACTOR = 1.0/3.0;\r\nconst float UNSKEWFACTOR = 1.0/6.0;\r\nconst float SIMPLEX_CORNER_POS = 0.5;\r\nconst float SIMPLEX_TETRAHADRON_HEIGHT = 0.70710678118654752440084436210485;\r\nfloat SimplexPerlin3D( vec3 P ){\r\n    P *= SIMPLEX_TETRAHADRON_HEIGHT;\r\n    vec3 Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) );    vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );\r\n    vec3 g = step(x0.yzx, x0.xyz);\r\n    vec3 l = 1.0 - g;\r\n    vec3 Pi_1 = min( g.xyz, l.zxy );\r\n    vec3 Pi_2 = max( g.xyz, l.zxy );\r\n    vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;\r\n    vec3 x2 = x0 - Pi_2 + SKEWFACTOR;\r\n    vec3 x3 = x0 - SIMPLEX_CORNER_POS;\r\n    vec4 v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );\r\n    vec4 v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );\r\n    vec4 v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );\r\n    Pi.xyz = Pi.xyz - floor(Pi.xyz * ( 1.0 / 69.0 )) * 69.0;\r\n    vec3 Pi_inc1 = step( Pi, vec3( 69.0 - 1.5 ) ) * ( Pi + 1.0 );\r\n    vec4 Pt = vec4( Pi.xy, Pi_inc1.xy ) + vec2( 50.0, 161.0 ).xyxy;\r\n    Pt *= Pt;\r\n    vec4 V1xy_V2xy = mix( Pt.xyxy, Pt.zwzw, vec4( Pi_1.xy, Pi_2.xy ) );\r\n    Pt = vec4( Pt.x, V1xy_V2xy.xz, Pt.z ) * vec4( Pt.y, V1xy_V2xy.yw, Pt.w );\r\n    const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );\r\n    const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );\r\n    vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi.zzz * ZINC.xyz ) );\r\n    vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi_inc1.zzz * ZINC.xyz ) );\r\n    Pi_1 = ( Pi_1.z < 0.5 ) ? lowz_mods : highz_mods;\r\n    Pi_2 = ( Pi_2.z < 0.5 ) ? lowz_mods : highz_mods;\r\n    vec4 hash_0 = fract( Pt * vec4( lowz_mods.x, Pi_1.x, Pi_2.x, highz_mods.x ) ) - 0.49999;\r\n    vec4 hash_1 = fract( Pt * vec4( lowz_mods.y, Pi_1.y, Pi_2.y, highz_mods.y ) ) - 0.49999;\r\n    vec4 hash_2 = fract( Pt * vec4( lowz_mods.z, Pi_1.z, Pi_2.z, highz_mods.z ) ) - 0.49999;\r\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 );\r\n    const float FINAL_NORMALIZATION = 37.837227241611314102871574478976;\r\n    vec4 kernel_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;\r\n    kernel_weights = max(0.5 - kernel_weights, 0.0);\r\n    kernel_weights = kernel_weights*kernel_weights*kernel_weights;\r\n    return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;\r\n}\r\n","// SimplexPerlin3D"),t.compilationString+=this._declareOutput(this._outputs[0],t)+" = SimplexPerlin3D("+this.seed.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.SimplexPerlin3DBlock"]=bl;var yl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("normalMap0",xs.Vector3),i.registerInput("normalMap1",xs.Vector3),i.registerOutput("output",xs.Vector3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color4),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),i._inputs[1].acceptedConnectionPointTypes.push(xs.Color3),i._inputs[1].acceptedConnectionPointTypes.push(xs.Color4),i._inputs[1].acceptedConnectionPointTypes.push(xs.Vector4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"NormalBlendBlock"},Object.defineProperty(t.prototype,"normalMap0",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normalMap1",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0],n=this._inputs[0],r=this._inputs[1],o=t._getFreeVariableName("stepR"),a=t._getFreeVariableName("stepG");return t.compilationString+="float "+o+" = step(0.5, "+n.associatedVariableName+".r);\r\n",t.compilationString+="float "+a+" = step(0.5, "+n.associatedVariableName+".g);\r\n",t.compilationString+=this._declareOutput(i,t)+";\r\n",t.compilationString+=i.associatedVariableName+".r = (1.0 - "+o+") * "+n.associatedVariableName+".r * "+r.associatedVariableName+".r * 2.0 + "+o+" * (1.0 - "+n.associatedVariableName+".r) * (1.0 - "+r.associatedVariableName+".r) * 2.0;\r\n",t.compilationString+=i.associatedVariableName+".g = (1.0 - "+a+") * "+n.associatedVariableName+".g * "+r.associatedVariableName+".g * 2.0 + "+a+" * (1.0 - "+n.associatedVariableName+".g) * (1.0 - "+r.associatedVariableName+".g) * 2.0;\r\n",t.compilationString+=i.associatedVariableName+".b = "+n.associatedVariableName+".b * "+r.associatedVariableName+".b;\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.NormalBlendBlock"]=yl;var Tl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("input",xs.Vector2),i.registerInput("angle",xs.Float),i.registerOutput("output",xs.Vector2),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"Rotate2dBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.angle.isConnected){var t=new qs("angle");t.value=0,t.output.connectTo(this.angle)}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0],n=this.angle,r=this.input;return t.compilationString+=this._declareOutput(i,t)+" = vec2(cos("+n.associatedVariableName+") * "+r.associatedVariableName+".x - sin("+n.associatedVariableName+") * "+r.associatedVariableName+".y, sin("+n.associatedVariableName+") * "+r.associatedVariableName+".x + cos("+n.associatedVariableName+") * "+r.associatedVariableName+".y);\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.Rotate2dBlock"]=Tl;var El=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("incident",xs.Vector3),i.registerInput("normal",xs.Vector3),i.registerOutput("output",xs.Vector3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color4),i._inputs[1].acceptedConnectionPointTypes.push(xs.Vector4),i._inputs[1].acceptedConnectionPointTypes.push(xs.Color3),i._inputs[1].acceptedConnectionPointTypes.push(xs.Color4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ReflectBlock"},Object.defineProperty(t.prototype,"incident",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = reflect("+this.incident.associatedVariableName+".xyz, "+this.normal.associatedVariableName+".xyz);\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.ReflectBlock"]=El;var Sl=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("incident",xs.Vector3),i.registerInput("normal",xs.Vector3),i.registerInput("ior",xs.Float),i.registerOutput("output",xs.Vector3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Vector4),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color3),i._inputs[0].acceptedConnectionPointTypes.push(xs.Color4),i._inputs[1].acceptedConnectionPointTypes.push(xs.Vector4),i._inputs[1].acceptedConnectionPointTypes.push(xs.Color3),i._inputs[1].acceptedConnectionPointTypes.push(xs.Color4),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"RefractBlock"},Object.defineProperty(t.prototype,"incident",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ior",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = refract("+this.incident.associatedVariableName+".xyz, "+this.normal.associatedVariableName+".xyz, "+this.ior.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.RefractBlock"]=Sl;var Al=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("color",xs.Color3),i.registerInput("level",xs.Float),i.registerOutput("output",xs.Color3),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DesaturateBlock"},Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0],n=this.color.associatedVariableName,r=t._getFreeVariableName("colorMin"),o=t._getFreeVariableName("colorMax"),a=t._getFreeVariableName("colorMerge");return t.compilationString+="float "+r+" = min(min("+n+".x, "+n+".y), "+n+".z);\r\n",t.compilationString+="float "+o+" = max(max("+n+".x, "+n+".y), "+n+".z);\r\n",t.compilationString+="float "+a+" = 0.5 * ("+r+" + "+o+");\r\n",t.compilationString+=this._declareOutput(i,t)+" = mix("+n+", vec3("+a+", "+a+", "+a+"), "+this.level.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.DesaturateBlock"]=Al;var Pl=function(e){function t(t,i,n,r,o,a){var s=e.call(this,t,i,n)||this;return s._blockType=r,s._blockName=o,s._nameForCheking=a,s._nameForCheking||(s._nameForCheking=t),s.needDualDirectionValidation=!0,s}return Object(h.d)(t,e),t.prototype.checkCompatibilityState=function(e){return e instanceof t&&e.name===this._nameForCheking?Ds.Compatible:Ds.TypeIncompatible},t.prototype.createCustomInputBlock=function(){return[new this._blockType(this._blockName),this.name]},t}(Us),Cl=function(e){function t(i){var n=e.call(this,i,Rs.Fragment)||this;return n.albedoScaling=!1,n.linkSheenWithAlbedo=!1,n._isUnique=!0,n.registerInput("intensity",xs.Float,!0,Rs.Fragment),n.registerInput("color",xs.Color3,!0,Rs.Fragment),n.registerInput("roughness",xs.Float,!0,Rs.Fragment),n.registerOutput("sheen",xs.Object,Rs.Fragment,new Pl("sheen",n,Ns.Output,t,"SheenBlock")),n}return Object(h.d)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("sheenOut"),e._excludeVariableName("sheenMapData"),e._excludeVariableName("vSheenColor"),e._excludeVariableName("vSheenRoughness")},t.prototype.getClassName=function(){return"SheenBlock"},Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roughness",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sheen",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.prepareDefines=function(t,i,n){e.prototype.prepareDefines.call(this,t,i,n),n.setValue("SHEEN",!0),n.setValue("SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE",!0,!0),n.setValue("SHEEN_LINKWITHALBEDO",this.linkSheenWithAlbedo,!0),n.setValue("SHEEN_ROUGHNESS",this.roughness.isConnected,!0),n.setValue("SHEEN_ALBEDOSCALING",this.albedoScaling,!0)},t.prototype.getCode=function(e){return"#ifdef SHEEN\n            sheenOutParams sheenOut;\n\n            vec4 vSheenColor = vec4("+(this.color.isConnected?this.color.associatedVariableName:"vec3(1.)")+", "+(this.intensity.isConnected?this.intensity.associatedVariableName:"1.")+");\n\n            sheenBlock(\n                vSheenColor,\n            #ifdef SHEEN_ROUGHNESS\n                "+(this.roughness.isConnected?this.roughness.associatedVariableName:"0.")+",\n            #endif\n                roughness,\n            #ifdef SHEEN_TEXTURE\n                vec4(0.),\n            #endif\n                reflectance,\n            #ifdef SHEEN_LINKWITHALBEDO\n                baseColor,\n                surfaceAlbedo,\n            #endif\n            #ifdef ENVIRONMENTBRDF\n                NdotV,\n                environmentBrdf,\n            #endif\n            #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n                AARoughnessFactors,\n                "+(null==e?void 0:e._vReflectionMicrosurfaceInfosName)+",\n                "+(null==e?void 0:e._vReflectionInfosName)+",\n                "+(null==e?void 0:e.reflectionColor)+",\n                vLightingIntensity,\n                #ifdef "+(null==e?void 0:e._define3DName)+"\n                    "+(null==e?void 0:e._cubeSamplerName)+",\n                #else\n                    "+(null==e?void 0:e._2DSamplerName)+",\n                #endif\n                reflectionOut.reflectionCoords,\n                NdotVUnclamped,\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef "+(null==e?void 0:e._define3DName)+"\n                        "+(null==e?void 0:e._cubeSamplerName)+",\n                        "+(null==e?void 0:e._cubeSamplerName)+",\n                    #else\n                        "+(null==e?void 0:e._2DSamplerName)+",\n                        "+(null==e?void 0:e._2DSamplerName)+",\n                    #endif\n                #endif\n                #if !defined("+(null==e?void 0:e._defineSkyboxName)+") && defined(RADIANCEOCCLUSION)\n                    seo,\n                #endif\n                #if !defined("+(null==e?void 0:e._defineSkyboxName)+") && defined(HORIZONOCCLUSION) && defined(BUMP) && defined("+(null==e?void 0:e._define3DName)+")\n                    eho,\n                #endif\n            #endif\n                sheenOut\n            );\n\n            #ifdef SHEEN_LINKWITHALBEDO\n                surfaceAlbedo = sheenOut.surfaceAlbedo;\n            #endif\n        #endif\r\n"},t.prototype._buildBlock=function(e){return e.target===Rs.Fragment&&e.sharedData.blocksWithDefines.push(this),this},t.prototype._dumpPropertiesCode=function(){var t=e.prototype._dumpPropertiesCode.call(this);return(t+=this._codeVariableName+".albedoScaling = "+this.albedoScaling+";\r\n")+(this._codeVariableName+".linkSheenWithAlbedo = ")+this.linkSheenWithAlbedo+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.albedoScaling=this.albedoScaling,t.linkSheenWithAlbedo=this.linkSheenWithAlbedo,t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.albedoScaling=t.albedoScaling,this.linkSheenWithAlbedo=t.linkSheenWithAlbedo},Object(h.c)([nc("Albedo scaling",tc.Boolean,"PROPERTIES",{notifiers:{update:!0}})],t.prototype,"albedoScaling",void 0),Object(h.c)([nc("Link sheen with albedo",tc.Boolean,"PROPERTIES",{notifiers:{update:!0}})],t.prototype,"linkSheenWithAlbedo",void 0),t}(ks);c.a.RegisteredTypes["BABYLON.SheenBlock"]=Cl;var Rl=function(e){function t(i){var n=e.call(this,i,Rs.Fragment)||this;return n._isUnique=!0,n.registerInput("intensity",xs.Float,!0,Rs.Fragment),n.registerInput("direction",xs.Vector2,!0,Rs.Fragment),n.registerInput("uv",xs.Vector2,!0),n.registerInput("worldTangent",xs.Vector4,!0),n.registerOutput("anisotropy",xs.Object,Rs.Fragment,new Pl("anisotropy",n,Ns.Output,t,"AnisotropyBlock")),n}return Object(h.d)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("anisotropicOut"),e._excludeVariableName("TBN")},t.prototype.getClassName=function(){return"AnisotropyBlock"},Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldTangent",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anisotropy",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._generateTBNSpace=function(e){var t="",i="//"+this.name,n=this.uv,r=this.worldPositionConnectionPoint,o=this.worldNormalConnectionPoint,a=this.worldTangent;n.isConnected||console.error("You must connect the 'uv' input of the Anisotropy block!"),e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");var s={search:/defined\(TANGENT\)/g,replace:a.isConnected?"defined(TANGENT)":"defined(IGNORE)"};return a.isConnected&&(t+="vec3 tbnNormal = normalize("+o.associatedVariableName+".xyz);\r\n",t+="vec3 tbnTangent = normalize("+a.associatedVariableName+".xyz);\r\n",t+="vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\r\n",t+="mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n"),t+="\n            #if defined("+(a.isConnected?"TANGENT":"IGNORE")+") && defined(NORMAL)\n                mat3 TBN = vTBN;\n            #else\n                mat3 TBN = cotangent_frame("+o.associatedVariableName+".xyz, v_"+r.associatedVariableName+".xyz, "+(n.isConnected?n.associatedVariableName:"vec2(0.)")+", vec2(1., 1.));\n            #endif\r\n",e._emitFunctionFromInclude("bumpFragmentMainFunctions",i,{replaceStrings:[s]}),t},t.prototype.getCode=function(e,t){void 0===t&&(t=!1);var i="";t&&(i+=this._generateTBNSpace(e));var n=this.intensity.isConnected?this.intensity.associatedVariableName:"1.0";return i+"anisotropicOutParams anisotropicOut;\n            anisotropicBlock(\n                vec3("+(this.direction.isConnected?this.direction.associatedVariableName:"vec2(1., 0.)")+", "+n+"),\n            #ifdef ANISOTROPIC_TEXTURE\n                vec3(0.),\n            #endif\n                TBN,\n                normalW,\n                viewDirectionW,\n                anisotropicOut\n            );\r\n"},t.prototype.prepareDefines=function(t,i,n){e.prototype.prepareDefines.call(this,t,i,n),n.setValue("ANISOTROPIC",!0),n.setValue("ANISOTROPIC_TEXTURE",!1,!0)},t.prototype._buildBlock=function(e){return e.target===Rs.Fragment&&e.sharedData.blocksWithDefines.push(this),this},t}(ks);c.a.RegisteredTypes["BABYLON.AnisotropyBlock"]=Rl;var xl=function(e){function t(i){var n=e.call(this,i)||this;return n.useSphericalHarmonics=!0,n.forceIrradianceInFragment=!1,n._isUnique=!0,n.registerInput("position",xs.Vector3,!1,Rs.Vertex),n.registerInput("world",xs.Matrix,!1,Rs.Vertex),n.registerInput("color",xs.Color3,!0,Rs.Fragment),n.registerOutput("reflection",xs.Object,Rs.Fragment,new Pl("reflection",n,Ns.Output,t,"ReflectionBlock")),n}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ReflectionBlock"},Object.defineProperty(t.prototype,"position",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this.worldPositionConnectionPoint},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this.worldNormalConnectionPoint},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this.cameraPositionConnectionPoint},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this.viewConnectionPoint},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflection",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTexture",{get:function(){return!!this._getTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionColor",{get:function(){return this.color.isConnected?this.color.associatedVariableName:"vec3(1., 1., 1.)"},enumerable:!1,configurable:!0}),t.prototype._getTexture=function(){return this.texture?this.texture:this._scene.environmentTexture},t.prototype.prepareDefines=function(t,i,n){e.prototype.prepareDefines.call(this,t,i,n);var r=this._getTexture(),o=r&&r.getTextureMatrix;n.setValue("REFLECTION",o,!0),o&&(n.setValue(this._defineLODReflectionAlpha,r.lodLevelInAlpha,!0),n.setValue(this._defineLinearSpecularReflection,r.linearSpecularLOD,!0),n.setValue(this._defineOppositeZ,this._scene.useRightHandedSystem?!r.invertZ:r.invertZ,!0),n.setValue("SPHERICAL_HARMONICS",this.useSphericalHarmonics,!0),n.setValue("GAMMAREFLECTION",r.gammaSpace,!0),n.setValue("RGBDREFLECTION",r.isRGBD,!0),r&&r.coordinatesMode!==Ke.a.SKYBOX_MODE&&r.isCube&&(n.setValue("USESPHERICALFROMREFLECTIONMAP",!0),n.setValue("USEIRRADIANCEMAP",!1),this.forceIrradianceInFragment||this._scene.getEngine().getCaps().maxVaryingVectors<=8?n.setValue("USESPHERICALINVERTEX",!1):n.setValue("USESPHERICALINVERTEX",!0)))},t.prototype.bind=function(t,i,n,r){e.prototype.bind.call(this,t,i,n);var o=this._getTexture();if(o&&r){o.isCube?t.setTexture(this._cubeSamplerName,o):t.setTexture(this._2DSamplerName,o);var a=o.getSize().width;t.setFloat3(this._vReflectionMicrosurfaceInfosName,a,o.lodGenerationScale,o.lodGenerationOffset),t.setFloat2(this._vReflectionFilteringInfoName,a,L.a.Log2(a));var s=r._materialDefines,c=o.sphericalPolynomial;if(s.USESPHERICALFROMREFLECTIONMAP&&c)if(s.SPHERICAL_HARMONICS){var l=c.preScaledHarmonics;t.setVector3("vSphericalL00",l.l00),t.setVector3("vSphericalL1_1",l.l1_1),t.setVector3("vSphericalL10",l.l10),t.setVector3("vSphericalL11",l.l11),t.setVector3("vSphericalL2_2",l.l2_2),t.setVector3("vSphericalL2_1",l.l2_1),t.setVector3("vSphericalL20",l.l20),t.setVector3("vSphericalL21",l.l21),t.setVector3("vSphericalL22",l.l22)}else t.setFloat3("vSphericalX",c.x.x,c.x.y,c.x.z),t.setFloat3("vSphericalY",c.y.x,c.y.y,c.y.z),t.setFloat3("vSphericalZ",c.z.x,c.z.y,c.z.z),t.setFloat3("vSphericalXX_ZZ",c.xx.x-c.zz.x,c.xx.y-c.zz.y,c.xx.z-c.zz.z),t.setFloat3("vSphericalYY_ZZ",c.yy.x-c.zz.x,c.yy.y-c.zz.y,c.yy.z-c.zz.z),t.setFloat3("vSphericalZZ",c.zz.x,c.zz.y,c.zz.z),t.setFloat3("vSphericalXY",c.xy.x,c.xy.y,c.xy.z),t.setFloat3("vSphericalYZ",c.yz.x,c.yz.y,c.yz.z),t.setFloat3("vSphericalZX",c.zx.x,c.zx.y,c.zx.z)}},t.prototype.handleVertexSide=function(t){var i=e.prototype.handleVertexSide.call(this,t);t._emitFunctionFromInclude("harmonicsFunctions","//"+this.name,{replaceStrings:[{search:/uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g,replace:""},{search:/uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g,replace:""}]});var n=t._getFreeVariableName("reflectionVector");return this._vEnvironmentIrradianceName=t._getFreeVariableName("vEnvironmentIrradiance"),t._emitVaryingFromString(this._vEnvironmentIrradianceName,"vec3","defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)"),t._emitUniformFromString("vSphericalL00","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL1_1","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL10","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL11","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL2_2","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL2_1","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL20","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL21","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL22","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalX","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalY","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalXX_ZZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalYY_ZZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalZZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalXY","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalYZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalZX","vec3","SPHERICAL_HARMONICS",!0),i+"#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n                vec3 "+n+" = vec3("+this._reflectionMatrixName+" * vec4(normalize("+this.worldNormal.associatedVariableName+").xyz, 0)).xyz;\n                #ifdef "+this._defineOppositeZ+"\n                    "+n+".z *= -1.0;\n                #endif\n                "+this._vEnvironmentIrradianceName+" = computeEnvironmentIrradiance("+n+");\n            #endif\r\n"},t.prototype.getCode=function(e,t){var i="";this.handleFragmentSideInits(e),e._emitFunctionFromInclude("harmonicsFunctions","//"+this.name,{replaceStrings:[{search:/uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g,replace:""},{search:/uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g,replace:""}]}),e._emitFunction("sampleReflection","\n            #ifdef "+this._define3DName+"\n                #define sampleReflection(s, c) textureCube(s, c)\n            #else\n                #define sampleReflection(s, c) texture2D(s, c)\n            #endif\r\n","//"+this.name),e._emitFunction("sampleReflectionLod","\n            #ifdef "+this._define3DName+"\n                #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)\n            #else\n                #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)\n            #endif\r\n","//"+this.name);var n="\n            vec3 computeReflectionCoordsPBR(vec4 worldPos, vec3 worldNormal) {\n                "+this.handleFragmentSideCodeReflectionCoords("worldNormal","worldPos",!0)+"\n                return "+this._reflectionVectorName+";\n            }\r\n";return e._emitFunction("computeReflectionCoordsPBR",n,"//"+this.name),this._vReflectionMicrosurfaceInfosName=e._getFreeVariableName("vReflectionMicrosurfaceInfos"),e._emitUniformFromString(this._vReflectionMicrosurfaceInfosName,"vec3"),this._vReflectionInfosName=e._getFreeVariableName("vReflectionInfos"),this._vReflectionFilteringInfoName=e._getFreeVariableName("vReflectionFilteringInfo"),e._emitUniformFromString(this._vReflectionFilteringInfoName,"vec2"),i+"#ifdef REFLECTION\n            vec2 "+this._vReflectionInfosName+" = vec2(1., 0.);\n\n            reflectionOutParams reflectionOut;\n\n            reflectionBlock(\n                v_"+this.worldPosition.associatedVariableName+".xyz,\n                "+t+",\n                alphaG,\n                "+this._vReflectionMicrosurfaceInfosName+",\n                "+this._vReflectionInfosName+",\n                "+this.reflectionColor+",\n            #ifdef ANISOTROPIC\n                anisotropicOut,\n            #endif\n            #if defined("+this._defineLODReflectionAlpha+") && !defined("+this._defineSkyboxName+")\n                NdotVUnclamped,\n            #endif\n            #ifdef "+this._defineLinearSpecularReflection+"\n                roughness,\n            #endif\n            #ifdef "+this._define3DName+"\n                "+this._cubeSamplerName+",\n            #else\n                "+this._2DSamplerName+",\n            #endif\n            #if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n                "+this._vEnvironmentIrradianceName+",\n            #endif\n            #ifdef USESPHERICALFROMREFLECTIONMAP\n                #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n                    "+this._reflectionMatrixName+",\n                #endif\n            #endif\n            #ifdef USEIRRADIANCEMAP\n                irradianceSampler, // ** not handled **\n            #endif\n            #ifndef LODBASEDMICROSFURACE\n                #ifdef "+this._define3DName+"\n                    "+this._cubeSamplerName+",\n                    "+this._cubeSamplerName+",\n                #else\n                    "+this._2DSamplerName+",\n                    "+this._2DSamplerName+",\n                #endif\n            #endif\n            #ifdef REALTIME_FILTERING\n                "+this._vReflectionFilteringInfoName+",\n            #endif\n                reflectionOut\n            );\n        #endif\r\n"},t.prototype._buildBlock=function(e){return this._scene=e.sharedData.scene,e.target!==Rs.Fragment&&(this._defineLODReflectionAlpha=e._getFreeDefineName("LODINREFLECTIONALPHA"),this._defineLinearSpecularReflection=e._getFreeDefineName("LINEARSPECULARREFLECTION")),this},t.prototype._dumpPropertiesCode=function(){var t=e.prototype._dumpPropertiesCode.call(this);return this.texture&&(t+=this._codeVariableName+".texture.gammaSpace = "+this.texture.gammaSpace+");\r\n"),(t+=this._codeVariableName+".useSphericalHarmonics = "+this.useSphericalHarmonics+";\r\n")+(this._codeVariableName+".forceIrradianceInFragment = ")+this.forceIrradianceInFragment+";\r\n"},t.prototype.serialize=function(){var t,i,n=e.prototype.serialize.call(this);return n.useSphericalHarmonics=this.useSphericalHarmonics,n.forceIrradianceInFragment=this.forceIrradianceInFragment,n.gammaSpace=null===(i=null===(t=this.texture)||void 0===t?void 0:t.gammaSpace)||void 0===i||i,n},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),this.useSphericalHarmonics=t.useSphericalHarmonics,this.forceIrradianceInFragment=t.forceIrradianceInFragment,this.texture&&(this.texture.gammaSpace=t.gammaSpace)},Object(h.c)([nc("Spherical Harmonics",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"useSphericalHarmonics",void 0),Object(h.c)([nc("Force irradiance in fragment",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"forceIrradianceInFragment",void 0),t}(Uc);c.a.RegisteredTypes["BABYLON.ReflectionBlock"]=xl;var Ol=function(e){function t(i){var n=e.call(this,i,Rs.Fragment)||this;return n.remapF0OnInterfaceChange=!0,n._isUnique=!0,n.registerInput("intensity",xs.Float,!1,Rs.Fragment),n.registerInput("roughness",xs.Float,!0,Rs.Fragment),n.registerInput("indexOfRefraction",xs.Float,!0,Rs.Fragment),n.registerInput("normalMapColor",xs.Color3,!0,Rs.Fragment),n.registerInput("uv",xs.Vector2,!0,Rs.Fragment),n.registerInput("tintColor",xs.Color3,!0,Rs.Fragment),n.registerInput("tintAtDistance",xs.Float,!0,Rs.Fragment),n.registerInput("tintThickness",xs.Float,!0,Rs.Fragment),n.registerInput("worldTangent",xs.Vector4,!0),n.registerOutput("clearcoat",xs.Object,Rs.Fragment,new Pl("clearcoat",n,Ns.Output,t,"ClearCoatBlock")),n}return Object(h.d)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("clearcoatOut"),e._excludeVariableName("vClearCoatParams"),e._excludeVariableName("vClearCoatTintParams"),e._excludeVariableName("vClearCoatRefractionParams"),e._excludeVariableName("vClearCoatTangentSpaceParams")},t.prototype.getClassName=function(){return"ClearCoatBlock"},Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roughness",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"indexOfRefraction",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normalMapColor",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintColor",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintAtDistance",{get:function(){return this._inputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintThickness",{get:function(){return this._inputs[7]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldTangent",{get:function(){return this._inputs[8]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearcoat",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.intensity.isConnected){var t=new qs("ClearCoat intensity",Rs.Fragment,xs.Float);t.value=1,t.output.connectTo(this.intensity)}},t.prototype.prepareDefines=function(t,i,n){e.prototype.prepareDefines.call(this,t,i,n),n.setValue("CLEARCOAT",!0),n.setValue("CLEARCOAT_TEXTURE",!1,!0),n.setValue("CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE",!0,!0),n.setValue("CLEARCOAT_TINT",this.tintColor.isConnected||this.tintThickness.isConnected||this.tintAtDistance.isConnected,!0),n.setValue("CLEARCOAT_BUMP",this.normalMapColor.isConnected,!0),n.setValue("CLEARCOAT_DEFAULTIOR",!this.indexOfRefraction.isConnected||this.indexOfRefraction.connectInputBlock.value===no._DefaultIndexOfRefraction,!0),n.setValue("CLEARCOAT_REMAP_F0",this.remapF0OnInterfaceChange,!0)},t.prototype.bind=function(t,i,n,r){var o,a;e.prototype.bind.call(this,t,i,n);var s=null!==(a=null===(o=this.indexOfRefraction.connectInputBlock)||void 0===o?void 0:o.value)&&void 0!==a?a:no._DefaultIndexOfRefraction,c=1-s,l=1+s,u=Math.pow(-c/l,2),h=1/s;t.setFloat4("vClearCoatRefractionParams",u,h,c,l);var d=this.clearcoat.hasEndpoints?this.clearcoat.endpoints[0].ownerBlock:null,f=(null==d?void 0:d.perturbedNormal.isConnected)?d.perturbedNormal.connectedPoint.ownerBlock:null;this._scene._mirroredCameraPosition?t.setFloat2("vClearCoatTangentSpaceParams",(null==f?void 0:f.invertX)?1:-1,(null==f?void 0:f.invertY)?1:-1):t.setFloat2("vClearCoatTangentSpaceParams",(null==f?void 0:f.invertX)?-1:1,(null==f?void 0:f.invertY)?-1:1)},t.prototype._generateTBNSpace=function(e,t,i){var n="",r="//"+this.name,o=this.worldTangent;e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");var a={search:/defined\(TANGENT\)/g,replace:o.isConnected?"defined(TANGENT)":"defined(IGNORE)"};return o.isConnected&&(n+="vec3 tbnNormal = normalize("+i+".xyz);\r\n",n+="vec3 tbnTangent = normalize("+o.associatedVariableName+".xyz);\r\n",n+="vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\r\n",n+="mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n"),e._emitFunctionFromInclude("bumpFragmentMainFunctions",r,{replaceStrings:[a]}),n},t.GetCode=function(e,t,i,n,r,o,a){var s="",c=(null==t?void 0:t.intensity.isConnected)?t.intensity.associatedVariableName:"1.",l=(null==t?void 0:t.roughness.isConnected)?t.roughness.associatedVariableName:"0.",u=(null==t?void 0:t.normalMapColor.isConnected)?t.normalMapColor.associatedVariableName:"vec3(0.)",h=(null==t?void 0:t.uv.isConnected)?t.uv.associatedVariableName:"vec2(0.)",d=(null==t?void 0:t.tintColor.isConnected)?t.tintColor.associatedVariableName:"vec3(1.)",f=(null==t?void 0:t.tintThickness.isConnected)?t.tintThickness.associatedVariableName:"1.",p=(null==t?void 0:t.tintAtDistance.isConnected)?t.tintAtDistance.associatedVariableName:"1.";return t&&(e._emitUniformFromString("vClearCoatRefractionParams","vec4"),e._emitUniformFromString("vClearCoatTangentSpaceParams","vec2")),r&&t&&(s+=t._generateTBNSpace(e,n,a),o=t.worldTangent.isConnected),s+"clearcoatOutParams clearcoatOut;\n\n        #ifdef CLEARCOAT\n            vec2 vClearCoatParams = vec2("+c+", "+l+");\n            vec4 vClearCoatTintParams = vec4("+d+", "+f+");\n\n            clearcoatBlock(\n                "+n+".xyz,\n                geometricNormalW,\n                viewDirectionW,\n                vClearCoatParams,\n                specularEnvironmentR0,\n            #ifdef CLEARCOAT_TEXTURE\n                vec2(0.),\n            #endif\n            #ifdef CLEARCOAT_TINT\n                vClearCoatTintParams,\n                "+p+",\n                vClearCoatRefractionParams,\n                #ifdef CLEARCOAT_TINT_TEXTURE\n                    vec4(0.),\n                #endif\n            #endif\n            #ifdef CLEARCOAT_BUMP\n                vec2(0., 1.),\n                vec4("+u+", 0.),\n                "+h+",\n                #if defined("+(o?"TANGENT":"IGNORE")+") && defined(NORMAL)\n                    vTBN,\n                #else\n                    vClearCoatTangentSpaceParams,\n                #endif\n                #ifdef OBJECTSPACE_NORMALMAP\n                    normalMatrix,\n                #endif\n            #endif\n            #if defined(FORCENORMALFORWARD) && defined(NORMAL)\n                faceNormal,\n            #endif\n            #ifdef REFLECTION\n                "+(null==i?void 0:i._vReflectionMicrosurfaceInfosName)+",\n                "+(null==i?void 0:i._vReflectionInfosName)+",\n                "+(null==i?void 0:i.reflectionColor)+",\n                vLightingIntensity,\n                #ifdef "+(null==i?void 0:i._define3DName)+"\n                    "+(null==i?void 0:i._cubeSamplerName)+",\n                #else\n                    "+(null==i?void 0:i._2DSamplerName)+",\n                #endif\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef "+(null==i?void 0:i._define3DName)+"\n                        "+(null==i?void 0:i._cubeSamplerName)+",\n                        "+(null==i?void 0:i._cubeSamplerName)+",\n                    #else\n                        "+(null==i?void 0:i._2DSamplerName)+",\n                        "+(null==i?void 0:i._2DSamplerName)+",\n                    #endif\n                #endif\n            #endif\n            #if defined(ENVIRONMENTBRDF) && !defined("+(null==i?void 0:i._defineSkyboxName)+")\n                #ifdef RADIANCEOCCLUSION\n                    ambientMonochrome,\n                #endif\n            #endif\n                clearcoatOut\n            );\n        #else\n            clearcoatOut.specularEnvironmentR0 = specularEnvironmentR0;\n        #endif\r\n"},t.prototype._buildBlock=function(e){return this._scene=e.sharedData.scene,e.target===Rs.Fragment&&(e.sharedData.bindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this)),this},t.prototype._dumpPropertiesCode=function(){return""+(this._codeVariableName+".remapF0OnInterfaceChange = ")+this.remapF0OnInterfaceChange+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.remapF0OnInterfaceChange=this.remapF0OnInterfaceChange,t},t.prototype._deserialize=function(t,i,n){var r;e.prototype._deserialize.call(this,t,i,n),this.remapF0OnInterfaceChange=null===(r=t.remapF0OnInterfaceChange)||void 0===r||r},Object(h.c)([nc("Remap F0 on interface change",tc.Boolean,"ADVANCED")],t.prototype,"remapF0OnInterfaceChange",void 0),t}(ks);c.a.RegisteredTypes["BABYLON.ClearCoatBlock"]=Ol;var Ml=function(e){function t(i){var n=e.call(this,i,Rs.Fragment)||this;return n.linkRefractionWithTransparency=!1,n.invertRefractionY=!1,n._isUnique=!0,n.registerInput("intensity",xs.Float,!1,Rs.Fragment),n.registerInput("tintAtDistance",xs.Float,!0,Rs.Fragment),n.registerOutput("refraction",xs.Object,Rs.Fragment,new Pl("refraction",n,Ns.Output,t,"RefractionBlock")),n}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"RefractionBlock"},Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintAtDistance",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this.viewConnectionPoint},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refraction",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTexture",{get:function(){return!!this._getTexture()},enumerable:!1,configurable:!0}),t.prototype._getTexture=function(){return this.texture?this.texture:this._scene.environmentTexture},t.prototype.autoConfigure=function(e){if(!this.intensity.isConnected){var t=new qs("Refraction intensity",Rs.Fragment,xs.Float);t.value=1,t.output.connectTo(this.intensity)}if(this.view&&!this.view.isConnected){var i=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.View});i||(i=new qs("view")).setAsSystemValue(Ms.View),i.output.connectTo(this.view)}},t.prototype.prepareDefines=function(t,i,n){e.prototype.prepareDefines.call(this,t,i,n);var r=this._getTexture(),o=r&&r.getTextureMatrix;n.setValue("SS_REFRACTION",o,!0),o&&(n.setValue(this._define3DName,r.isCube,!0),n.setValue(this._defineLODRefractionAlpha,r.lodLevelInAlpha,!0),n.setValue(this._defineLinearSpecularRefraction,r.linearSpecularLOD,!0),n.setValue(this._defineOppositeZ,this._scene.useRightHandedSystem?!r.invertZ:r.invertZ,!0),n.setValue("SS_LINKREFRACTIONTOTRANSPARENCY",this.linkRefractionWithTransparency,!0),n.setValue("SS_GAMMAREFRACTION",r.gammaSpace,!0),n.setValue("SS_RGBDREFRACTION",r.isRGBD,!0))},t.prototype.isReady=function(){var e=this._getTexture();return!(e&&!e.isReadyOrNotBlocking())},t.prototype.bind=function(t,i,n,r){var o,a;e.prototype.bind.call(this,t,i,n);var s=this._getTexture();if(s){s.isCube?t.setTexture(this._cubeSamplerName,s):t.setTexture(this._2DSamplerName,s),t.setMatrix(this._refractionMatrixName,s.getReflectionTextureMatrix());var c=1;s.isCube||s.depth&&(c=s.depth);var l=null!==(a=null===(o=this.indexOfRefractionConnectionPoint.connectInputBlock)||void 0===o?void 0:o.value)&&void 0!==a?a:1.5;t.setFloat4(this._vRefractionInfosName,s.level,1/l,c,this.invertRefractionY?-1:1),t.setFloat3(this._vRefractionMicrosurfaceInfosName,s.getSize().width,s.lodGenerationScale,s.lodGenerationOffset);var u=s.getSize().width;t.setFloat2(this._vRefractionFilteringInfoName,u,L.a.Log2(u))}},t.prototype.getCode=function(e){return e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),this._cubeSamplerName=e._getFreeVariableName(this.name+"CubeSampler"),e.samplers.push(this._cubeSamplerName),this._2DSamplerName=e._getFreeVariableName(this.name+"2DSampler"),e.samplers.push(this._2DSamplerName),this._define3DName=e._getFreeDefineName("SS_REFRACTIONMAP_3D"),e._samplerDeclaration+="#ifdef "+this._define3DName+"\r\n",e._samplerDeclaration+="uniform samplerCube "+this._cubeSamplerName+";\r\n",e._samplerDeclaration+="#else\r\n",e._samplerDeclaration+="uniform sampler2D "+this._2DSamplerName+";\r\n",e._samplerDeclaration+="#endif\r\n",e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this),this._defineLODRefractionAlpha=e._getFreeDefineName("SS_LODINREFRACTIONALPHA"),this._defineLinearSpecularRefraction=e._getFreeDefineName("SS_LINEARSPECULARREFRACTION"),this._defineOppositeZ=e._getFreeDefineName("SS_REFRACTIONMAP_OPPOSITEZ"),this._refractionMatrixName=e._getFreeVariableName("refractionMatrix"),e._emitUniformFromString(this._refractionMatrixName,"mat4"),e._emitFunction("sampleRefraction","\n            #ifdef "+this._define3DName+"\n                #define sampleRefraction(s, c) textureCube(s, c)\n            #else\n                #define sampleRefraction(s, c) texture2D(s, c)\n            #endif\r\n","//"+this.name),e._emitFunction("sampleRefractionLod","\n            #ifdef "+this._define3DName+"\n                #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)\n            #else\n                #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)\n            #endif\r\n","//"+this.name),this._vRefractionMicrosurfaceInfosName=e._getFreeVariableName("vRefractionMicrosurfaceInfos"),e._emitUniformFromString(this._vRefractionMicrosurfaceInfosName,"vec3"),this._vRefractionInfosName=e._getFreeVariableName("vRefractionInfos"),e._emitUniformFromString(this._vRefractionInfosName,"vec4"),this._vRefractionFilteringInfoName=e._getFreeVariableName("vRefractionFilteringInfo"),e._emitUniformFromString(this._vRefractionFilteringInfoName,"vec2"),""},t.prototype._buildBlock=function(e){return this._scene=e.sharedData.scene,this},t.prototype._dumpPropertiesCode=function(){var t=e.prototype._dumpPropertiesCode.call(this);return this.texture&&(t=this.texture.isCube?this._codeVariableName+'.texture = new BABYLON.CubeTexture("'+this.texture.name+'");\r\n':this._codeVariableName+'.texture = new BABYLON.Texture("'+this.texture.name+'");\r\n',t+=this._codeVariableName+".texture.coordinatesMode = "+this.texture.coordinatesMode+";\r\n"),(t+=this._codeVariableName+".linkRefractionWithTransparency = "+this.linkRefractionWithTransparency+";\r\n")+(this._codeVariableName+".invertRefractionY = ")+this.invertRefractionY+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.texture&&(t.texture=this.texture.serialize()),t.linkRefractionWithTransparency=this.linkRefractionWithTransparency,t.invertRefractionY=this.invertRefractionY,t},t.prototype._deserialize=function(t,i,n){e.prototype._deserialize.call(this,t,i,n),t.texture&&(n=0===t.texture.url.indexOf("data:")?"":n,t.texture.isCube?this.texture=Wr.Parse(t.texture,i,n):this.texture=Ke.a.Parse(t.texture,i,n)),this.linkRefractionWithTransparency=t.linkRefractionWithTransparency,this.invertRefractionY=t.invertRefractionY},Object(h.c)([nc("Link refraction to transparency",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"linkRefractionWithTransparency",void 0),Object(h.c)([nc("Invert refraction Y",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"invertRefractionY",void 0),t}(ks);c.a.RegisteredTypes["BABYLON.RefractionBlock"]=Ml;var Il=function(e){function t(i){var n=e.call(this,i,Rs.Fragment)||this;return n._isUnique=!0,n.registerInput("thickness",xs.Float,!1,Rs.Fragment),n.registerInput("tintColor",xs.Color3,!0,Rs.Fragment),n.registerInput("translucencyIntensity",xs.Float,!0,Rs.Fragment),n.registerInput("translucencyDiffusionDist",xs.Color3,!0,Rs.Fragment),n.registerInput("refraction",xs.Object,!0,Rs.Fragment,new Pl("refraction",n,Ns.Input,Ml,"RefractionBlock")),n.registerOutput("subsurface",xs.Object,Rs.Fragment,new Pl("subsurface",n,Ns.Output,t,"SubSurfaceBlock")),n}return Object(h.d)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("subSurfaceOut"),e._excludeVariableName("vThicknessParam"),e._excludeVariableName("vTintColor"),e._excludeVariableName("vSubSurfaceIntensity")},t.prototype.getClassName=function(){return"SubSurfaceBlock"},Object.defineProperty(t.prototype,"thickness",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintColor",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translucencyIntensity",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translucencyDiffusionDist",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refraction",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subsurface",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.thickness.isConnected){var t=new qs("SubSurface thickness",Rs.Fragment,xs.Float);t.value=0,t.output.connectTo(this.thickness)}},t.prototype.prepareDefines=function(t,i,n){e.prototype.prepareDefines.call(this,t,i,n);var r=this.translucencyDiffusionDist.isConnected||this.translucencyIntensity.isConnected;n.setValue("SUBSURFACE",r||this.refraction.isConnected,!0),n.setValue("SS_TRANSLUCENCY",r,!0),n.setValue("SS_THICKNESSANDMASK_TEXTURE",!1,!0),n.setValue("SS_MASK_FROM_THICKNESS_TEXTURE",!1,!0),n.setValue("SS_MASK_FROM_THICKNESS_TEXTURE_GLTF",!1,!0)},t.GetCode=function(e,t,i,n){var r,o,a,s,c,l,u,h,d,f,p,_,m,g,v,b,y="",T=(null==t?void 0:t.thickness.isConnected)?t.thickness.associatedVariableName:"0.",E=(null==t?void 0:t.tintColor.isConnected)?t.tintColor.associatedVariableName:"vec3(1.)",S=(null==t?void 0:t.translucencyIntensity.isConnected)?null==t?void 0:t.translucencyIntensity.associatedVariableName:"1.",A=(null==t?void 0:t.translucencyDiffusionDist.isConnected)?null==t?void 0:t.translucencyDiffusionDist.associatedVariableName:"vec3(1.)",P=(null==t?void 0:t.refraction.isConnected)?null===(r=null==t?void 0:t.refraction.connectedPoint)||void 0===r?void 0:r.ownerBlock:null,C=(null==P?void 0:P.tintAtDistance.isConnected)?P.tintAtDistance.associatedVariableName:"1.",R=(null==P?void 0:P.intensity.isConnected)?P.intensity.associatedVariableName:"1.",x=(null==P?void 0:P.view.isConnected)?P.view.associatedVariableName:"";return(y+=null!==(o=null==P?void 0:P.getCode(e))&&void 0!==o?o:"")+"subSurfaceOutParams subSurfaceOut;\n\n        #ifdef SUBSURFACE\n            vec2 vThicknessParam = vec2(0., "+T+");\n            vec4 vTintColor = vec4("+E+", "+C+");\n            vec3 vSubSurfaceIntensity = vec3("+R+", "+S+", 0.);\n\n            subSurfaceBlock(\n                vSubSurfaceIntensity,\n                vThicknessParam,\n                vTintColor,\n                normalW,\n                specularEnvironmentReflectance,\n            #ifdef SS_THICKNESSANDMASK_TEXTURE\n                vec4(0.),\n            #endif\n            #ifdef REFLECTION\n                #ifdef SS_TRANSLUCENCY\n                    "+(null==i?void 0:i._reflectionMatrixName)+",\n                    #ifdef USESPHERICALFROMREFLECTIONMAP\n                        #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n                            reflectionOut.irradianceVector,\n                        #endif\n                        #if defined(REALTIME_FILTERING)\n                            "+(null==i?void 0:i._cubeSamplerName)+",\n                            "+(null==i?void 0:i._vReflectionFilteringInfoName)+",\n                        #endif\n                        #endif\n                    #ifdef USEIRRADIANCEMAP\n                        irradianceSampler,\n                    #endif\n                #endif\n            #endif\n            #ifdef SS_REFRACTION\n                "+n+".xyz,\n                viewDirectionW,\n                "+x+",\n                surfaceAlbedo,\n                "+(null!==(a=null==P?void 0:P._vRefractionInfosName)&&void 0!==a?a:"")+",\n                "+(null!==(s=null==P?void 0:P._refractionMatrixName)&&void 0!==s?s:"")+",\n                "+(null!==(c=null==P?void 0:P._vRefractionMicrosurfaceInfosName)&&void 0!==c?c:"")+",\n                vLightingIntensity,\n                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n                    alpha,\n                #endif\n                #ifdef "+(null!==(l=null==P?void 0:P._defineLODRefractionAlpha)&&void 0!==l?l:"IGNORE")+"\n                    NdotVUnclamped,\n                #endif\n                #ifdef "+(null!==(u=null==P?void 0:P._defineLinearSpecularRefraction)&&void 0!==u?u:"IGNORE")+"\n                    roughness,\n                #else\n                    alphaG,\n                #endif\n                #ifdef "+(null!==(h=null==P?void 0:P._define3DName)&&void 0!==h?h:"IGNORE")+"\n                    "+(null!==(d=null==P?void 0:P._cubeSamplerName)&&void 0!==d?d:"")+",\n                #else\n                    "+(null!==(f=null==P?void 0:P._2DSamplerName)&&void 0!==f?f:"")+",\n                #endif\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef "+(null!==(p=null==P?void 0:P._define3DName)&&void 0!==p?p:"IGNORE")+"\n                        "+(null!==(_=null==P?void 0:P._cubeSamplerName)&&void 0!==_?_:"")+",\n                        "+(null!==(m=null==P?void 0:P._cubeSamplerName)&&void 0!==m?m:"")+",\n                    #else\n                        "+(null!==(g=null==P?void 0:P._2DSamplerName)&&void 0!==g?g:"")+",\n                        "+(null!==(v=null==P?void 0:P._2DSamplerName)&&void 0!==v?v:"")+",\n                    #endif\n                #endif\n                #ifdef ANISOTROPIC\n                    anisotropicOut,\n                #endif\n                #ifdef REALTIME_FILTERING\n                    "+(null!==(b=null==P?void 0:P._vRefractionFilteringInfoName)&&void 0!==b?b:"")+",\n                #endif\n            #endif\n            #ifdef SS_TRANSLUCENCY\n                "+A+",\n            #endif\n                subSurfaceOut\n            );\n\n            #ifdef SS_REFRACTION\n                surfaceAlbedo = subSurfaceOut.surfaceAlbedo;\n                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n                    alpha = subSurfaceOut.alpha;\n                #endif\n            #endif\n        #else\n            subSurfaceOut.specularEnvironmentReflectance = specularEnvironmentReflectance;\n        #endif\r\n"},t.prototype._buildBlock=function(e){return e.target===Rs.Fragment&&e.sharedData.blocksWithDefines.push(this),this},t}(ks);c.a.RegisteredTypes["BABYLON.SubSurfaceBlock"]=Il;var Dl={ambientClr:["finalAmbient",""],diffuseDir:["finalDiffuse",""],specularDir:["finalSpecularScaled","!defined(UNLIT) && defined(SPECULARTERM)"],clearcoatDir:["finalClearCoatScaled","!defined(UNLIT) && defined(CLEARCOAT)"],sheenDir:["finalSheenScaled","!defined(UNLIT) && defined(SHEEN)"],diffuseInd:["finalIrradiance","!defined(UNLIT) && defined(REFLECTION)"],specularInd:["finalRadianceScaled","!defined(UNLIT) && defined(REFLECTION)"],clearcoatInd:["clearcoatOut.finalClearCoatRadianceScaled","!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)"],sheenInd:["sheenOut.finalSheenRadianceScaled","!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)"],refraction:["subSurfaceOut.finalRefraction","!defined(UNLIT) && defined(SS_REFRACTION)"],lighting:["finalColor.rgb",""],shadow:["shadow",""],alpha:["alpha",""]},Nl=function(e){function t(t){var i=e.call(this,t,Rs.VertexAndFragment)||this;return i._environmentBRDFTexture=null,i._metallicReflectanceColor=s.a.White(),i._metallicF0Factor=1,i.directIntensity=1,i.environmentIntensity=1,i.specularIntensity=1,i.lightFalloff=0,i.useAlphaTest=!1,i.alphaTestCutoff=.5,i.useAlphaBlending=!1,i.useRadianceOverAlpha=!0,i.useSpecularOverAlpha=!0,i.enableSpecularAntiAliasing=!1,i.realTimeFiltering=!1,i.realTimeFilteringQuality=g.a.TEXTURE_FILTERING_QUALITY_LOW,i.useEnergyConservation=!0,i.useRadianceOcclusion=!0,i.useHorizonOcclusion=!0,i.unlit=!1,i.forceNormalForward=!1,i.debugMode=0,i.debugLimit=0,i.debugFactor=1,i._isUnique=!0,i.registerInput("worldPosition",xs.Vector4,!1,Rs.Vertex),i.registerInput("worldNormal",xs.Vector4,!1,Rs.Fragment),i.registerInput("view",xs.Matrix,!1),i.registerInput("cameraPosition",xs.Vector3,!1,Rs.Fragment),i.registerInput("perturbedNormal",xs.Vector4,!0,Rs.Fragment),i.registerInput("baseColor",xs.Color3,!0,Rs.Fragment),i.registerInput("metallic",xs.Float,!1,Rs.Fragment),i.registerInput("roughness",xs.Float,!1,Rs.Fragment),i.registerInput("ambientOcc",xs.Float,!0,Rs.Fragment),i.registerInput("opacity",xs.Float,!0,Rs.Fragment),i.registerInput("indexOfRefraction",xs.Float,!0,Rs.Fragment),i.registerInput("ambientColor",xs.Color3,!0,Rs.Fragment),i.registerInput("reflection",xs.Object,!0,Rs.Fragment,new Pl("reflection",i,Ns.Input,xl,"ReflectionBlock")),i.registerInput("clearcoat",xs.Object,!0,Rs.Fragment,new Pl("clearcoat",i,Ns.Input,Ol,"ClearCoatBlock")),i.registerInput("sheen",xs.Object,!0,Rs.Fragment,new Pl("sheen",i,Ns.Input,Cl,"SheenBlock")),i.registerInput("subsurface",xs.Object,!0,Rs.Fragment,new Pl("subsurface",i,Ns.Input,Il,"SubSurfaceBlock")),i.registerInput("anisotropy",xs.Object,!0,Rs.Fragment,new Pl("anisotropy",i,Ns.Input,Rl,"AnisotropyBlock")),i.registerOutput("ambientClr",xs.Color3,Rs.Fragment),i.registerOutput("diffuseDir",xs.Color3,Rs.Fragment),i.registerOutput("specularDir",xs.Color3,Rs.Fragment),i.registerOutput("clearcoatDir",xs.Color3,Rs.Fragment),i.registerOutput("sheenDir",xs.Color3,Rs.Fragment),i.registerOutput("diffuseInd",xs.Color3,Rs.Fragment),i.registerOutput("specularInd",xs.Color3,Rs.Fragment),i.registerOutput("clearcoatInd",xs.Color3,Rs.Fragment),i.registerOutput("sheenInd",xs.Color3,Rs.Fragment),i.registerOutput("refraction",xs.Color3,Rs.Fragment),i.registerOutput("lighting",xs.Color3,Rs.Fragment),i.registerOutput("shadow",xs.Float,Rs.Fragment),i.registerOutput("alpha",xs.Float,Rs.Fragment),i}return Object(h.d)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("vLightingIntensity"),e._excludeVariableName("geometricNormalW"),e._excludeVariableName("normalW"),e._excludeVariableName("faceNormal"),e._excludeVariableName("albedoOpacityOut"),e._excludeVariableName("surfaceAlbedo"),e._excludeVariableName("alpha"),e._excludeVariableName("aoOut"),e._excludeVariableName("baseColor"),e._excludeVariableName("reflectivityOut"),e._excludeVariableName("microSurface"),e._excludeVariableName("roughness"),e._excludeVariableName("NdotVUnclamped"),e._excludeVariableName("NdotV"),e._excludeVariableName("alphaG"),e._excludeVariableName("AARoughnessFactors"),e._excludeVariableName("environmentBrdf"),e._excludeVariableName("ambientMonochrome"),e._excludeVariableName("seo"),e._excludeVariableName("eho"),e._excludeVariableName("environmentRadiance"),e._excludeVariableName("irradianceVector"),e._excludeVariableName("environmentIrradiance"),e._excludeVariableName("diffuseBase"),e._excludeVariableName("specularBase"),e._excludeVariableName("preInfo"),e._excludeVariableName("info"),e._excludeVariableName("shadow"),e._excludeVariableName("finalDiffuse"),e._excludeVariableName("finalAmbient"),e._excludeVariableName("ambientOcclusionForDirectDiffuse"),e._excludeVariableName("finalColor"),e._excludeVariableName("vClipSpacePosition"),e._excludeVariableName("vDebugMode")},t.prototype.getClassName=function(){return"PBRMetallicRoughnessBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perturbedNormal",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseColor",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metallic",{get:function(){return this._inputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roughness",{get:function(){return this._inputs[7]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ambientOcc",{get:function(){return this._inputs[8]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"opacity",{get:function(){return this._inputs[9]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"indexOfRefraction",{get:function(){return this._inputs[10]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ambientColor",{get:function(){return this._inputs[11]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflection",{get:function(){return this._inputs[12]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearcoat",{get:function(){return this._inputs[13]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sheen",{get:function(){return this._inputs[14]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subsurface",{get:function(){return this._inputs[15]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anisotropy",{get:function(){return this._inputs[16]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ambientClr",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diffuseDir",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"specularDir",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearcoatDir",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sheenDir",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diffuseIndirect",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"specularIndirect",{get:function(){return this._outputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearcoatIndirect",{get:function(){return this._outputs[7]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sheenIndirect",{get:function(){return this._outputs[8]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refraction",{get:function(){return this._outputs[9]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lighting",{get:function(){return this._outputs[10]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadow",{get:function(){return this._outputs[11]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._outputs[12]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.cameraPosition.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.CameraPosition});t||(t=new qs("cameraPosition")).setAsSystemValue(Ms.CameraPosition),t.output.connectTo(this.cameraPosition)}if(!this.view.isConnected){var i=e.getInputBlockByPredicate(function(e){return e.systemValue===Ms.View});i||(i=new qs("view")).setAsSystemValue(Ms.View),i.output.connectTo(this.view)}},t.prototype.prepareDefines=function(e,t,i){i.setValue("PBR",!0),i.setValue("METALLICWORKFLOW",!0),i.setValue("DEBUGMODE",this.debugMode,!0),i.setValue("NORMALXYSCALE",!0),i.setValue("BUMP",this.perturbedNormal.isConnected,!0),i.setValue("LODBASEDMICROSFURACE",this._scene.getEngine().getCaps().textureLOD),i.setValue("ALBEDO",!1,!0),i.setValue("OPACITY",this.opacity.isConnected,!0),i.setValue("AMBIENT",!0,!0),i.setValue("AMBIENTINGRAYSCALE",!1,!0),i.setValue("REFLECTIVITY",!1,!0),i.setValue("AOSTOREINMETALMAPRED",!1,!0),i.setValue("METALLNESSSTOREINMETALMAPBLUE",!1,!0),i.setValue("ROUGHNESSSTOREINMETALMAPALPHA",!1,!0),i.setValue("ROUGHNESSSTOREINMETALMAPGREEN",!1,!0),this.lightFalloff===_o.LIGHTFALLOFF_STANDARD?(i.setValue("USEPHYSICALLIGHTFALLOFF",!1),i.setValue("USEGLTFLIGHTFALLOFF",!1)):this.lightFalloff===_o.LIGHTFALLOFF_GLTF?(i.setValue("USEPHYSICALLIGHTFALLOFF",!1),i.setValue("USEGLTFLIGHTFALLOFF",!0)):(i.setValue("USEPHYSICALLIGHTFALLOFF",!0),i.setValue("USEGLTFLIGHTFALLOFF",!1));var n=this.alphaTestCutoff.toString();if(i.setValue("ALPHABLEND",this.useAlphaBlending,!0),i.setValue("ALPHAFROMALBEDO",!1,!0),i.setValue("ALPHATEST",this.useAlphaTest,!0),i.setValue("ALPHATESTVALUE",n.indexOf(".")<0?n+".":n,!0),i.setValue("OPACITYRGB",!1,!0),i.setValue("RADIANCEOVERALPHA",this.useRadianceOverAlpha,!0),i.setValue("SPECULAROVERALPHA",this.useSpecularOverAlpha,!0),i.setValue("SPECULARAA",this._scene.getEngine().getCaps().standardDerivatives&&this.enableSpecularAntiAliasing,!0),i.setValue("REALTIME_FILTERING",this.realTimeFiltering,!0),this._scene.getEngine().webGLVersion>1?i.setValue("NUM_SAMPLES",this.realTimeFilteringQuality+"u",!0):i.setValue("NUM_SAMPLES",""+this.realTimeFilteringQuality,!0),i.setValue("BRDF_V_HEIGHT_CORRELATED",!0),i.setValue("MS_BRDF_ENERGY_CONSERVATION",this.useEnergyConservation,!0),i.setValue("RADIANCEOCCLUSION",this.useRadianceOcclusion,!0),i.setValue("HORIZONOCCLUSION",this.useHorizonOcclusion,!0),i.setValue("UNLIT",this.unlit,!0),i.setValue("FORCENORMALFORWARD",this.forceNormalForward,!0),this._environmentBRDFTexture&&Kr.a.ReflectionTextureEnabled?(i.setValue("ENVIRONMENTBRDF",!0),i.setValue("ENVIRONMENTBRDF_RGBD",this._environmentBRDFTexture.isRGBD,!0)):(i.setValue("ENVIRONMENTBRDF",!1),i.setValue("ENVIRONMENTBRDF_RGBD",!1)),i._areLightsDirty){var r=e.getScene();if(this.light){var o={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};Hr.a.PrepareDefinesForLight(r,e,this.light,this._lightId,i,!0,o),o.needRebuild&&i.rebuild()}else Hr.a.PrepareDefinesForLights(r,e,i,!0,t.maxSimultaneousLights),i._needNormals=!0,Hr.a.PrepareDefinesForMultiview(r,i)}},t.prototype.updateUniformsAndSamples=function(e,t,i,n){for(var r=0;r<t.maxSimultaneousLights&&i["LIGHT"+r];r++){var o=e.uniforms.indexOf("vLightData"+r)>=0;Hr.a.PrepareUniformsAndSamplersForLight(r,e.uniforms,e.samplers,i["PROJECTEDLIGHTTEXTURE"+r],n,o)}},t.prototype.bind=function(e,t,i){var n,r;if(i){var o=i.getScene();this.light?Hr.a.BindLight(this.light,this._lightId,o,e,!0):Hr.a.BindLights(o,i,e,!0,t.maxSimultaneousLights),e.setTexture(this._environmentBrdfSamplerName,this._environmentBRDFTexture),e.setFloat2("vDebugMode",this.debugLimit,this.debugFactor);var a=this._scene.ambientColor;a&&e.setColor3("ambientFromScene",a);var c=o.useRightHandedSystem===(null!=o._mirroredCameraPosition);e.setFloat(this._invertNormalName,c?-1:1),e.setFloat4("vLightingIntensity",this.directIntensity,1,this.environmentIntensity*this._scene.environmentIntensity,this.specularIntensity);var l=null!==(r=null===(n=this.indexOfRefraction.connectInputBlock)||void 0===n?void 0:n.value)&&void 0!==r?r:1.5,u=Math.pow((l-1)/(l+1),2);this._metallicReflectanceColor.scaleToRef(u*this._metallicF0Factor,s.c.Color3[0]);var h=this._metallicF0Factor;e.setColor4(this._vMetallicReflectanceFactorsName,s.c.Color3[0],h)}},t.prototype._injectVertexCode=function(e){var t,i,n=this.worldPosition,r="//"+this.name;this.light?(this._lightId=(void 0!==e.counters.lightCounter?e.counters.lightCounter:-1)+1,e.counters.lightCounter=this._lightId,e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",r,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString())):(e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",r,{repeatKey:"maxSimultaneousLights"}),this._lightId=0,e.sharedData.dynamicUniformBlocks.push(this));var o="v_"+n.associatedVariableName;e._emitVaryingFromString(o,"vec4")&&(e.compilationString+=o+" = "+n.associatedVariableName+";\r\n");var a=this.reflection.isConnected?null===(t=this.reflection.connectedPoint)||void 0===t?void 0:t.ownerBlock:null;a&&(a.viewConnectionPoint=this.view),e.compilationString+=null!==(i=null==a?void 0:a.handleVertexSide(e))&&void 0!==i?i:"",e._emitUniformFromString("vDebugMode","vec2","defined(IGNORE) || DEBUGMODE > 0"),e._emitUniformFromString("ambientFromScene","vec3"),e._emitVaryingFromString("vClipSpacePosition","vec4","defined(IGNORE) || DEBUGMODE > 0")&&(e._injectAtEnd+="#if DEBUGMODE > 0\r\n",e._injectAtEnd+="vClipSpacePosition = gl_Position;\r\n",e._injectAtEnd+="#endif\r\n"),this.light?e.compilationString+=e._emitCodeFromInclude("shadowsVertex",r,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()},{search:/worldPos/g,replace:n.associatedVariableName}]}):(e.compilationString+="vec4 worldPos = "+n.associatedVariableName+";\r\n",this.view.isConnected&&(e.compilationString+="mat4 view = "+this.view.associatedVariableName+";\r\n"),e.compilationString+=e._emitCodeFromInclude("shadowsVertex",r,{repeatKey:"maxSimultaneousLights"}))},t.prototype._getAlbedoOpacityCode=function(){return"albedoOpacityOutParams albedoOpacityOut;\r\n"+"albedoOpacityBlock(\n                vec4("+(this.baseColor.isConnected?this.baseColor.associatedVariableName:"vec3(1.)")+", 1.),\n            #ifdef ALBEDO\n                vec4(1.),\n                vec2(1., 1.),\n            #endif\n            #ifdef OPACITY\n                vec4("+(this.opacity.isConnected?this.opacity.associatedVariableName:"1.")+"),\n                vec2(1., 1.),\n            #endif\n                albedoOpacityOut\n            );\n\n            vec3 surfaceAlbedo = albedoOpacityOut.surfaceAlbedo;\n            float alpha = albedoOpacityOut.alpha;\r\n"},t.prototype._getAmbientOcclusionCode=function(){return"ambientOcclusionOutParams aoOut;\r\n"+"ambientOcclusionBlock(\n            #ifdef AMBIENT\n                vec3("+(this.ambientOcc.isConnected?this.ambientOcc.associatedVariableName:"1.")+"),\n                vec4(0., 1.0, 1.0, 0.),\n            #endif\n                aoOut\n            );\r\n"},t.prototype._getReflectivityCode=function(e){var t="reflectivityOutParams reflectivityOut;\r\n";return this._vMetallicReflectanceFactorsName=e._getFreeVariableName("vMetallicReflectanceFactors"),e._emitUniformFromString(this._vMetallicReflectanceFactorsName,"vec4"),t+"vec3 baseColor = surfaceAlbedo;\n\n            reflectivityBlock(\n                vec4("+this.metallic.associatedVariableName+", "+this.roughness.associatedVariableName+", 0., 0.),\n            #ifdef METALLICWORKFLOW\n                surfaceAlbedo,\n                "+this._vMetallicReflectanceFactorsName+",\n            #endif\n            #ifdef REFLECTIVITY\n                vec3(0., 0., 1.),\n                vec4(1.),\n            #endif\n            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY)  && defined(AOSTOREINMETALMAPRED)\n                aoOut.ambientOcclusionColor,\n            #endif\n            #ifdef MICROSURFACEMAP\n                microSurfaceTexel, <== not handled!\n            #endif\n                reflectivityOut\n            );\n\n            float microSurface = reflectivityOut.microSurface;\n            float roughness = reflectivityOut.roughness;\n\n            #ifdef METALLICWORKFLOW\n                surfaceAlbedo = reflectivityOut.surfaceAlbedo;\n            #endif\n            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n                aoOut.ambientOcclusionColor = reflectivityOut.ambientOcclusionColor;\n            #endif\r\n"},t.prototype._buildBlock=function(t){var i,n,r,o,a,s,c,l,u,h,d,f,p,_,m,g,v,b,y,T,E,S,A,P,C,R,x,O,M,I,D,N,L,w,F,B,U,V,k;e.prototype._buildBlock.call(this,t),this._scene=t.sharedData.scene,this._environmentBRDFTexture||(this._environmentBRDFTexture=io.GetEnvironmentBRDFTexture(this._scene));var G=this.reflection.isConnected?null===(i=this.reflection.connectedPoint)||void 0===i?void 0:i.ownerBlock:null;if(G&&(G.worldPositionConnectionPoint=this.worldPosition,G.cameraPositionConnectionPoint=this.cameraPosition,G.worldNormalConnectionPoint=this.worldNormal),t.target!==Rs.Fragment)return this._injectVertexCode(t),this;t.sharedData.bindableBlocks.push(this),t.sharedData.blocksWithDefines.push(this);var z="//"+this.name,j="v_"+this.worldPosition.associatedVariableName,W=this.perturbedNormal;this._environmentBrdfSamplerName=t._getFreeVariableName("environmentBrdfSampler"),t._emit2DSampler(this._environmentBrdfSamplerName),t.sharedData.hints.needAlphaBlending=t.sharedData.hints.needAlphaBlending||this.useAlphaBlending,t.sharedData.hints.needAlphaTesting=t.sharedData.hints.needAlphaTesting||this.useAlphaTest,t._emitExtension("lod","#extension GL_EXT_shader_texture_lod : enable","defined(LODBASEDMICROSFURACE)"),t._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable"),this.light?t._emitFunctionFromInclude(t.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",z,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString()):t._emitFunctionFromInclude(t.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",z,{repeatKey:"maxSimultaneousLights"}),t._emitFunctionFromInclude("helperFunctions",z),t._emitFunctionFromInclude("importanceSampling",z),t._emitFunctionFromInclude("pbrHelperFunctions",z),t._emitFunctionFromInclude("imageProcessingFunctions",z),t._emitFunctionFromInclude("shadowsFragmentFunctions",z,{replaceStrings:[{search:/vPositionW/g,replace:j+".xyz"}]}),t._emitFunctionFromInclude("pbrDirectLightingSetupFunctions",z,{replaceStrings:[{search:/vPositionW/g,replace:j+".xyz"}]}),t._emitFunctionFromInclude("pbrDirectLightingFalloffFunctions",z),t._emitFunctionFromInclude("pbrBRDFFunctions",z,{replaceStrings:[{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(n=null==G?void 0:G._defineSkyboxName)&&void 0!==n?n:"REFLECTIONMAP_SKYBOX"}]}),t._emitFunctionFromInclude("hdrFilteringFunctions",z),t._emitFunctionFromInclude("pbrDirectLightingFunctions",z,{replaceStrings:[{search:/vPositionW/g,replace:j+".xyz"}]}),t._emitFunctionFromInclude("pbrIBLFunctions",z),t._emitFunctionFromInclude("pbrBlockAlbedoOpacity",z),t._emitFunctionFromInclude("pbrBlockReflectivity",z),t._emitFunctionFromInclude("pbrBlockAmbientOcclusion",z),t._emitFunctionFromInclude("pbrBlockAlphaFresnel",z),t._emitFunctionFromInclude("pbrBlockAnisotropic",z),t._emitUniformFromString("vLightingIntensity","vec4"),this._vNormalWName=t._getFreeVariableName("vNormalW"),t.compilationString+="vec4 "+this._vNormalWName+" = normalize("+this.worldNormal.associatedVariableName+");\r\n",t._registerTempVariable("viewDirectionW")&&(t.compilationString+="vec3 viewDirectionW = normalize("+this.cameraPosition.associatedVariableName+" - "+j+".xyz);\r\n"),t.compilationString+="vec3 geometricNormalW = "+this._vNormalWName+".xyz;\r\n",t.compilationString+="vec3 normalW = "+(W.isConnected?"normalize("+W.associatedVariableName+".xyz)":"geometricNormalW")+";\r\n",this._invertNormalName=t._getFreeVariableName("invertNormal"),t._emitUniformFromString(this._invertNormalName,"float"),t.compilationString+=t._emitCodeFromInclude("pbrBlockNormalFinal",z,{replaceStrings:[{search:/vPositionW/g,replace:j+".xyz"},{search:/vEyePosition.w/g,replace:this._invertNormalName}]}),t.compilationString+=this._getAlbedoOpacityCode(),t.compilationString+=t._emitCodeFromInclude("depthPrePass",z),t.compilationString+=this._getAmbientOcclusionCode(),t.compilationString+=t._emitCodeFromInclude("pbrBlockLightmapInit",z),t.compilationString+="#ifdef UNLIT\n                vec3 diffuseBase = vec3(1., 1., 1.);\n            #else\r\n",t.compilationString+=this._getReflectivityCode(t),t.compilationString+=t._emitCodeFromInclude("pbrBlockGeometryInfo",z,{replaceStrings:[{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(r=null==G?void 0:G._defineSkyboxName)&&void 0!==r?r:"REFLECTIONMAP_SKYBOX"},{search:/REFLECTIONMAP_3D/g,replace:null!==(o=null==G?void 0:G._define3DName)&&void 0!==o?o:"REFLECTIONMAP_3D"}]});var H=this.anisotropy.isConnected?null===(a=this.anisotropy.connectedPoint)||void 0===a?void 0:a.ownerBlock:null;H&&(H.worldPositionConnectionPoint=this.worldPosition,H.worldNormalConnectionPoint=this.worldNormal,t.compilationString+=H.getCode(t,!this.perturbedNormal.isConnected)),G&&G.hasTexture&&(t.compilationString+=G.getCode(t,H?"anisotropicOut.anisotropicNormal":"normalW")),t._emitFunctionFromInclude("pbrBlockReflection",z,{replaceStrings:[{search:/computeReflectionCoords/g,replace:"computeReflectionCoordsPBR"},{search:/REFLECTIONMAP_3D/g,replace:null!==(s=null==G?void 0:G._define3DName)&&void 0!==s?s:"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:null!==(c=null==G?void 0:G._defineOppositeZ)&&void 0!==c?c:"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:null!==(l=null==G?void 0:G._defineProjectionName)&&void 0!==l?l:"REFLECTIONMAP_PROJECTION"},{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(u=null==G?void 0:G._defineSkyboxName)&&void 0!==u?u:"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:null!==(h=null==G?void 0:G._defineLODReflectionAlpha)&&void 0!==h?h:"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:null!==(d=null==G?void 0:G._defineLinearSpecularReflection)&&void 0!==d?d:"LINEARSPECULARREFLECTION"},{search:/vReflectionFilteringInfo/g,replace:null!==(f=null==G?void 0:G._vReflectionFilteringInfoName)&&void 0!==f?f:"vReflectionFilteringInfo"}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockReflectance0",z,{replaceStrings:[{search:/metallicReflectanceFactors/g,replace:this._vMetallicReflectanceFactorsName}]});var X=this.sheen.isConnected?null===(p=this.sheen.connectedPoint)||void 0===p?void 0:p.ownerBlock:null;X&&(t.compilationString+=X.getCode(G)),t._emitFunctionFromInclude("pbrBlockSheen",z,{replaceStrings:[{search:/REFLECTIONMAP_3D/g,replace:null!==(_=null==G?void 0:G._define3DName)&&void 0!==_?_:"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(m=null==G?void 0:G._defineSkyboxName)&&void 0!==m?m:"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:null!==(g=null==G?void 0:G._defineLODReflectionAlpha)&&void 0!==g?g:"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:null!==(v=null==G?void 0:G._defineLinearSpecularReflection)&&void 0!==v?v:"LINEARSPECULARREFLECTION"}]});var Y=this.clearcoat.isConnected?null===(b=this.clearcoat.connectedPoint)||void 0===b?void 0:b.ownerBlock:null,K=!this.perturbedNormal.isConnected&&!this.anisotropy.isConnected,Q=this.perturbedNormal.isConnected&&(null===(y=this.perturbedNormal.connectedPoint)||void 0===y?void 0:y.ownerBlock).worldTangent.isConnected,q=this.anisotropy.isConnected&&(null===(T=this.anisotropy.connectedPoint)||void 0===T?void 0:T.ownerBlock).worldTangent.isConnected,Z=Q||!this.perturbedNormal.isConnected&&q;t.compilationString+=Ol.GetCode(t,Y,G,j,K,Z,this.worldNormal.associatedVariableName),K&&(Z=null!==(E=null==Y?void 0:Y.worldTangent.isConnected)&&void 0!==E&&E),t._emitFunctionFromInclude("pbrBlockClearcoat",z,{replaceStrings:[{search:/computeReflectionCoords/g,replace:"computeReflectionCoordsPBR"},{search:/REFLECTIONMAP_3D/g,replace:null!==(S=null==G?void 0:G._define3DName)&&void 0!==S?S:"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:null!==(A=null==G?void 0:G._defineOppositeZ)&&void 0!==A?A:"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:null!==(P=null==G?void 0:G._defineProjectionName)&&void 0!==P?P:"REFLECTIONMAP_PROJECTION"},{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(C=null==G?void 0:G._defineSkyboxName)&&void 0!==C?C:"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:null!==(R=null==G?void 0:G._defineLODReflectionAlpha)&&void 0!==R?R:"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:null!==(x=null==G?void 0:G._defineLinearSpecularReflection)&&void 0!==x?x:"LINEARSPECULARREFLECTION"},{search:/defined\(TANGENT\)/g,replace:Z?"defined(TANGENT)":"defined(IGNORE)"}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockReflectance",z,{replaceStrings:[{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(O=null==G?void 0:G._defineSkyboxName)&&void 0!==O?O:"REFLECTIONMAP_SKYBOX"},{search:/REFLECTIONMAP_3D/g,replace:null!==(M=null==G?void 0:G._define3DName)&&void 0!==M?M:"REFLECTIONMAP_3D"}]});var J=this.subsurface.isConnected?null===(I=this.subsurface.connectedPoint)||void 0===I?void 0:I.ownerBlock:null,$=this.subsurface.isConnected?null===(N=(null===(D=this.subsurface.connectedPoint)||void 0===D?void 0:D.ownerBlock).refraction.connectedPoint)||void 0===N?void 0:N.ownerBlock:null;$&&($.viewConnectionPoint=this.view,$.indexOfRefractionConnectionPoint=this.indexOfRefraction),t.compilationString+=Il.GetCode(t,J,G,j),t._emitFunctionFromInclude("pbrBlockSubSurface",z,{replaceStrings:[{search:/REFLECTIONMAP_3D/g,replace:null!==(L=null==G?void 0:G._define3DName)&&void 0!==L?L:"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:null!==(w=null==G?void 0:G._defineOppositeZ)&&void 0!==w?w:"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:null!==(F=null==G?void 0:G._defineProjectionName)&&void 0!==F?F:"REFLECTIONMAP_PROJECTION"},{search:/SS_REFRACTIONMAP_3D/g,replace:null!==(B=null==$?void 0:$._define3DName)&&void 0!==B?B:"SS_REFRACTIONMAP_3D"},{search:/SS_LODINREFRACTIONALPHA/g,replace:null!==(U=null==$?void 0:$._defineLODRefractionAlpha)&&void 0!==U?U:"SS_LODINREFRACTIONALPHA"},{search:/SS_LINEARSPECULARREFRACTION/g,replace:null!==(V=null==$?void 0:$._defineLinearSpecularRefraction)&&void 0!==V?V:"SS_LINEARSPECULARREFRACTION"},{search:/SS_REFRACTIONMAP_OPPOSITEZ/g,replace:null!==(k=null==$?void 0:$._defineOppositeZ)&&void 0!==k?k:"SS_REFRACTIONMAP_OPPOSITEZ"}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockDirectLighting",z),this.light?t.compilationString+=t._emitCodeFromInclude("lightFragment",z,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]}):t.compilationString+=t._emitCodeFromInclude("lightFragment",z,{repeatKey:"maxSimultaneousLights"}),t.compilationString+=t._emitCodeFromInclude("pbrBlockFinalLitComponents",z),t.compilationString+="#endif\r\n";var ee=this.ambientColor.isConnected?this.ambientColor.associatedVariableName:"vec3(0., 0., 0.)",te=_o.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString();-1===te.indexOf(".")&&(te+="."),t.compilationString+=t._emitCodeFromInclude("pbrBlockFinalUnlitComponents",z,{replaceStrings:[{search:/vec3 finalEmissive[\s\S]*?finalEmissive\*=vLightingIntensity\.y;/g,replace:""},{search:/vAmbientColor/g,replace:ee+" * ambientFromScene"},{search:/vAmbientInfos\.w/g,replace:te}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockFinalColorComposition",z,{replaceStrings:[{search:/finalEmissive/g,replace:"vec3(0.)"}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockImageProcessing",z,{replaceStrings:[{search:/visibility/g,replace:"1."}]}),t.compilationString+=t._emitCodeFromInclude("pbrDebug",z,{replaceStrings:[{search:/vNormalW/g,replace:this._vNormalWName},{search:/vPositionW/g,replace:j},{search:/albedoTexture\.rgb;/g,replace:"vec3(1.);\r\ngl_FragColor.rgb = toGammaSpace(gl_FragColor.rgb);\r\n"}]});for(var ie=0,ne=this._outputs;ie<ne.length;ie++){var re=ne[ie];if(re.hasEndpoints){var oe=Dl[re.name];if(oe){var ae=oe[0],se=oe[1];se&&(t.compilationString+="#if "+se+"\r\n"),t.compilationString+=this._declareOutput(re,t)+" = "+ae+";\r\n",se&&(t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(re,t)+" = vec3(0.);\r\n",t.compilationString+="#endif\r\n")}else console.error("There's no remapping for the "+re.name+" end point! No code generated")}}return this},t.prototype._dumpPropertiesCode=function(){var e="";return e+=this._codeVariableName+".lightFalloff = "+this.lightFalloff+";\r\n",e+=this._codeVariableName+".useAlphaTest = "+this.useAlphaTest+";\r\n",e+=this._codeVariableName+".alphaTestCutoff = "+this.alphaTestCutoff+";\r\n",e+=this._codeVariableName+".useAlphaBlending = "+this.useAlphaBlending+";\r\n",e+=this._codeVariableName+".useRadianceOverAlpha = "+this.useRadianceOverAlpha+";\r\n",e+=this._codeVariableName+".useSpecularOverAlpha = "+this.useSpecularOverAlpha+";\r\n",e+=this._codeVariableName+".enableSpecularAntiAliasing = "+this.enableSpecularAntiAliasing+";\r\n",e+=this._codeVariableName+".realTimeFiltering = "+this.realTimeFiltering+";\r\n",e+=this._codeVariableName+".realTimeFilteringQuality = "+this.realTimeFilteringQuality+";\r\n",e+=this._codeVariableName+".useEnergyConservation = "+this.useEnergyConservation+";\r\n",e+=this._codeVariableName+".useRadianceOcclusion = "+this.useRadianceOcclusion+";\r\n",e+=this._codeVariableName+".useHorizonOcclusion = "+this.useHorizonOcclusion+";\r\n",e+=this._codeVariableName+".unlit = "+this.unlit+";\r\n",e+=this._codeVariableName+".forceNormalForward = "+this.forceNormalForward+";\r\n",e+=this._codeVariableName+".debugMode = "+this.debugMode+";\r\n",(e+=this._codeVariableName+".debugLimit = "+this.debugLimit+";\r\n")+(this._codeVariableName+".debugFactor = ")+this.debugFactor+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.light&&(t.lightId=this.light.id),t.lightFalloff=this.lightFalloff,t.useAlphaTest=this.useAlphaTest,t.alphaTestCutoff=this.alphaTestCutoff,t.useAlphaBlending=this.useAlphaBlending,t.useRadianceOverAlpha=this.useRadianceOverAlpha,t.useSpecularOverAlpha=this.useSpecularOverAlpha,t.enableSpecularAntiAliasing=this.enableSpecularAntiAliasing,t.realTimeFiltering=this.realTimeFiltering,t.realTimeFilteringQuality=this.realTimeFilteringQuality,t.useEnergyConservation=this.useEnergyConservation,t.useRadianceOcclusion=this.useRadianceOcclusion,t.useHorizonOcclusion=this.useHorizonOcclusion,t.unlit=this.unlit,t.forceNormalForward=this.forceNormalForward,t.debugMode=this.debugMode,t.debugLimit=this.debugLimit,t.debugFactor=this.debugFactor,t},t.prototype._deserialize=function(t,i,n){var r,o;e.prototype._deserialize.call(this,t,i,n),t.lightId&&(this.light=i.getLightByID(t.lightId)),this.lightFalloff=null!==(r=t.lightFalloff)&&void 0!==r?r:0,this.useAlphaTest=t.useAlphaTest,this.alphaTestCutoff=t.alphaTestCutoff,this.useAlphaBlending=t.useAlphaBlending,this.useRadianceOverAlpha=t.useRadianceOverAlpha,this.useSpecularOverAlpha=t.useSpecularOverAlpha,this.enableSpecularAntiAliasing=t.enableSpecularAntiAliasing,this.realTimeFiltering=!!t.realTimeFiltering,this.realTimeFilteringQuality=null!==(o=t.realTimeFilteringQuality)&&void 0!==o?o:g.a.TEXTURE_FILTERING_QUALITY_LOW,this.useEnergyConservation=t.useEnergyConservation,this.useRadianceOcclusion=t.useRadianceOcclusion,this.useHorizonOcclusion=t.useHorizonOcclusion,this.unlit=t.unlit,this.forceNormalForward=!!t.forceNormalForward,this.debugMode=t.debugMode,this.debugLimit=t.debugLimit,this.debugFactor=t.debugFactor},Object(h.c)([nc("Direct lights",tc.Float,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],t.prototype,"directIntensity",void 0),Object(h.c)([nc("Environment lights",tc.Float,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],t.prototype,"environmentIntensity",void 0),Object(h.c)([nc("Specular highlights",tc.Float,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],t.prototype,"specularIntensity",void 0),Object(h.c)([nc("Light falloff",tc.List,"LIGHTING & COLORS",{notifiers:{update:!0},options:[{label:"Physical",value:_o.LIGHTFALLOFF_PHYSICAL},{label:"GLTF",value:_o.LIGHTFALLOFF_GLTF},{label:"Standard",value:_o.LIGHTFALLOFF_STANDARD}]})],t.prototype,"lightFalloff",void 0),Object(h.c)([nc("Alpha Testing",tc.Boolean,"OPACITY")],t.prototype,"useAlphaTest",void 0),Object(h.c)([nc("Alpha CutOff",tc.Float,"OPACITY",{min:0,max:1,notifiers:{update:!0}})],t.prototype,"alphaTestCutoff",void 0),Object(h.c)([nc("Alpha blending",tc.Boolean,"OPACITY")],t.prototype,"useAlphaBlending",void 0),Object(h.c)([nc("Radiance over alpha",tc.Boolean,"RENDERING",{notifiers:{update:!0}})],t.prototype,"useRadianceOverAlpha",void 0),Object(h.c)([nc("Specular over alpha",tc.Boolean,"RENDERING",{notifiers:{update:!0}})],t.prototype,"useSpecularOverAlpha",void 0),Object(h.c)([nc("Specular anti-aliasing",tc.Boolean,"RENDERING",{notifiers:{update:!0}})],t.prototype,"enableSpecularAntiAliasing",void 0),Object(h.c)([nc("Realtime filtering",tc.Boolean,"RENDERING",{notifiers:{update:!0}})],t.prototype,"realTimeFiltering",void 0),Object(h.c)([nc("Realtime filtering quality",tc.List,"RENDERING",{notifiers:{update:!0},options:[{label:"Low",value:g.a.TEXTURE_FILTERING_QUALITY_LOW},{label:"Medium",value:g.a.TEXTURE_FILTERING_QUALITY_MEDIUM},{label:"High",value:g.a.TEXTURE_FILTERING_QUALITY_HIGH}]})],t.prototype,"realTimeFilteringQuality",void 0),Object(h.c)([nc("Energy Conservation",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"useEnergyConservation",void 0),Object(h.c)([nc("Radiance occlusion",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"useRadianceOcclusion",void 0),Object(h.c)([nc("Horizon occlusion",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"useHorizonOcclusion",void 0),Object(h.c)([nc("Unlit",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"unlit",void 0),Object(h.c)([nc("Force normal forward",tc.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"forceNormalForward",void 0),Object(h.c)([nc("Debug mode",tc.List,"DEBUG",{notifiers:{update:!0},options:[{label:"None",value:0},{label:"Normalized position",value:1},{label:"Normals",value:2},{label:"Tangents",value:3},{label:"Bitangents",value:4},{label:"Bump Normals",value:5},{label:"ClearCoat Normals",value:8},{label:"ClearCoat Tangents",value:9},{label:"ClearCoat Bitangents",value:10},{label:"Anisotropic Normals",value:11},{label:"Anisotropic Tangents",value:12},{label:"Anisotropic Bitangents",value:13},{label:"Env Refraction",value:40},{label:"Env Reflection",value:41},{label:"Env Clear Coat",value:42},{label:"Direct Diffuse",value:50},{label:"Direct Specular",value:51},{label:"Direct Clear Coat",value:52},{label:"Direct Sheen",value:53},{label:"Env Irradiance",value:54},{label:"Surface Albedo",value:60},{label:"Reflectance 0",value:61},{label:"Metallic",value:62},{label:"Metallic F0",value:71},{label:"Roughness",value:63},{label:"AlphaG",value:64},{label:"NdotV",value:65},{label:"ClearCoat Color",value:66},{label:"ClearCoat Roughness",value:67},{label:"ClearCoat NdotV",value:68},{label:"Transmittance",value:69},{label:"Refraction Transmittance",value:70},{label:"SEO",value:80},{label:"EHO",value:81},{label:"Energy Factor",value:82},{label:"Specular Reflectance",value:83},{label:"Clear Coat Reflectance",value:84},{label:"Sheen Reflectance",value:85},{label:"Luminance Over Alpha",value:86},{label:"Alpha",value:87}]})],t.prototype,"debugMode",void 0),Object(h.c)([nc("Split position",tc.Float,"DEBUG",{min:-1,max:1,notifiers:{update:!0}})],t.prototype,"debugLimit",void 0),Object(h.c)([nc("Output factor",tc.Float,"DEBUG",{min:0,max:5,notifiers:{update:!0}})],t.prototype,"debugFactor",void 0),t}(ks);c.a.RegisteredTypes["BABYLON.PBRMetallicRoughnessBlock"]=Nl;var Ll=function(e){function t(t){var i=e.call(this,t,Rs.Neutral)||this;return i.registerInput("left",xs.AutoDetect),i.registerInput("right",xs.AutoDetect),i.registerOutput("output",xs.BasedOnInput),i._outputs[0]._typeConnectionSource=i._inputs[0],i._linkConnectionTypes(0,1),i}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ModBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var i=this._outputs[0];return t.compilationString+=this._declareOutput(i,t)+" = mod("+this.left.associatedVariableName+", "+this.right.associatedVariableName+");\r\n",this},t}(ks);c.a.RegisteredTypes["BABYLON.ModBlock"]=Ll;var wl=function(){function e(){}return e.prototype.optimize=function(e,t){},e}(),Fl=i(120),Bl=function(){function e(){this.mm=new Map}return e.prototype.get=function(e,t){var i=this.mm.get(e);if(void 0!==i)return i.get(t)},e.prototype.set=function(e,t,i){var n=this.mm.get(e);void 0===n&&this.mm.set(e,n=new Map),n.set(t,i)},e}(),Ul=function(){function e(e,t,i){var n=this;this._baseMaterial=e,this._scene=t,this._options=i,this._subMeshToEffect=new Map,this._subMeshToDepthEffect=new Bl,this._meshes=new Map;var r="NodeMaterial"===e.getClassName()?"u_":"";if(r){this._matriceNames={world:r+"World",view:r+"View",projection:r+"Projection",viewProjection:r+"ViewProjection",worldView:r+"WorldxView",worldViewProjection:r+"WorldxViewxProjection"};for(var o=e.getInputBlocks(),a=0;a<o.length;++a)switch(o[a]._systemValue){case Ms.World:this._matriceNames.world=o[a].associatedVariableName;break;case Ms.View:this._matriceNames.view=o[a].associatedVariableName;break;case Ms.Projection:this._matriceNames.projection=o[a].associatedVariableName;break;case Ms.ViewProjection:this._matriceNames.viewProjection=o[a].associatedVariableName;break;case Ms.WorldView:this._matriceNames.worldView=o[a].associatedVariableName;break;case Ms.WorldViewProjection:this._matriceNames.worldViewProjection=o[a].associatedVariableName}}else this._matriceNames={world:r+"world",view:r+"view",projection:r+"projection",viewProjection:r+"viewProjection",worldView:r+"worldView",worldViewProjection:r+"worldViewProjection"};this._onEffectCreatedObserver=this._baseMaterial.onEffectCreatedObservable.add(function(e){var t,i=null===(t=e.subMesh)||void 0===t?void 0:t.getMesh();i&&!n._meshes.has(i)&&n._meshes.set(i,i.onDisposeObservable.add(function(e){for(var t=n._subMeshToEffect.keys(),i=t.next();!0!==i.done;i=t.next()){var r=i.value;(null==r?void 0:r.getMesh())===e&&(n._subMeshToEffect.delete(r),n._subMeshToDepthEffect.mm.delete(r))}})),n._subMeshToEffect.set(e.subMesh,e.effect),n._subMeshToDepthEffect.mm.delete(e.subMesh)})}return Object.defineProperty(e.prototype,"standalone",{get:function(){var e,t;return null!==(t=null===(e=this._options)||void 0===e?void 0:e.standalone)&&void 0!==t&&t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMaterial",{get:function(){return this._baseMaterial},enumerable:!1,configurable:!0}),e.prototype.getEffect=function(e,t){var i,n,r,o,a,s;return null!==(s=null!==(r=null===(n=null===(i=this._subMeshToDepthEffect.mm.get(e))||void 0===i?void 0:i.get(t))||void 0===n?void 0:n.depthEffect)&&void 0!==r?r:null===(a=null===(o=this._subMeshToDepthEffect.mm.get(null))||void 0===o?void 0:o.get(t))||void 0===a?void 0:a.depthEffect)&&void 0!==s?s:null},e.prototype.isReadyForSubMesh=function(e,t,i,n){var r,o;return this.standalone&&this._baseMaterial.isReadyForSubMesh(e.getMesh(),e,n),null!==(o=null===(r=this._makeEffect(e,t,i))||void 0===r?void 0:r.isReady())&&void 0!==o&&o},e.prototype.dispose=function(){this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver),this._onEffectCreatedObserver=null;for(var e=this._meshes.entries(),t=e.next();!0!==t.done;t=e.next()){var i=t.value,n=i[0],r=i[1];n.onDisposeObservable.remove(r)}},e.prototype._makeEffect=function(e,t,i){var n,r=null!==(n=this._subMeshToEffect.get(e))&&void 0!==n?n:this._subMeshToEffect.get(null);if(!r)return null;var o=this._subMeshToDepthEffect.get(e,i);o||(o={depthEffect:null,depthDefines:"",token:Fl.a.RandomId()},this._subMeshToDepthEffect.set(e,i,o));var a=t.join("\n");if(o.depthEffect&&a===o.depthDefines)return o.depthEffect;o.depthDefines=a;var s=r.rawVertexSourceCode,c=r.rawFragmentSourceCode,l=this._options&&this._options.remappedVariables?"#include<shadowMapVertexNormalBias>("+this._options.remappedVariables.join(",")+")":ai.a.IncludesShadersStore.shadowMapVertexNormalBias,u=this._options&&this._options.remappedVariables?"#include<shadowMapVertexMetric>("+this._options.remappedVariables.join(",")+")":ai.a.IncludesShadersStore.shadowMapVertexMetric,h=this._options&&this._options.remappedVariables?"#include<shadowMapFragmentSoftTransparentShadow>("+this._options.remappedVariables.join(",")+")":ai.a.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow,d=ai.a.IncludesShadersStore.shadowMapFragment;s=(s=-1!==(s=(s=s.replace(/void\s+?main/g,ai.a.IncludesShadersStore.shadowMapVertexDeclaration+"\r\nvoid main")).replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g,l)).indexOf("#define SHADOWDEPTH_METRIC")?s.replace(/#define SHADOWDEPTH_METRIC/g,u):s.replace(/}\s*$/g,u+"\r\n}")).replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g,"");var f=c.indexOf("#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW")>=0||c.indexOf("#define CUSTOM_FRAGMENT_BEFORE_FOG")>=0,p=-1!==c.indexOf("#define SHADOWDEPTH_FRAGMENT"),_="";f?c=c.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g,h):_=h+"\r\n",c=c.replace(/void\s+?main/g,ai.a.IncludesShadersStore.shadowMapFragmentDeclaration+"\r\nvoid main"),p?c=c.replace(/#define SHADOWDEPTH_FRAGMENT/g,d):_+=d+"\r\n",_&&(c=c.replace(/}\s*$/g,_+"}")),c=c.replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g,"");var m=r.getUniformNames().slice();return m.push("biasAndScaleSM","depthValuesSM","lightDataSM","softTransparentShadowSM"),o.depthEffect=this._scene.getEngine().createEffect({vertexSource:s,fragmentSource:c,vertexToken:o.token,fragmentToken:o.token},{attributes:r.getAttributesNames(),uniformsNames:m,uniformBuffersNames:r.getUniformBuffersNames(),samplers:r.getSamplers(),defines:a+"\n"+r.defines.replace("#define SHADOWS","").replace(/#define SHADOW\d/g,""),indexParameters:r.getIndexParameters()},this._scene.getEngine()),o.depthEffect},e}(),Vl=i(101);function kl(e,t,i,n,r){var o=new e.DecoderBuffer;o.Init(t,t.byteLength);var a,s,c=new e.Decoder;try{var l=c.GetEncodedGeometryType(o);switch(l){case e.TRIANGULAR_MESH:a=new e.Mesh,s=c.DecodeBufferToMesh(o,a);break;case e.POINT_CLOUD:a=new e.PointCloud,s=c.DecodeBufferToPointCloud(o,a);break;default:throw new Error("Invalid geometry type "+l)}if(!s.ok()||!a.ptr)throw new Error(s.error_msg());if(l===e.TRIANGULAR_MESH){var u=3*a.num_faces(),h=4*u,d=e._malloc(h);try{c.GetTrianglesUInt32Array(a,h,d);var f=new Uint32Array(u);f.set(new Uint32Array(e.HEAPF32.buffer,d,u)),n(f)}finally{e._free(d)}}var p=function(t,i){var n=i.num_components(),o=a.num_points(),s=o*n,l=s*Float32Array.BYTES_PER_ELEMENT,u=e._malloc(l);try{c.GetAttributeDataArrayForAllPoints(a,i,e.DT_FLOAT32,l,u);var h=new Float32Array(e.HEAPF32.buffer,u,s);if("color"===t&&3===n){for(var d=new Float32Array(4*o),f=0,p=0;f<d.length;f+=4,p+=n)d[f+0]=h[p+0],d[f+1]=h[p+1],d[f+2]=h[p+2],d[f+3]=1;r(t,d)}else(d=new Float32Array(s)).set(new Float32Array(e.HEAPF32.buffer,u,s)),r(t,d)}finally{e._free(u)}};if(i)for(var _ in i){var m=i[_];p(_,c.GetAttributeByUniqueId(a,m))}else{var g={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"};for(var _ in g)-1!==(m=c.GetAttributeId(a,e[g[_]]))&&p(_,c.GetAttribute(a,m))}}finally{a&&e.destroy(a),e.destroy(c),e.destroy(o)}}function Gl(e){return"object"!=typeof document||"string"!=typeof e?e:Ce.b.GetAbsoluteUrl(e)}var zl=function(){function e(t){void 0===t&&(t=e.DefaultNumWorkers);var i=e.Configuration.decoder,n=i.wasmUrl&&i.wasmBinaryUrl&&"object"==typeof WebAssembly?{url:i.wasmUrl,wasmBinaryPromise:Ce.b.LoadFileAsync(Gl(i.wasmBinaryUrl))}:{url:i.fallbackUrl,wasmBinaryPromise:Promise.resolve(void 0)};t&&"function"==typeof Worker?this._workerPoolPromise=n.wasmBinaryPromise.then(function(e){for(var i=kl+"("+function(){var e;onmessage=function(t){var i=t.data;switch(i.id){case"init":var n=i.decoder;n.url&&(importScripts(n.url),e=DracoDecoderModule({wasmBinary:n.wasmBinary})),postMessage("done");break;case"decodeMesh":if(!e)throw new Error("Draco decoder module is not available");e.then(function(e){kl(e,i.dataView,i.attributes,function(e){postMessage({id:"indices",value:e},[e.buffer])},function(e,t){postMessage({id:e,value:t},[t.buffer])}),postMessage("done")})}}}+")()",r=URL.createObjectURL(new Blob([i],{type:"application/javascript"})),o=new Array(t),a=0;a<o.length;a++)o[a]=new Promise(function(t,i){var o=new Worker(r),a=function(e){o.removeEventListener("error",a),o.removeEventListener("message",s),i(e)},s=function(e){"done"===e.data&&(o.removeEventListener("error",a),o.removeEventListener("message",s),t(o))};o.addEventListener("error",a),o.addEventListener("message",s),o.postMessage({id:"init",decoder:{url:Gl(n.url),wasmBinary:e}})});return Promise.all(o).then(function(e){return new Co(e)})}):this._decoderModulePromise=n.wasmBinaryPromise.then(function(e){if(!n.url)throw new Error("Draco decoder module is not available");return Ce.b.LoadScriptAsync(n.url).then(function(){return t=e,new Promise(function(e){DracoDecoderModule({wasmBinary:t}).then(function(t){e({module:t})})});var t})})}return Object.defineProperty(e,"DecoderAvailable",{get:function(){var t=e.Configuration.decoder;return!!(t.wasmUrl&&t.wasmBinaryUrl&&"object"==typeof WebAssembly||t.fallbackUrl)},enumerable:!1,configurable:!0}),e.GetDefaultNumWorkers=function(){return"object"==typeof navigator&&navigator.hardwareConcurrency?Math.min(Math.floor(.5*navigator.hardwareConcurrency),4):1},Object.defineProperty(e,"Default",{get:function(){return e._Default||(e._Default=new e),e._Default},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._workerPoolPromise&&this._workerPoolPromise.then(function(e){e.dispose()}),delete this._workerPoolPromise,delete this._decoderModulePromise},e.prototype.whenReadyAsync=function(){return this._workerPoolPromise?this._workerPoolPromise.then(function(){}):this._decoderModulePromise?this._decoderModulePromise.then(function(){}):Promise.resolve()},e.prototype.decodeMeshAsync=function(e,t){var i=e instanceof ArrayBuffer?new Uint8Array(e):e;if(this._workerPoolPromise)return this._workerPoolPromise.then(function(e){return new Promise(function(n,r){e.push(function(e,o){var a=new zi.a,s=function(t){e.removeEventListener("error",s),e.removeEventListener("message",c),r(t),o()},c=function(t){"done"===t.data?(e.removeEventListener("error",s),e.removeEventListener("message",c),n(a),o()):"indices"===t.data.id?a.indices=t.data.value:a.set(t.data.value,t.data.id)};e.addEventListener("error",s),e.addEventListener("message",c);var l=new Uint8Array(i.byteLength);l.set(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),e.postMessage({id:"decodeMesh",dataView:l,attributes:t},[l.buffer])})})});if(this._decoderModulePromise)return this._decoderModulePromise.then(function(e){var n=new zi.a;return kl(e.module,i,t,function(e){n.indices=e},function(e,t){n.set(t,e)}),n});throw new Error("Draco decoder module is not available")},e.Configuration={decoder:{wasmUrl:"https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js",wasmBinaryUrl:"https://preview.babylonjs.com/draco_decoder_gltf.wasm",fallbackUrl:"https://preview.babylonjs.com/draco_decoder_gltf.js"}},e.DefaultNumWorkers=e.GetDefaultNumWorkers(),e._Default=null,e}(),jl=i(61),Wl=0,Hl=function(){function e(e,t,i,n){this.pos=e,this.normal=t,this.uv=i,this.vertColor=n}return e.prototype.clone=function(){var t,i;return new e(this.pos.clone(),this.normal.clone(),null===(t=this.uv)||void 0===t?void 0:t.clone(),null===(i=this.vertColor)||void 0===i?void 0:i.clone())},e.prototype.flip=function(){this.normal=this.normal.scale(-1)},e.prototype.interpolate=function(t,i){return new e(a.e.Lerp(this.pos,t.pos,i),a.e.Lerp(this.normal,t.normal,i),this.uv&&t.uv?a.d.Lerp(this.uv,t.uv,i):void 0,this.vertColor&&t.vertColor?s.b.Lerp(this.vertColor,t.vertColor,i):void 0)},e}(),Xl=function(){function e(e,t){this.normal=e,this.w=t}return e.FromPoints=function(t,i,n){var r=n.subtract(t),o=i.subtract(t);if(0===r.lengthSquared()||0===o.lengthSquared())return null;var s=a.e.Normalize(a.e.Cross(r,o));return new e(s,a.e.Dot(s,t))},e.prototype.clone=function(){return new e(this.normal.clone(),this.w)},e.prototype.flip=function(){this.normal.scaleInPlace(-1),this.w=-this.w},e.prototype.splitPolygon=function(t,i,n,r,o){var s,c,l=0,u=[];for(s=0;s<t.vertices.length;s++){var h=(c=a.e.Dot(this.normal,t.vertices[s].pos)-this.w)<-e.EPSILON?2:c>e.EPSILON?1:0;l|=h,u.push(h)}switch(l){case 0:(a.e.Dot(this.normal,t.plane.normal)>0?i:n).push(t);break;case 1:r.push(t);break;case 2:o.push(t);break;case 3:var d,f=[],p=[];for(s=0;s<t.vertices.length;s++){var _=(s+1)%t.vertices.length,m=u[s],g=u[_],v=t.vertices[s],b=t.vertices[_];if(2!==m&&f.push(v),1!==m&&p.push(2!==m?v.clone():v),3==(m|g)){c=(this.w-a.e.Dot(this.normal,v.pos))/a.e.Dot(this.normal,b.pos.subtract(v.pos));var y=v.interpolate(b,c);f.push(y),p.push(y.clone())}}f.length>=3&&(d=new Yl(f,t.shared)).plane&&r.push(d),p.length>=3&&(d=new Yl(p,t.shared)).plane&&o.push(d)}},e.EPSILON=1e-5,e}(),Yl=function(){function e(e,t){this.vertices=e,this.shared=t,this.plane=Xl.FromPoints(e[0].pos,e[1].pos,e[2].pos)}return e.prototype.clone=function(){return new e(this.vertices.map(function(e){return e.clone()}),this.shared)},e.prototype.flip=function(){this.vertices.reverse().map(function(e){e.flip()}),this.plane.flip()},e}(),Kl=function(){function e(e){this.plane=null,this.front=null,this.back=null,this.polygons=new Array,e&&this.build(e)}return e.prototype.clone=function(){var t=new e;return t.plane=this.plane&&this.plane.clone(),t.front=this.front&&this.front.clone(),t.back=this.back&&this.back.clone(),t.polygons=this.polygons.map(function(e){return e.clone()}),t},e.prototype.invert=function(){for(var e=0;e<this.polygons.length;e++)this.polygons[e].flip();this.plane&&this.plane.flip(),this.front&&this.front.invert(),this.back&&this.back.invert();var t=this.front;this.front=this.back,this.back=t},e.prototype.clipPolygons=function(e){if(!this.plane)return e.slice();for(var t=new Array,i=new Array,n=0;n<e.length;n++)this.plane.splitPolygon(e[n],t,i,t,i);return this.front&&(t=this.front.clipPolygons(t)),i=this.back?this.back.clipPolygons(i):[],t.concat(i)},e.prototype.clipTo=function(e){this.polygons=e.clipPolygons(this.polygons),this.front&&this.front.clipTo(e),this.back&&this.back.clipTo(e)},e.prototype.allPolygons=function(){var e=this.polygons.slice();return this.front&&(e=e.concat(this.front.allPolygons())),this.back&&(e=e.concat(this.back.allPolygons())),e},e.prototype.build=function(t){if(t.length){this.plane||(this.plane=t[0].plane.clone());for(var i=new Array,n=new Array,r=0;r<t.length;r++)this.plane.splitPolygon(t[r],this.polygons,this.polygons,i,n);i.length&&(this.front||(this.front=new e),this.front.build(i)),n.length&&(this.back||(this.back=new e),this.back.build(n))}},e}(),Ql=function(){function e(){this.polygons=new Array}return e.FromMesh=function(t){var i,n,r,o,c,l,u,h,d,f=void 0,p=void 0,_=new Array,m=null;if(!(t instanceof be.a))throw"BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh";t.computeWorldMatrix(!0),l=t.getWorldMatrix(),u=t.position.clone(),h=t.rotation.clone(),t.rotationQuaternion&&(m=t.rotationQuaternion.clone()),d=t.scaling.clone();for(var g=t.getIndices(),v=t.getVerticesData(ji.b.PositionKind),b=t.getVerticesData(ji.b.NormalKind),y=t.getVerticesData(ji.b.UVKind),T=t.getVerticesData(ji.b.ColorKind),E=t.subMeshes,S=0,A=E.length;S<A;S++)for(var P=E[S].indexStart,C=E[S].indexCount+E[S].indexStart;P<C;P+=3){c=[];for(var R=0;R<3;R++){var x=new a.e(b[3*g[P+R]],b[3*g[P+R]+1],b[3*g[P+R]+2]);y&&(f=new a.d(y[2*g[P+R]],y[2*g[P+R]+1])),T&&(p=new s.b(T[4*g[P+R]],T[4*g[P+R]+1],T[4*g[P+R]+2],T[4*g[P+R]+3]));var O=new a.e(v[3*g[P+R]],v[3*g[P+R]+1],v[3*g[P+R]+2]);r=a.e.TransformCoordinates(O,l),n=a.e.TransformNormal(x,l),i=new Hl(r,n,f,p),c.push(i)}(o=new Yl(c,{subMeshId:S,meshId:Wl,materialIndex:E[S].materialIndex})).plane&&_.push(o)}var M=e.FromPolygons(_);return M.matrix=l,M.position=u,M.rotation=h,M.scaling=d,M.rotationQuaternion=m,Wl++,M},e.FromPolygons=function(t){var i=new e;return i.polygons=t,i},e.prototype.clone=function(){var t=new e;return t.polygons=this.polygons.map(function(e){return e.clone()}),t.copyTransformAttributes(this),t},e.prototype.union=function(t){var i=new Kl(this.clone().polygons),n=new Kl(t.clone().polygons);return i.clipTo(n),n.clipTo(i),n.invert(),n.clipTo(i),n.invert(),i.build(n.allPolygons()),e.FromPolygons(i.allPolygons()).copyTransformAttributes(this)},e.prototype.unionInPlace=function(e){var t=new Kl(this.polygons),i=new Kl(e.polygons);t.clipTo(i),i.clipTo(t),i.invert(),i.clipTo(t),i.invert(),t.build(i.allPolygons()),this.polygons=t.allPolygons()},e.prototype.subtract=function(t){var i=new Kl(this.clone().polygons),n=new Kl(t.clone().polygons);return i.invert(),i.clipTo(n),n.clipTo(i),n.invert(),n.clipTo(i),n.invert(),i.build(n.allPolygons()),i.invert(),e.FromPolygons(i.allPolygons()).copyTransformAttributes(this)},e.prototype.subtractInPlace=function(e){var t=new Kl(this.polygons),i=new Kl(e.polygons);t.invert(),t.clipTo(i),i.clipTo(t),i.invert(),i.clipTo(t),i.invert(),t.build(i.allPolygons()),t.invert(),this.polygons=t.allPolygons()},e.prototype.intersect=function(t){var i=new Kl(this.clone().polygons),n=new Kl(t.clone().polygons);return i.invert(),n.clipTo(i),n.invert(),i.clipTo(n),n.clipTo(i),i.build(n.allPolygons()),i.invert(),e.FromPolygons(i.allPolygons()).copyTransformAttributes(this)},e.prototype.intersectInPlace=function(e){var t=new Kl(this.polygons),i=new Kl(e.polygons);t.invert(),i.clipTo(t),i.invert(),t.clipTo(i),i.clipTo(t),t.build(i.allPolygons()),t.invert(),this.polygons=t.allPolygons()},e.prototype.inverse=function(){var e=this.clone();return e.inverseInPlace(),e},e.prototype.inverseInPlace=function(){this.polygons.map(function(e){e.flip()})},e.prototype.copyTransformAttributes=function(e){return this.matrix=e.matrix,this.position=e.position,this.rotation=e.rotation,this.scaling=e.scaling,this.rotationQuaternion=e.rotationQuaternion,this},e.prototype.buildMeshGeometry=function(e,t,i){var n=this.matrix.clone();n.invert();var r,o,c,l=new be.a(e,t),u=[],h=[],d=[],f=null,p=null,_=a.e.Zero(),m=a.e.Zero(),g=a.d.Zero(),v=new s.b(0,0,0,0),b=this.polygons,y=[0,0,0],T={},E=0,S={};i&&b.sort(function(e,t){return e.shared.meshId===t.shared.meshId?e.shared.subMeshId-t.shared.subMeshId:e.shared.meshId-t.shared.meshId});for(var A=0,P=b.length;A<P;A++){S[(r=b[A]).shared.meshId]||(S[r.shared.meshId]={}),S[r.shared.meshId][r.shared.subMeshId]||(S[r.shared.meshId][r.shared.subMeshId]={indexStart:1/0,indexEnd:-1/0,materialIndex:r.shared.materialIndex}),c=S[r.shared.meshId][r.shared.subMeshId];for(var C=2,R=r.vertices.length;C<R;C++){y[0]=0,y[1]=C-1,y[2]=C;for(var x=0;x<3;x++){_.copyFrom(r.vertices[y[x]].pos),m.copyFrom(r.vertices[y[x]].normal),r.vertices[y[x]].uv&&(f||(f=[]),g.copyFrom(r.vertices[y[x]].uv)),r.vertices[y[x]].vertColor&&(p||(p=[]),v.copyFrom(r.vertices[y[x]].vertColor));var O=a.e.TransformCoordinates(_,n),M=a.e.TransformNormal(m,n);o=T[O.x+","+O.y+","+O.z];var I=!1;f&&f[2*o]!==g.x&&f[2*o+1]!==g.y&&(I=!0);var D=!1;p&&p[4*o]!==v.r&&p[4*o+1]!==v.g&&p[4*o+2]!==v.b&&p[4*o+3]!==v.a&&(D=!0),(void 0===o||d[3*o]!==M.x||d[3*o+1]!==M.y||d[3*o+2]!==M.z||I||D)&&(u.push(O.x,O.y,O.z),f&&f.push(g.x,g.y),d.push(m.x,m.y,m.z),p&&p.push(v.r,v.g,v.b,v.a),o=T[O.x+","+O.y+","+O.z]=u.length/3-1),h.push(o),c.indexStart=Math.min(E,c.indexStart),c.indexEnd=Math.max(E,c.indexEnd),E++}}}if(l.setVerticesData(ji.b.PositionKind,u),l.setVerticesData(ji.b.NormalKind,d),f&&l.setVerticesData(ji.b.UVKind,f),p&&l.setVerticesData(ji.b.ColorKind,p),l.setIndices(h,null),i){var N,L=0;for(var w in l.subMeshes=new Array,S){for(var F in N=-1,S[w])c=S[w][F],jl.a.CreateFromIndices(c.materialIndex+L,c.indexStart,c.indexEnd-c.indexStart+1,l),N=Math.max(c.materialIndex,N);L+=++N}}return l},e.prototype.toMesh=function(e,t,i,n){void 0===t&&(t=null);var r=this.buildMeshGeometry(e,i,n);return r.material=t,r.position.copyFrom(this.position),r.rotation.copyFrom(this.rotation),this.rotationQuaternion&&(r.rotationQuaternion=this.rotationQuaternion.clone()),r.scaling.copyFrom(this.scaling),r.computeWorldMatrix(!0),r},e}(),ql=function(e){function t(t,i,n,r,o,s){void 0===r&&(r=1),void 0===o&&(o=60),void 0===s&&(s=!0);var c=e.call(this,t,n)||this;c._sectionPolygonPointsCount=4,c._running=!1,c._autoStart=s,c._generator=i,c._diameter=r,c._length=o,c._sectionVectors=[],c._sectionNormalVectors=[];for(var l=0;l<c._sectionPolygonPointsCount;l++)c._sectionVectors[l]=a.e.Zero(),c._sectionNormalVectors[l]=a.e.Zero();return c._createMesh(),c}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"TrailMesh"},t.prototype._createMesh=function(){var e=new zi.a,t=[],i=[],n=[],r=a.e.Zero();r=this._generator instanceof ze.a&&this._generator._boundingInfo?this._generator._boundingInfo.boundingBox.centerWorld:this._generator.position;for(var o=2*Math.PI/this._sectionPolygonPointsCount,s=0;s<this._sectionPolygonPointsCount;s++)t.push(r.x+Math.cos(s*o)*this._diameter,r.y+Math.sin(s*o)*this._diameter,r.z);for(s=1;s<=this._length;s++){for(var c=0;c<this._sectionPolygonPointsCount;c++)t.push(r.x+Math.cos(c*o)*this._diameter,r.y+Math.sin(c*o)*this._diameter,r.z);var l=t.length/3-2*this._sectionPolygonPointsCount;for(c=0;c<this._sectionPolygonPointsCount-1;c++)n.push(l+c,l+c+this._sectionPolygonPointsCount,l+c+this._sectionPolygonPointsCount+1),n.push(l+c,l+c+this._sectionPolygonPointsCount+1,l+c+1);n.push(l+this._sectionPolygonPointsCount-1,l+this._sectionPolygonPointsCount-1+this._sectionPolygonPointsCount,l+this._sectionPolygonPointsCount),n.push(l+this._sectionPolygonPointsCount-1,l+this._sectionPolygonPointsCount,l)}zi.a.ComputeNormals(t,n,i),e.positions=t,e.normals=i,e.indices=n,e.applyToMesh(this,!0),this._autoStart&&this.start()},t.prototype.start=function(){var e=this;this._running||(this._running=!0,this._beforeRenderObserver=this.getScene().onBeforeRenderObservable.add(function(){e.update()}))},t.prototype.stop=function(){this._beforeRenderObserver&&this._running&&(this._running=!1,this.getScene().onBeforeRenderObservable.remove(this._beforeRenderObserver))},t.prototype.update=function(){var e=this.getVerticesData(ji.b.PositionKind),t=this.getVerticesData(ji.b.NormalKind),i=this._generator.getWorldMatrix();if(e&&t){for(var n=3*this._sectionPolygonPointsCount;n<e.length;n++)e[n-3*this._sectionPolygonPointsCount]=e[n]-t[n]/this._length*this._diameter;for(n=3*this._sectionPolygonPointsCount;n<t.length;n++)t[n-3*this._sectionPolygonPointsCount]=t[n];var r=e.length-3*this._sectionPolygonPointsCount,o=2*Math.PI/this._sectionPolygonPointsCount;for(n=0;n<this._sectionPolygonPointsCount;n++)this._sectionVectors[n].copyFromFloats(Math.cos(n*o)*this._diameter,Math.sin(n*o)*this._diameter,0),this._sectionNormalVectors[n].copyFromFloats(Math.cos(n*o),Math.sin(n*o),0),a.e.TransformCoordinatesToRef(this._sectionVectors[n],i,this._sectionVectors[n]),a.e.TransformNormalToRef(this._sectionNormalVectors[n],i,this._sectionNormalVectors[n]);for(n=0;n<this._sectionPolygonPointsCount;n++)e[r+3*n]=this._sectionVectors[n].x,e[r+3*n+1]=this._sectionVectors[n].y,e[r+3*n+2]=this._sectionVectors[n].z,t[r+3*n]=this._sectionNormalVectors[n].x,t[r+3*n+1]=this._sectionNormalVectors[n].y,t[r+3*n+2]=this._sectionNormalVectors[n].z;this.updateVerticesData(ji.b.PositionKind,e,!0,!1),this.updateVerticesData(ji.b.NormalKind,t,!0,!1)}},t.prototype.clone=function(e,i){return void 0===e&&(e=""),new t(e,void 0===i?this._generator:i,this.getScene(),this._diameter,this._length,this._autoStart)},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t)},t.Parse=function(e,i){return new t(e.name,e._generator,i,e._diameter,e._length,e._autoStart)},t}(be.a),Zl=i(151),Jl=i(98),$l=i(82);zi.a.CreateDisc=function(e){var t=new Array,i=new Array,n=new Array,r=new Array,o=e.radius||.5,a=e.tessellation||64,s=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,c=0===e.sideOrientation?0:e.sideOrientation||zi.a.DEFAULTSIDE;t.push(0,0,0),r.push(.5,.5);for(var l=2*Math.PI*s,u=1===s?l/a:l/(a-1),h=0,d=0;d<a;d++){var f=Math.cos(h),p=Math.sin(h),_=(f+1)/2,m=(1-p)/2;t.push(o*f,o*p,0),r.push(_,m),h+=u}1===s&&(t.push(t[3],t[4],t[5]),r.push(r[2],r[3]));for(var g=t.length/3,v=1;v<g-1;v++)i.push(v+1,0,v);zi.a.ComputeNormals(t,i,n),zi.a._ComputeSides(c,t,i,n,r,e.frontUVs,e.backUVs);var b=new zi.a;return b.indices=i,b.positions=t,b.normals=n,b.uvs=r,b},be.a.CreateDisc=function(e,t,i,n,r,o){void 0===n&&(n=null);var a={radius:t,tessellation:i,sideOrientation:o,updatable:r};return eu.CreateDisc(e,a,n)};var eu=function(){function e(){}return e.CreateDisc=function(e,t,i){void 0===i&&(i=null);var n=new be.a(e,i);return t.sideOrientation=be.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,zi.a.CreateDisc(t).applyToMesh(n,t.updatable),n},e}();zi.a.CreateTiledBox=function(e){for(var t=e.faceUV||new Array(6),i=e.faceColors,n=e.pattern||be.a.NO_FLIP,r=e.width||e.size||1,o=e.height||e.size||1,c=e.depth||e.size||1,l=e.tileWidth||e.tileSize||1,u=e.tileHeight||e.tileSize||1,h=e.alignHorizontal||0,d=e.alignVertical||0,f=0===e.sideOrientation?0:e.sideOrientation||zi.a.DEFAULTSIDE,p=0;p<6;p++)void 0===t[p]&&(t[p]=new a.f(0,0,1,1)),i&&void 0===i[p]&&(i[p]=new s.b(1,1,1,1));var _=r/2,m=o/2,g=c/2,v=[];for(p=0;p<2;p++)v[p]=zi.a.CreateTiledPlane({pattern:n,tileWidth:l,tileHeight:u,width:r,height:o,alignVertical:d,alignHorizontal:h,sideOrientation:f});for(p=2;p<4;p++)v[p]=zi.a.CreateTiledPlane({pattern:n,tileWidth:l,tileHeight:u,width:c,height:o,alignVertical:d,alignHorizontal:h,sideOrientation:f});var b=d;for(d===be.a.BOTTOM?b=be.a.TOP:d===be.a.TOP&&(b=be.a.BOTTOM),p=4;p<6;p++)v[p]=zi.a.CreateTiledPlane({pattern:n,tileWidth:l,tileHeight:u,width:r,height:c,alignVertical:b,alignHorizontal:h,sideOrientation:f});var y=[],T=[],E=[],S=[],A=[],P=[],C=[],R=[],x=0,O=0,M=0;for(p=0;p<6;p++){x=v[p].positions.length,P[p]=[],C[p]=[];for(var I=0;I<x/3;I++)P[p].push(new a.e(v[p].positions[3*I],v[p].positions[3*I+1],v[p].positions[3*I+2])),C[p].push(new a.e(v[p].normals[3*I],v[p].normals[3*I+1],v[p].normals[3*I+2]));O=v[p].uvs.length,R[p]=[];for(var D=0;D<O;D+=2)R[p][D]=t[p].x+(t[p].z-t[p].x)*v[p].uvs[D],R[p][D+1]=t[p].y+(t[p].w-t[p].y)*v[p].uvs[D+1];if(E=E.concat(R[p]),S=S.concat(v[p].indices.map(function(e){return e+M})),M+=P[p].length,i)for(var N=0;N<4;N++)A.push(i[p].r,i[p].g,i[p].b,i[p].a)}var L=new a.e(0,0,g),w=a.a.RotationY(Math.PI);y=P[0].map(function(e){return a.e.TransformNormal(e,w).add(L)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[]),T=C[0].map(function(e){return a.e.TransformNormal(e,w)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[]),y=y.concat(P[1].map(function(e){return e.subtract(L)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[])),T=T.concat(C[1].map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[]));var F=new a.e(_,0,0),B=a.a.RotationY(-Math.PI/2);y=y.concat(P[2].map(function(e){return a.e.TransformNormal(e,B).add(F)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[])),T=T.concat(C[2].map(function(e){return a.e.TransformNormal(e,B)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[]));var U=a.a.RotationY(Math.PI/2);y=y.concat(P[3].map(function(e){return a.e.TransformNormal(e,U).subtract(F)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[])),T=T.concat(C[3].map(function(e){return a.e.TransformNormal(e,U)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[]));var V=new a.e(0,m,0),k=a.a.RotationX(Math.PI/2);y=y.concat(P[4].map(function(e){return a.e.TransformNormal(e,k).add(V)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[])),T=T.concat(C[4].map(function(e){return a.e.TransformNormal(e,k)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[]));var G=a.a.RotationX(-Math.PI/2);y=y.concat(P[5].map(function(e){return a.e.TransformNormal(e,G).subtract(V)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[])),T=T.concat(C[5].map(function(e){return a.e.TransformNormal(e,G)}).map(function(e){return[e.x,e.y,e.z]}).reduce(function(e,t){return e.concat(t)},[])),zi.a._ComputeSides(f,y,S,T,E);var z=new zi.a;if(z.indices=S,z.positions=y,z.normals=T,z.uvs=E,i){var j=f===zi.a.DOUBLESIDE?A.concat(A):A;z.colors=j}return z};var tu=function(){function e(){}return e.CreateTiledBox=function(e,t,i){void 0===i&&(i=null);var n=new be.a(e,i);return t.sideOrientation=be.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,zi.a.CreateTiledBox(t).applyToMesh(n,t.updatable),n},e}();zi.a.CreateTorusKnot=function(e){var t,i,n=new Array,r=new Array,o=new Array,s=new Array,c=e.radius||2,l=e.tube||.5,u=e.radialSegments||32,h=e.tubularSegments||32,d=e.p||2,f=e.q||3,p=0===e.sideOrientation?0:e.sideOrientation||zi.a.DEFAULTSIDE,_=function(e){var t=Math.cos(e),i=Math.sin(e),n=f/d*e,r=Math.cos(n),o=c*(2+r)*.5*t,s=c*(2+r)*i*.5,l=c*Math.sin(n)*.5;return new a.e(o,s,l)};for(t=0;t<=u;t++){var m=t%u/u*2*d*Math.PI,g=_(m),v=_(m+.01),b=v.subtract(g),y=v.add(g),T=a.e.Cross(b,y);for(y=a.e.Cross(T,b),T.normalize(),y.normalize(),i=0;i<h;i++){var E=i%h/h*2*Math.PI,S=-l*Math.cos(E),A=l*Math.sin(E);r.push(g.x+S*y.x+A*T.x),r.push(g.y+S*y.y+A*T.y),r.push(g.z+S*y.z+A*T.z),s.push(t/u),s.push(i/h)}}for(t=0;t<u;t++)for(i=0;i<h;i++){var P=(i+1)%h,C=t*h+i,R=(t+1)*h+i,x=(t+1)*h+P,O=t*h+P;n.push(O),n.push(R),n.push(C),n.push(O),n.push(x),n.push(R)}zi.a.ComputeNormals(r,n,o),zi.a._ComputeSides(p,r,n,o,s,e.frontUVs,e.backUVs);var M=new zi.a;return M.indices=n,M.positions=r,M.normals=o,M.uvs=s,M},be.a.CreateTorusKnot=function(e,t,i,n,r,o,a,s,c,l){var u={radius:t,tube:i,radialSegments:n,tubularSegments:r,p:o,q:a,sideOrientation:l,updatable:c};return iu.CreateTorusKnot(e,u,s)};var iu=function(){function e(){}return e.CreateTorusKnot=function(e,t,i){var n=new be.a(e,i);return t.sideOrientation=be.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,zi.a.CreateTorusKnot(t).applyToMesh(n,t.updatable),n},e}(),nu=function(e){function t(t,i){var n=e.call(this,t.x,t.y)||this;return n.index=i,n}return Object(h.d)(t,e),t}(a.d),ru=function(){function e(){this.elements=new Array}return e.prototype.add=function(e){var t=this,i=new Array;return e.forEach(function(e){var n=new nu(e,t.elements.length);i.push(n),t.elements.push(n)}),i},e.prototype.computeBounds=function(){var e=new a.d(this.elements[0].x,this.elements[0].y),t=new a.d(this.elements[0].x,this.elements[0].y);return this.elements.forEach(function(i){i.x<e.x?e.x=i.x:i.x>t.x&&(t.x=i.x),i.y<e.y?e.y=i.y:i.y>t.y&&(t.y=i.y)}),{min:e,max:t,width:t.x-e.x,height:t.y-e.y}},e}(),ou=function(){function e(){}return e.Rectangle=function(e,t,i,n){return[new a.d(e,t),new a.d(i,t),new a.d(i,n),new a.d(e,n)]},e.Circle=function(e,t,i,n){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=32);for(var r=new Array,o=0,s=2*Math.PI/n,c=0;c<n;c++)r.push(new a.d(t+Math.cos(o)*e,i+Math.sin(o)*e)),o-=s;return r},e.Parse=function(e){var t,i=e.split(/[^-+eE\.\d]+/).map(parseFloat).filter(function(e){return!isNaN(e)}),n=[];for(t=0;t<(2147483646&i.length);t+=2)n.push(new a.d(i[t],i[t+1]));return n},e.StartingAt=function(e,t){return re.f.StartingAt(e,t)},e}(),au=function(){function e(e,t,i,n){var r;void 0===n&&(n=earcut),this._points=new ru,this._outlinepoints=new ru,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=n,this._name=e,this._scene=i||Se.a.LastCreatedScene,r=t instanceof re.f?t.getPoints():t,this._addToepoint(r),this._points.add(r),this._outlinepoints.add(r),void 0===this.bjsEarcut&&m.a.Warn("Earcut was not found, the polygon will not be built.")}return e.prototype._addToepoint=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];this._epoints.push(n.x,n.y)}},e.prototype.addHole=function(e){this._points.add(e);var t=new ru;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this},e.prototype.build=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=0);var i=new be.a(this._name,this._scene),n=this.buildVertexData(t);return i.setVerticesData(ji.b.PositionKind,n.positions,e),i.setVerticesData(ji.b.NormalKind,n.normals,e),i.setVerticesData(ji.b.UVKind,n.uvs,e),i.setIndices(n.indices),i},e.prototype.buildVertexData=function(e){var t=this;void 0===e&&(e=0);var i=new zi.a,n=new Array,r=new Array,o=new Array,a=this._points.computeBounds();this._points.elements.forEach(function(e){n.push(0,1,0),r.push(e.x,0,e.y),o.push((e.x-a.min.x)/a.width,(e.y-a.min.y)/a.height)});for(var s=new Array,c=this.bjsEarcut(this._epoints,this._eholes,2),l=0;l<c.length;l++)s.push(c[l]);if(e>0){var u=r.length/3;this._points.elements.forEach(function(t){n.push(0,-1,0),r.push(t.x,-e,t.y),o.push(1-(t.x-a.min.x)/a.width,1-(t.y-a.min.y)/a.height)});var h=s.length;for(l=0;l<h;l+=3){var d=s[l+0],f=s[l+1],p=s[l+2];s.push(p+u),s.push(f+u),s.push(d+u)}this.addSide(r,n,o,s,a,this._outlinepoints,e,!1),this._holes.forEach(function(i){t.addSide(r,n,o,s,a,i,e,!0)})}return i.indices=s,i.positions=r,i.normals=n,i.uvs=o,i},e.prototype.addSide=function(e,t,i,n,r,o,s,c){for(var l=e.length/3,u=0,h=0;h<o.elements.length;h++){var d,f=o.elements[h];d=h+1>o.elements.length-1?o.elements[0]:o.elements[h+1],e.push(f.x,0,f.y),e.push(f.x,-s,f.y),e.push(d.x,0,d.y),e.push(d.x,-s,d.y);var p=new a.e(f.x,0,f.y),_=new a.e(d.x,0,d.y).subtract(p),m=new a.e(0,1,0),g=a.e.Cross(_,m);g=g.normalize(),i.push(u/r.width,0),i.push(u/r.width,1),u+=_.length(),i.push(u/r.width,0),i.push(u/r.width,1),c?(t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),n.push(l),n.push(l+2),n.push(l+1),n.push(l+1),n.push(l+2),n.push(l+3)):(t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),n.push(l),n.push(l+1),n.push(l+2),n.push(l+1),n.push(l+3),n.push(l+2)),l+=4}},e}();zi.a.CreatePolygon=function(e,t,i,n,r,o,c){for(var l=i||new Array(3),u=n,h=[],d=c||!1,f=0;f<3;f++)void 0===l[f]&&(l[f]=new a.f(0,0,1,1)),u&&void 0===u[f]&&(u[f]=new s.b(1,1,1,1));var p=e.getVerticesData(ji.b.PositionKind),_=e.getVerticesData(ji.b.NormalKind),m=e.getVerticesData(ji.b.UVKind),g=e.getIndices(),v=p.length/9,b=0,y=0,T=0,E=0,S=[0];if(d)for(var A=v;A<p.length/3;A+=4)y=p[3*(A+2)]-p[3*A],T=p[3*(A+2)+2]-p[3*A+2],E+=Math.sqrt(y*y+T*T),S.push(E);A=0;for(var P=0,C=0;C<_.length;C+=3)Math.abs(_[C+1])<.001&&(P=1),Math.abs(_[C+1]-1)<.001&&(P=0),Math.abs(_[C+1]+1)<.001&&(P=2),A=C/3,1===P?(b=A-v,m[2*A]=b%4<1.5?d?l[P].x+(l[P].z-l[P].x)*S[Math.floor(b/4)]/E:l[P].x:d?l[P].x+(l[P].z-l[P].x)*S[Math.floor(b/4)+1]/E:l[P].z,m[2*A+1]=b%2==0?l[P].w:l[P].y):(m[2*A]=(1-m[2*A])*l[P].x+m[2*A]*l[P].z,m[2*A+1]=(1-m[2*A+1])*l[P].y+m[2*A+1]*l[P].w),u&&h.push(u[P].r,u[P].g,u[P].b,u[P].a);zi.a._ComputeSides(t,p,g,_,m,r,o);var R=new zi.a;if(R.indices=g,R.positions=p,R.normals=_,R.uvs=m,u){var x=t===zi.a.DOUBLESIDE?h.concat(h):h;R.colors=x}return R},be.a.CreatePolygon=function(e,t,i,n,r,o,a){void 0===a&&(a=earcut);var s={shape:t,holes:n,updatable:r,sideOrientation:o};return su.CreatePolygon(e,s,i,a)},be.a.ExtrudePolygon=function(e,t,i,n,r,o,a,s){void 0===s&&(s=earcut);var c={shape:t,holes:r,depth:i,updatable:o,sideOrientation:a};return su.ExtrudePolygon(e,c,n,s)};var su=function(){function e(){}return e.CreatePolygon=function(e,t,i,n){void 0===i&&(i=null),void 0===n&&(n=earcut),t.sideOrientation=be.a._GetDefaultSideOrientation(t.sideOrientation);for(var r=t.shape,o=t.holes||[],s=t.depth||0,c=[],l=[],u=0;u<r.length;u++)c[u]=new a.d(r[u].x,r[u].z);c[0].equalsWithEpsilon(c[c.length-1],1e-8)&&c.pop();for(var h=new au(e,c,i||x.a.LastCreatedScene,n),d=0;d<o.length;d++){l=[];for(var f=0;f<o[d].length;f++)l.push(new a.d(o[d][f].x,o[d][f].z));h.addHole(l)}var p=h.build(t.updatable,s);return p._originalBuilderSideOrientation=t.sideOrientation,zi.a.CreatePolygon(p,t.sideOrientation,t.faceUV,t.faceColors,t.frontUVs,t.backUVs,t.wrap).applyToMesh(p,t.updatable),p},e.ExtrudePolygon=function(t,i,n,r){return void 0===n&&(n=null),void 0===r&&(r=earcut),e.CreatePolygon(t,i,n,r)},e}();be.a.CreateLathe=function(e,t,i,n,r,o,a){var s={shape:t,radius:i,tessellation:n,sideOrientation:a,updatable:o};return cu.CreateLathe(e,s,r)};var cu=function(){function e(){}return e.CreateLathe=function(e,t,i){void 0===i&&(i=null);var n,r=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,o=void 0===t.closed||t.closed,s=t.shape,c=t.radius||1,l=t.tessellation||64,u=t.clip||0,h=t.updatable,d=be.a._GetDefaultSideOrientation(t.sideOrientation),f=t.cap||be.a.NO_CAP,p=2*Math.PI,_=new Array,m=t.invertUV||!1,g=0,v=0,b=p/l*r,y=new Array;for(g=0;g<=l-u;g++){for(y=[],f!=be.a.CAP_START&&f!=be.a.CAP_ALL||(y.push(new a.e(0,s[0].y,0)),y.push(new a.e(Math.cos(g*b)*s[0].x*c,s[0].y,Math.sin(g*b)*s[0].x*c))),v=0;v<s.length;v++)n=new a.e(Math.cos(g*b)*s[v].x*c,s[v].y,Math.sin(g*b)*s[v].x*c),y.push(n);f!=be.a.CAP_END&&f!=be.a.CAP_ALL||(y.push(new a.e(Math.cos(g*b)*s[s.length-1].x*c,s[s.length-1].y,Math.sin(g*b)*s[s.length-1].x*c)),y.push(new a.e(0,s[s.length-1].y,0))),_.push(y)}return $l.a.CreateRibbon(e,{pathArray:_,closeArray:o,sideOrientation:d,updatable:h,invertUV:m,frontUVs:t.frontUVs,backUVs:t.backUVs},i)},e}();zi.a.CreateTiledPlane=function(e){var t=e.pattern||be.a.NO_FLIP,i=e.tileWidth||e.tileSize||1,n=e.tileHeight||e.tileSize||1,r=e.alignHorizontal||0,o=e.alignVertical||0,a=e.width||e.size||1,s=Math.floor(a/i),c=a-s*i,l=e.height||e.size||1,u=Math.floor(l/n),h=l-u*n,d=i*s/2,f=n*u/2,p=0,_=0,m=0,g=0,v=0,b=0;if(c>0||h>0){switch(m=-d,g=-f,v=d,b=f,r){case be.a.CENTER:m-=c/=2,v+=c;break;case be.a.LEFT:v+=c,p=-c/2;break;case be.a.RIGHT:m-=c,p=c/2}switch(o){case be.a.CENTER:g-=h/=2,b+=h;break;case be.a.BOTTOM:b+=h,_=-h/2;break;case be.a.TOP:g-=h,_=h/2}}var y=[],T=[],E=[];E[0]=[0,0,1,0,1,1,0,1],E[1]=[0,0,1,0,1,1,0,1],t!==be.a.ROTATE_TILE&&t!==be.a.ROTATE_ROW||(E[1]=[1,1,0,1,0,0,1,0]),t!==be.a.FLIP_TILE&&t!==be.a.FLIP_ROW||(E[1]=[1,0,0,0,0,1,1,1]),t!==be.a.FLIP_N_ROTATE_TILE&&t!==be.a.FLIP_N_ROTATE_ROW||(E[1]=[0,1,1,1,1,0,0,0]);for(var S=[],A=[],P=[],C=0,R=0;R<u;R++)for(var x=0;x<s;x++)y.push(x*i-d+p,R*n-f+_,0),y.push((x+1)*i-d+p,R*n-f+_,0),y.push((x+1)*i-d+p,(R+1)*n-f+_,0),y.push(x*i-d+p,(R+1)*n-f+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),S=t===be.a.FLIP_TILE||t===be.a.ROTATE_TILE||t===be.a.FLIP_N_ROTATE_TILE?S.concat(E[(x%2+R%2)%2]):t===be.a.FLIP_ROW||t===be.a.ROTATE_ROW||t===be.a.FLIP_N_ROTATE_ROW?S.concat(E[R%2]):S.concat(E[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),C+=4;if(c>0||h>0){var O,M,I,D,N=h>0&&(o===be.a.CENTER||o===be.a.TOP),L=h>0&&(o===be.a.CENTER||o===be.a.BOTTOM),w=c>0&&(r===be.a.CENTER||r===be.a.RIGHT),F=c>0&&(r===be.a.CENTER||r===be.a.LEFT),B=[];if(N&&w&&(y.push(m+p,g+_,0),y.push(-d+p,g+_,0),y.push(-d+p,g+h+_,0),y.push(m+p,g+h+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,B=[O=1-c/i,M=1-h/n,I=1,M,I,D=1,O,D],t===be.a.ROTATE_ROW&&(B=[1-O,1-M,1-I,1-M,1-I,1-D,1-O,1-D]),t===be.a.FLIP_ROW&&(B=[1-O,M,1-I,M,1-I,D,1-O,D]),t===be.a.FLIP_N_ROTATE_ROW&&(B=[O,1-M,I,1-M,I,1-D,O,1-D]),S=S.concat(B),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),N&&F&&(y.push(d+p,g+_,0),y.push(v+p,g+_,0),y.push(v+p,g+h+_,0),y.push(d+p,g+h+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,B=[O=0,M=1-h/n,I=c/i,M,I,D=1,O,D],(t===be.a.ROTATE_ROW||t===be.a.ROTATE_TILE&&s%2==0)&&(B=[1-O,1-M,1-I,1-M,1-I,1-D,1-O,1-D]),(t===be.a.FLIP_ROW||t===be.a.FLIP_TILE&&s%2==0)&&(B=[1-O,M,1-I,M,1-I,D,1-O,D]),(t===be.a.FLIP_N_ROTATE_ROW||t===be.a.FLIP_N_ROTATE_TILE&&s%2==0)&&(B=[O,1-M,I,1-M,I,1-D,O,1-D]),S=S.concat(B),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L&&w&&(y.push(m+p,f+_,0),y.push(-d+p,f+_,0),y.push(-d+p,b+_,0),y.push(m+p,b+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,B=[O=1-c/i,M=0,I=1,M,I,D=h/n,O,D],(t===be.a.ROTATE_ROW&&u%2==1||t===be.a.ROTATE_TILE&&u%1==0)&&(B=[1-O,1-M,1-I,1-M,1-I,1-D,1-O,1-D]),(t===be.a.FLIP_ROW&&u%2==1||t===be.a.FLIP_TILE&&u%2==0)&&(B=[1-O,M,1-I,M,1-I,D,1-O,D]),(t===be.a.FLIP_N_ROTATE_ROW&&u%2==1||t===be.a.FLIP_N_ROTATE_TILE&&u%2==0)&&(B=[O,1-M,I,1-M,I,1-D,O,1-D]),S=S.concat(B),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L&&F&&(y.push(d+p,f+_,0),y.push(v+p,f+_,0),y.push(v+p,b+_,0),y.push(d+p,b+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,B=[O=0,M=0,I=c/i,M,I,D=h/n,O,D],(t===be.a.ROTATE_ROW&&u%2==1||t===be.a.ROTATE_TILE&&(u+s)%2==1)&&(B=[1-O,1-M,1-I,1-M,1-I,1-D,1-O,1-D]),(t===be.a.FLIP_ROW&&u%2==1||t===be.a.FLIP_TILE&&(u+s)%2==1)&&(B=[1-O,M,1-I,M,1-I,D,1-O,D]),(t===be.a.FLIP_N_ROTATE_ROW&&u%2==1||t===be.a.FLIP_N_ROTATE_TILE&&(u+s)%2==1)&&(B=[O,1-M,I,1-M,I,1-D,O,1-D]),S=S.concat(B),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),N){var U=[];for(O=0,M=1-h/n,I=1,D=1,U[0]=[O,M,I,M,I,D,O,D],U[1]=[O,M,I,M,I,D,O,D],t!==be.a.ROTATE_TILE&&t!==be.a.ROTATE_ROW||(U[1]=[1-O,1-M,1-I,1-M,1-I,1-D,1-O,1-D]),t!==be.a.FLIP_TILE&&t!==be.a.FLIP_ROW||(U[1]=[1-O,M,1-I,M,1-I,D,1-O,D]),t!==be.a.FLIP_N_ROTATE_TILE&&t!==be.a.FLIP_N_ROTATE_ROW||(U[1]=[O,1-M,I,1-M,I,1-D,O,1-D]),x=0;x<s;x++)y.push(x*i-d+p,g+_,0),y.push((x+1)*i-d+p,g+_,0),y.push((x+1)*i-d+p,g+h+_,0),y.push(x*i-d+p,g+h+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,S=t===be.a.FLIP_TILE||t===be.a.ROTATE_TILE||t===be.a.FLIP_N_ROTATE_TILE?S.concat(U[(x+1)%2]):t===be.a.FLIP_ROW||t===be.a.ROTATE_ROW||t===be.a.FLIP_N_ROTATE_ROW?S.concat(U[1]):S.concat(U[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(L){var V=[];for(O=0,M=0,I=1,D=h/n,V[0]=[O,M,I,M,I,D,O,D],V[1]=[O,M,I,M,I,D,O,D],t!==be.a.ROTATE_TILE&&t!==be.a.ROTATE_ROW||(V[1]=[1-O,1-M,1-I,1-M,1-I,1-D,1-O,1-D]),t!==be.a.FLIP_TILE&&t!==be.a.FLIP_ROW||(V[1]=[1-O,M,1-I,M,1-I,D,1-O,D]),t!==be.a.FLIP_N_ROTATE_TILE&&t!==be.a.FLIP_N_ROTATE_ROW||(V[1]=[O,1-M,I,1-M,I,1-D,O,1-D]),x=0;x<s;x++)y.push(x*i-d+p,b-h+_,0),y.push((x+1)*i-d+p,b-h+_,0),y.push((x+1)*i-d+p,b+_,0),y.push(x*i-d+p,b+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,S=t===be.a.FLIP_TILE||t===be.a.ROTATE_TILE||t===be.a.FLIP_N_ROTATE_TILE?S.concat(V[(x+u)%2]):t===be.a.FLIP_ROW||t===be.a.ROTATE_ROW||t===be.a.FLIP_N_ROTATE_ROW?S.concat(V[u%2]):S.concat(V[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(w){var k=[];for(O=1-c/i,M=0,I=1,D=1,k[0]=[O,M,I,M,I,D,O,D],k[1]=[O,M,I,M,I,D,O,D],t!==be.a.ROTATE_TILE&&t!==be.a.ROTATE_ROW||(k[1]=[1-O,1-M,1-I,1-M,1-I,1-D,1-O,1-D]),t!==be.a.FLIP_TILE&&t!==be.a.FLIP_ROW||(k[1]=[1-O,M,1-I,M,1-I,D,1-O,D]),t!==be.a.FLIP_N_ROTATE_TILE&&t!==be.a.FLIP_N_ROTATE_ROW||(k[1]=[O,1-M,I,1-M,I,1-D,O,1-D]),R=0;R<u;R++)y.push(m+p,R*n-f+_,0),y.push(m+c+p,R*n-f+_,0),y.push(m+c+p,(R+1)*n-f+_,0),y.push(m+p,(R+1)*n-f+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,S=t===be.a.FLIP_TILE||t===be.a.ROTATE_TILE||t===be.a.FLIP_N_ROTATE_TILE?S.concat(k[(R+1)%2]):t===be.a.FLIP_ROW||t===be.a.ROTATE_ROW||t===be.a.FLIP_N_ROTATE_ROW?S.concat(k[R%2]):S.concat(k[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(F){var G=[];for(O=0,M=0,I=c/n,D=1,G[0]=[O,M,I,M,I,D,O,D],G[1]=[O,M,I,M,I,D,O,D],t!==be.a.ROTATE_TILE&&t!==be.a.ROTATE_ROW||(G[1]=[1-O,1-M,1-I,1-M,1-I,1-D,1-O,1-D]),t!==be.a.FLIP_TILE&&t!==be.a.FLIP_ROW||(G[1]=[1-O,M,1-I,M,1-I,D,1-O,D]),t!==be.a.FLIP_N_ROTATE_TILE&&t!==be.a.FLIP_N_ROTATE_ROW||(G[1]=[O,1-M,I,1-M,I,1-D,O,1-D]),R=0;R<u;R++)y.push(v-c+p,R*n-f+_,0),y.push(v+p,R*n-f+_,0),y.push(v+p,(R+1)*n-f+_,0),y.push(v-c+p,(R+1)*n-f+_,0),P.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,S=t===be.a.FLIP_TILE||t===be.a.ROTATE_TILE||t===be.a.FLIP_N_ROTATE_TILE?S.concat(G[(R+s)%2]):t===be.a.FLIP_ROW||t===be.a.ROTATE_ROW||t===be.a.FLIP_N_ROTATE_ROW?S.concat(G[R%2]):S.concat(G[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}var z=0===e.sideOrientation?0:e.sideOrientation||zi.a.DEFAULTSIDE;zi.a._ComputeSides(z,y,P,T,S,e.frontUVs,e.backUVs);var j=new zi.a;j.indices=P,j.positions=y,j.normals=T,j.uvs=S;var W=z===zi.a.DOUBLESIDE?A.concat(A):A;return j.colors=W,j};var lu=function(){function e(){}return e.CreateTiledPlane=function(e,t,i){void 0===i&&(i=null);var n=new be.a(e,i);return t.sideOrientation=be.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,zi.a.CreateTiledPlane(t).applyToMesh(n,t.updatable),n},e}();be.a.CreateTube=function(e,t,i,n,r,o,a,s,c,l){var u={path:t,radius:i,tessellation:n,radiusFunction:r,arc:1,cap:o,updatable:s,sideOrientation:c,instance:l};return uu.CreateTube(e,u,a)};var uu=function(){function e(){}return e.CreateTube=function(e,t,i){void 0===i&&(i=null);var n=t.path,r=t.instance,o=1;void 0!==t.radius?o=t.radius:r&&(o=r._creationDataStorage.radius);var s=t.tessellation||64,c=t.radiusFunction||null,l=t.cap||be.a.NO_CAP,u=t.invertUV||!1,h=t.updatable,d=be.a._GetDefaultSideOrientation(t.sideOrientation);t.arc=t.arc&&(t.arc<=0||t.arc>1)?1:t.arc||1;var f,p,_=function(e,t,i,n,r,o,s,c){for(var l,u,h,d,f=t.getTangents(),p=t.getNormals(),_=t.getDistances(),m=2*Math.PI/r*c,g=o||function(){return n},v=a.c.Matrix[0],b=s===be.a.NO_CAP||s===be.a.CAP_END?0:2,y=0;y<e.length;y++){u=g(y,_[y]),l=Array(),h=p[y];for(var T=0;T<r;T++)a.a.RotationAxisToRef(f[y],m*T,v),d=l[T]?l[T]:a.e.Zero(),a.e.TransformCoordinatesToRef(h,v,d),d.scaleInPlace(u).addInPlace(e[y]),l[T]=d;i[b]=l,b++}var E=function(t,i){for(var n=Array(),r=0;r<t;r++)n.push(e[i]);return n};switch(s){case be.a.NO_CAP:break;case be.a.CAP_START:i[0]=E(r,0),i[1]=i[2].slice(0);break;case be.a.CAP_END:i[b]=i[b-1].slice(0),i[b+1]=E(r,e.length-1);break;case be.a.CAP_ALL:i[0]=E(r,0),i[1]=i[2].slice(0),i[b]=i[b-1].slice(0),i[b+1]=E(r,e.length-1)}return i};if(r){var m=r._creationDataStorage,g=t.arc||m.arc;return p=_(n,f=m.path3D.update(n),m.pathArray,o,m.tessellation,c,m.cap,g),r=$l.a.CreateRibbon("",{pathArray:p,instance:r}),m.path3D=f,m.pathArray=p,m.arc=g,m.radius=o,r}p=_(n,f=new re.g(n),new Array,o,s,c,l=l<0||l>3?0:l,t.arc);var v=$l.a.CreateRibbon(e,{pathArray:p,closePath:!0,closeArray:!1,updatable:h,sideOrientation:d,invertUV:u,frontUVs:t.frontUVs,backUVs:t.backUVs},i);return v._creationDataStorage.pathArray=p,v._creationDataStorage.path3D=f,v._creationDataStorage.tessellation=s,v._creationDataStorage.cap=l,v._creationDataStorage.arc=t.arc,v._creationDataStorage.radius=o,v},e}();zi.a.CreateIcoSphere=function(e){var t,i=e.sideOrientation||zi.a.DEFAULTSIDE,n=e.radius||1,r=void 0===e.flat||e.flat,o=e.subdivisions||4,s=e.radiusX||n,c=e.radiusY||n,l=e.radiusZ||n,u=(1+Math.sqrt(5))/2,h=[-1,u,-0,1,u,0,-1,-u,0,1,-u,0,0,-1,-u,0,1,-u,0,-1,u,0,1,u,u,0,1,u,0,-1,-u,0,1,-u,0,-1],d=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],f=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],p=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],_=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],m=new Array,g=new Array,v=new Array,b=new Array,y=0,T=new Array(3),E=new Array(3);for(t=0;t<3;t++)T[t]=a.e.Zero(),E[t]=a.d.Zero();for(var S=0;S<20;S++){for(t=0;t<3;t++){var A=d[3*S+t];T[t].copyFromFloats(h[3*f[A]],h[3*f[A]+1],h[3*f[A]+2]),T[t].normalize().scaleInPlace(n),E[t].copyFromFloats(p[2*A]*(138/1024)+60/1024+_[S]*(-40/1024),p[2*A+1]*(239/1024)+26/1024+_[S]*(20/1024))}for(var P=function(e,t,i,n){var u,h=a.e.Lerp(T[0],T[2],t/o),d=a.e.Lerp(T[1],T[2],t/o),f=o===t?T[2]:a.e.Lerp(h,d,e/(o-t));if(f.normalize(),r){var p=a.e.Lerp(T[0],T[2],n/o),_=a.e.Lerp(T[1],T[2],n/o);u=a.e.Lerp(p,_,i/(o-n))}else u=new a.e(f.x,f.y,f.z);u.x/=s,u.y/=c,u.z/=l,u.normalize();var S=a.d.Lerp(E[0],E[2],t/o),A=a.d.Lerp(E[1],E[2],t/o),P=o===t?E[2]:a.d.Lerp(S,A,e/(o-t));g.push(f.x*s,f.y*c,f.z*l),v.push(u.x,u.y,u.z),b.push(P.x,P.y),m.push(y),y++},C=0;C<o;C++)for(var R=0;R+C<o;R++)P(R,C,R+1/3,C+1/3),P(R+1,C,R+1/3,C+1/3),P(R,C+1,R+1/3,C+1/3),R+C+1<o&&(P(R+1,C,R+2/3,C+2/3),P(R+1,C+1,R+2/3,C+2/3),P(R,C+1,R+2/3,C+2/3))}zi.a._ComputeSides(i,g,m,v,b,e.frontUVs,e.backUVs);var x=new zi.a;return x.indices=m,x.positions=g,x.normals=v,x.uvs=b,x},be.a.CreateIcoSphere=function(e,t,i){return hu.CreateIcoSphere(e,t,i)};var hu=function(){function e(){}return e.CreateIcoSphere=function(e,t,i){void 0===i&&(i=null);var n=new be.a(e,i);return t.sideOrientation=be.a._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,zi.a.CreateIcoSphere(t).applyToMesh(n,t.updatable),n},e}();be.a.CreateDecal=function(e,t,i,n,r,o){var a={position:i,normal:n,size:r,angle:o};return du.CreateDecal(e,t,a)};var du=function(){function e(){}return e.CreateDecal=function(e,t,i){var n=t.getIndices(),r=t.getVerticesData(ji.b.PositionKind),o=t.getVerticesData(ji.b.NormalKind),s=i.position||a.e.Zero(),c=i.normal||a.e.Up(),l=i.size||a.e.One(),u=i.angle||0;if(!c){var h=new a.e(0,0,1),d=t.getScene().activeCamera,f=a.e.TransformCoordinates(h,d.getWorldMatrix());c=d.globalPosition.subtract(f)}var p=-Math.atan2(c.z,c.x)-Math.PI/2,_=Math.sqrt(c.x*c.x+c.z*c.z),m=Math.atan2(c.y,_),g=a.a.RotationYawPitchRoll(p,m,u).multiply(a.a.Translation(s.x,s.y,s.z)),v=a.a.Invert(g),b=t.getWorldMatrix().multiply(v),y=new zi.a;y.indices=[],y.positions=[],y.normals=[],y.uvs=[];for(var T=0,E=function(e){var t=new Ur;if(!n||!r||!o)return t;var i=n[e];return t.position=new a.e(r[3*i],r[3*i+1],r[3*i+2]),t.position=a.e.TransformCoordinates(t.position,b),t.normal=new a.e(o[3*i],o[3*i+1],o[3*i+2]),t.normal=a.e.TransformNormal(t.normal,b),t},S=function(e,t){if(0===e.length)return e;for(var i=.5*Math.abs(a.e.Dot(l,t)),n=function(e,n){var r=a.e.GetClipFactor(e.position,n.position,t,i);return new Ur(a.e.Lerp(e.position,n.position,r),a.e.Lerp(e.normal,n.normal,r))},r=new Array,o=0;o<e.length;o+=3){var s,c,u,h=null,d=null,f=null,p=null;switch(((s=a.e.Dot(e[o].position,t)-i>0)?1:0)+((c=a.e.Dot(e[o+1].position,t)-i>0)?1:0)+((u=a.e.Dot(e[o+2].position,t)-i>0)?1:0)){case 0:r.push(e[o]),r.push(e[o+1]),r.push(e[o+2]);break;case 1:if(s&&(h=e[o+1],d=e[o+2],f=n(e[o],h),p=n(e[o],d)),c){h=e[o],d=e[o+2],f=n(e[o+1],h),p=n(e[o+1],d),r.push(f),r.push(d.clone()),r.push(h.clone()),r.push(d.clone()),r.push(f.clone()),r.push(p);break}u&&(h=e[o],d=e[o+1],f=n(e[o+2],h),p=n(e[o+2],d)),h&&d&&f&&p&&(r.push(h.clone()),r.push(d.clone()),r.push(f),r.push(p),r.push(f.clone()),r.push(d.clone()));break;case 2:s||(d=n(h=e[o].clone(),e[o+1]),f=n(h,e[o+2]),r.push(h),r.push(d),r.push(f)),c||(d=n(h=e[o+1].clone(),e[o+2]),f=n(h,e[o]),r.push(h),r.push(d),r.push(f)),u||(d=n(h=e[o+2].clone(),e[o]),f=n(h,e[o+1]),r.push(h),r.push(d),r.push(f))}}return r},A=0;A<n.length;A+=3){var P=new Array;if(P.push(E(A)),P.push(E(A+1)),P.push(E(A+2)),P=S(P,new a.e(1,0,0)),P=S(P,new a.e(-1,0,0)),P=S(P,new a.e(0,1,0)),P=S(P,new a.e(0,-1,0)),P=S(P,new a.e(0,0,1)),0!==(P=S(P,new a.e(0,0,-1))).length)for(var C=0;C<P.length;C++){var R=P[C];y.indices.push(T),R.position.toArray(y.positions,3*T),R.normal.toArray(y.normals,3*T),y.uvs.push(.5+R.position.x/l.x),y.uvs.push(.5+R.position.y/l.y),T++}}var x=new be.a(e,t.getScene());return y.applyToMesh(x),x.position=s.clone(),x.rotation=new a.e(m,p,u),x},e}();zi.a.CreateCapsule=function(e){void 0===e&&(e={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6});var t,i,n=Math.max(e.subdivisions?e.subdivisions:2,1),r=Math.max(e.tessellation?e.tessellation:16,3),o=Math.max(e.height?e.height:1,0),s=Math.max(e.radius?e.radius:.25,0),c=Math.max(e.capSubdivisions?e.capSubdivisions:6,1),l=r,u=n,h=Math.max(e.radiusTop?e.radiusTop:s,0),d=Math.max(e.radiusBottom?e.radiusBottom:s,0),f=o-(h+d),p=2*Math.PI,_=Math.max(e.topCapSubdivisions?e.topCapSubdivisions:c,1),m=Math.max(e.bottomCapSubdivisions?e.bottomCapSubdivisions:c,1),g=Math.acos((d-h)/o),v=[],b=[],y=[],T=[],E=0,S=[],A=.5*f,P=.5*Math.PI,C=a.e.Zero(),R=a.e.Zero(),x=Math.cos(g),O=Math.sin(g),M=new a.d(h*O,A+h*x).subtract(new a.d(d*O,d*x-A)).length(),I=h*g+M+d*(P-g),D=0;for(i=0;i<=_;i++){var N=[],L=P-g*(i/_);D+=h*g/_;var w=Math.cos(L),F=Math.sin(L),B=w*h;for(t=0;t<=l;t++){var U=(j=t/l)*p+0,V=Math.sin(U),k=Math.cos(U);R.x=B*V,R.y=A+F*h,R.z=B*k,b.push(R.x,R.y,R.z),C.set(w*V,F,w*k),y.push(C.x,C.y,C.z),T.push(j,1-D/I),N.push(E),E++}S.push(N)}var G=o-h-d+x*h-x*d,z=O*(d-h)/G;for(i=1;i<=u;i++){for(N=[],D+=M/u,B=O*(i*(d-h)/u+h),t=0;t<=l;t++)U=(j=t/l)*p+0,V=Math.sin(U),k=Math.cos(U),R.x=B*V,R.y=A+x*h-i*G/u,R.z=B*k,b.push(R.x,R.y,R.z),C.set(V,z,k).normalize(),y.push(C.x,C.y,C.z),T.push(j,1-D/I),N.push(E),E++;S.push(N)}for(i=1;i<=m;i++){for(N=[],L=P-g-(Math.PI-g)*(i/m),D+=d*g/m,w=Math.cos(L),F=Math.sin(L),B=w*d,t=0;t<=l;t++){var j;U=(j=t/l)*p+0,V=Math.sin(U),k=Math.cos(U),R.x=B*V,R.y=F*d-A,R.z=B*k,b.push(R.x,R.y,R.z),C.set(w*V,F,w*k),y.push(C.x,C.y,C.z),T.push(j,1-D/I),N.push(E),E++}S.push(N)}for(t=0;t<l;t++)for(i=0;i<_+u+m;i++){var W=S[i][t],H=S[i+1][t],X=S[i+1][t+1],Y=S[i][t+1];v.push(W),v.push(H),v.push(Y),v.push(H),v.push(X),v.push(Y)}if(v=v.reverse(),e.orientation&&!e.orientation.equals(a.e.Up())){var K=new a.a;e.orientation.clone().scale(.5*Math.PI).cross(a.e.Up()).toQuaternion().toRotationMatrix(K);for(var Q=a.e.Zero(),q=0;q<b.length;q+=3)Q.set(b[q],b[q+1],b[q+2]),a.e.TransformCoordinatesToRef(Q.clone(),K,Q),b[q]=Q.x,b[q+1]=Q.y,b[q+2]=Q.z}var Z=new zi.a;return Z.positions=b,Z.normals=y,Z.uvs=T,Z.indices=v,Z},be.a.CreateCapsule=function(e,t,i){return pu.CreateCapsule(e,t,i)};var fu,pu=function(){function e(){}return e.CreateCapsule=function(e,t,i){void 0===t&&(t={orientation:a.e.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6});var n=new be.a(e,i);return zi.a.CreateCapsule(t).applyToMesh(n),n},e}(),_u=function(){function e(){}return e.CreateBox=function(e,t,i){return void 0===i&&(i=null),mr.a.CreateBox(e,t,i)},e.CreateTiledBox=function(e,t,i){return void 0===i&&(i=null),tu.CreateTiledBox(e,t,i)},e.CreateSphere=function(e,t,i){return void 0===i&&(i=null),yr.a.CreateSphere(e,t,i)},e.CreateDisc=function(e,t,i){return void 0===i&&(i=null),eu.CreateDisc(e,t,i)},e.CreateIcoSphere=function(e,t,i){return void 0===i&&(i=null),hu.CreateIcoSphere(e,t,i)},e.CreateRibbon=function(e,t,i){return void 0===i&&(i=null),$l.a.CreateRibbon(e,t,i)},e.CreateCylinder=function(e,t,i){return void 0===i&&(i=null),qi.a.CreateCylinder(e,t,i)},e.CreateTorus=function(e,t,i){return void 0===i&&(i=null),Qi.CreateTorus(e,t,i)},e.CreateTorusKnot=function(e,t,i){return void 0===i&&(i=null),iu.CreateTorusKnot(e,t,i)},e.CreateLineSystem=function(e,t,i){return Tr.a.CreateLineSystem(e,t,i)},e.CreateLines=function(e,t,i){return void 0===i&&(i=null),Tr.a.CreateLines(e,t,i)},e.CreateDashedLines=function(e,t,i){return void 0===i&&(i=null),Tr.a.CreateDashedLines(e,t,i)},e.ExtrudeShape=function(e,t,i){return void 0===i&&(i=null),Ya.a.ExtrudeShape(e,t,i)},e.ExtrudeShapeCustom=function(e,t,i){return void 0===i&&(i=null),Ya.a.ExtrudeShapeCustom(e,t,i)},e.CreateLathe=function(e,t,i){return void 0===i&&(i=null),cu.CreateLathe(e,t,i)},e.CreateTiledPlane=function(e,t,i){return void 0===i&&(i=null),lu.CreateTiledPlane(e,t,i)},e.CreatePlane=function(e,t,i){return void 0===i&&(i=null),Cr.a.CreatePlane(e,t,i)},e.CreateGround=function(e,t,i){return void 0===i&&(i=null),Xi.CreateGround(e,t,i)},e.CreateTiledGround=function(e,t,i){return void 0===i&&(i=null),Xi.CreateTiledGround(e,t,i)},e.CreateGroundFromHeightMap=function(e,t,i,n){return void 0===n&&(n=null),Xi.CreateGroundFromHeightMap(e,t,i,n)},e.CreatePolygon=function(e,t,i,n){return void 0===i&&(i=null),void 0===n&&(n=earcut),su.CreatePolygon(e,t,i,n)},e.ExtrudePolygon=function(e,t,i,n){return void 0===i&&(i=null),void 0===n&&(n=earcut),su.ExtrudePolygon(e,t,i,n)},e.CreateTube=function(e,t,i){return void 0===i&&(i=null),uu.CreateTube(e,t,i)},e.CreatePolyhedron=function(e,t,i){return void 0===i&&(i=null),Or.CreatePolyhedron(e,t,i)},e.CreateDecal=function(e,t,i){return du.CreateDecal(e,t,i)},e.CreateCapsule=function(e,t,i){return void 0===t&&(t={orientation:a.e.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}),void 0===i&&(i=null),pu.CreateCapsule(e,t,i)},e}(),mu=function(e,t,i){this.quality=e,this.distance=t,this.optimizeMesh=i},gu=function(){function e(){this.running=!1,this._simplificationArray=[]}return e.prototype.addTask=function(e){this._simplificationArray.push(e)},e.prototype.executeNext=function(){var e=this._simplificationArray.pop();e?(this.running=!0,this.runSimplification(e)):this.running=!1},e.prototype.runSimplification=function(e){var t=this;if(e.parallelProcessing)e.settings.forEach(function(i){t.getSimplifier(e).simplify(i,function(n){void 0!==i.distance&&e.mesh.addLODLevel(i.distance,n),n.isVisible=!0,i.quality===e.settings[e.settings.length-1].quality&&e.successCallback&&e.successCallback(),t.executeNext()})});else{var i=this.getSimplifier(e);Ce.a.Run(e.settings.length,function(t){var n,r;n=e.settings[t.index],r=function(){t.executeNext()},i.simplify(n,function(t){void 0!==n.distance&&e.mesh.addLODLevel(n.distance,t),t.isVisible=!0,r()})},function(){e.successCallback&&e.successCallback(),t.executeNext()})}},e.prototype.getSimplifier=function(e){switch(e.simplificationType){case fu.QUADRATIC:default:return new Eu(e.mesh)}},e}();!function(e){e[e.QUADRATIC=0]="QUADRATIC"}(fu||(fu={}));var vu=function(e){this.vertices=e,this.error=new Array(4),this.deleted=!1,this.isDirty=!1,this.deletePending=!1,this.borderFactor=0},bu=function(){function e(e,t){this.position=e,this.id=t,this.isBorder=!0,this.q=new yu,this.triangleCount=0,this.triangleStart=0,this.originalOffsets=[]}return e.prototype.updatePosition=function(e){this.position.copyFrom(e)},e}(),yu=function(){function e(e){this.data=new Array(10);for(var t=0;t<10;++t)e&&e[t]?this.data[t]=e[t]:this.data[t]=0}return e.prototype.det=function(e,t,i,n,r,o,a,s,c){return this.data[e]*this.data[r]*this.data[c]+this.data[i]*this.data[n]*this.data[s]+this.data[t]*this.data[o]*this.data[a]-this.data[i]*this.data[r]*this.data[a]-this.data[e]*this.data[o]*this.data[s]-this.data[t]*this.data[n]*this.data[c]},e.prototype.addInPlace=function(e){for(var t=0;t<10;++t)this.data[t]+=e.data[t]},e.prototype.addArrayInPlace=function(e){for(var t=0;t<10;++t)this.data[t]+=e[t]},e.prototype.add=function(t){for(var i=new e,n=0;n<10;++n)i.data[n]=this.data[n]+t.data[n];return i},e.FromData=function(t,i,n,r){return new e(e.DataFromNumbers(t,i,n,r))},e.DataFromNumbers=function(e,t,i,n){return[e*e,e*t,e*i,e*n,t*t,t*i,t*n,i*i,i*n,n*n]},e}(),Tu=function(e,t){this.vertexId=e,this.triangleId=t},Eu=function(){function e(e){this._mesh=e,this.syncIterations=5e3,this.aggressiveness=7,this.decimationIterations=100,this.boundingBoxEpsilon=Nt.a}return e.prototype.simplify=function(e,t){var i=this;this.initDecimatedMesh(),Ce.a.Run(this._mesh.subMeshes.length,function(t){i.initWithMesh(t.index,function(){i.runDecimation(e,t.index,function(){t.executeNext()})},e.optimizeMesh)},function(){setTimeout(function(){t(i._reconstructedMesh)},0)})},e.prototype.runDecimation=function(e,t,i){var n=this,r=~~(this.triangles.length*e.quality),o=0,s=this.triangles.length;Ce.a.Run(this.decimationIterations,function(e){var t,i;s-o<=r?e.breakLoop():(t=e.index,i=function(){e.executeNext()},setTimeout(function(){t%5==0&&n.updateMesh(0===t);for(var e=0;e<n.triangles.length;++e)n.triangles[e].isDirty=!1;var c=1e-9*Math.pow(t+3,n.aggressiveness);Ce.a.SyncAsyncForLoop(n.triangles.length,n.syncIterations,function(e){var t=~~((n.triangles.length/2+e)%n.triangles.length),i=n.triangles[t];if(i&&!(i.error[3]>c||i.deleted||i.isDirty))for(var r=0;r<3;++r)if(i.error[r]<c){var s=[],l=[],u=i.vertices[r],h=i.vertices[(r+1)%3];if(u.isBorder||h.isBorder)continue;var d=a.e.Zero();n.calculateError(u,h,d);var f=new Array;if(n.isFlipped(u,h,d,s,f))continue;if(n.isFlipped(h,u,d,l,f))continue;if(s.indexOf(!0)<0||l.indexOf(!0)<0)continue;var p=new Array;if(f.forEach(function(e){-1===p.indexOf(e)&&(e.deletePending=!0,p.push(e))}),p.length%2!=0)continue;u.q=h.q.add(u.q),u.updatePosition(d);var _=n.references.length;o=n.updateTriangles(u,u,s,o),o=n.updateTriangles(u,h,l,o);var m=n.references.length-_;if(m<=u.triangleCount){if(m)for(var g=0;g<m;g++)n.references[u.triangleStart+g]=n.references[_+g]}else u.triangleStart=_;u.triangleCount=m;break}},i,function(){return s-o<=r})},0))},function(){setTimeout(function(){n.reconstructMesh(t),i()},0)})},e.prototype.initWithMesh=function(e,t,i){var n=this;this.vertices=[],this.triangles=[];var r=this._mesh.getVerticesData(ji.b.PositionKind),o=this._mesh.getIndices(),s=this._mesh.subMeshes[e],c=[],l=s.verticesCount;Ce.a.SyncAsyncForLoop(l,this.syncIterations/4>>0,function(e){if(r){var t=e+s.verticesStart,o=a.e.FromArray(r,3*t),l=function(e){if(i)for(var t=0;t<n.vertices.length;++t)if(n.vertices[t].position.equalsWithEpsilon(e,1e-4))return n.vertices[t];return null}(o)||new bu(o,n.vertices.length);l.originalOffsets.push(t),l.id===n.vertices.length&&n.vertices.push(l),c.push(l.id)}},function(){Ce.a.SyncAsyncForLoop(s.indexCount/3,n.syncIterations,function(e){if(o){var t=3*(s.indexStart/3+e),i=o[t+0],r=o[t+1],a=o[t+2],l=n.vertices[c[i-s.verticesStart]],u=n.vertices[c[r-s.verticesStart]],h=n.vertices[c[a-s.verticesStart]],d=new vu([l,u,h]);d.originalOffset=t,n.triangles.push(d)}},function(){n.init(t)})})},e.prototype.init=function(e){var t=this;Ce.a.SyncAsyncForLoop(this.triangles.length,this.syncIterations,function(e){var i=t.triangles[e];i.normal=a.e.Cross(i.vertices[1].position.subtract(i.vertices[0].position),i.vertices[2].position.subtract(i.vertices[0].position)).normalize();for(var n=0;n<3;n++)i.vertices[n].q.addArrayInPlace(yu.DataFromNumbers(i.normal.x,i.normal.y,i.normal.z,-a.e.Dot(i.normal,i.vertices[0].position)))},function(){Ce.a.SyncAsyncForLoop(t.triangles.length,t.syncIterations,function(e){for(var i=t.triangles[e],n=0;n<3;++n)i.error[n]=t.calculateError(i.vertices[n],i.vertices[(n+1)%3]);i.error[3]=Math.min(i.error[0],i.error[1],i.error[2])},function(){e()})})},e.prototype.reconstructMesh=function(e){var t,i,n,r=[];for(t=0;t<this.vertices.length;++t)this.vertices[t].triangleCount=0;for(t=0;t<this.triangles.length;++t)if(!this.triangles[t].deleted){for(i=this.triangles[t],n=0;n<3;++n)i.vertices[n].triangleCount=1;r.push(i)}var o=this._reconstructedMesh.getVerticesData(ji.b.PositionKind)||[],a=this._reconstructedMesh.getVerticesData(ji.b.NormalKind)||[],s=this._reconstructedMesh.getVerticesData(ji.b.UVKind)||[],c=this._reconstructedMesh.getVerticesData(ji.b.ColorKind)||[],l=this._mesh.getVerticesData(ji.b.NormalKind),u=this._mesh.getVerticesData(ji.b.UVKind),h=this._mesh.getVerticesData(ji.b.ColorKind),d=0;for(t=0;t<this.vertices.length;++t){var f=this.vertices[t];f.id=d,f.triangleCount&&f.originalOffsets.forEach(function(e){o.push(f.position.x),o.push(f.position.y),o.push(f.position.z),l&&l.length&&(a.push(l[3*e]),a.push(l[3*e+1]),a.push(l[3*e+2])),u&&u.length&&(s.push(u[2*e]),s.push(u[2*e+1])),h&&h.length&&(c.push(h[4*e]),c.push(h[4*e+1]),c.push(h[4*e+2]),c.push(h[4*e+3])),++d})}var p=this._reconstructedMesh.getTotalIndices(),_=this._reconstructedMesh.getTotalVertices(),m=this._reconstructedMesh.subMeshes;this._reconstructedMesh.subMeshes=[];var g=this._reconstructedMesh.getIndices(),v=this._mesh.getIndices();for(t=0;t<r.length;++t)i=r[t],[0,1,2].forEach(function(e){var t=v[i.originalOffset+e],n=i.vertices[e].originalOffsets.indexOf(t);n<0&&(n=0),g.push(i.vertices[e].id+n+_)});this._reconstructedMesh.setIndices(g),this._reconstructedMesh.setVerticesData(ji.b.PositionKind,o),a.length>0&&this._reconstructedMesh.setVerticesData(ji.b.NormalKind,a),s.length>0&&this._reconstructedMesh.setVerticesData(ji.b.UVKind,s),c.length>0&&this._reconstructedMesh.setVerticesData(ji.b.ColorKind,c);var b=this._mesh.subMeshes[e];e>0&&(this._reconstructedMesh.subMeshes=[],m.forEach(function(e){jl.a.AddToMesh(e.materialIndex,e.verticesStart,e.verticesCount,e.indexStart,e.indexCount,e.getMesh())}),jl.a.AddToMesh(b.materialIndex,_,d,p,3*r.length,this._reconstructedMesh))},e.prototype.initDecimatedMesh=function(){this._reconstructedMesh=new be.a(this._mesh.name+"Decimated",this._mesh.getScene()),this._reconstructedMesh.material=this._mesh.material,this._reconstructedMesh.parent=this._mesh.parent,this._reconstructedMesh.isVisible=!1,this._reconstructedMesh.renderingGroupId=this._mesh.renderingGroupId},e.prototype.isFlipped=function(e,t,i,n,r){for(var o=0;o<e.triangleCount;++o){var s=this.triangles[this.references[e.triangleStart+o].triangleId];if(!s.deleted){var c=this.references[e.triangleStart+o].vertexId,l=s.vertices[(c+1)%3],u=s.vertices[(c+2)%3];if(l!==t&&u!==t){var h=l.position.subtract(i);h=h.normalize();var d=u.position.subtract(i);if(d=d.normalize(),Math.abs(a.e.Dot(h,d))>.999)return!0;var f=a.e.Cross(h,d).normalize();if(n[o]=!1,a.e.Dot(f,s.normal)<.2)return!0}else n[o]=!0,r.push(s)}}return!1},e.prototype.updateTriangles=function(e,t,i,n){for(var r=n,o=0;o<t.triangleCount;++o){var a=this.references[t.triangleStart+o],s=this.triangles[a.triangleId];s.deleted||(i[o]&&s.deletePending?(s.deleted=!0,r++):(s.vertices[a.vertexId]=e,s.isDirty=!0,s.error[0]=this.calculateError(s.vertices[0],s.vertices[1])+s.borderFactor/2,s.error[1]=this.calculateError(s.vertices[1],s.vertices[2])+s.borderFactor/2,s.error[2]=this.calculateError(s.vertices[2],s.vertices[0])+s.borderFactor/2,s.error[3]=Math.min(s.error[0],s.error[1],s.error[2]),this.references.push(a)))}return r},e.prototype.identifyBorder=function(){for(var e=0;e<this.vertices.length;++e){var t,i=[],n=[],r=this.vertices[e];for(t=0;t<r.triangleCount;++t)for(var o=this.triangles[this.references[r.triangleStart+t].triangleId],a=0;a<3;a++){for(var s=0,c=o.vertices[a];s<i.length&&n[s]!==c.id;)++s;s===i.length?(i.push(1),n.push(c.id)):i[s]++}for(t=0;t<i.length;++t)1===i[t]?this.vertices[n[t]].isBorder=!0:this.vertices[n[t]].isBorder=!1}},e.prototype.updateMesh=function(e){var t,i,n,r;if(void 0===e&&(e=!1),!e){var o=[];for(t=0;t<this.triangles.length;++t)this.triangles[t].deleted||o.push(this.triangles[t]);this.triangles=o}for(t=0;t<this.vertices.length;++t)this.vertices[t].triangleCount=0,this.vertices[t].triangleStart=0;for(t=0;t<this.triangles.length;++t)for(i=this.triangles[t],n=0;n<3;++n)(r=i.vertices[n]).triangleCount++;var a=0;for(t=0;t<this.vertices.length;++t)this.vertices[t].triangleStart=a,a+=this.vertices[t].triangleCount,this.vertices[t].triangleCount=0;var s=new Array(3*this.triangles.length);for(t=0;t<this.triangles.length;++t)for(i=this.triangles[t],n=0;n<3;++n)s[(r=i.vertices[n]).triangleStart+r.triangleCount]=new Tu(n,t),r.triangleCount++;this.references=s,e&&this.identifyBorder()},e.prototype.vertexError=function(e,t){var i=t.x,n=t.y,r=t.z;return e.data[0]*i*i+2*e.data[1]*i*n+2*e.data[2]*i*r+2*e.data[3]*i+e.data[4]*n*n+2*e.data[5]*n*r+2*e.data[6]*n+e.data[7]*r*r+2*e.data[8]*r+e.data[9]},e.prototype.calculateError=function(e,t,i){var n=e.q.add(t.q),r=e.isBorder&&t.isBorder,o=0,s=n.det(0,1,2,1,4,5,2,5,7);if(0===s||r){var c=e.position.add(t.position).divide(new a.e(2,2,2)),l=this.vertexError(n,e.position),u=this.vertexError(n,t.position),h=this.vertexError(n,c);(o=Math.min(l,u,h))===l?i&&i.copyFrom(e.position):o===u?i&&i.copyFrom(t.position):i&&i.copyFrom(c)}else i||(i=a.e.Zero()),i.x=-1/s*n.det(1,2,3,4,5,6,5,7,8),i.y=1/s*n.det(0,2,3,1,5,6,2,7,8),i.z=-1/s*n.det(0,1,3,1,4,6,2,5,8),o=this.vertexError(n,i);return o},e}();Object.defineProperty(Q.a.prototype,"simplificationQueue",{get:function(){if(!this._simplificationQueue){this._simplificationQueue=new gu;var e=this._getComponent(Me.a.NAME_SIMPLIFICATIONQUEUE);e||(e=new Su(this),this._addComponent(e))}return this._simplificationQueue},set:function(e){this._simplificationQueue=e},enumerable:!0,configurable:!0}),be.a.prototype.simplify=function(e,t,i,n){return void 0===t&&(t=!0),void 0===i&&(i=fu.QUADRATIC),this.getScene().simplificationQueue.addTask({settings:e,parallelProcessing:t,mesh:this,simplificationType:i,successCallback:n}),this};var Su=function(){function e(e){this.name=Me.a.NAME_SIMPLIFICATIONQUEUE,this.scene=e}return e.prototype.register=function(){this.scene._beforeCameraUpdateStage.registerStep(Me.a.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE,this,this._beforeCameraUpdate)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype._beforeCameraUpdate=function(){this.scene._simplificationQueue&&!this.scene._simplificationQueue.running&&this.scene._simplificationQueue.executeNext()},e}(),Au=i(149),Pu=i(88);be.a.prototype.thinInstanceAdd=function(e,t){void 0===t&&(t=!0),this._thinInstanceUpdateBufferSize("matrix",Array.isArray(e)?e.length:1);var i=this._thinInstanceDataStorage.instancesCount;if(Array.isArray(e))for(var n=0;n<e.length;++n)this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,e[n],n===e.length-1&&t);else this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,e,t);return i},be.a.prototype.thinInstanceAddSelf=function(e){return void 0===e&&(e=!0),this.thinInstanceAdd(a.a.IdentityReadOnly,e)},be.a.prototype.thinInstanceRegisterAttribute=function(e,t){this.removeVerticesData(e),this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.strides[e]=t,this._userThinInstanceBuffersStorage.sizes[e]=t*Math.max(32,this._thinInstanceDataStorage.instancesCount),this._userThinInstanceBuffersStorage.data[e]=new Float32Array(this._userThinInstanceBuffersStorage.sizes[e]),this._userThinInstanceBuffersStorage.vertexBuffers[e]=new ji.b(this.getEngine(),this._userThinInstanceBuffersStorage.data[e],e,!0,!1,t,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e])},be.a.prototype.thinInstanceSetMatrixAt=function(e,t,i){if(void 0===i&&(i=!0),!this._thinInstanceDataStorage.matrixData||e>=this._thinInstanceDataStorage.instancesCount)return!1;var n=this._thinInstanceDataStorage.matrixData;return t.copyToArray(n,16*e),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[e]=t),i&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0},be.a.prototype.thinInstanceSetAttributeAt=function(e,t,i,n){return void 0===n&&(n=!0),!(!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.data[e]||t>=this._thinInstanceDataStorage.instancesCount||(this._thinInstanceUpdateBufferSize(e,0),this._userThinInstanceBuffersStorage.data[e].set(i,t*this._userThinInstanceBuffersStorage.strides[e]),n&&this.thinInstanceBufferUpdated(e),0))},Object.defineProperty(be.a.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(e){var t,i;e<=(null!==(i=null===(t=this._thinInstanceDataStorage.matrixData)||void 0===t?void 0:t.length)&&void 0!==i?i:0)/16&&(this._thinInstanceDataStorage.instancesCount=e)},enumerable:!0,configurable:!0}),be.a.prototype.thinInstanceSetBuffer=function(e,t,i,n){var r,o;if(void 0===i&&(i=0),void 0===n&&(n=!1),i=i||16,"matrix"===e)if(null===(r=this._thinInstanceDataStorage.matrixBuffer)||void 0===r||r.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=t?t.length:32*i,this._thinInstanceDataStorage.matrixData=t,this._thinInstanceDataStorage.worldMatrices=null,null!==t){this._thinInstanceDataStorage.instancesCount=t.length/i;var a=new ji.a(this.getEngine(),t,!n,i,!1,!0);this._thinInstanceDataStorage.matrixBuffer=a,this.setVerticesBuffer(a.createVertexBuffer("world0",0,4)),this.setVerticesBuffer(a.createVertexBuffer("world1",4,4)),this.setVerticesBuffer(a.createVertexBuffer("world2",8,4)),this.setVerticesBuffer(a.createVertexBuffer("world3",12,4)),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)}else this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo(!0);else null===t?(null===(o=this._userThinInstanceBuffersStorage)||void 0===o?void 0:o.data[e])&&(this.removeVerticesData(e),delete this._userThinInstanceBuffersStorage.data[e],delete this._userThinInstanceBuffersStorage.strides[e],delete this._userThinInstanceBuffersStorage.sizes[e],delete this._userThinInstanceBuffersStorage.vertexBuffers[e]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[e]=t,this._userThinInstanceBuffersStorage.strides[e]=i,this._userThinInstanceBuffersStorage.sizes[e]=t.length,this._userThinInstanceBuffersStorage.vertexBuffers[e]=new ji.b(this.getEngine(),t,e,!n,!1,i,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e]))},be.a.prototype.thinInstanceBufferUpdated=function(e){var t;"matrix"===e?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount):(null===(t=this._userThinInstanceBuffersStorage)||void 0===t?void 0:t.vertexBuffers[e])&&this._userThinInstanceBuffersStorage.vertexBuffers[e].updateDirectly(this._userThinInstanceBuffersStorage.data[e],0)},be.a.prototype.thinInstancePartialBufferUpdate=function(e,t,i){var n;"matrix"===e?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(t,i):(null===(n=this._userThinInstanceBuffersStorage)||void 0===n?void 0:n.vertexBuffers[e])&&this._userThinInstanceBuffersStorage.vertexBuffers[e].updateDirectly(t,i)},be.a.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];var e=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=new Array;for(var t=0;t<this._thinInstanceDataStorage.instancesCount;++t)this._thinInstanceDataStorage.worldMatrices[t]=a.a.FromArray(e,16*t)}return this._thinInstanceDataStorage.worldMatrices},be.a.prototype.thinInstanceRefreshBoundingInfo=function(e){if(void 0===e&&(e=!1),this._thinInstanceDataStorage.matrixData&&this._thinInstanceDataStorage.matrixBuffer){var t=this._thinInstanceDataStorage.boundingVectors;e&&(t.length=0,this.refreshBoundingInfo(!0));var i=this.getBoundingInfo(),n=this._thinInstanceDataStorage.matrixData;if(0===t.length)for(var r=0;r<i.boundingBox.vectors.length;++r)t.push(i.boundingBox.vectors[r].clone());a.c.Vector3[0].setAll(Number.POSITIVE_INFINITY),a.c.Vector3[1].setAll(Number.NEGATIVE_INFINITY);for(var o=0;o<this._thinInstanceDataStorage.instancesCount;++o)for(a.a.FromArrayToRef(n,16*o,a.c.Matrix[0]),r=0;r<t.length;++r)a.e.TransformCoordinatesToRef(t[r],a.c.Matrix[0],a.c.Vector3[2]),a.c.Vector3[0].minimizeInPlace(a.c.Vector3[2]),a.c.Vector3[1].maximizeInPlace(a.c.Vector3[2]);i.reConstruct(a.c.Vector3[0],a.c.Vector3[1]),this._updateBoundingInfo()}},be.a.prototype._thinInstanceUpdateBufferSize=function(e,t){var i,n;void 0===t&&(t=1);var r="matrix"===e;if(r||this._userThinInstanceBuffersStorage&&this._userThinInstanceBuffersStorage.strides[e]){for(var o=r?16:this._userThinInstanceBuffersStorage.strides[e],a=r?this._thinInstanceDataStorage.matrixBufferSize:this._userThinInstanceBuffersStorage.sizes[e],s=r?this._thinInstanceDataStorage.matrixData:this._userThinInstanceBuffersStorage.data[e],c=(this._thinInstanceDataStorage.instancesCount+t)*o,l=a;l<c;)l*=2;if(!s||a!=l){if(s){var u=new Float32Array(l);u.set(s,0),s=u}else s=new Float32Array(l);if(r){null===(i=this._thinInstanceDataStorage.matrixBuffer)||void 0===i||i.dispose();var h=new ji.a(this.getEngine(),s,!0,o,!1,!0);this._thinInstanceDataStorage.matrixBuffer=h,this._thinInstanceDataStorage.matrixData=s,this._thinInstanceDataStorage.matrixBufferSize=l,this.setVerticesBuffer(h.createVertexBuffer("world0",0,4)),this.setVerticesBuffer(h.createVertexBuffer("world1",4,4)),this.setVerticesBuffer(h.createVertexBuffer("world2",8,4)),this.setVerticesBuffer(h.createVertexBuffer("world3",12,4))}else null===(n=this._userThinInstanceBuffersStorage.vertexBuffers[e])||void 0===n||n.dispose(),this._userThinInstanceBuffersStorage.data[e]=s,this._userThinInstanceBuffersStorage.sizes[e]=l,this._userThinInstanceBuffersStorage.vertexBuffers[e]=new ji.b(this.getEngine(),s,e,!0,!1,o,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e])}}},be.a.prototype._thinInstanceInitializeUserStorage=function(){this._userThinInstanceBuffersStorage||(this._userThinInstanceBuffersStorage={data:{},sizes:{},vertexBuffers:{},strides:{}})},be.a.prototype._disposeThinInstanceSpecificData=function(){var e;(null===(e=this._thinInstanceDataStorage)||void 0===e?void 0:e.matrixBuffer)&&(this._thinInstanceDataStorage.matrixBuffer.dispose(),this._thinInstanceDataStorage.matrixBuffer=null)};var Cu=function(){function e(e){void 0===e&&(e=Recast),this.bjsRECAST={},this.name="RecastJSPlugin",this._maximumSubStepCount=10,this._timeStep=1/60,"function"==typeof e?e(this.bjsRECAST):this.bjsRECAST=e,this.isSupported()?this.setTimeStep():m.a.Error("RecastJS is not available. Please make sure you included the js file.")}return e.prototype.setTimeStep=function(e){void 0===e&&(e=1/60),this._timeStep=e},e.prototype.getTimeStep=function(){return this._timeStep},e.prototype.setMaximumSubStepCount=function(e){void 0===e&&(e=10),this._maximumSubStepCount=e},e.prototype.getMaximumSubStepCount=function(){return this._maximumSubStepCount},e.prototype.createNavMesh=function(e,t){var i,n,r,o=new this.bjsRECAST.rcConfig;o.cs=t.cs,o.ch=t.ch,o.borderSize=0,o.tileSize=0,o.walkableSlopeAngle=t.walkableSlopeAngle,o.walkableHeight=t.walkableHeight,o.walkableClimb=t.walkableClimb,o.walkableRadius=t.walkableRadius,o.maxEdgeLen=t.maxEdgeLen,o.maxSimplificationError=t.maxSimplificationError,o.minRegionArea=t.minRegionArea,o.mergeRegionArea=t.mergeRegionArea,o.maxVertsPerPoly=t.maxVertsPerPoly,o.detailSampleDist=t.detailSampleDist,o.detailSampleMaxError=t.detailSampleMaxError,this.navMesh=new this.bjsRECAST.NavMesh;var s=[],c=[],l=0;for(i=0;i<e.length;i++)if(e[i]){var u=e[i],h=u.getIndices();if(!h)continue;var d=u.getVerticesData(ji.b.PositionKind,!1,!1);if(!d)continue;var f=u.computeWorldMatrix(!0);for(n=0;n<h.length;n++)s.push(h[n]+l);var p=a.e.Zero(),_=a.e.Zero();for(r=0;r<d.length;r+=3)a.e.FromArrayToRef(d,r,_),a.e.TransformCoordinatesToRef(_,f,p),c.push(p.x,p.y,p.z);l+=d.length/3}this.navMesh.build(c,l,s,s.length,o)},e.prototype.createDebugNavMesh=function(e){var t,i,n=this.navMesh.getDebugNavMesh(),r=n.getTriangleCount(),o=[],a=[];for(t=0;t<3*r;t++)o.push(t);for(t=0;t<r;t++)for(i=0;i<3;i++){var s=n.getTriangle(t).getPoint(i);a.push(s.x,s.y,s.z)}var c=new be.a("NavMeshDebug",e),l=new zi.a;return l.indices=o,l.positions=a,l.applyToMesh(c,!1),c},e.prototype.getClosestPoint=function(e){var t=new this.bjsRECAST.Vec3(e.x,e.y,e.z),i=this.navMesh.getClosestPoint(t);return new a.e(i.x,i.y,i.z)},e.prototype.getClosestPointToRef=function(e,t){var i=new this.bjsRECAST.Vec3(e.x,e.y,e.z),n=this.navMesh.getClosestPoint(i);t.set(n.x,n.y,n.z)},e.prototype.getRandomPointAround=function(e,t){var i=new this.bjsRECAST.Vec3(e.x,e.y,e.z),n=this.navMesh.getRandomPointAround(i,t);return new a.e(n.x,n.y,n.z)},e.prototype.getRandomPointAroundToRef=function(e,t,i){var n=new this.bjsRECAST.Vec3(e.x,e.y,e.z),r=this.navMesh.getRandomPointAround(n,t);i.set(r.x,r.y,r.z)},e.prototype.moveAlong=function(e,t){var i=new this.bjsRECAST.Vec3(e.x,e.y,e.z),n=new this.bjsRECAST.Vec3(t.x,t.y,t.z),r=this.navMesh.moveAlong(i,n);return new a.e(r.x,r.y,r.z)},e.prototype.moveAlongToRef=function(e,t,i){var n=new this.bjsRECAST.Vec3(e.x,e.y,e.z),r=new this.bjsRECAST.Vec3(t.x,t.y,t.z),o=this.navMesh.moveAlong(n,r);i.set(o.x,o.y,o.z)},e.prototype.computePath=function(e,t){var i,n=new this.bjsRECAST.Vec3(e.x,e.y,e.z),r=new this.bjsRECAST.Vec3(t.x,t.y,t.z),o=this.navMesh.computePath(n,r),s=o.getPointCount(),c=[];for(i=0;i<s;i++){var l=o.getPoint(i);c.push(new a.e(l.x,l.y,l.z))}return c},e.prototype.createCrowd=function(e,t,i){return new Ru(this,e,t,i)},e.prototype.setDefaultQueryExtent=function(e){var t=new this.bjsRECAST.Vec3(e.x,e.y,e.z);this.navMesh.setDefaultQueryExtent(t)},e.prototype.getDefaultQueryExtent=function(){var e=this.navMesh.getDefaultQueryExtent();return new a.e(e.x,e.y,e.z)},e.prototype.buildFromNavmeshData=function(e){var t=e.length*e.BYTES_PER_ELEMENT,i=this.bjsRECAST._malloc(t),n=new Uint8Array(this.bjsRECAST.HEAPU8.buffer,i,t);n.set(e);var r=new this.bjsRECAST.NavmeshData;r.dataPointer=n.byteOffset,r.size=e.length,this.navMesh=new this.bjsRECAST.NavMesh,this.navMesh.buildFromNavmeshData(r),this.bjsRECAST._free(n.byteOffset)},e.prototype.getNavmeshData=function(){var e=this.navMesh.getNavmeshData(),t=new Uint8Array(this.bjsRECAST.HEAPU8.buffer,e.dataPointer,e.size),i=new Uint8Array(e.size);return i.set(t),this.navMesh.freeNavmeshData(e),i},e.prototype.getDefaultQueryExtentToRef=function(e){var t=this.navMesh.getDefaultQueryExtent();e.set(t.x,t.y,t.z)},e.prototype.dispose=function(){},e.prototype.isSupported=function(){return void 0!==this.bjsRECAST},e}(),Ru=function(){function e(e,t,i,n){var r=this;this.recastCrowd={},this.transforms=new Array,this.agents=new Array,this._onBeforeAnimationsObserver=null,this.bjsRECASTPlugin=e,this.recastCrowd=new this.bjsRECASTPlugin.bjsRECAST.Crowd(t,i,this.bjsRECASTPlugin.navMesh.getNavMesh()),this._scene=n,this._onBeforeAnimationsObserver=n.onBeforeAnimationsObservable.add(function(){r.update(.001*n.getEngine().getDeltaTime())})}return e.prototype.addAgent=function(e,t,i){var n=new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams;n.radius=t.radius,n.height=t.height,n.maxAcceleration=t.maxAcceleration,n.maxSpeed=t.maxSpeed,n.collisionQueryRange=t.collisionQueryRange,n.pathOptimizationRange=t.pathOptimizationRange,n.separationWeight=t.separationWeight,n.updateFlags=7,n.obstacleAvoidanceType=0,n.queryFilterType=0,n.userData=0;var r=this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x,e.y,e.z),n);return this.transforms.push(i),this.agents.push(r),r},e.prototype.getAgentPosition=function(e){var t=this.recastCrowd.getAgentPosition(e);return new a.e(t.x,t.y,t.z)},e.prototype.getAgentPositionToRef=function(e,t){var i=this.recastCrowd.getAgentPosition(e);t.set(i.x,i.y,i.z)},e.prototype.getAgentVelocity=function(e){var t=this.recastCrowd.getAgentVelocity(e);return new a.e(t.x,t.y,t.z)},e.prototype.getAgentVelocityToRef=function(e,t){var i=this.recastCrowd.getAgentVelocity(e);t.set(i.x,i.y,i.z)},e.prototype.getAgentNextTargetPath=function(e){var t=this.recastCrowd.getAgentNextTargetPath(e);return new a.e(t.x,t.y,t.z)},e.prototype.getAgentNextTargetPathToRef=function(e,t){var i=this.recastCrowd.getAgentNextTargetPath(e);t.set(i.x,i.y,i.z)},e.prototype.getAgentState=function(e){return this.recastCrowd.getAgentState(e)},e.prototype.overOffmeshConnection=function(e){return this.recastCrowd.overOffmeshConnection(e)},e.prototype.agentGoto=function(e,t){this.recastCrowd.agentGoto(e,new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x,t.y,t.z))},e.prototype.agentTeleport=function(e,t){this.recastCrowd.agentTeleport(e,new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x,t.y,t.z))},e.prototype.updateAgentParameters=function(e,t){var i=this.recastCrowd.getAgentParameters(e);void 0!==t.radius&&(i.radius=t.radius),void 0!==t.height&&(i.height=t.height),void 0!==t.maxAcceleration&&(i.maxAcceleration=t.maxAcceleration),void 0!==t.maxSpeed&&(i.maxSpeed=t.maxSpeed),void 0!==t.collisionQueryRange&&(i.collisionQueryRange=t.collisionQueryRange),void 0!==t.pathOptimizationRange&&(i.pathOptimizationRange=t.pathOptimizationRange),void 0!==t.separationWeight&&(i.separationWeight=t.separationWeight),this.recastCrowd.setAgentParameters(e,i)},e.prototype.removeAgent=function(e){this.recastCrowd.removeAgent(e);var t=this.agents.indexOf(e);t>-1&&(this.agents.splice(t,1),this.transforms.splice(t,1))},e.prototype.getAgents=function(){return this.agents},e.prototype.update=function(e){var t=this.bjsRECASTPlugin.getTimeStep(),i=this.bjsRECASTPlugin.getMaximumSubStepCount();if(t<=Nt.a)this.recastCrowd.update(e);else{var n=e/t;i&&n>i&&(n=i),n<1&&(n=1);for(var r=0;r<n;r++)this.recastCrowd.update(t)}for(var o=0;o<this.agents.length;o++)this.transforms[o].position=this.getAgentPosition(this.agents[o])},e.prototype.setDefaultQueryExtent=function(e){var t=new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x,e.y,e.z);this.recastCrowd.setDefaultQueryExtent(t)},e.prototype.getDefaultQueryExtent=function(){var e=this.recastCrowd.getDefaultQueryExtent();return new a.e(e.x,e.y,e.z)},e.prototype.getDefaultQueryExtentToRef=function(e){var t=this.recastCrowd.getDefaultQueryExtent();e.set(t.x,t.y,t.z)},e.prototype.dispose=function(){this.recastCrowd.destroy(),this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null},e}();Se.a.OfflineProviderFactory=function(e,t,i){return void 0===i&&(i=!1),new Ou(e,t,i)};var xu,Ou=function(){function e(t,i,n){var r=this;void 0===n&&(n=!1),this._idbFactory="undefined"!=typeof window?window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB:indexedDB,this._callbackManifestChecked=i,this._currentSceneUrl=e._ReturnFullUrlLocation(t),this._db=null,this._enableSceneOffline=!1,this._enableTexturesOffline=!1,this._manifestVersionFound=0,this._mustUpdateRessources=!1,this._hasReachedQuota=!1,e.IDBStorageEnabled?n?(this._enableSceneOffline=!0,this._enableTexturesOffline=!0,this._manifestVersionFound=1,Ce.b.SetImmediate(function(){r._callbackManifestChecked(!0)})):this._checkManifestFile():this._callbackManifestChecked(!0)}return Object.defineProperty(e.prototype,"enableSceneOffline",{get:function(){return this._enableSceneOffline},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enableTexturesOffline",{get:function(){return this._enableTexturesOffline},enumerable:!1,configurable:!0}),e.prototype._checkManifestFile=function(){var t=this,i=function(){t._enableSceneOffline=!1,t._enableTexturesOffline=!1,t._callbackManifestChecked(!1)},n=!1,r=this._currentSceneUrl+".manifest",o=new V.a;navigator.onLine&&(n=!0,r=r+(null==r.match(/\?/)?"?":"&")+Date.now()),o.open("GET",r),o.addEventListener("load",function(){if(200===o.status||e._ValidateXHRData(o,1))try{var n=JSON.parse(o.response);t._enableSceneOffline=n.enableSceneOffline,t._enableTexturesOffline=n.enableTexturesOffline&&e.IsUASupportingBlobStorage,n.version&&!isNaN(parseInt(n.version))&&(t._manifestVersionFound=n.version),t._callbackManifestChecked&&t._callbackManifestChecked(!0)}catch(e){i()}else i()},!1),o.addEventListener("error",function(){if(n){n=!1;var e=t._currentSceneUrl+".manifest";o.open("GET",e),o.send()}else i()},!1);try{o.send()}catch(e){m.a.Error("Error on XHR send request."),this._callbackManifestChecked(!1)}},e.prototype.open=function(e,t){var i=this,n=function(){i._isSupported=!1,t&&t()};if(this._idbFactory&&(this._enableSceneOffline||this._enableTexturesOffline))if(this._db)e&&e();else{this._hasReachedQuota=!1,this._isSupported=!0;var r=this._idbFactory.open("babylonjs",1);r.onerror=function(){n()},r.onblocked=function(){m.a.Error("IDB request blocked. Please reload the page."),n()},r.onsuccess=function(){i._db=r.result,e()},r.onupgradeneeded=function(e){if(i._db=e.target.result,i._db)try{i._db.createObjectStore("scenes",{keyPath:"sceneUrl"}),i._db.createObjectStore("versions",{keyPath:"sceneUrl"}),i._db.createObjectStore("textures",{keyPath:"textureUrl"})}catch(e){m.a.Error("Error while creating object stores. Exception: "+e.message),n()}}}else this._isSupported=!1,t&&t()},e.prototype.loadImage=function(t,i){var n=this,r=e._ReturnFullUrlLocation(t),o=function(){n._hasReachedQuota||null===n._db?i.src=t:n._saveImageIntoDBAsync(r,i)};this._mustUpdateRessources?o():this._loadImageFromDBAsync(r,i,o)},e.prototype._loadImageFromDBAsync=function(e,t,i){if(this._isSupported&&null!==this._db){var n,r=this._db.transaction(["textures"]);r.onabort=function(){t.src=e},r.oncomplete=function(){var r;if(n){var o=window.URL||window.webkitURL;r=o.createObjectURL(n.data),t.onerror=function(){m.a.Error("Error loading image from blob URL: "+r+" switching back to web url: "+e),t.src=e},t.src=r}else i()};var o=r.objectStore("textures").get(e);o.onsuccess=function(e){n=e.target.result},o.onerror=function(){m.a.Error("Error loading texture "+e+" from DB."),t.src=e}}else m.a.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."),t.src=e},e.prototype._saveImageIntoDBAsync=function(t,i){var n=this;if(this._isSupported){var r=function(){var e;if(o){var t=window.URL||window.webkitURL;try{e=t.createObjectURL(o)}catch(i){e=t.createObjectURL(o)}}e&&(i.src=e)};if(e.IsUASupportingBlobStorage){var o,a=new V.a;a.open("GET",t),a.responseType="blob",a.addEventListener("load",function(){if(200===a.status&&n._db){o=a.response;var s=n._db.transaction(["textures"],"readwrite");s.onabort=function(e){try{var t=(e.srcElement||e.target).error;t&&"QuotaExceededError"===t.name&&(n._hasReachedQuota=!0)}catch(e){}r()},s.oncomplete=function(){r()};var c={textureUrl:t,data:o};try{var l=s.objectStore("textures").put(c);l.onsuccess=function(){},l.onerror=function(){r()}}catch(r){25===r.code&&(e.IsUASupportingBlobStorage=!1,n._enableTexturesOffline=!1),i.src=t}}else i.src=t},!1),a.addEventListener("error",function(){m.a.Error("Error in XHR request in BABYLON.Database."),i.src=t},!1),a.send()}else i.src=t}else m.a.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),i.src=t},e.prototype._checkVersionFromDB=function(e,t){var i=this;this._loadVersionFromDBAsync(e,t,function(){i._saveVersionIntoDBAsync(e,t)})},e.prototype._loadVersionFromDBAsync=function(e,t,i){var n,r=this;if(this._isSupported&&this._db)try{var o=this._db.transaction(["versions"]);o.oncomplete=function(){n?r._manifestVersionFound!==n.data?(r._mustUpdateRessources=!0,i()):t(n.data):(r._mustUpdateRessources=!0,i())},o.onabort=function(){t(-1)};var a=o.objectStore("versions").get(e);a.onsuccess=function(e){n=e.target.result},a.onerror=function(){m.a.Error("Error loading version for scene "+e+" from DB."),t(-1)}}catch(e){m.a.Error("Error while accessing 'versions' object store (READ OP). Exception: "+e.message),t(-1)}else m.a.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),t(-1)},e.prototype._saveVersionIntoDBAsync=function(e,t){var i=this;if(this._isSupported&&!this._hasReachedQuota&&this._db)try{var n=this._db.transaction(["versions"],"readwrite");n.onabort=function(e){try{var n=e.srcElement.error;n&&"QuotaExceededError"===n.name&&(i._hasReachedQuota=!0)}catch(e){}t(-1)},n.oncomplete=function(){t(i._manifestVersionFound)};var r={sceneUrl:e,data:this._manifestVersionFound},o=n.objectStore("versions").put(r);o.onsuccess=function(){},o.onerror=function(){m.a.Error("Error in DB add version request in BABYLON.Database.")}}catch(e){m.a.Error("Error while accessing 'versions' object store (WRITE OP). Exception: "+e.message),t(-1)}else t(-1)},e.prototype.loadFile=function(t,i,n,r,o){var a=this,s=e._ReturnFullUrlLocation(t),c=function(){a._saveFileAsync(s,i,n,o,r)};this._checkVersionFromDB(s,function(e){-1!==e?a._mustUpdateRessources?a._saveFileAsync(s,i,n,o,r):a._loadFileAsync(s,i,c):r&&r()})},e.prototype._loadFileAsync=function(e,t,i){if(this._isSupported&&this._db){var n,r;n=-1!==e.indexOf(".babylon")?"scenes":"textures";var o=this._db.transaction([n]);o.oncomplete=function(){r?t(r.data):i()},o.onabort=function(){i()};var a=o.objectStore(n).get(e);a.onsuccess=function(e){r=e.target.result},a.onerror=function(){m.a.Error("Error loading file "+e+" from DB."),i()}}else m.a.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."),t()},e.prototype._saveFileAsync=function(t,i,n,r,o){var a=this;if(this._isSupported){var s;s=-1!==t.indexOf(".babylon")?"scenes":"textures";var c,l=new V.a;l.open("GET",t+"?"+Date.now()),r&&(l.responseType="arraybuffer"),n&&(l.onprogress=n),l.addEventListener("load",function(){if(200===l.status||l.status<400&&e._ValidateXHRData(l,r?6:1))if(c=r?l.response:l.responseText,!a._hasReachedQuota&&a._db){var n,u=a._db.transaction([s],"readwrite");u.onabort=function(e){try{var t=e.srcElement.error;t&&"QuotaExceededError"===t.name&&(a._hasReachedQuota=!0)}catch(e){}i(c)},u.oncomplete=function(){i(c)},n="scenes"===s?{sceneUrl:t,data:c,version:a._manifestVersionFound}:{textureUrl:t,data:c};try{var h=u.objectStore(s).put(n);h.onsuccess=function(){},h.onerror=function(){m.a.Error("Error in DB add file request in BABYLON.Database.")}}catch(e){i(c)}}else i(c);else l.status>=400&&o?o(l):i()},!1),l.addEventListener("error",function(){m.a.Error("error on XHR request."),i()},!1),l.send()}else m.a.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),i()},e._ValidateXHRData=function(e,t){void 0===t&&(t=7);try{if(1&t){if(e.responseText&&e.responseText.length>0)return!0;if(1===t)return!1}if(2&t){var i=fs.GetTGAHeader(e.response);if(i.width&&i.height&&i.width>0&&i.height>0)return!0;if(2===t)return!1}if(4&t){var n=new Uint8Array(e.response,0,3);return 68===n[0]&&68===n[1]&&83===n[2]}}catch(e){}return!1},e.IsUASupportingBlobStorage=!0,e.IDBStorageEnabled=!1,e._ParseURL=function(e){document.createElement("a").href=e;var t=e.substring(0,e.lastIndexOf("#")),i=e.substring(t.lastIndexOf("/")+1,e.length);return e.substring(0,e.indexOf(i,0))},e._ReturnFullUrlLocation=function(t){return-1===t.indexOf("http:/")&&-1===t.indexOf("https:/")&&"undefined"!=typeof window?e._ParseURL(window.location.href)+t:t},e}(),Mu=function(){function e(e,t,i){this.gradient=e,this.color1=t,this.color2=i}return e.prototype.getColorToRef=function(e){this.color2?s.b.LerpToRef(this.color1,this.color2,Math.random(),e):e.copyFrom(this.color1)},e}(),Iu=function(e,t){this.gradient=e,this.color=t},Du=function(){function e(e,t,i){this.gradient=e,this.factor1=t,this.factor2=i}return e.prototype.getFactor=function(){return void 0===this.factor2||this.factor2===this.factor1?this.factor1:this.factor1+(this.factor2-this.factor1)*Math.random()},e}(),Nu=function(){function e(){}return e.GetCurrentGradient=function(e,t,i){if(t[0].gradient>e)i(t[0],t[0],1);else{for(var n=0;n<t.length-1;n++){var r=t[n],o=t[n+1];if(e>=r.gradient&&e<=o.gradient)return void i(r,o,(e-r.gradient)/(o.gradient-r.gradient))}var a=t.length-1;i(t[a],t[a],1)}},e}(),Lu=function(){function e(t){this.particleSystem=t,this.position=a.e.Zero(),this.direction=a.e.Zero(),this.color=new s.b(0,0,0,0),this.colorStep=new s.b(0,0,0,0),this.lifeTime=1,this.age=0,this.size=0,this.scale=new a.d(1,1),this.angle=0,this.angularSpeed=0,this.cellIndex=0,this._attachedSubEmitters=null,this._currentColor1=new s.b(0,0,0,0),this._currentColor2=new s.b(0,0,0,0),this._currentSize1=0,this._currentSize2=0,this._currentAngularSpeed1=0,this._currentAngularSpeed2=0,this._currentVelocity1=0,this._currentVelocity2=0,this._currentLimitVelocity1=0,this._currentLimitVelocity2=0,this._currentDrag1=0,this._currentDrag2=0,this.id=e._Count++,this.particleSystem.isAnimationSheetEnabled&&this.updateCellInfoFromSystem()}return e.prototype.updateCellInfoFromSystem=function(){this.cellIndex=this.particleSystem.startSpriteCellID},e.prototype.updateCellIndex=function(){var e=this.age,t=this.particleSystem.spriteCellChangeSpeed;this.particleSystem.spriteRandomStartCell&&(void 0===this._randomCellOffset&&(this._randomCellOffset=Math.random()*this.lifeTime),0===t?(t=1,e=this._randomCellOffset):e+=this._randomCellOffset);var i=this._initialEndSpriteCellID-this._initialStartSpriteCellID,n=L.a.Clamp(e*t%this.lifeTime/this.lifeTime);this.cellIndex=this._initialStartSpriteCellID+n*i|0},e.prototype._inheritParticleInfoToSubEmitter=function(e){if(e.particleSystem.emitter.position){var t=e.particleSystem.emitter;if(t.position.copyFrom(this.position),e.inheritDirection){var i=a.c.Vector3[0];this.direction.normalizeToRef(i),t.setDirection(i,0,Math.PI/2)}}else e.particleSystem.emitter.copyFrom(this.position);this.direction.scaleToRef(e.inheritedVelocityAmount/2,a.c.Vector3[0]),e.particleSystem._inheritedVelocityOffset.copyFrom(a.c.Vector3[0])},e.prototype._inheritParticleInfoToSubEmitters=function(){var e=this;this._attachedSubEmitters&&this._attachedSubEmitters.length>0&&this._attachedSubEmitters.forEach(function(t){e._inheritParticleInfoToSubEmitter(t)})},e.prototype._reset=function(){this.age=0,this.id=e._Count++,this._currentColorGradient=null,this._currentSizeGradient=null,this._currentAngularSpeedGradient=null,this._currentVelocityGradient=null,this._currentLimitVelocityGradient=null,this._currentDragGradient=null,this.cellIndex=this.particleSystem.startSpriteCellID,this._randomCellOffset=void 0},e.prototype.copyTo=function(e){e.position.copyFrom(this.position),this._initialDirection?e._initialDirection?e._initialDirection.copyFrom(this._initialDirection):e._initialDirection=this._initialDirection.clone():e._initialDirection=null,e.direction.copyFrom(this.direction),this._localPosition&&(e._localPosition?e._localPosition.copyFrom(this._localPosition):e._localPosition=this._localPosition.clone()),e.color.copyFrom(this.color),e.colorStep.copyFrom(this.colorStep),e.lifeTime=this.lifeTime,e.age=this.age,e._randomCellOffset=this._randomCellOffset,e.size=this.size,e.scale.copyFrom(this.scale),e.angle=this.angle,e.angularSpeed=this.angularSpeed,e.particleSystem=this.particleSystem,e.cellIndex=this.cellIndex,e.id=this.id,e._attachedSubEmitters=this._attachedSubEmitters,this._currentColorGradient&&(e._currentColorGradient=this._currentColorGradient,e._currentColor1.copyFrom(this._currentColor1),e._currentColor2.copyFrom(this._currentColor2)),this._currentSizeGradient&&(e._currentSizeGradient=this._currentSizeGradient,e._currentSize1=this._currentSize1,e._currentSize2=this._currentSize2),this._currentAngularSpeedGradient&&(e._currentAngularSpeedGradient=this._currentAngularSpeedGradient,e._currentAngularSpeed1=this._currentAngularSpeed1,e._currentAngularSpeed2=this._currentAngularSpeed2),this._currentVelocityGradient&&(e._currentVelocityGradient=this._currentVelocityGradient,e._currentVelocity1=this._currentVelocity1,e._currentVelocity2=this._currentVelocity2),this._currentLimitVelocityGradient&&(e._currentLimitVelocityGradient=this._currentLimitVelocityGradient,e._currentLimitVelocity1=this._currentLimitVelocity1,e._currentLimitVelocity2=this._currentLimitVelocity2),this._currentDragGradient&&(e._currentDragGradient=this._currentDragGradient,e._currentDrag1=this._currentDrag1,e._currentDrag2=this._currentDrag2),this.particleSystem.isAnimationSheetEnabled&&(e._initialStartSpriteCellID=this._initialStartSpriteCellID,e._initialEndSpriteCellID=this._initialEndSpriteCellID),this.particleSystem.useRampGradients&&(e.remapData&&this.remapData?e.remapData.copyFrom(this.remapData):e.remapData=new a.f(0,0,0,0)),this._randomNoiseCoordinates1&&(e._randomNoiseCoordinates1?(e._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1),e._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)):(e._randomNoiseCoordinates1=this._randomNoiseCoordinates1.clone(),e._randomNoiseCoordinates2=this._randomNoiseCoordinates2.clone()))},e._Count=0,e}();!function(e){e[e.ATTACHED=0]="ATTACHED",e[e.END=1]="END"}(xu||(xu={}));var wu=function(){function e(e){if(this.particleSystem=e,this.type=xu.END,this.inheritDirection=!1,this.inheritedVelocityAmount=0,!e.emitter||!e.emitter.dispose){var t=c.a.GetClass("BABYLON.AbstractMesh");e.emitter=new t("SubemitterSystemEmitter",e.getScene())}e.onDisposeObservable.add(function(){e.emitter&&e.emitter.dispose&&e.emitter.dispose()})}return e.prototype.clone=function(){var t=this.particleSystem.emitter;t?t instanceof a.e?t=t.clone():-1!==t.getClassName().indexOf("Mesh")&&((t=new(c.a.GetClass("BABYLON.Mesh"))("",t.getScene())).isVisible=!1):t=new a.e;var i=new e(this.particleSystem.clone("",t));return i.particleSystem.name+="Clone",i.type=this.type,i.inheritDirection=this.inheritDirection,i.inheritedVelocityAmount=this.inheritedVelocityAmount,i.particleSystem._disposeEmitterOnDispose=!0,i.particleSystem.disposeOnStop=!0,i},e.prototype.serialize=function(){var e={};return e.type=this.type,e.inheritDirection=this.inheritDirection,e.inheritedVelocityAmount=this.inheritedVelocityAmount,e.particleSystem=this.particleSystem.serialize(),e},e._ParseParticleSystem=function(e,t,i){throw Re.a.WarnImport("ParseParticle")},e.Parse=function(t,i,n){var r=t.particleSystem,o=new e(e._ParseParticleSystem(r,i,n));return o.type=t.type,o.inheritDirection=t.inheritDirection,o.inheritedVelocityAmount=t.inheritedVelocityAmount,o.particleSystem._isSubEmitter=!0,o},e.prototype.dispose=function(){this.particleSystem.dispose()},e}();ai.a.ShadersStore.particlesPixelShader="\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec4 textureMask;\nuniform sampler2D diffuseSampler;\n#include<clipPlaneFragmentDeclaration>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\nuniform sampler2D rampSampler;\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec4 textureColor=texture2D(diffuseSampler,vUV);\nvec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n#ifdef RAMPGRADIENT\nfloat alpha=baseColor.a;\nfloat remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);\nvec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));\nbaseColor.rgb*=rampColor.rgb;\n\nfloat finalAlpha=baseColor.a;\nbaseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nfloat sourceAlpha=vColor.a*textureColor.a;\nbaseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\nbaseColor=applyImageProcessing(baseColor);\n#endif\n#endif\ngl_FragColor=baseColor;\n}";ai.a.ShadersStore.particlesVertexShader="\nattribute vec3 position;\nattribute vec4 color;\nattribute float angle;\nattribute vec2 size;\n#ifdef ANIMATESHEET\nattribute float cellIndex;\n#endif\n#ifndef BILLBOARD\nattribute vec3 direction;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction;\n#endif\n#ifdef RAMPGRADIENT\nattribute vec4 remapData;\n#endif\nattribute vec2 offset;\n\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\n#ifdef ANIMATESHEET\nuniform vec3 particlesInfos;\n#endif\n\nvarying vec2 vUV;\nvarying vec4 vColor;\nvarying vec3 vPositionW;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration>\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#endif\nvoid main(void) {\nvec2 cornerPos;\ncornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n#ifdef BILLBOARD\n\nvec3 rotatedCorner;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=position-eyePosition;\nyaxis.y=0.;\nvPositionW=rotate(normalize(yaxis),rotatedCorner);\nvec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=position-eyePosition;\nvPositionW=rotateAlign(toCamera,rotatedCorner);\nvec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;\nvPositionW=(invView*vec4(viewPos,1)).xyz;\n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\n\ngl_Position=projection*vec4(viewPos,1.0);\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=normalize(direction);\nvPositionW=rotate(yaxis,rotatedCorner);\ngl_Position=projection*view*vec4(vPositionW,1.0);\n#endif\nvColor=color;\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex*particlesInfos.z);\nfloat columnOffset=cellIndex-rowOffset/particlesInfos.z;\nvec2 uvScale=particlesInfos.xy;\nvec2 uvOffset=vec2(offset.x ,1.0-offset.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=offset;\n#endif\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n}";var Fu=function(e){function t(t,i,n,r,c,l){void 0===r&&(r=null),void 0===c&&(c=!1),void 0===l&&(l=.01);var u=e.call(this,t)||this;return u._inheritedVelocityOffset=new a.e,u.onDisposeObservable=new o.c,u.onStoppedObservable=new o.c,u._particles=new Array,u._stockParticles=new Array,u._newPartsExcess=0,u._vertexBuffers={},u._scaledColorStep=new s.b(0,0,0,0),u._colorDiff=new s.b(0,0,0,0),u._scaledDirection=a.e.Zero(),u._scaledGravity=a.e.Zero(),u._currentRenderId=-1,u._useInstancing=!1,u._started=!1,u._stopped=!1,u._actualFrame=0,u._currentEmitRate1=0,u._currentEmitRate2=0,u._currentStartSize1=0,u._currentStartSize2=0,u._rawTextureWidth=256,u._useRampGradients=!1,u._disposeEmitterOnDispose=!1,u.isLocal=!1,u._onBeforeDrawParticlesObservable=null,u.recycleParticle=function(e){var t=u._particles.pop();t!==e&&t.copyTo(e),u._stockParticles.push(t)},u._createParticle=function(){var e;if(0!==u._stockParticles.length?(e=u._stockParticles.pop())._reset():e=new Lu(u),u._subEmitters&&u._subEmitters.length>0){var t=u._subEmitters[Math.floor(Math.random()*u._subEmitters.length)];e._attachedSubEmitters=[],t.forEach(function(t){if(t.type===xu.ATTACHED){var i=t.clone();e._attachedSubEmitters.push(i),i.particleSystem.start()}})}return e},u._emitFromParticle=function(e){if(u._subEmitters&&0!==u._subEmitters.length){var t=Math.floor(Math.random()*u._subEmitters.length);u._subEmitters[t].forEach(function(t){if(t.type===xu.END){var i=t.clone();e._inheritParticleInfoToSubEmitter(i),i.particleSystem._rootParticleSystem=u,u.activeSubSystems.push(i.particleSystem),i.particleSystem.start()}})}},u._capacity=i,u._epsilon=l,u._isAnimationSheetEnabled=c,n&&"Scene"!==n.getClassName()?(u._engine=n,u.defaultProjectionMatrix=a.a.PerspectiveFovLH(.8,1,.1,100)):(u._scene=n||x.a.LastCreatedScene,u._engine=u._scene.getEngine(),u.uniqueId=u._scene.getUniqueId(),u._scene.particleSystems.push(u)),u._engine.getCaps().vertexArrayObject&&(u._vertexArrayObject=null),u._attachImageProcessingConfiguration(null),u._customEffect={0:r},u._useInstancing=u._engine.getCaps().instancedArrays,u._createIndexBuffer(),u._createVertexBuffers(),u.particleEmitterType=new ac,u.updateFunction=function(e){var t=null,i=null;u.noiseTexture&&(t=u.noiseTexture.getSize(),i=u.noiseTexture.getContent());for(var n,r=function(){n=e[o];var r=u._scaledUpdateSpeed,c=n.age;if(n.age+=r,n.age>n.lifeTime){var l=n.age-c;r=(n.lifeTime-c)*r/l,n.age=n.lifeTime}var h=n.age/n.lifeTime;u._colorGradients&&u._colorGradients.length>0?Nu.GetCurrentGradient(h,u._colorGradients,function(e,t,i){e!==n._currentColorGradient&&(n._currentColor1.copyFrom(n._currentColor2),t.getColorToRef(n._currentColor2),n._currentColorGradient=e),s.b.LerpToRef(n._currentColor1,n._currentColor2,i,n.color)}):(n.colorStep.scaleToRef(r,u._scaledColorStep),n.color.addInPlace(u._scaledColorStep),n.color.a<0&&(n.color.a=0)),u._angularSpeedGradients&&u._angularSpeedGradients.length>0&&Nu.GetCurrentGradient(h,u._angularSpeedGradients,function(e,t,i){e!==n._currentAngularSpeedGradient&&(n._currentAngularSpeed1=n._currentAngularSpeed2,n._currentAngularSpeed2=t.getFactor(),n._currentAngularSpeedGradient=e),n.angularSpeed=L.a.Lerp(n._currentAngularSpeed1,n._currentAngularSpeed2,i)}),n.angle+=n.angularSpeed*r;var d=r;if(u._velocityGradients&&u._velocityGradients.length>0&&Nu.GetCurrentGradient(h,u._velocityGradients,function(e,t,i){e!==n._currentVelocityGradient&&(n._currentVelocity1=n._currentVelocity2,n._currentVelocity2=t.getFactor(),n._currentVelocityGradient=e),d*=L.a.Lerp(n._currentVelocity1,n._currentVelocity2,i)}),n.direction.scaleToRef(d,u._scaledDirection),u._limitVelocityGradients&&u._limitVelocityGradients.length>0&&Nu.GetCurrentGradient(h,u._limitVelocityGradients,function(e,t,i){e!==n._currentLimitVelocityGradient&&(n._currentLimitVelocity1=n._currentLimitVelocity2,n._currentLimitVelocity2=t.getFactor(),n._currentLimitVelocityGradient=e);var r=L.a.Lerp(n._currentLimitVelocity1,n._currentLimitVelocity2,i);n.direction.length()>r&&n.direction.scaleInPlace(u.limitVelocityDamping)}),u._dragGradients&&u._dragGradients.length>0&&Nu.GetCurrentGradient(h,u._dragGradients,function(e,t,i){e!==n._currentDragGradient&&(n._currentDrag1=n._currentDrag2,n._currentDrag2=t.getFactor(),n._currentDragGradient=e);var r=L.a.Lerp(n._currentDrag1,n._currentDrag2,i);u._scaledDirection.scaleInPlace(1-r)}),u.isLocal&&n._localPosition?(n._localPosition.addInPlace(u._scaledDirection),a.e.TransformCoordinatesToRef(n._localPosition,u._emitterWorldMatrix,n.position)):n.position.addInPlace(u._scaledDirection),i&&t&&n._randomNoiseCoordinates1){var f=u._fetchR(n._randomNoiseCoordinates1.x,n._randomNoiseCoordinates1.y,t.width,t.height,i),p=u._fetchR(n._randomNoiseCoordinates1.z,n._randomNoiseCoordinates2.x,t.width,t.height,i),_=u._fetchR(n._randomNoiseCoordinates2.y,n._randomNoiseCoordinates2.z,t.width,t.height,i),m=a.c.Vector3[0],g=a.c.Vector3[1];m.copyFromFloats((2*f-1)*u.noiseStrength.x,(2*p-1)*u.noiseStrength.y,(2*_-1)*u.noiseStrength.z),m.scaleToRef(r,g),n.direction.addInPlace(g)}if(u.gravity.scaleToRef(r,u._scaledGravity),n.direction.addInPlace(u._scaledGravity),u._sizeGradients&&u._sizeGradients.length>0&&Nu.GetCurrentGradient(h,u._sizeGradients,function(e,t,i){e!==n._currentSizeGradient&&(n._currentSize1=n._currentSize2,n._currentSize2=t.getFactor(),n._currentSizeGradient=e),n.size=L.a.Lerp(n._currentSize1,n._currentSize2,i)}),u._useRampGradients&&(u._colorRemapGradients&&u._colorRemapGradients.length>0&&Nu.GetCurrentGradient(h,u._colorRemapGradients,function(e,t,i){var r=L.a.Lerp(e.factor1,t.factor1,i),o=L.a.Lerp(e.factor2,t.factor2,i);n.remapData.x=r,n.remapData.y=o-r}),u._alphaRemapGradients&&u._alphaRemapGradients.length>0&&Nu.GetCurrentGradient(h,u._alphaRemapGradients,function(e,t,i){var r=L.a.Lerp(e.factor1,t.factor1,i),o=L.a.Lerp(e.factor2,t.factor2,i);n.remapData.z=r,n.remapData.w=o-r})),u._isAnimationSheetEnabled&&n.updateCellIndex(),n._inheritParticleInfoToSubEmitters(),n.age>=n.lifeTime)return u._emitFromParticle(n),n._attachedSubEmitters&&(n._attachedSubEmitters.forEach(function(e){e.particleSystem.disposeOnStop=!0,e.particleSystem.stop()}),n._attachedSubEmitters=null),u.recycleParticle(n),o--,"continue"},o=0;o<e.length;o++)r()},u}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useRampGradients",{get:function(){return this._useRampGradients},set:function(e){this._useRampGradients!==e&&(this._useRampGradients=e,this._resetEffect())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"particles",{get:function(){return this._particles},enumerable:!1,configurable:!0}),t.prototype.getActiveCount=function(){return this._particles.length},t.prototype.getClassName=function(){return"ParticleSystem"},t.prototype.isStopping=function(){return this._stopped&&this.isAlive()},t.prototype.getCustomEffect=function(e){var t;return void 0===e&&(e=0),null!==(t=this._customEffect[e])&&void 0!==t?t:this._customEffect[0]},t.prototype.setCustomEffect=function(e,t){void 0===t&&(t=0),this._customEffect[t]=e},Object.defineProperty(t.prototype,"onBeforeDrawParticlesObservable",{get:function(){return this._onBeforeDrawParticlesObservable||(this._onBeforeDrawParticlesObservable=new o.c),this._onBeforeDrawParticlesObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexShaderName",{get:function(){return"particles"},enumerable:!1,configurable:!0}),t.prototype._addFactorGradient=function(e,t,i,n){var r=new Du(t,i,n);e.push(r),e.sort(function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0})},t.prototype._removeFactorGradient=function(e,t){if(e)for(var i=0,n=0,r=e;n<r.length;n++){if(r[n].gradient===t){e.splice(i,1);break}i++}},t.prototype.addLifeTimeGradient=function(e,t,i){return this._lifeTimeGradients||(this._lifeTimeGradients=[]),this._addFactorGradient(this._lifeTimeGradients,e,t,i),this},t.prototype.removeLifeTimeGradient=function(e){return this._removeFactorGradient(this._lifeTimeGradients,e),this},t.prototype.addSizeGradient=function(e,t,i){return this._sizeGradients||(this._sizeGradients=[]),this._addFactorGradient(this._sizeGradients,e,t,i),this},t.prototype.removeSizeGradient=function(e){return this._removeFactorGradient(this._sizeGradients,e),this},t.prototype.addColorRemapGradient=function(e,t,i){return this._colorRemapGradients||(this._colorRemapGradients=[]),this._addFactorGradient(this._colorRemapGradients,e,t,i),this},t.prototype.removeColorRemapGradient=function(e){return this._removeFactorGradient(this._colorRemapGradients,e),this},t.prototype.addAlphaRemapGradient=function(e,t,i){return this._alphaRemapGradients||(this._alphaRemapGradients=[]),this._addFactorGradient(this._alphaRemapGradients,e,t,i),this},t.prototype.removeAlphaRemapGradient=function(e){return this._removeFactorGradient(this._alphaRemapGradients,e),this},t.prototype.addAngularSpeedGradient=function(e,t,i){return this._angularSpeedGradients||(this._angularSpeedGradients=[]),this._addFactorGradient(this._angularSpeedGradients,e,t,i),this},t.prototype.removeAngularSpeedGradient=function(e){return this._removeFactorGradient(this._angularSpeedGradients,e),this},t.prototype.addVelocityGradient=function(e,t,i){return this._velocityGradients||(this._velocityGradients=[]),this._addFactorGradient(this._velocityGradients,e,t,i),this},t.prototype.removeVelocityGradient=function(e){return this._removeFactorGradient(this._velocityGradients,e),this},t.prototype.addLimitVelocityGradient=function(e,t,i){return this._limitVelocityGradients||(this._limitVelocityGradients=[]),this._addFactorGradient(this._limitVelocityGradients,e,t,i),this},t.prototype.removeLimitVelocityGradient=function(e){return this._removeFactorGradient(this._limitVelocityGradients,e),this},t.prototype.addDragGradient=function(e,t,i){return this._dragGradients||(this._dragGradients=[]),this._addFactorGradient(this._dragGradients,e,t,i),this},t.prototype.removeDragGradient=function(e){return this._removeFactorGradient(this._dragGradients,e),this},t.prototype.addEmitRateGradient=function(e,t,i){return this._emitRateGradients||(this._emitRateGradients=[]),this._addFactorGradient(this._emitRateGradients,e,t,i),this},t.prototype.removeEmitRateGradient=function(e){return this._removeFactorGradient(this._emitRateGradients,e),this},t.prototype.addStartSizeGradient=function(e,t,i){return this._startSizeGradients||(this._startSizeGradients=[]),this._addFactorGradient(this._startSizeGradients,e,t,i),this},t.prototype.removeStartSizeGradient=function(e){return this._removeFactorGradient(this._startSizeGradients,e),this},t.prototype._createRampGradientTexture=function(){if(this._rampGradients&&this._rampGradients.length&&!this._rampGradientsTexture&&this._scene){for(var e=new Uint8Array(4*this._rawTextureWidth),t=s.c.Color3[0],i=0;i<this._rawTextureWidth;i++){var n=i/this._rawTextureWidth;Nu.GetCurrentGradient(n,this._rampGradients,function(n,r,o){s.a.LerpToRef(n.color,r.color,o,t),e[4*i]=255*t.r,e[4*i+1]=255*t.g,e[4*i+2]=255*t.b,e[4*i+3]=255})}this._rampGradientsTexture=et.CreateRGBATexture(e,this._rawTextureWidth,1,this._scene,!1,!1,g.a.TEXTURE_NEAREST_SAMPLINGMODE)}},t.prototype.getRampGradients=function(){return this._rampGradients},t.prototype.forceRefreshGradients=function(){this._syncRampGradientTexture()},t.prototype._syncRampGradientTexture=function(){this._rampGradients&&(this._rampGradients.sort(function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0}),this._rampGradientsTexture&&(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),this._createRampGradientTexture())},t.prototype.addRampGradient=function(e,t){this._rampGradients||(this._rampGradients=[]);var i=new Iu(e,t);return this._rampGradients.push(i),this._syncRampGradientTexture(),this},t.prototype.removeRampGradient=function(e){return this._removeGradientAndTexture(e,this._rampGradients,this._rampGradientsTexture),this._rampGradientsTexture=null,this._rampGradients&&this._rampGradients.length>0&&this._createRampGradientTexture(),this},t.prototype.addColorGradient=function(e,t,i){this._colorGradients||(this._colorGradients=[]);var n=new Mu(e,t,i);return this._colorGradients.push(n),this._colorGradients.sort(function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0}),this},t.prototype.removeColorGradient=function(e){if(!this._colorGradients)return this;for(var t=0,i=0,n=this._colorGradients;i<n.length;i++){if(n[i].gradient===e){this._colorGradients.splice(t,1);break}t++}return this},t.prototype._fetchR=function(e,t,i,n,r){return r[4*(((e=.5*Math.abs(e)+.5)*i%i|0)+((t=.5*Math.abs(t)+.5)*n%n|0)*i)]/255},t.prototype._reset=function(){this._resetEffect()},t.prototype._resetEffect=function(){this._vertexBuffer&&(this._vertexBuffer.dispose(),this._vertexBuffer=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._vertexArrayObject&&(this._engine.releaseVertexArrayObject(this._vertexArrayObject),this._vertexArrayObject=null),this._createVertexBuffers()},t.prototype._createVertexBuffers=function(){this._vertexBufferSize=this._useInstancing?10:12,this._isAnimationSheetEnabled&&(this._vertexBufferSize+=1),this._isBillboardBased&&this.billboardMode!==t.BILLBOARDMODE_STRETCHED||(this._vertexBufferSize+=3),this._useRampGradients&&(this._vertexBufferSize+=4);var e=this._engine;this._vertexData=new Float32Array(this._capacity*this._vertexBufferSize*(this._useInstancing?1:4)),this._vertexBuffer=new ji.a(e,this._vertexData,!0,this._vertexBufferSize);var i=0,n=this._vertexBuffer.createVertexBuffer(ji.b.PositionKind,i,3,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[ji.b.PositionKind]=n,i+=3;var r=this._vertexBuffer.createVertexBuffer(ji.b.ColorKind,i,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[ji.b.ColorKind]=r,i+=4;var o=this._vertexBuffer.createVertexBuffer("angle",i,1,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.angle=o,i+=1;var a,s=this._vertexBuffer.createVertexBuffer("size",i,2,this._vertexBufferSize,this._useInstancing);if(this._vertexBuffers.size=s,i+=2,this._isAnimationSheetEnabled){var c=this._vertexBuffer.createVertexBuffer("cellIndex",i,1,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.cellIndex=c,i+=1}if(!this._isBillboardBased||this.billboardMode===t.BILLBOARDMODE_STRETCHED){var l=this._vertexBuffer.createVertexBuffer("direction",i,3,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.direction=l,i+=3}if(this._useRampGradients){var u=this._vertexBuffer.createVertexBuffer("remapData",i,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.remapData=u,i+=4}if(this._useInstancing){var h=new Float32Array([0,0,1,0,1,1,0,1]);this._spriteBuffer=new ji.a(e,h,!1,2),a=this._spriteBuffer.createVertexBuffer("offset",0,2)}else a=this._vertexBuffer.createVertexBuffer("offset",i,2,this._vertexBufferSize,this._useInstancing),i+=2;this._vertexBuffers.offset=a},t.prototype._createIndexBuffer=function(){if(!this._useInstancing){for(var e=[],t=0,i=0;i<this._capacity;i++)e.push(t),e.push(t+1),e.push(t+2),e.push(t),e.push(t+2),e.push(t+3),t+=4;this._indexBuffer=this._engine.createIndexBuffer(e)}},t.prototype.getCapacity=function(){return this._capacity},t.prototype.isAlive=function(){return this._alive},t.prototype.isStarted=function(){return this._started},t.prototype._prepareSubEmitterInternalArray=function(){var e=this;this._subEmitters=new Array,this.subEmitters&&this.subEmitters.forEach(function(i){i instanceof t?e._subEmitters.push([new wu(i)]):i instanceof wu?e._subEmitters.push([i]):i instanceof Array&&e._subEmitters.push(i)})},t.prototype.start=function(e){var t,i=this;if(void 0===e&&(e=this.startDelay),!this.targetStopDuration&&this._hasTargetStopDurationDependantGradient())throw"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";if(e)setTimeout(function(){i.start(0)},e);else{if(this._prepareSubEmitterInternalArray(),this._started=!0,this._stopped=!1,this._actualFrame=0,this._subEmitters&&0!=this._subEmitters.length&&(this.activeSubSystems=new Array),this._emitRateGradients&&(this._emitRateGradients.length>0&&(this._currentEmitRateGradient=this._emitRateGradients[0],this._currentEmitRate1=this._currentEmitRateGradient.getFactor(),this._currentEmitRate2=this._currentEmitRate1),this._emitRateGradients.length>1&&(this._currentEmitRate2=this._emitRateGradients[1].getFactor())),this._startSizeGradients&&(this._startSizeGradients.length>0&&(this._currentStartSizeGradient=this._startSizeGradients[0],this._currentStartSize1=this._currentStartSizeGradient.getFactor(),this._currentStartSize2=this._currentStartSize1),this._startSizeGradients.length>1&&(this._currentStartSize2=this._startSizeGradients[1].getFactor())),this.preWarmCycles){-1!==(null===(t=this.emitter)||void 0===t?void 0:t.getClassName().indexOf("Mesh"))&&this.emitter.computeWorldMatrix(!0);var n=this.noiseTexture;if(n&&n.onGeneratedObservable)n.onGeneratedObservable.addOnce(function(){setTimeout(function(){for(var e=0;e<i.preWarmCycles;e++)i.animate(!0),n.render()})});else for(var r=0;r<this.preWarmCycles;r++)this.animate(!0)}this.beginAnimationOnStart&&this.animations&&this.animations.length>0&&this._scene&&this._scene.beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop)}},t.prototype.stop=function(e){void 0===e&&(e=!0),this._stopped||(this.onStoppedObservable.notifyObservers(this),this._stopped=!0,e&&this._stopSubEmitters())},t.prototype.reset=function(){this._stockParticles=[],this._particles=[]},t.prototype._appendParticleVertex=function(e,i,n,r){var o=e*this._vertexBufferSize;if(this._vertexData[o++]=i.position.x+this.worldOffset.x,this._vertexData[o++]=i.position.y+this.worldOffset.y,this._vertexData[o++]=i.position.z+this.worldOffset.z,this._vertexData[o++]=i.color.r,this._vertexData[o++]=i.color.g,this._vertexData[o++]=i.color.b,this._vertexData[o++]=i.color.a,this._vertexData[o++]=i.angle,this._vertexData[o++]=i.scale.x*i.size,this._vertexData[o++]=i.scale.y*i.size,this._isAnimationSheetEnabled&&(this._vertexData[o++]=i.cellIndex),this._isBillboardBased)this.billboardMode===t.BILLBOARDMODE_STRETCHED&&(this._vertexData[o++]=i.direction.x,this._vertexData[o++]=i.direction.y,this._vertexData[o++]=i.direction.z);else if(i._initialDirection){var s=i._initialDirection;this.isLocal&&(a.e.TransformNormalToRef(s,this._emitterWorldMatrix,a.c.Vector3[0]),s=a.c.Vector3[0]),0===s.x&&0===s.z&&(s.x=.001),this._vertexData[o++]=s.x,this._vertexData[o++]=s.y,this._vertexData[o++]=s.z}else{var c=i.direction;this.isLocal&&(a.e.TransformNormalToRef(c,this._emitterWorldMatrix,a.c.Vector3[0]),c=a.c.Vector3[0]),0===c.x&&0===c.z&&(c.x=.001),this._vertexData[o++]=c.x,this._vertexData[o++]=c.y,this._vertexData[o++]=c.z}this._useRampGradients&&i.remapData&&(this._vertexData[o++]=i.remapData.x,this._vertexData[o++]=i.remapData.y,this._vertexData[o++]=i.remapData.z,this._vertexData[o++]=i.remapData.w),this._useInstancing||(this._isAnimationSheetEnabled&&(0===n?n=this._epsilon:1===n&&(n=1-this._epsilon),0===r?r=this._epsilon:1===r&&(r=1-this._epsilon)),this._vertexData[o++]=n,this._vertexData[o++]=r)},t.prototype._stopSubEmitters=function(){this.activeSubSystems&&(this.activeSubSystems.forEach(function(e){e.stop(!0)}),this.activeSubSystems=new Array)},t.prototype._removeFromRoot=function(){if(this._rootParticleSystem){var e=this._rootParticleSystem.activeSubSystems.indexOf(this);-1!==e&&this._rootParticleSystem.activeSubSystems.splice(e,1),this._rootParticleSystem=null}},t.prototype._update=function(e){var t,i=this;if(this._alive=this._particles.length>0,this.emitter.position){var n=this.emitter;this._emitterWorldMatrix=n.getWorldMatrix()}else{var r=this.emitter;this._emitterWorldMatrix=a.a.Translation(r.x,r.y,r.z)}this.updateFunction(this._particles);for(var o,c=function(){if(l._particles.length===l._capacity)return"break";if(t=l._createParticle(),l._particles.push(t),l.targetStopDuration&&l._lifeTimeGradients&&l._lifeTimeGradients.length>0){var e=L.a.Clamp(l._actualFrame/l.targetStopDuration);Nu.GetCurrentGradient(e,l._lifeTimeGradients,function(i,n){var r=i,o=n,a=r.getFactor(),s=o.getFactor(),c=(e-r.gradient)/(o.gradient-r.gradient);t.lifeTime=L.a.Lerp(a,s,c)})}else t.lifeTime=L.a.RandomRange(l.minLifeTime,l.maxLifeTime);var n=L.a.RandomRange(l.minEmitPower,l.maxEmitPower);if(l.startPositionFunction?l.startPositionFunction(l._emitterWorldMatrix,t.position,t,l.isLocal):l.particleEmitterType.startPositionFunction(l._emitterWorldMatrix,t.position,t,l.isLocal),l.isLocal&&(t._localPosition?t._localPosition.copyFrom(t.position):t._localPosition=t.position.clone(),a.e.TransformCoordinatesToRef(t._localPosition,l._emitterWorldMatrix,t.position)),l.startDirectionFunction?l.startDirectionFunction(l._emitterWorldMatrix,t.direction,t,l.isLocal):l.particleEmitterType.startDirectionFunction(l._emitterWorldMatrix,t.direction,t,l.isLocal),0===n?t._initialDirection?t._initialDirection.copyFrom(t.direction):t._initialDirection=t.direction.clone():t._initialDirection=null,t.direction.scaleInPlace(n),l._sizeGradients&&0!==l._sizeGradients.length?(t._currentSizeGradient=l._sizeGradients[0],t._currentSize1=t._currentSizeGradient.getFactor(),t.size=t._currentSize1,l._sizeGradients.length>1?t._currentSize2=l._sizeGradients[1].getFactor():t._currentSize2=t._currentSize1):t.size=L.a.RandomRange(l.minSize,l.maxSize),t.scale.copyFromFloats(L.a.RandomRange(l.minScaleX,l.maxScaleX),L.a.RandomRange(l.minScaleY,l.maxScaleY)),l._startSizeGradients&&l._startSizeGradients[0]&&l.targetStopDuration){var r=l._actualFrame/l.targetStopDuration;Nu.GetCurrentGradient(r,l._startSizeGradients,function(e,n,r){e!==i._currentStartSizeGradient&&(i._currentStartSize1=i._currentStartSize2,i._currentStartSize2=n.getFactor(),i._currentStartSizeGradient=e);var o=L.a.Lerp(i._currentStartSize1,i._currentStartSize2,r);t.scale.scaleInPlace(o)})}l._angularSpeedGradients&&0!==l._angularSpeedGradients.length?(t._currentAngularSpeedGradient=l._angularSpeedGradients[0],t.angularSpeed=t._currentAngularSpeedGradient.getFactor(),t._currentAngularSpeed1=t.angularSpeed,l._angularSpeedGradients.length>1?t._currentAngularSpeed2=l._angularSpeedGradients[1].getFactor():t._currentAngularSpeed2=t._currentAngularSpeed1):t.angularSpeed=L.a.RandomRange(l.minAngularSpeed,l.maxAngularSpeed),t.angle=L.a.RandomRange(l.minInitialRotation,l.maxInitialRotation),l._velocityGradients&&l._velocityGradients.length>0&&(t._currentVelocityGradient=l._velocityGradients[0],t._currentVelocity1=t._currentVelocityGradient.getFactor(),l._velocityGradients.length>1?t._currentVelocity2=l._velocityGradients[1].getFactor():t._currentVelocity2=t._currentVelocity1),l._limitVelocityGradients&&l._limitVelocityGradients.length>0&&(t._currentLimitVelocityGradient=l._limitVelocityGradients[0],t._currentLimitVelocity1=t._currentLimitVelocityGradient.getFactor(),l._limitVelocityGradients.length>1?t._currentLimitVelocity2=l._limitVelocityGradients[1].getFactor():t._currentLimitVelocity2=t._currentLimitVelocity1),l._dragGradients&&l._dragGradients.length>0&&(t._currentDragGradient=l._dragGradients[0],t._currentDrag1=t._currentDragGradient.getFactor(),l._dragGradients.length>1?t._currentDrag2=l._dragGradients[1].getFactor():t._currentDrag2=t._currentDrag1),l._colorGradients&&0!==l._colorGradients.length?(t._currentColorGradient=l._colorGradients[0],t._currentColorGradient.getColorToRef(t.color),t._currentColor1.copyFrom(t.color),l._colorGradients.length>1?l._colorGradients[1].getColorToRef(t._currentColor2):t._currentColor2.copyFrom(t.color)):(o=L.a.RandomRange(0,1),s.b.LerpToRef(l.color1,l.color2,o,t.color),l.colorDead.subtractToRef(t.color,l._colorDiff),l._colorDiff.scaleToRef(1/t.lifeTime,t.colorStep)),l._isAnimationSheetEnabled&&(t._initialStartSpriteCellID=l.startSpriteCellID,t._initialEndSpriteCellID=l.endSpriteCellID),t.direction.addInPlace(l._inheritedVelocityOffset),l._useRampGradients&&(t.remapData=new a.f(0,1,0,1)),l.noiseTexture&&(t._randomNoiseCoordinates1?(t._randomNoiseCoordinates1.copyFromFloats(Math.random(),Math.random(),Math.random()),t._randomNoiseCoordinates2.copyFromFloats(Math.random(),Math.random(),Math.random())):(t._randomNoiseCoordinates1=new a.e(Math.random(),Math.random(),Math.random()),t._randomNoiseCoordinates2=new a.e(Math.random(),Math.random(),Math.random()))),t._inheritParticleInfoToSubEmitters()},l=this,u=0;u<e&&"break"!==c();u++);},t._GetAttributeNamesOrOptions=function(e,t,i){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===i&&(i=!1);var n=[ji.b.PositionKind,ji.b.ColorKind,"angle","offset","size"];return e&&n.push("cellIndex"),t||n.push("direction"),i&&n.push("remapData"),n},t._GetEffectCreationOptions=function(e){void 0===e&&(e=!1);var t=["invView","view","projection","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","textureMask","translationPivot","eyePosition"];return e&&t.push("particlesInfos"),t},t.prototype.fillDefines=function(e,i){if(this._scene&&(this._scene.clipPlane&&e.push("#define CLIPPLANE"),this._scene.clipPlane2&&e.push("#define CLIPPLANE2"),this._scene.clipPlane3&&e.push("#define CLIPPLANE3"),this._scene.clipPlane4&&e.push("#define CLIPPLANE4"),this._scene.clipPlane5&&e.push("#define CLIPPLANE5"),this._scene.clipPlane6&&e.push("#define CLIPPLANE6")),this._isAnimationSheetEnabled&&e.push("#define ANIMATESHEET"),i===t.BLENDMODE_MULTIPLY&&e.push("#define BLENDMULTIPLYMODE"),this._useRampGradients&&e.push("#define RAMPGRADIENT"),this._isBillboardBased)switch(e.push("#define BILLBOARD"),this.billboardMode){case t.BILLBOARDMODE_Y:e.push("#define BILLBOARDY");break;case t.BILLBOARDMODE_STRETCHED:e.push("#define BILLBOARDSTRETCHED");break;case t.BILLBOARDMODE_ALL:e.push("#define BILLBOARDMODE_ALL")}this._imageProcessingConfiguration&&(this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),e.push(this._imageProcessingConfigurationDefines.toString()))},t.prototype.fillUniformsAttributesAndSamplerNames=function(e,i,n){i.push.apply(i,t._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled,this._isBillboardBased&&this.billboardMode!==t.BILLBOARDMODE_STRETCHED,this._useRampGradients)),e.push.apply(e,t._GetEffectCreationOptions(this._isAnimationSheetEnabled)),n.push("diffuseSampler","rampSampler"),this._imageProcessingConfiguration&&(Bi.a.PrepareUniforms(e,this._imageProcessingConfigurationDefines),Bi.a.PrepareSamplers(n,this._imageProcessingConfigurationDefines))},t.prototype._getEffect=function(e){var t=this.getCustomEffect(e);if(t)return t;var i=[];this.fillDefines(i,e);var n=i.join("\n");if(this._cachedDefines!==n){this._cachedDefines=n;var r=[],o=[],a=[];this.fillUniformsAttributesAndSamplerNames(o,r,a),this._effect=this._engine.createEffect("particles",r,o,a,n)}return this._effect},t.prototype.animate=function(e){var t,i=this;if(void 0===e&&(e=!1),this._started){if(!e&&this._scene){if(!this.isReady())return;if(this._currentRenderId===this._scene.getFrameId())return;this._currentRenderId=this._scene.getFrameId()}var n;if(this._scaledUpdateSpeed=this.updateSpeed*(e?this.preWarmStepOffset:(null===(t=this._scene)||void 0===t?void 0:t.getAnimationRatio())||1),this.manualEmitCount>-1)n=this.manualEmitCount,this._newPartsExcess=0,this.manualEmitCount=0;else{var r=this.emitRate;if(this._emitRateGradients&&this._emitRateGradients.length>0&&this.targetStopDuration){var o=this._actualFrame/this.targetStopDuration;Nu.GetCurrentGradient(o,this._emitRateGradients,function(e,t,n){e!==i._currentEmitRateGradient&&(i._currentEmitRate1=i._currentEmitRate2,i._currentEmitRate2=t.getFactor(),i._currentEmitRateGradient=e),r=L.a.Lerp(i._currentEmitRate1,i._currentEmitRate2,n)})}n=r*this._scaledUpdateSpeed>>0,this._newPartsExcess+=r*this._scaledUpdateSpeed-n}if(this._newPartsExcess>1&&(n+=this._newPartsExcess>>0,this._newPartsExcess-=this._newPartsExcess>>0),this._alive=!1,this._stopped?n=0:(this._actualFrame+=this._scaledUpdateSpeed,this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop()),this._update(n),this._stopped&&(this._alive||(this._started=!1,this.onAnimationEnd&&this.onAnimationEnd(),this.disposeOnStop&&this._scene&&this._scene._toBeDisposed.push(this))),!e){for(var a=0,s=0;s<this._particles.length;s++){var c=this._particles[s];this._appendParticleVertices(a,c),a+=this._useInstancing?1:4}this._vertexBuffer&&this._vertexBuffer.update(this._vertexData)}0===this.manualEmitCount&&this.disposeOnStop&&this.stop()}},t.prototype._appendParticleVertices=function(e,t){this._appendParticleVertex(e++,t,0,0),this._useInstancing||(this._appendParticleVertex(e++,t,1,0),this._appendParticleVertex(e++,t,1,1),this._appendParticleVertex(e++,t,0,1))},t.prototype.rebuild=function(){for(var e in this._createIndexBuffer(),this._vertexBuffer&&this._vertexBuffer._rebuild(),this._vertexBuffers)this._vertexBuffers[e]._rebuild()},t.prototype.isReady=function(){if(!this.emitter||this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady()||!this.particleTexture||!this.particleTexture.isReady())return!1;if(this.blendMode!==t.BLENDMODE_MULTIPLYADD){if(!this._getEffect(this.blendMode).isReady())return!1}else{if(!this._getEffect(t.BLENDMODE_MULTIPLY).isReady())return!1;if(!this._getEffect(t.BLENDMODE_ADD).isReady())return!1}return!0},t.prototype._render=function(e){var i,n,r=this._getEffect(e),o=this._engine;o.enableEffect(r);var s=null!==(i=this.defaultViewMatrix)&&void 0!==i?i:this._scene.getViewMatrix();if(r.setTexture("diffuseSampler",this.particleTexture),r.setMatrix("view",s),r.setMatrix("projection",null!==(n=this.defaultProjectionMatrix)&&void 0!==n?n:this._scene.getProjectionMatrix()),this._isAnimationSheetEnabled&&this.particleTexture){var c=this.particleTexture.getBaseSize();r.setFloat3("particlesInfos",this.spriteCellWidth/c.width,this.spriteCellHeight/c.height,this.spriteCellWidth/c.width)}if(r.setVector2("translationPivot",this.translationPivot),r.setFloat4("textureMask",this.textureMask.r,this.textureMask.g,this.textureMask.b,this.textureMask.a),this._isBillboardBased&&this._scene){var l=this._scene.activeCamera;r.setVector3("eyePosition",l.globalPosition)}this._rampGradientsTexture&&(this._rampGradients&&this._rampGradients.length||(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),r.setTexture("rampSampler",this._rampGradientsTexture));var u=r.defines;switch(this._scene&&(this._scene.clipPlane||this._scene.clipPlane2||this._scene.clipPlane3||this._scene.clipPlane4||this._scene.clipPlane5||this._scene.clipPlane6)&&os.a.BindClipPlane(r,this._scene),u.indexOf("#define BILLBOARDMODE_ALL")>=0&&(s.invertToRef(a.c.Matrix[0]),r.setMatrix("invView",a.c.Matrix[0])),void 0!==this._vertexArrayObject?(this._vertexArrayObject||(this._vertexArrayObject=this._engine.recordVertexArrayObject(this._vertexBuffers,this._indexBuffer,r)),this._engine.bindVertexArrayObject(this._vertexArrayObject,this._indexBuffer)):o.bindBuffers(this._vertexBuffers,this._indexBuffer,r),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(r),e){case t.BLENDMODE_ADD:o.setAlphaMode(g.a.ALPHA_ADD);break;case t.BLENDMODE_ONEONE:o.setAlphaMode(g.a.ALPHA_ONEONE);break;case t.BLENDMODE_STANDARD:o.setAlphaMode(g.a.ALPHA_COMBINE);break;case t.BLENDMODE_MULTIPLY:o.setAlphaMode(g.a.ALPHA_MULTIPLY)}return this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.notifyObservers(r),this._useInstancing?o.drawArraysType(g.a.MATERIAL_TriangleFanDrawMode,0,4,this._particles.length):o.drawElementsType(g.a.MATERIAL_TriangleFillMode,0,6*this._particles.length),this._particles.length},t.prototype.render=function(){if(!this.isReady()||!this._particles.length)return 0;var e=this._engine;e.setState&&(e.setState(!1),this.forceDepthWrite&&e.setDepthWrite(!0));var i;return i=this.blendMode===t.BLENDMODE_MULTIPLYADD?this._render(t.BLENDMODE_MULTIPLY)+this._render(t.BLENDMODE_ADD):this._render(this.blendMode),this._engine.unbindInstanceAttributes(),this._engine.setAlphaMode(g.a.ALPHA_DISABLE),i},t.prototype.dispose=function(e){if(void 0===e&&(e=!0),this._vertexBuffer&&(this._vertexBuffer.dispose(),this._vertexBuffer=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._indexBuffer&&(this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this._vertexArrayObject&&(this._engine.releaseVertexArrayObject(this._vertexArrayObject),this._vertexArrayObject=null),e&&this.particleTexture&&(this.particleTexture.dispose(),this.particleTexture=null),e&&this.noiseTexture&&(this.noiseTexture.dispose(),this.noiseTexture=null),this._rampGradientsTexture&&(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),this._removeFromRoot(),this._subEmitters&&this._subEmitters.length){for(var t=0;t<this._subEmitters.length;t++)for(var i=0,n=this._subEmitters[t];i<n.length;i++)n[i].dispose();this._subEmitters=[],this.subEmitters=[]}this._disposeEmitterOnDispose&&this.emitter&&this.emitter.dispose&&this.emitter.dispose(!0),this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.clear(),this._scene&&((t=this._scene.particleSystems.indexOf(this))>-1&&this._scene.particleSystems.splice(t,1),this._scene._activeParticleSystems.dispose()),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onStoppedObservable.clear(),this.reset()},t.prototype.clone=function(e,i){var n=Object(h.a)({},this._customEffect),r=null,o=this._engine;if(o.createEffectForParticles&&null!=this.customShader){var a=(r=this.customShader).shaderOptions.defines.length>0?r.shaderOptions.defines.join("\n"):"";n[0]=o.createEffectForParticles(r.shaderPath.fragmentElement,r.shaderOptions.uniforms,r.shaderOptions.samplers,a)}var s=this.serialize(),c=t.Parse(s,this._scene||this._engine,"");return c.name=e,c.customShader=r,c._customEffect=n,void 0===i&&(i=this.emitter),this.noiseTexture&&(c.noiseTexture=this.noiseTexture.clone()),c.emitter=i,this.preventAutoStart||c.start(),c},t.prototype.serialize=function(e){void 0===e&&(e=!1);var i={};if(t._Serialize(i,this,e),i.textureMask=this.textureMask.asArray(),i.customShader=this.customShader,i.preventAutoStart=this.preventAutoStart,this.subEmitters){i.subEmitters=[],this._subEmitters||this._prepareSubEmitterInternalArray();for(var n=0,r=this._subEmitters;n<r.length;n++){for(var o=[],a=0,s=r[n];a<s.length;a++){var c=s[a];o.push(c.serialize())}i.subEmitters.push(o)}}return i},t._Serialize=function(e,t,i){if(e.name=t.name,e.id=t.id,e.capacity=t.getCapacity(),t.emitter.position){var n=t.emitter;e.emitterId=n.id}else{var r=t.emitter;e.emitter=r.asArray()}t.particleEmitterType&&(e.particleEmitterType=t.particleEmitterType.serialize()),t.particleTexture&&(i?e.texture=t.particleTexture.serialize():(e.textureName=t.particleTexture.name,e.invertY=!!t.particleTexture._invertY)),e.isLocal=t.isLocal,w.a.AppendSerializedAnimations(t,e),e.beginAnimationOnStart=t.beginAnimationOnStart,e.beginAnimationFrom=t.beginAnimationFrom,e.beginAnimationTo=t.beginAnimationTo,e.beginAnimationLoop=t.beginAnimationLoop,e.startDelay=t.startDelay,e.renderingGroupId=t.renderingGroupId,e.isBillboardBased=t.isBillboardBased,e.billboardMode=t.billboardMode,e.minAngularSpeed=t.minAngularSpeed,e.maxAngularSpeed=t.maxAngularSpeed,e.minSize=t.minSize,e.maxSize=t.maxSize,e.minScaleX=t.minScaleX,e.maxScaleX=t.maxScaleX,e.minScaleY=t.minScaleY,e.maxScaleY=t.maxScaleY,e.minEmitPower=t.minEmitPower,e.maxEmitPower=t.maxEmitPower,e.minLifeTime=t.minLifeTime,e.maxLifeTime=t.maxLifeTime,e.emitRate=t.emitRate,e.gravity=t.gravity.asArray(),e.noiseStrength=t.noiseStrength.asArray(),e.color1=t.color1.asArray(),e.color2=t.color2.asArray(),e.colorDead=t.colorDead.asArray(),e.updateSpeed=t.updateSpeed,e.targetStopDuration=t.targetStopDuration,e.blendMode=t.blendMode,e.preWarmCycles=t.preWarmCycles,e.preWarmStepOffset=t.preWarmStepOffset,e.minInitialRotation=t.minInitialRotation,e.maxInitialRotation=t.maxInitialRotation,e.startSpriteCellID=t.startSpriteCellID,e.endSpriteCellID=t.endSpriteCellID,e.spriteCellChangeSpeed=t.spriteCellChangeSpeed,e.spriteCellWidth=t.spriteCellWidth,e.spriteCellHeight=t.spriteCellHeight,e.spriteRandomStartCell=t.spriteRandomStartCell,e.isAnimationSheetEnabled=t.isAnimationSheetEnabled;var o=t.getColorGradients();if(o){e.colorGradients=[];for(var a=0,s=o;a<s.length;a++){var c=s[a],l={gradient:c.gradient,color1:c.color1.asArray()};c.color2?l.color2=c.color2.asArray():l.color2=c.color1.asArray(),e.colorGradients.push(l)}}var u=t.getRampGradients();if(u){e.rampGradients=[];for(var h=0,d=u;h<d.length;h++){var f=d[h];l={gradient:f.gradient,color:f.color.asArray()},e.rampGradients.push(l)}e.useRampGradients=t.useRampGradients}var p=t.getColorRemapGradients();if(p){e.colorRemapGradients=[];for(var _=0,m=p;_<m.length;_++){var g=m[_];l={gradient:g.gradient,factor1:g.factor1},void 0!==g.factor2?l.factor2=g.factor2:l.factor2=g.factor1,e.colorRemapGradients.push(l)}}var v=t.getAlphaRemapGradients();if(v){e.alphaRemapGradients=[];for(var b=0,y=v;b<y.length;b++){var T=y[b];l={gradient:T.gradient,factor1:T.factor1},void 0!==T.factor2?l.factor2=T.factor2:l.factor2=T.factor1,e.alphaRemapGradients.push(l)}}var E=t.getSizeGradients();if(E){e.sizeGradients=[];for(var S=0,A=E;S<A.length;S++){var P=A[S];l={gradient:P.gradient,factor1:P.factor1},void 0!==P.factor2?l.factor2=P.factor2:l.factor2=P.factor1,e.sizeGradients.push(l)}}var C=t.getAngularSpeedGradients();if(C){e.angularSpeedGradients=[];for(var R=0,x=C;R<x.length;R++){var O=x[R];l={gradient:O.gradient,factor1:O.factor1},void 0!==O.factor2?l.factor2=O.factor2:l.factor2=O.factor1,e.angularSpeedGradients.push(l)}}var M=t.getVelocityGradients();if(M){e.velocityGradients=[];for(var I=0,D=M;I<D.length;I++){var N=D[I];l={gradient:N.gradient,factor1:N.factor1},void 0!==N.factor2?l.factor2=N.factor2:l.factor2=N.factor1,e.velocityGradients.push(l)}}var L=t.getDragGradients();if(L){e.dragGradients=[];for(var F=0,B=L;F<B.length;F++){var U=B[F];l={gradient:U.gradient,factor1:U.factor1},void 0!==U.factor2?l.factor2=U.factor2:l.factor2=U.factor1,e.dragGradients.push(l)}}var V=t.getEmitRateGradients();if(V){e.emitRateGradients=[];for(var k=0,G=V;k<G.length;k++){var z=G[k];l={gradient:z.gradient,factor1:z.factor1},void 0!==z.factor2?l.factor2=z.factor2:l.factor2=z.factor1,e.emitRateGradients.push(l)}}var j=t.getStartSizeGradients();if(j){e.startSizeGradients=[];for(var W=0,H=j;W<H.length;W++){var X=H[W];l={gradient:X.gradient,factor1:X.factor1},void 0!==X.factor2?l.factor2=X.factor2:l.factor2=X.factor1,e.startSizeGradients.push(l)}}var Y=t.getLifeTimeGradients();if(Y){e.lifeTimeGradients=[];for(var K=0,Q=Y;K<Q.length;K++){var q=Q[K];l={gradient:q.gradient,factor1:q.factor1},void 0!==q.factor2?l.factor2=q.factor2:l.factor2=q.factor1,e.lifeTimeGradients.push(l)}}var Z=t.getLimitVelocityGradients();if(Z){e.limitVelocityGradients=[];for(var J=0,$=Z;J<$.length;J++){var ee=$[J];l={gradient:ee.gradient,factor1:ee.factor1},void 0!==ee.factor2?l.factor2=ee.factor2:l.factor2=ee.factor1,e.limitVelocityGradients.push(l)}e.limitVelocityDamping=t.limitVelocityDamping}t.noiseTexture&&(e.noiseTexture=t.noiseTexture.serialize())},t._Parse=function(e,t,i,n){var r;r=i instanceof qe.a?null:i;var o,l=c.a.GetClass("BABYLON.Texture");if(l&&r&&(e.texture?t.particleTexture=l.Parse(e.texture,r,n):e.textureName&&(t.particleTexture=new l(n+e.textureName,r,!1,void 0===e.invertY||e.invertY),t.particleTexture.name=e.textureName)),e.emitterId||0===e.emitterId||void 0!==e.emitter?e.emitterId&&r?t.emitter=r.getLastMeshByID(e.emitterId):t.emitter=a.e.FromArray(e.emitter):t.emitter=a.e.Zero(),t.isLocal=!!e.isLocal,void 0!==e.renderingGroupId&&(t.renderingGroupId=e.renderingGroupId),void 0!==e.isBillboardBased&&(t.isBillboardBased=e.isBillboardBased),void 0!==e.billboardMode&&(t.billboardMode=e.billboardMode),e.animations){for(var u=0;u<e.animations.length;u++){var h=e.animations[u],d=c.a.GetClass("BABYLON.Animation");d&&t.animations.push(d.Parse(h))}t.beginAnimationOnStart=e.beginAnimationOnStart,t.beginAnimationFrom=e.beginAnimationFrom,t.beginAnimationTo=e.beginAnimationTo,t.beginAnimationLoop=e.beginAnimationLoop}if(e.autoAnimate&&r&&r.beginAnimation(t,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),t.startDelay=0|e.startDelay,t.minAngularSpeed=e.minAngularSpeed,t.maxAngularSpeed=e.maxAngularSpeed,t.minSize=e.minSize,t.maxSize=e.maxSize,e.minScaleX&&(t.minScaleX=e.minScaleX,t.maxScaleX=e.maxScaleX,t.minScaleY=e.minScaleY,t.maxScaleY=e.maxScaleY),void 0!==e.preWarmCycles&&(t.preWarmCycles=e.preWarmCycles,t.preWarmStepOffset=e.preWarmStepOffset),void 0!==e.minInitialRotation&&(t.minInitialRotation=e.minInitialRotation,t.maxInitialRotation=e.maxInitialRotation),t.minLifeTime=e.minLifeTime,t.maxLifeTime=e.maxLifeTime,t.minEmitPower=e.minEmitPower,t.maxEmitPower=e.maxEmitPower,t.emitRate=e.emitRate,t.gravity=a.e.FromArray(e.gravity),e.noiseStrength&&(t.noiseStrength=a.e.FromArray(e.noiseStrength)),t.color1=s.b.FromArray(e.color1),t.color2=s.b.FromArray(e.color2),t.colorDead=s.b.FromArray(e.colorDead),t.updateSpeed=e.updateSpeed,t.targetStopDuration=e.targetStopDuration,t.blendMode=e.blendMode,e.colorGradients)for(var f=0,p=e.colorGradients;f<p.length;f++){var _=p[f];t.addColorGradient(_.gradient,s.b.FromArray(_.color1),_.color2?s.b.FromArray(_.color2):void 0)}if(e.rampGradients){for(var m=0,g=e.rampGradients;m<g.length;m++){var v=g[m];t.addRampGradient(v.gradient,s.a.FromArray(v.color))}t.useRampGradients=e.useRampGradients}if(e.colorRemapGradients)for(var b=0,y=e.colorRemapGradients;b<y.length;b++){var T=y[b];t.addColorRemapGradient(T.gradient,void 0!==T.factor1?T.factor1:T.factor,T.factor2)}if(e.alphaRemapGradients)for(var E=0,S=e.alphaRemapGradients;E<S.length;E++){var A=S[E];t.addAlphaRemapGradient(A.gradient,void 0!==A.factor1?A.factor1:A.factor,A.factor2)}if(e.sizeGradients)for(var P=0,C=e.sizeGradients;P<C.length;P++){var R=C[P];t.addSizeGradient(R.gradient,void 0!==R.factor1?R.factor1:R.factor,R.factor2)}if(e.angularSpeedGradients)for(var x=0,O=e.angularSpeedGradients;x<O.length;x++){var M=O[x];t.addAngularSpeedGradient(M.gradient,void 0!==M.factor1?M.factor1:M.factor,M.factor2)}if(e.velocityGradients)for(var I=0,D=e.velocityGradients;I<D.length;I++){var N=D[I];t.addVelocityGradient(N.gradient,void 0!==N.factor1?N.factor1:N.factor,N.factor2)}if(e.dragGradients)for(var L=0,w=e.dragGradients;L<w.length;L++){var F=w[L];t.addDragGradient(F.gradient,void 0!==F.factor1?F.factor1:F.factor,F.factor2)}if(e.emitRateGradients)for(var B=0,U=e.emitRateGradients;B<U.length;B++){var V=U[B];t.addEmitRateGradient(V.gradient,void 0!==V.factor1?V.factor1:V.factor,V.factor2)}if(e.startSizeGradients)for(var k=0,G=e.startSizeGradients;k<G.length;k++){var z=G[k];t.addStartSizeGradient(z.gradient,void 0!==z.factor1?z.factor1:z.factor,z.factor2)}if(e.lifeTimeGradients)for(var j=0,W=e.lifeTimeGradients;j<W.length;j++){var H=W[j];t.addLifeTimeGradient(H.gradient,void 0!==H.factor1?H.factor1:H.factor,H.factor2)}if(e.limitVelocityGradients){for(var X=0,Y=e.limitVelocityGradients;X<Y.length;X++){var K=Y[X];t.addLimitVelocityGradient(K.gradient,void 0!==K.factor1?K.factor1:K.factor,K.factor2)}t.limitVelocityDamping=e.limitVelocityDamping}if(e.noiseTexture&&r){var Q=c.a.GetClass("BABYLON.ProceduralTexture");t.noiseTexture=Q.Parse(e.noiseTexture,r,n)}if(e.particleEmitterType){switch(e.particleEmitterType.type){case"SphereParticleEmitter":o=new dc;break;case"SphereDirectedParticleEmitter":o=new fc;break;case"ConeEmitter":case"ConeParticleEmitter":o=new sc;break;case"CylinderParticleEmitter":o=new cc;break;case"CylinderDirectedParticleEmitter":o=new lc;break;case"HemisphericParticleEmitter":o=new uc;break;case"PointParticleEmitter":o=new hc;break;case"MeshParticleEmitter":o=new _c;break;case"BoxEmitter":case"BoxParticleEmitter":default:o=new ac}o.parse(e.particleEmitterType,r)}else(o=new ac).parse(e,r);t.particleEmitterType=o,t.startSpriteCellID=e.startSpriteCellID,t.endSpriteCellID=e.endSpriteCellID,t.spriteCellWidth=e.spriteCellWidth,t.spriteCellHeight=e.spriteCellHeight,t.spriteCellChangeSpeed=e.spriteCellChangeSpeed,t.spriteRandomStartCell=e.spriteRandomStartCell},t.Parse=function(e,i,n,r){void 0===r&&(r=!1);var o,a=e.name,c=null,l=null;if(o=i instanceof qe.a?i:i.getEngine(),e.customShader&&o.createEffectForParticles){var u=(l=e.customShader).shaderOptions.defines.length>0?l.shaderOptions.defines.join("\n"):"";c=o.createEffectForParticles(l.shaderPath.fragmentElement,l.shaderOptions.uniforms,l.shaderOptions.samplers,u)}var h=new t(a,e.capacity,i,c,e.isAnimationSheetEnabled);if(h.customShader=l,e.id&&(h.id=e.id),e.subEmitters){h.subEmitters=[];for(var d=0,f=e.subEmitters;d<f.length;d++){for(var p=[],_=0,m=f[d];_<m.length;_++){var g=m[_];p.push(wu.Parse(g,i,n))}h.subEmitters.push(p)}}return t._Parse(e,h,i,n),e.textureMask&&(h.textureMask=s.b.FromArray(e.textureMask)),e.preventAutoStart&&(h.preventAutoStart=e.preventAutoStart),r||h.preventAutoStart||h.start(),h},t.BILLBOARDMODE_Y=g.a.PARTICLES_BILLBOARDMODE_Y,t.BILLBOARDMODE_ALL=g.a.PARTICLES_BILLBOARDMODE_ALL,t.BILLBOARDMODE_STRETCHED=g.a.PARTICLES_BILLBOARDMODE_STRETCHED,t}(mc);wu._ParseParticleSystem=Fu.Parse,ai.a.ShadersStore.gpuUpdateParticlesPixelShader="#version 300 es\nvoid main() {\ndiscard;\n}\n";ai.a.ShadersStore.gpuUpdateParticlesVertexShader="#version 300 es\n#define PI 3.14159\nuniform float currentCount;\nuniform float timeDelta;\nuniform float stopFactor;\n#ifndef LOCAL\nuniform mat4 emitterWM;\n#endif\nuniform vec2 lifeTime;\nuniform vec2 emitPower;\nuniform vec2 sizeRange;\nuniform vec4 scaleRange;\n#ifndef COLORGRADIENTS\nuniform vec4 color1;\nuniform vec4 color2;\n#endif\nuniform vec3 gravity;\nuniform sampler2D randomSampler;\nuniform sampler2D randomSampler2;\nuniform vec4 angleRange;\n#ifdef BOXEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\nuniform vec3 minEmitBox;\nuniform vec3 maxEmitBox;\n#endif\n#ifdef POINTEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#endif\n#ifdef HEMISPHERICEMITTER\nuniform float radius;\nuniform float radiusRange;\nuniform float directionRandomizer;\n#endif\n#ifdef SPHEREEMITTER\nuniform float radius;\nuniform float radiusRange;\n#ifdef DIRECTEDSPHEREEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nuniform float radius;\nuniform float height;\nuniform float radiusRange;\n#ifdef DIRECTEDCYLINDEREMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CONEEMITTER\nuniform vec2 radius;\nuniform float coneAngle;\nuniform vec2 height;\nuniform float directionRandomizer;\n#endif\n\nin vec3 position;\n#ifdef CUSTOMEMITTER\nin vec3 initialPosition;\n#endif\nin float age;\nin float life;\nin vec4 seed;\nin vec3 size;\n#ifndef COLORGRADIENTS\nin vec4 color;\n#endif\nin vec3 direction;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nin float angle;\n#else\nin vec2 angle;\n#endif\n#ifdef ANIMATESHEET\nin float cellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nin float cellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nin vec3 noiseCoordinates1;\nin vec3 noiseCoordinates2;\n#endif\n\nout vec3 outPosition;\n#ifdef CUSTOMEMITTER\nout vec3 outInitialPosition;\n#endif\nout float outAge;\nout float outLife;\nout vec4 outSeed;\nout vec3 outSize;\n#ifndef COLORGRADIENTS\nout vec4 outColor;\n#endif\nout vec3 outDirection;\n#ifndef BILLBOARD\nout vec3 outInitialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nout float outAngle;\n#else\nout vec2 outAngle;\n#endif\n#ifdef ANIMATESHEET\nout float outCellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nout float outCellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nout vec3 outNoiseCoordinates1;\nout vec3 outNoiseCoordinates2;\n#endif\n#ifdef SIZEGRADIENTS\nuniform sampler2D sizeGradientSampler;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nuniform sampler2D angularSpeedGradientSampler;\n#endif\n#ifdef VELOCITYGRADIENTS\nuniform sampler2D velocityGradientSampler;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nuniform sampler2D limitVelocityGradientSampler;\nuniform float limitVelocityDamping;\n#endif\n#ifdef DRAGGRADIENTS\nuniform sampler2D dragGradientSampler;\n#endif\n#ifdef NOISE\nuniform vec3 noiseStrength;\nuniform sampler2D noiseSampler;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 cellInfos;\n#endif\nvec3 getRandomVec3(float offset) {\nreturn texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;\n}\nvec4 getRandomVec4(float offset) {\nreturn texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));\n}\nvoid main() {\nfloat newAge=age+timeDelta;\n\nif (newAge>=life && stopFactor != 0.) {\nvec3 newPosition;\nvec3 newDirection;\n\nvec4 randoms=getRandomVec4(seed.x);\n\noutLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;\noutAge=newAge-life;\n\noutSeed=seed;\n\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(0,0)).r;\n#else\noutSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;\n#endif\noutSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;\noutSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a;\n#ifndef COLORGRADIENTS\n\noutColor=color1+(color2-color1)*randoms.b;\n#endif\n\n#ifndef ANGULARSPEEDGRADIENTS\noutAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;\noutAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#else\noutAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#endif\n\n#ifdef POINTEMITTER\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nnewPosition=vec3(0,0,0);\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(BOXEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nnewPosition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(HEMISPHERICEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nnewPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);\nnewDirection=newPosition+directionRandomizer*randoms3;\n#elif defined(SPHEREEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nnewPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nnewDirection=newPosition+directionRandomizer*randoms3;\n#endif\n#elif defined(CYLINDEREMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat yPos=(randoms2.x-0.5)*height;\nfloat angle=randoms2.y*PI*2.;\nfloat inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));\nfloat positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));\nfloat xPos=positionRadius*cos(angle);\nfloat zPos=positionRadius*sin(angle);\nnewPosition=vec3(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nangle=angle+((randoms3.x-0.5)*PI);\nnewDirection=vec3(cos(angle),randoms3.y-0.5,sin(angle));\nnewDirection=normalize(newDirection);\n#endif\n#elif defined(CONEEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nfloat s=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nfloat h=0.0001;\n#else\nfloat h=randoms2.y*height.y;\n\nh=1.-h*h;\n#endif\nfloat lRadius=radius.x-radius.x*randoms2.z*radius.y;\nlRadius=lRadius*h;\nfloat randX=lRadius*sin(s);\nfloat randZ=lRadius*cos(s);\nfloat randY=h*height.x;\nnewPosition=vec3(randX,randY,randZ);\n\nif (abs(cos(coneAngle)) == 1.0) {\nnewDirection=vec3(0.,1.0,0.);\n} else {\nvec3 randoms3=getRandomVec3(seed.z);\nnewDirection=normalize(newPosition+directionRandomizer*randoms3);\n}\n#elif defined(CUSTOMEMITTER)\nnewPosition=initialPosition;\noutInitialPosition=initialPosition;\n#else\n\nnewPosition=vec3(0.,0.,0.);\n\nnewDirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));\n#endif\nfloat power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;\n#ifdef LOCAL\noutPosition=newPosition;\n#else\noutPosition=(emitterWM*vec4(newPosition,1.)).xyz;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#ifndef BILLBOARD\noutInitialDirection=direction;\n#endif\n#else\n#ifdef LOCAL\nvec3 initial=newDirection;\n#else\nvec3 initial=(emitterWM*vec4(newDirection,0.)).xyz;\n#endif\noutDirection=initial*power;\n#ifndef BILLBOARD\noutInitialDirection=initial;\n#endif\n#endif\n#ifdef ANIMATESHEET\noutCellIndex=cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=randoms.a*outLife;\n#endif\n#endif\n#ifdef NOISE\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n} else {\nfloat directionScale=timeDelta;\noutAge=newAge;\nfloat ageGradient=newAge/life;\n#ifdef VELOCITYGRADIENTS\ndirectionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#ifdef DRAGGRADIENTS\ndirectionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#if defined(CUSTOMEMITTER)\noutPosition=position+(direction-position)*ageGradient;\noutInitialPosition=initialPosition;\n#else\noutPosition=position+direction*directionScale;\n#endif\noutLife=life;\noutSeed=seed;\n#ifndef COLORGRADIENTS\noutColor=color;\n#endif\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;\noutSize.yz=size.yz;\n#else\noutSize=size;\n#endif\n#ifndef BILLBOARD\noutInitialDirection=initialDirection;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#else\nvec3 updatedDirection=direction+gravity*timeDelta;\n#ifdef LIMITVELOCITYGRADIENTS\nfloat limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;\nfloat currentVelocity=length(updatedDirection);\nif (currentVelocity>limitVelocity) {\nupdatedDirection=updatedDirection*limitVelocityDamping;\n}\n#endif\noutDirection=updatedDirection;\n#ifdef NOISE\nfloat fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;\nvec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;\noutDirection=outDirection+force*timeDelta;\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nfloat angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;\noutAngle=angle+angularSpeed*timeDelta;\n#else\noutAngle=vec2(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET\nfloat offsetAge=outAge;\nfloat dist=cellInfos.y-cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=cellStartOffset;\noffsetAge+=cellStartOffset;\n#else\nfloat cellStartOffset=0.;\n#endif\nfloat ratio=clamp(mod(cellStartOffset+cellInfos.z*offsetAge,life)/life,0.,1.0);\noutCellIndex=float(int(cellInfos.x+ratio*dist));\n#endif\n}\n}";ai.a.IncludesShadersStore.clipPlaneFragmentDeclaration2="#ifdef CLIPPLANE\nin float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nin float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nin float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nin float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nin float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nin float fClipDistance6;\n#endif";ai.a.ShadersStore.gpuRenderParticlesPixelShader="#version 300 es\nuniform sampler2D diffuseSampler;\nin vec2 vUV;\nin vec4 vColor;\nout vec4 outFragColor;\n#include<clipPlaneFragmentDeclaration2>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main() {\n#include<clipPlaneFragment>\nvec4 textureColor=texture(diffuseSampler,vUV);\noutFragColor=textureColor*vColor;\n#ifdef BLENDMULTIPLYMODE\nfloat alpha=vColor.a*textureColor.a;\noutFragColor.rgb=outFragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\noutFragColor=applyImageProcessing(outFragColor);\n#endif\n#endif\n}\n";ai.a.IncludesShadersStore.clipPlaneVertexDeclaration2="#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nout float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nout float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nout float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nout float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nout float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nout float fClipDistance6;\n#endif";ai.a.ShadersStore.gpuRenderParticlesVertexShader="#version 300 es\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\nuniform vec3 worldOffset;\n#ifdef LOCAL\nuniform mat4 emitterWM;\n#endif\n\nin vec3 position;\nin float age;\nin float life;\nin vec3 size;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef BILLBOARDSTRETCHED\nin vec3 direction;\n#endif\nin float angle;\n#ifdef ANIMATESHEET\nin float cellIndex;\n#endif\nin vec2 offset;\nin vec2 uv;\nout vec2 vUV;\nout vec4 vColor;\nout vec3 vPositionW;\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration2>\n#ifdef COLORGRADIENTS\nuniform sampler2D colorGradientSampler;\n#else\nuniform vec4 colorDead;\nin vec4 color;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 sheetInfos;\n#endif\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#endif\nvoid main() {\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/sheetInfos.z);\nfloat columnOffset=cellIndex-rowOffset*sheetInfos.z;\nvec2 uvScale=sheetInfos.xy;\nvec2 uvOffset=vec2(uv.x ,1.0-uv.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=uv;\n#endif\nfloat ratio=age/life;\n#ifdef COLORGRADIENTS\nvColor=texture(colorGradientSampler,vec2(ratio,0));\n#else\nvColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);\n#endif\nvec2 cornerPos=(offset-translationPivot)*size.yz*size.x+translationPivot;\n#ifdef BILLBOARD\nvec4 rotatedCorner;\nrotatedCorner.w=0.;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=(position+worldOffset)-eyePosition;\nyaxis.y=0.;\nvPositionW=rotate(normalize(yaxis),rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(vPositionW,1.0));\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=(position+worldOffset)-eyePosition;\nvPositionW=rotateAlign(toCamera,rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(vPositionW,1.0));\n#else\n\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\n#ifdef LOCAL\nvec4 viewPosition=view*vec4(((emitterWM*vec4(position,1.0)).xyz+worldOffset),1.0)+rotatedCorner;\n#else\nvec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;\n#endif\nvPositionW=(invView*viewPosition).xyz;\n#endif\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=0.;\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nvec3 yaxis=normalize(initialDirection);\nvPositionW=rotate(yaxis,rotatedCorner);\n\nvec4 viewPosition=view*vec4(vPositionW,1.0);\n#endif\ngl_Position=projection*viewPosition;\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n}";var Bu=function(e){function t(t,i,n,r,s){void 0===r&&(r=!1),void 0===s&&(s=null);var c=e.call(this,t)||this;c.layerMask=268435455,c._accumulatedCount=0,c._targetIndex=0,c._currentRenderId=-1,c._started=!1,c._stopped=!1,c._timeDelta=0,c._actualFrame=0,c._rawTextureWidth=256,c.onDisposeObservable=new o.c,c.onStoppedObservable=new o.c,c.forceDepthWrite=!1,c._preWarmDone=!1,c.isLocal=!1,c._onBeforeDrawParticlesObservable=null,n&&"Scene"!==n.getClassName()?(c._engine=n,c.defaultProjectionMatrix=a.a.PerspectiveFovLH(.8,1,.1,100)):(c._scene=n||x.a.LastCreatedScene,c._engine=c._scene.getEngine(),c.uniqueId=c._scene.getUniqueId(),c._scene.particleSystems.push(c)),c._customEffect={0:s},c._attachImageProcessingConfiguration(null),i.randomTextureSize||delete i.randomTextureSize;var l=Object(h.a)({capacity:5e4,randomTextureSize:c._engine.getCaps().maxTextureSize},i),u=i;isFinite(u)&&(l.capacity=u),c._capacity=l.capacity,c._activeCount=l.capacity,c._currentActiveCount=0,c._isAnimationSheetEnabled=r,c._updateEffectOptions={attributes:["position","initialPosition","age","life","seed","size","color","direction","initialDirection","angle","cellIndex","cellStartOffset","noiseCoordinates1","noiseCoordinates2"],uniformsNames:["currentCount","timeDelta","emitterWM","lifeTime","color1","color2","sizeRange","scaleRange","gravity","emitPower","direction1","direction2","minEmitBox","maxEmitBox","radius","directionRandomizer","height","coneAngle","stopFactor","angleRange","radiusRange","cellInfos","noiseStrength","limitVelocityDamping"],uniformBuffersNames:[],samplers:["randomSampler","randomSampler2","sizeGradientSampler","angularSpeedGradientSampler","velocityGradientSampler","limitVelocityGradientSampler","noiseSampler","dragGradientSampler"],defines:"",fallbacks:null,onCompiled:null,onError:null,indexParameters:null,maxSimultaneousLights:0,transformFeedbackVaryings:[]},c.particleEmitterType=new ac;for(var d=Math.min(c._engine.getCaps().maxTextureSize,l.randomTextureSize),f=[],p=0;p<d;++p)f.push(Math.random()),f.push(Math.random()),f.push(Math.random()),f.push(Math.random());for(c._randomTexture=new et(new Float32Array(f),d,1,g.a.TEXTUREFORMAT_RGBA,n,!1,!1,g.a.TEXTURE_NEAREST_SAMPLINGMODE,g.a.TEXTURETYPE_FLOAT),c._randomTexture.wrapU=g.a.TEXTURE_WRAP_ADDRESSMODE,c._randomTexture.wrapV=g.a.TEXTURE_WRAP_ADDRESSMODE,f=[],p=0;p<d;++p)f.push(Math.random()),f.push(Math.random()),f.push(Math.random()),f.push(Math.random());return c._randomTexture2=new et(new Float32Array(f),d,1,g.a.TEXTUREFORMAT_RGBA,n,!1,!1,g.a.TEXTURE_NEAREST_SAMPLINGMODE,g.a.TEXTURETYPE_FLOAT),c._randomTexture2.wrapU=g.a.TEXTURE_WRAP_ADDRESSMODE,c._randomTexture2.wrapV=g.a.TEXTURE_WRAP_ADDRESSMODE,c._randomTextureSize=d,c}return Object(h.d)(t,e),Object.defineProperty(t,"IsSupported",{get:function(){return!!x.a.LastCreatedEngine&&x.a.LastCreatedEngine.webGLVersion>1},enumerable:!1,configurable:!0}),t.prototype.getCapacity=function(){return this._capacity},Object.defineProperty(t.prototype,"activeParticleCount",{get:function(){return this._activeCount},set:function(e){this._activeCount=Math.min(e,this._capacity)},enumerable:!1,configurable:!0}),t.prototype.isReady=function(){return this._updateEffect?!!(this.emitter&&this._updateEffect.isReady()&&(!this._imageProcessingConfiguration||this._imageProcessingConfiguration.isReady())&&this._getEffect().isReady()&&this.particleTexture&&this.particleTexture.isReady()):(this._recreateUpdateEffect(),this._recreateRenderEffect(),!1)},t.prototype.isStarted=function(){return this._started},t.prototype.isStopped=function(){return this._stopped},t.prototype.isStopping=function(){return!1},t.prototype.getActiveCount=function(){return this._currentActiveCount},t.prototype.start=function(e){var t=this;if(void 0===e&&(e=this.startDelay),!this.targetStopDuration&&this._hasTargetStopDurationDependantGradient())throw"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";e?setTimeout(function(){t.start(0)},e):(this._started=!0,this._stopped=!1,this._preWarmDone=!1,this.beginAnimationOnStart&&this.animations&&this.animations.length>0&&this._scene&&this._scene.beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop))},t.prototype.stop=function(){this._stopped||(this._stopped=!0)},t.prototype.reset=function(){this._releaseBuffers(),this._releaseVAOs(),this._currentActiveCount=0,this._targetIndex=0},t.prototype.getClassName=function(){return"GPUParticleSystem"},t.prototype.getCustomEffect=function(e){var t;return void 0===e&&(e=0),null!==(t=this._customEffect[e])&&void 0!==t?t:this._customEffect[0]},t.prototype.setCustomEffect=function(e,t){void 0===t&&(t=0),this._customEffect[t]=e},Object.defineProperty(t.prototype,"onBeforeDrawParticlesObservable",{get:function(){return this._onBeforeDrawParticlesObservable||(this._onBeforeDrawParticlesObservable=new o.c),this._onBeforeDrawParticlesObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexShaderName",{get:function(){return"gpuRenderParticles"},enumerable:!1,configurable:!0}),t.prototype._removeGradientAndTexture=function(t,i,n){return e.prototype._removeGradientAndTexture.call(this,t,i,n),this._releaseBuffers(),this},t.prototype.addColorGradient=function(e,t,i){this._colorGradients||(this._colorGradients=[]);var n=new Mu(e,t);return this._colorGradients.push(n),this._refreshColorGradient(!0),this._releaseBuffers(),this},t.prototype._refreshColorGradient=function(e){void 0===e&&(e=!1),this._colorGradients&&(e&&this._colorGradients.sort(function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0}),this._colorGradientsTexture&&(this._colorGradientsTexture.dispose(),this._colorGradientsTexture=null))},t.prototype.forceRefreshGradients=function(){this._refreshColorGradient(),this._refreshFactorGradient(this._sizeGradients,"_sizeGradientsTexture"),this._refreshFactorGradient(this._angularSpeedGradients,"_angularSpeedGradientsTexture"),this._refreshFactorGradient(this._velocityGradients,"_velocityGradientsTexture"),this._refreshFactorGradient(this._limitVelocityGradients,"_limitVelocityGradientsTexture"),this._refreshFactorGradient(this._dragGradients,"_dragGradientsTexture"),this.reset()},t.prototype.removeColorGradient=function(e){return this._removeGradientAndTexture(e,this._colorGradients,this._colorGradientsTexture),this._colorGradientsTexture=null,this},t.prototype._addFactorGradient=function(e,t,i){var n=new Du(t,i);e.push(n),this._releaseBuffers()},t.prototype.addSizeGradient=function(e,t){return this._sizeGradients||(this._sizeGradients=[]),this._addFactorGradient(this._sizeGradients,e,t),this._refreshFactorGradient(this._sizeGradients,"_sizeGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeSizeGradient=function(e){return this._removeGradientAndTexture(e,this._sizeGradients,this._sizeGradientsTexture),this._sizeGradientsTexture=null,this},t.prototype._refreshFactorGradient=function(e,t,i){void 0===i&&(i=!1),e&&(i&&e.sort(function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0}),this[t]&&(this[t].dispose(),this[t]=null))},t.prototype.addAngularSpeedGradient=function(e,t){return this._angularSpeedGradients||(this._angularSpeedGradients=[]),this._addFactorGradient(this._angularSpeedGradients,e,t),this._refreshFactorGradient(this._angularSpeedGradients,"_angularSpeedGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeAngularSpeedGradient=function(e){return this._removeGradientAndTexture(e,this._angularSpeedGradients,this._angularSpeedGradientsTexture),this._angularSpeedGradientsTexture=null,this},t.prototype.addVelocityGradient=function(e,t){return this._velocityGradients||(this._velocityGradients=[]),this._addFactorGradient(this._velocityGradients,e,t),this._refreshFactorGradient(this._velocityGradients,"_velocityGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeVelocityGradient=function(e){return this._removeGradientAndTexture(e,this._velocityGradients,this._velocityGradientsTexture),this._velocityGradientsTexture=null,this},t.prototype.addLimitVelocityGradient=function(e,t){return this._limitVelocityGradients||(this._limitVelocityGradients=[]),this._addFactorGradient(this._limitVelocityGradients,e,t),this._refreshFactorGradient(this._limitVelocityGradients,"_limitVelocityGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeLimitVelocityGradient=function(e){return this._removeGradientAndTexture(e,this._limitVelocityGradients,this._limitVelocityGradientsTexture),this._limitVelocityGradientsTexture=null,this},t.prototype.addDragGradient=function(e,t){return this._dragGradients||(this._dragGradients=[]),this._addFactorGradient(this._dragGradients,e,t),this._refreshFactorGradient(this._dragGradients,"_dragGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeDragGradient=function(e){return this._removeGradientAndTexture(e,this._dragGradients,this._dragGradientsTexture),this._dragGradientsTexture=null,this},t.prototype.addEmitRateGradient=function(e,t,i){return this},t.prototype.removeEmitRateGradient=function(e){return this},t.prototype.addStartSizeGradient=function(e,t,i){return this},t.prototype.removeStartSizeGradient=function(e){return this},t.prototype.addColorRemapGradient=function(e,t,i){return this},t.prototype.removeColorRemapGradient=function(){return this},t.prototype.addAlphaRemapGradient=function(e,t,i){return this},t.prototype.removeAlphaRemapGradient=function(){return this},t.prototype.addRampGradient=function(e,t){return this},t.prototype.removeRampGradient=function(){return this},t.prototype.getRampGradients=function(){return null},Object.defineProperty(t.prototype,"useRampGradients",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),t.prototype.addLifeTimeGradient=function(e,t,i){return this},t.prototype.removeLifeTimeGradient=function(e){return this},t.prototype._reset=function(){this._releaseBuffers()},t.prototype._createUpdateVAO=function(e){var t={};t.position=e.createVertexBuffer("position",0,3);var i=3;this.particleEmitterType instanceof pc&&(t.initialPosition=e.createVertexBuffer("initialPosition",i,3),i+=3),t.age=e.createVertexBuffer("age",i,1),i+=1,t.life=e.createVertexBuffer("life",i,1),i+=1,t.seed=e.createVertexBuffer("seed",i,4),i+=4,t.size=e.createVertexBuffer("size",i,3),i+=3,this._colorGradientsTexture||(t.color=e.createVertexBuffer("color",i,4),i+=4),t.direction=e.createVertexBuffer("direction",i,3),i+=3,this._isBillboardBased||(t.initialDirection=e.createVertexBuffer("initialDirection",i,3),i+=3),this._angularSpeedGradientsTexture?(t.angle=e.createVertexBuffer("angle",i,1),i+=1):(t.angle=e.createVertexBuffer("angle",i,2),i+=2),this._isAnimationSheetEnabled&&(t.cellIndex=e.createVertexBuffer("cellIndex",i,1),i+=1,this.spriteRandomStartCell&&(t.cellStartOffset=e.createVertexBuffer("cellStartOffset",i,1),i+=1)),this.noiseTexture&&(t.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",i,3),i+=3,t.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",i,3),i+=3);var n=this._engine.recordVertexArrayObject(t,null,this._updateEffect);return this._engine.bindArrayBuffer(null),n},t.prototype._createRenderVAO=function(e,t){var i={};i.position=e.createVertexBuffer("position",0,3,this._attributesStrideSize,!0);var n=3;this.particleEmitterType instanceof pc&&(n+=3),i.age=e.createVertexBuffer("age",n,1,this._attributesStrideSize,!0),n+=1,i.life=e.createVertexBuffer("life",n,1,this._attributesStrideSize,!0),n+=5,i.size=e.createVertexBuffer("size",n,3,this._attributesStrideSize,!0),n+=3,this._colorGradientsTexture||(i.color=e.createVertexBuffer("color",n,4,this._attributesStrideSize,!0),n+=4),this.billboardMode===Fu.BILLBOARDMODE_STRETCHED&&(i.direction=e.createVertexBuffer("direction",n,3,this._attributesStrideSize,!0)),n+=3,this._isBillboardBased||(i.initialDirection=e.createVertexBuffer("initialDirection",n,3,this._attributesStrideSize,!0),n+=3),i.angle=e.createVertexBuffer("angle",n,1,this._attributesStrideSize,!0),this._angularSpeedGradientsTexture?n++:n+=2,this._isAnimationSheetEnabled&&(i.cellIndex=e.createVertexBuffer("cellIndex",n,1,this._attributesStrideSize,!0),n+=1,this.spriteRandomStartCell&&(i.cellStartOffset=e.createVertexBuffer("cellStartOffset",n,1,this._attributesStrideSize,!0),n+=1)),this.noiseTexture&&(i.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",n,3,this._attributesStrideSize,!0),n+=3,i.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",n,3,this._attributesStrideSize,!0),n+=3),i.offset=t.createVertexBuffer("offset",0,2),i.uv=t.createVertexBuffer("uv",2,2);var r=this._engine.recordVertexArrayObject(i,null,this._getEffect());return this._engine.bindArrayBuffer(null),r},t.prototype._initialize=function(e){if(void 0===e&&(e=!1),!this._buffer0||e){var t=this._engine,i=new Array;this._attributesStrideSize=21,this._targetIndex=0,this.particleEmitterType instanceof pc&&(this._attributesStrideSize+=3),this.isBillboardBased||(this._attributesStrideSize+=3),this._colorGradientsTexture&&(this._attributesStrideSize-=4),this._angularSpeedGradientsTexture&&(this._attributesStrideSize-=1),this._isAnimationSheetEnabled&&(this._attributesStrideSize+=1,this.spriteRandomStartCell&&(this._attributesStrideSize+=1)),this.noiseTexture&&(this._attributesStrideSize+=6);for(var n=this.particleEmitterType instanceof pc,r=a.c.Vector3[0],o=0;o<this._capacity;o++)i.push(0),i.push(0),i.push(0),n&&(this.particleEmitterType.particlePositionGenerator(o,null,r),i.push(r.x),i.push(r.y),i.push(r.z)),i.push(0),i.push(0),i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),i.push(0),i.push(0),i.push(0),this._colorGradientsTexture||(i.push(0),i.push(0),i.push(0),i.push(0)),n?(this.particleEmitterType.particleDestinationGenerator(o,null,r),i.push(r.x),i.push(r.y),i.push(r.z)):(i.push(0),i.push(0),i.push(0)),this.isBillboardBased||(i.push(0),i.push(0),i.push(0)),i.push(0),this._angularSpeedGradientsTexture||i.push(0),this._isAnimationSheetEnabled&&(i.push(0),this.spriteRandomStartCell&&i.push(0)),this.noiseTexture&&(i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),i.push(Math.random()));var s=new Float32Array([.5,.5,1,1,-.5,.5,0,1,-.5,-.5,0,0,.5,-.5,1,0]);this._buffer0=new ji.a(t,i,!1,this._attributesStrideSize),this._buffer1=new ji.a(t,i,!1,this._attributesStrideSize),this._spriteBuffer=new ji.a(t,s,!1,4),this._updateVAO=[],this._updateVAO.push(this._createUpdateVAO(this._buffer0)),this._updateVAO.push(this._createUpdateVAO(this._buffer1)),this._renderVAO=[],this._renderVAO.push(this._createRenderVAO(this._buffer1,this._spriteBuffer)),this._renderVAO.push(this._createRenderVAO(this._buffer0,this._spriteBuffer)),this._sourceBuffer=this._buffer0,this._targetBuffer=this._buffer1}},t.prototype._recreateUpdateEffect=function(){var e=this.particleEmitterType?this.particleEmitterType.getEffectDefines():"";this._isBillboardBased&&(e+="\n#define BILLBOARD"),this._colorGradientsTexture&&(e+="\n#define COLORGRADIENTS"),this._sizeGradientsTexture&&(e+="\n#define SIZEGRADIENTS"),this._angularSpeedGradientsTexture&&(e+="\n#define ANGULARSPEEDGRADIENTS"),this._velocityGradientsTexture&&(e+="\n#define VELOCITYGRADIENTS"),this._limitVelocityGradientsTexture&&(e+="\n#define LIMITVELOCITYGRADIENTS"),this._dragGradientsTexture&&(e+="\n#define DRAGGRADIENTS"),this.isAnimationSheetEnabled&&(e+="\n#define ANIMATESHEET",this.spriteRandomStartCell&&(e+="\n#define ANIMATESHEETRANDOMSTART")),this.noiseTexture&&(e+="\n#define NOISE"),this.isLocal&&(e+="\n#define LOCAL"),this._updateEffect&&this._updateEffectOptions.defines===e||(this._updateEffectOptions.transformFeedbackVaryings=["outPosition"],this.particleEmitterType instanceof pc&&this._updateEffectOptions.transformFeedbackVaryings.push("outInitialPosition"),this._updateEffectOptions.transformFeedbackVaryings.push("outAge"),this._updateEffectOptions.transformFeedbackVaryings.push("outLife"),this._updateEffectOptions.transformFeedbackVaryings.push("outSeed"),this._updateEffectOptions.transformFeedbackVaryings.push("outSize"),this._colorGradientsTexture||this._updateEffectOptions.transformFeedbackVaryings.push("outColor"),this._updateEffectOptions.transformFeedbackVaryings.push("outDirection"),this._isBillboardBased||this._updateEffectOptions.transformFeedbackVaryings.push("outInitialDirection"),this._updateEffectOptions.transformFeedbackVaryings.push("outAngle"),this.isAnimationSheetEnabled&&(this._updateEffectOptions.transformFeedbackVaryings.push("outCellIndex"),this.spriteRandomStartCell&&this._updateEffectOptions.transformFeedbackVaryings.push("outCellStartOffset")),this.noiseTexture&&(this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates1"),this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates2")),this._updateEffectOptions.defines=e,this._updateEffect=new ai.a("gpuUpdateParticles",this._updateEffectOptions,this._engine))},t.prototype._getEffect=function(){var e;return null!==(e=this.getCustomEffect())&&void 0!==e?e:this._renderEffect},t.prototype.fillDefines=function(e,t){if(void 0===t&&(t=0),this._scene&&(this._scene.clipPlane&&e.push("#define CLIPPLANE"),this._scene.clipPlane2&&e.push("#define CLIPPLANE2"),this._scene.clipPlane3&&e.push("#define CLIPPLANE3"),this._scene.clipPlane4&&e.push("#define CLIPPLANE4"),this._scene.clipPlane5&&e.push("#define CLIPPLANE5"),this._scene.clipPlane6&&e.push("#define CLIPPLANE6")),this.blendMode===Fu.BLENDMODE_MULTIPLY&&e.push("#define BLENDMULTIPLYMODE"),this.isLocal&&e.push("#define LOCAL"),this._isBillboardBased)switch(e.push("#define BILLBOARD"),this.billboardMode){case Fu.BILLBOARDMODE_Y:e.push("#define BILLBOARDY");break;case Fu.BILLBOARDMODE_STRETCHED:e.push("#define BILLBOARDSTRETCHED");break;case Fu.BILLBOARDMODE_ALL:e.push("#define BILLBOARDMODE_ALL")}this._colorGradientsTexture&&e.push("#define COLORGRADIENTS"),this.isAnimationSheetEnabled&&e.push("#define ANIMATESHEET"),this._imageProcessingConfiguration&&(this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),e.push(""+this._imageProcessingConfigurationDefines.toString()))},t.prototype.fillUniformsAttributesAndSamplerNames=function(e,t,i){t.push("position","age","life","size","color","offset","uv","direction","initialDirection","angle","cellIndex"),e.push("emitterWM","worldOffset","view","projection","colorDead","invView","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","sheetInfos","translationPivot","eyePosition"),i.push("diffuseSampler","colorGradientSampler"),this._imageProcessingConfiguration&&(Bi.a.PrepareUniforms(e,this._imageProcessingConfigurationDefines),Bi.a.PrepareSamplers(i,this._imageProcessingConfigurationDefines))},t.prototype._recreateRenderEffect=function(){var e=this.getCustomEffect();if(e)return e;var t=[];this.fillDefines(t);var i=t.join("\n");if(this._renderEffect&&this._renderEffect.defines===i)return this._renderEffect;var n=[],r=[],o=[];return this.fillUniformsAttributesAndSamplerNames(r,n,o),this._renderEffect=new ai.a("gpuRenderParticles",n,r,o,this._engine,i),this._renderEffect},t.prototype.animate=function(e){var t;void 0===e&&(e=!1),this._timeDelta=this.updateSpeed*(e?this.preWarmStepOffset:(null===(t=this._scene)||void 0===t?void 0:t.getAnimationRatio())||1),this._actualFrame+=this._timeDelta,this._stopped||this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop()},t.prototype._createFactorGradientTexture=function(e,t){var i=this[t];if(e&&e.length&&!i){for(var n=new Float32Array(this._rawTextureWidth),r=0;r<this._rawTextureWidth;r++){var o=r/this._rawTextureWidth;Nu.GetCurrentGradient(o,e,function(e,t,i){n[r]=L.a.Lerp(e.factor1,t.factor1,i)})}this[t]=et.CreateRTexture(n,this._rawTextureWidth,1,this._scene||this._engine,!1,!1,g.a.TEXTURE_NEAREST_SAMPLINGMODE)}},t.prototype._createSizeGradientTexture=function(){this._createFactorGradientTexture(this._sizeGradients,"_sizeGradientsTexture")},t.prototype._createAngularSpeedGradientTexture=function(){this._createFactorGradientTexture(this._angularSpeedGradients,"_angularSpeedGradientsTexture")},t.prototype._createVelocityGradientTexture=function(){this._createFactorGradientTexture(this._velocityGradients,"_velocityGradientsTexture")},t.prototype._createLimitVelocityGradientTexture=function(){this._createFactorGradientTexture(this._limitVelocityGradients,"_limitVelocityGradientsTexture")},t.prototype._createDragGradientTexture=function(){this._createFactorGradientTexture(this._dragGradients,"_dragGradientsTexture")},t.prototype._createColorGradientTexture=function(){if(this._colorGradients&&this._colorGradients.length&&!this._colorGradientsTexture){for(var e=new Uint8Array(4*this._rawTextureWidth),t=s.c.Color4[0],i=0;i<this._rawTextureWidth;i++){var n=i/this._rawTextureWidth;Nu.GetCurrentGradient(n,this._colorGradients,function(n,r,o){s.b.LerpToRef(n.color1,r.color1,o,t),e[4*i]=255*t.r,e[4*i+1]=255*t.g,e[4*i+2]=255*t.b,e[4*i+3]=255*t.a})}this._colorGradientsTexture=et.CreateRGBATexture(e,this._rawTextureWidth,1,this._scene,!1,!1,g.a.TEXTURE_NEAREST_SAMPLINGMODE)}},t.prototype.render=function(e){var t,i;if(void 0===e&&(e=!1),!this._started)return 0;if(this._createColorGradientTexture(),this._createSizeGradientTexture(),this._createAngularSpeedGradientTexture(),this._createVelocityGradientTexture(),this._createLimitVelocityGradientTexture(),this._createDragGradientTexture(),this._recreateUpdateEffect(),this._recreateRenderEffect(),!this.isReady())return 0;if(!e&&this._scene){if(!this._preWarmDone&&this.preWarmCycles){for(var n=0;n<this.preWarmCycles;n++)this.animate(!0),this.render(!0);this._preWarmDone=!0}if(this._currentRenderId===this._scene.getFrameId())return 0;this._currentRenderId=this._scene.getFrameId()}if(this._initialize(),this._accumulatedCount+=this.emitRate*this._timeDelta,this._accumulatedCount>1){var r=0|this._accumulatedCount;this._accumulatedCount-=r,this._currentActiveCount=Math.min(this._activeCount,this._currentActiveCount+r)}if(!this._currentActiveCount)return 0;this._engine.enableEffect(this._updateEffect);var o,s=this._engine;if(!s.setState)throw new Error("GPU particles cannot work with a full Engine. ThinEngine is not supported");if(this._updateEffect.setFloat("currentCount",this._currentActiveCount),this._updateEffect.setFloat("timeDelta",this._timeDelta),this._updateEffect.setFloat("stopFactor",this._stopped?0:1),this._updateEffect.setTexture("randomSampler",this._randomTexture),this._updateEffect.setTexture("randomSampler2",this._randomTexture2),this._updateEffect.setFloat2("lifeTime",this.minLifeTime,this.maxLifeTime),this._updateEffect.setFloat2("emitPower",this.minEmitPower,this.maxEmitPower),this._colorGradientsTexture||(this._updateEffect.setDirectColor4("color1",this.color1),this._updateEffect.setDirectColor4("color2",this.color2)),this._updateEffect.setFloat2("sizeRange",this.minSize,this.maxSize),this._updateEffect.setFloat4("scaleRange",this.minScaleX,this.maxScaleX,this.minScaleY,this.maxScaleY),this._updateEffect.setFloat4("angleRange",this.minAngularSpeed,this.maxAngularSpeed,this.minInitialRotation,this.maxInitialRotation),this._updateEffect.setVector3("gravity",this.gravity),this._sizeGradientsTexture&&this._updateEffect.setTexture("sizeGradientSampler",this._sizeGradientsTexture),this._angularSpeedGradientsTexture&&this._updateEffect.setTexture("angularSpeedGradientSampler",this._angularSpeedGradientsTexture),this._velocityGradientsTexture&&this._updateEffect.setTexture("velocityGradientSampler",this._velocityGradientsTexture),this._limitVelocityGradientsTexture&&(this._updateEffect.setTexture("limitVelocityGradientSampler",this._limitVelocityGradientsTexture),this._updateEffect.setFloat("limitVelocityDamping",this.limitVelocityDamping)),this._dragGradientsTexture&&this._updateEffect.setTexture("dragGradientSampler",this._dragGradientsTexture),this.particleEmitterType&&this.particleEmitterType.applyToShader(this._updateEffect),this._isAnimationSheetEnabled&&this._updateEffect.setFloat3("cellInfos",this.startSpriteCellID,this.endSpriteCellID,this.spriteCellChangeSpeed),this.noiseTexture&&(this._updateEffect.setTexture("noiseSampler",this.noiseTexture),this._updateEffect.setVector3("noiseStrength",this.noiseStrength)),this.emitter.position)o=this.emitter.getWorldMatrix();else{var c=this.emitter;o=a.a.Translation(c.x,c.y,c.z)}if(this.isLocal||this._updateEffect.setMatrix("emitterWM",o),this._engine.bindVertexArrayObject(this._updateVAO[this._targetIndex],null),s.bindTransformFeedbackBuffer(this._targetBuffer.getBuffer()),s.setRasterizerState(!1),s.beginTransformFeedback(!0),s.drawArraysType(g.a.MATERIAL_PointListDrawMode,0,this._currentActiveCount),s.endTransformFeedback(),s.setRasterizerState(!0),s.bindTransformFeedbackBuffer(null),!e){var l=this._getEffect();this._engine.enableEffect(l);var u=(null===(t=this._scene)||void 0===t?void 0:t.getViewMatrix())||a.a.IdentityReadOnly;if(l.setMatrix("view",u),l.setMatrix("projection",null!==(i=this.defaultProjectionMatrix)&&void 0!==i?i:this._scene.getProjectionMatrix()),l.setTexture("diffuseSampler",this.particleTexture),l.setVector2("translationPivot",this.translationPivot),l.setVector3("worldOffset",this.worldOffset),this.isLocal&&l.setMatrix("emitterWM",o),this._colorGradientsTexture?l.setTexture("colorGradientSampler",this._colorGradientsTexture):l.setDirectColor4("colorDead",this.colorDead),this._isAnimationSheetEnabled&&this.particleTexture){var h=this.particleTexture.getBaseSize();l.setFloat3("sheetInfos",this.spriteCellWidth/h.width,this.spriteCellHeight/h.height,h.width/this.spriteCellWidth)}if(this._isBillboardBased&&this._scene){var d=this._scene.activeCamera;l.setVector3("eyePosition",d.globalPosition)}var f=l.defines;if(this._scene&&(this._scene.clipPlane||this._scene.clipPlane2||this._scene.clipPlane3||this._scene.clipPlane4||this._scene.clipPlane5||this._scene.clipPlane6)&&Hr.a.BindClipPlane(l,this._scene),f.indexOf("#define BILLBOARDMODE_ALL")>=0){var p=u.clone();p.invert(),l.setMatrix("invView",p)}switch(this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(l),this.blendMode){case Fu.BLENDMODE_ADD:this._engine.setAlphaMode(g.a.ALPHA_ADD);break;case Fu.BLENDMODE_ONEONE:this._engine.setAlphaMode(g.a.ALPHA_ONEONE);break;case Fu.BLENDMODE_STANDARD:this._engine.setAlphaMode(g.a.ALPHA_COMBINE);break;case Fu.BLENDMODE_MULTIPLY:this._engine.setAlphaMode(g.a.ALPHA_MULTIPLY)}this.forceDepthWrite&&s.setDepthWrite(!0),this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex],null),this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.notifyObservers(l),this._engine.drawArraysType(g.a.MATERIAL_TriangleFanDrawMode,0,4,this._currentActiveCount),this._engine.setAlphaMode(g.a.ALPHA_DISABLE)}this._targetIndex++,2===this._targetIndex&&(this._targetIndex=0);var _=this._sourceBuffer;return this._sourceBuffer=this._targetBuffer,this._targetBuffer=_,this._currentActiveCount},t.prototype.rebuild=function(){this._initialize(!0)},t.prototype._releaseBuffers=function(){this._buffer0&&(this._buffer0.dispose(),this._buffer0=null),this._buffer1&&(this._buffer1.dispose(),this._buffer1=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null)},t.prototype._releaseVAOs=function(){if(this._updateVAO){for(var e=0;e<this._updateVAO.length;e++)this._engine.releaseVertexArrayObject(this._updateVAO[e]);for(this._updateVAO=[],e=0;e<this._renderVAO.length;e++)this._engine.releaseVertexArrayObject(this._renderVAO[e]);this._renderVAO=[]}},t.prototype.dispose=function(e){if(void 0===e&&(e=!0),this._scene){var t=this._scene.particleSystems.indexOf(this);t>-1&&this._scene.particleSystems.splice(t,1)}this._releaseBuffers(),this._releaseVAOs(),this._colorGradientsTexture&&(this._colorGradientsTexture.dispose(),this._colorGradientsTexture=null),this._sizeGradientsTexture&&(this._sizeGradientsTexture.dispose(),this._sizeGradientsTexture=null),this._angularSpeedGradientsTexture&&(this._angularSpeedGradientsTexture.dispose(),this._angularSpeedGradientsTexture=null),this._velocityGradientsTexture&&(this._velocityGradientsTexture.dispose(),this._velocityGradientsTexture=null),this._limitVelocityGradientsTexture&&(this._limitVelocityGradientsTexture.dispose(),this._limitVelocityGradientsTexture=null),this._dragGradientsTexture&&(this._dragGradientsTexture.dispose(),this._dragGradientsTexture=null),this._randomTexture&&(this._randomTexture.dispose(),this._randomTexture=null),this._randomTexture2&&(this._randomTexture2.dispose(),this._randomTexture2=null),e&&this.particleTexture&&(this.particleTexture.dispose(),this.particleTexture=null),e&&this.noiseTexture&&(this.noiseTexture.dispose(),this.noiseTexture=null),this.onStoppedObservable.clear(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},t.prototype.clone=function(e,i){var n=this.serialize(),r=t.Parse(n,this._scene||this._engine,""),o=Object(h.a)({},this._customEffect);return r.name=e,r._customEffect=o,void 0===i&&(i=this.emitter),r.emitter=i,r.noiseTexture=this.noiseTexture,r},t.prototype.serialize=function(e){void 0===e&&(e=!1);var t={};return Fu._Serialize(t,this,e),t.activeParticleCount=this.activeParticleCount,t.randomTextureSize=this._randomTextureSize,t},t.Parse=function(e,i,n,r){void 0===r&&(r=!1);var o=new t(e.name,{capacity:e.capacity,randomTextureSize:e.randomTextureSize},i);return e.activeParticleCount&&(o.activeParticleCount=e.activeParticleCount),Fu._Parse(e,o,i,n),e.preventAutoStart&&(o.preventAutoStart=e.preventAutoStart),r||o.preventAutoStart||o.start(),o},t}(mc),Uu=function(){function e(){this.systems=new Array}return Object.defineProperty(e.prototype,"emitterNode",{get:function(){return this._emitterNode},enumerable:!1,configurable:!0}),e.prototype.setEmitterAsSphere=function(e,t,i){this._emitterNode&&this._emitterNode.dispose(),this._emitterCreationOptions={kind:"Sphere",options:e,renderingGroupId:t};var n=yr.a.CreateSphere("emitterSphere",{diameter:e.diameter,segments:e.segments},i);n.renderingGroupId=t;var r=new Ui.a("emitterSphereMaterial",i);r.emissiveColor=e.color,n.material=r;for(var o=0,a=this.systems;o<a.length;o++)a[o].emitter=n;this._emitterNode=n},e.prototype.start=function(e){for(var t=0,i=this.systems;t<i.length;t++){var n=i[t];e&&(n.emitter=e),n.start()}},e.prototype.dispose=function(){for(var e=0,t=this.systems;e<t.length;e++)t[e].dispose();this.systems=[],this._emitterNode&&(this._emitterNode.dispose(),this._emitterNode=null)},e.prototype.serialize=function(e){void 0===e&&(e=!1);for(var t={systems:[]},i=0,n=this.systems;i<n.length;i++){var r=n[i];t.systems.push(r.serialize(e))}return this._emitterNode&&(t.emitter=this._emitterCreationOptions),t},e.Parse=function(t,i,n){void 0===n&&(n=!1);var r=new e,o=this.BaseAssetsUrl+"/textures/";i=i||x.a.LastCreatedScene;for(var a=0,c=t.systems;a<c.length;a++){var l=c[a];r.systems.push(n?Bu.Parse(l,i,o,!0):Fu.Parse(l,i,o,!0))}if(t.emitter){var u=t.emitter.options;switch(t.emitter.kind){case"Sphere":r.setEmitterAsSphere({diameter:u.diameter,segments:u.segments,color:s.a.FromArray(u.color)},t.emitter.renderingGroupId,i)}}return r},e.BaseAssetsUrl="https://assets.babylonjs.com/particles",e}(),Vu=function(){function e(){}return e.CreateDefault=function(e,t,i,n){var r;return void 0===t&&(t=500),void 0===n&&(n=!1),(r=n?new Bu("default system",{capacity:t},i):new Fu("default system",t,i)).emitter=e,r.particleTexture=new Ke.a("https://www.babylonjs.com/assets/Flare.png",r.getScene()),r.createConeEmitter(.1,Math.PI/4),r.color1=new s.b(1,1,1,1),r.color2=new s.b(1,1,1,1),r.colorDead=new s.b(1,1,1,0),r.minSize=.1,r.maxSize=.1,r.minEmitPower=2,r.maxEmitPower=2,r.updateSpeed=1/60,r.emitRate=30,r},e.CreateAsync=function(t,i,n){void 0===n&&(n=!1),i||(i=x.a.LastCreatedScene);var r={};return i._addPendingData(r),new Promise(function(o,a){if(n&&!Bu.IsSupported)return i._removePendingData(r),a("Particle system with GPU is not supported.");Ce.b.LoadFile(e.BaseAssetsUrl+"/systems/"+t+".json",function(e){i._removePendingData(r);var t=JSON.parse(e.toString());return o(Uu.Parse(t,i,n))},void 0,void 0,void 0,function(){return i._removePendingData(r),a("An error occured while the creation of your particle system. Check if your type '"+t+"' exists.")})})},e.ExportSet=function(e){for(var t=new Uu,i=0,n=e;i<n.length;i++){var r=n[i];t.systems.push(r)}return t},e.ParseFromFileAsync=function(e,t,i,n,r){return void 0===n&&(n=!1),void 0===r&&(r=""),new Promise(function(o,a){var s=new V.a;s.addEventListener("readystatechange",function(){if(4==s.readyState)if(200==s.status){var t=JSON.parse(s.responseText),c=void 0;c=n?Bu.Parse(t,i,r):Fu.Parse(t,i,r),e&&(c.name=e),o(c)}else a("Unable to load the particle system")}),s.open("GET",t),s.send()})},e.CreateFromSnippetAsync=function(e,t,i,n){var r=this;if(void 0===i&&(i=!1),void 0===n&&(n=""),"_BLANK"===e){var o=this.CreateDefault(null);return o.start(),Promise.resolve(o)}return new Promise(function(o,a){var s=new V.a;s.addEventListener("readystatechange",function(){if(4==s.readyState)if(200==s.status){var r=JSON.parse(JSON.parse(s.responseText).jsonPayload),c=JSON.parse(r.particleSystem),l=void 0;(l=i?Bu.Parse(c,t,n):Fu.Parse(c,t,n)).snippetId=e,o(l)}else a("Unable to load the snippet "+e)}),s.open("GET",r.SnippetUrl+"/"+e.replace(/#/g,"/")),s.send()})},e.BaseAssetsUrl=Uu.BaseAssetsUrl,e.SnippetUrl="https://snippet.babylonjs.com",e}();n.a.AddParser(Me.a.NAME_PARTICLESYSTEM,function(e,t,i,r){var o=n.a.GetIndividualParser(Me.a.NAME_PARTICLESYSTEM);if(o&&void 0!==e.particleSystems&&null!==e.particleSystems)for(var a=0,s=e.particleSystems.length;a<s;a++){var c=e.particleSystems[a];i.particleSystems.push(o(c,t,r))}}),n.a.AddIndividualParser(Me.a.NAME_PARTICLESYSTEM,function(e,t,i){return e.activeParticleCount?Bu.Parse(e,t,i):Fu.Parse(e,t,i)}),Se.a.prototype.createEffectForParticles=function(e,t,i,n,r,o,a,s){var c;void 0===t&&(t=[]),void 0===i&&(i=[]),void 0===n&&(n="");var l=[],u=[],h=[];return s?s.fillUniformsAttributesAndSamplerNames(u,l,h):(l=Fu._GetAttributeNamesOrOptions(),u=Fu._GetEffectCreationOptions()),-1===n.indexOf(" BILLBOARD")&&(n+="\n#define BILLBOARD\n"),-1===i.indexOf("diffuseSampler")&&i.push("diffuseSampler"),this.createEffect({vertex:null!==(c=null==s?void 0:s.vertexShaderName)&&void 0!==c?c:"particles",fragmentElement:e},l,u.concat(t),h.concat(i),n,r,o,a)},be.a.prototype.getEmittedParticleSystems=function(){for(var e=new Array,t=0;t<this.getScene().particleSystems.length;t++){var i=this.getScene().particleSystems[t];i.emitter===this&&e.push(i)}return e},be.a.prototype.getHierarchyEmittedParticleSystems=function(){var e=new Array,t=this.getDescendants();t.push(this);for(var i=0;i<this.getScene().particleSystems.length;i++){var n=this.getScene().particleSystems[i],r=n.emitter;r.position&&-1!==t.indexOf(r)&&e.push(n)}return e};var ku,Gu=function(){function e(e,t,i,n,r,o,c,l,u,h){void 0===u&&(u=null),void 0===h&&(h=null),this.idx=0,this.id=0,this.color=new s.b(1,1,1,1),this.position=a.e.Zero(),this.rotation=a.e.Zero(),this.scaling=a.e.One(),this.uvs=new a.f(0,0,1,1),this.velocity=a.e.Zero(),this.pivot=a.e.Zero(),this.translateFromPivot=!1,this.alive=!0,this.isVisible=!0,this._pos=0,this._ind=0,this.shapeId=0,this.idxInShape=0,this._stillInvisible=!1,this._rotationMatrix=[1,0,0,0,1,0,0,0,1],this.parentId=null,this.materialIndex=null,this.props=null,this.cullingStrategy=ze.a.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this._globalPosition=a.e.Zero(),this.idx=e,this.id=t,this._pos=i,this._ind=n,this._model=r,this.shapeId=o,this.idxInShape=c,this._sps=l,u&&(this._modelBoundingInfo=u,this._boundingInfo=new _n.a(u.minimum,u.maximum)),null!==h&&(this.materialIndex=h)}return e.prototype.copyToRef=function(e){return e.position.copyFrom(this.position),e.rotation.copyFrom(this.rotation),this.rotationQuaternion&&(e.rotationQuaternion?e.rotationQuaternion.copyFrom(this.rotationQuaternion):e.rotationQuaternion=this.rotationQuaternion.clone()),e.scaling.copyFrom(this.scaling),this.color&&(e.color?e.color.copyFrom(this.color):e.color=this.color.clone()),e.uvs.copyFrom(this.uvs),e.velocity.copyFrom(this.velocity),e.pivot.copyFrom(this.pivot),e.translateFromPivot=this.translateFromPivot,e.alive=this.alive,e.isVisible=this.isVisible,e.parentId=this.parentId,e.cullingStrategy=this.cullingStrategy,null!==this.materialIndex&&(e.materialIndex=this.materialIndex),this},Object.defineProperty(e.prototype,"scale",{get:function(){return this.scaling},set:function(e){this.scaling=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quaternion",{get:function(){return this.rotationQuaternion},set:function(e){this.rotationQuaternion=e},enumerable:!1,configurable:!0}),e.prototype.intersectsMesh=function(e){return!(!this._boundingInfo||!e._boundingInfo)&&(this._sps._bSphereOnly?mn.a.Intersects(this._boundingInfo.boundingSphere,e._boundingInfo.boundingSphere):this._boundingInfo.intersects(e._boundingInfo,!1))},e.prototype.isInFrustum=function(e){return null!==this._boundingInfo&&this._boundingInfo.isInFrustum(e,this.cullingStrategy)},e.prototype.getRotationMatrix=function(e){var t;if(this.rotationQuaternion)t=this.rotationQuaternion;else{t=a.c.Quaternion[0];var i=this.rotation;a.b.RotationYawPitchRollToRef(i.y,i.x,i.z,t)}t.toRotationMatrix(e)},e}(),zu=function(e,t,i,n,r,o,a,s,c){this._indicesLength=0,this.shapeID=e,this._shape=t,this._indices=i,this._indicesLength=i.length,this._shapeUV=o,this._shapeColors=r,this._normals=n,this._positionFunction=a,this._vertexFunction=s,this._material=c},ju=function(e,t,i,n){this.idx=0,this.ind=0,this.indicesLength=0,this.sqDistance=0,this.materialIndex=0,this.idx=e,this.ind=t,this.indicesLength=i,this.materialIndex=n},Wu=function(){function e(){this.position=a.e.Zero(),this.color=new s.b(1,1,1,1),this.uv=a.d.Zero()}return Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(e){this.position.x=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(e){this.position.y=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this.position.z},set:function(e){this.position.z=e},enumerable:!1,configurable:!0}),e}(),Hu=function(){function e(e,t,i){this.particles=new Array,this.nbParticles=0,this.billboard=!1,this.recomputeNormals=!1,this.counter=0,this.vars={},this._bSphereOnly=!1,this._bSphereRadiusFactor=1,this._positions=new Array,this._indices=new Array,this._normals=new Array,this._colors=new Array,this._uvs=new Array,this._index=0,this._updatable=!0,this._pickable=!1,this._isVisibilityBoxLocked=!1,this._alwaysVisible=!1,this._depthSort=!1,this._expandable=!1,this._shapeCounter=0,this._copy=new Gu(0,0,0,0,null,0,0,this),this._color=new s.b(0,0,0,0),this._computeParticleColor=!0,this._computeParticleTexture=!0,this._computeParticleRotation=!0,this._computeParticleVertex=!1,this._computeBoundingBox=!1,this._depthSortParticles=!0,this._mustUnrotateFixedNormals=!1,this._particlesIntersect=!1,this._needs32Bits=!1,this._isNotBuilt=!0,this._lastParticleId=0,this._idxOfId=[],this._multimaterialEnabled=!1,this._useModelMaterial=!1,this._depthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},this._materialSortFunction=function(e,t){return e.materialIndex-t.materialIndex},this._autoUpdateSubMeshes=!1,this.name=e,this._scene=t||x.a.LastCreatedScene,this._camera=t.activeCamera,this._pickable=!!i&&i.isPickable,this._depthSort=!!i&&i.enableDepthSort,this._multimaterialEnabled=!!i&&i.enableMultiMaterial,this._useModelMaterial=!!i&&i.useModelMaterial,this._multimaterialEnabled=!!this._useModelMaterial||this._multimaterialEnabled,this._expandable=!!i&&i.expandable,this._particlesIntersect=!!i&&i.particleIntersection,this._bSphereOnly=!!i&&i.boundingSphereOnly,this._bSphereRadiusFactor=i&&i.bSphereRadiusFactor?i.bSphereRadiusFactor:1,i&&void 0!==i.updatable?this._updatable=i.updatable:this._updatable=!0,this._pickable&&(this.pickedBySubMesh=[[]],this.pickedParticles=this.pickedBySubMesh[0]),(this._depthSort||this._multimaterialEnabled)&&(this.depthSortedParticles=[]),this._multimaterialEnabled&&(this._multimaterial=new Da.a(this.name+"MultiMaterial",this._scene),this._materials=[],this._materialIndexesById={}),this._tmpVertex=new Wu}return e.prototype.buildMesh=function(){if(!this._isNotBuilt&&this.mesh)return this.mesh;if(0===this.nbParticles&&!this.mesh){var e=eu.CreateDisc("",{radius:1,tessellation:3},this._scene);this.addShape(e,1),e.dispose()}if(this._indices32=this._needs32Bits?new Uint32Array(this._indices):new Uint16Array(this._indices),this._positions32=new Float32Array(this._positions),this._uvs32=new Float32Array(this._uvs),this._colors32=new Float32Array(this._colors),!this.mesh){var t=new be.a(this.name,this._scene);this.mesh=t}!this._updatable&&this._multimaterialEnabled&&this._sortParticlesByMaterial(),this.recomputeNormals&&zi.a.ComputeNormals(this._positions32,this._indices32,this._normals),this._normals32=new Float32Array(this._normals),this._fixedNormal32=new Float32Array(this._normals),this._mustUnrotateFixedNormals&&this._unrotateFixedNormals();var i=new zi.a;if(i.indices=this._depthSort?this._indices:this._indices32,i.set(this._positions32,ji.b.PositionKind),i.set(this._normals32,ji.b.NormalKind),this._uvs32.length>0&&i.set(this._uvs32,ji.b.UVKind),this._colors32.length>0&&i.set(this._colors32,ji.b.ColorKind),i.applyToMesh(this.mesh,this._updatable),this.mesh.isPickable=this._pickable,this._pickable)for(var n=0,r=0;r<this.nbParticles;r++)for(var o=this.particles[r],a=o._model._indicesLength,s=0;s<a;s++)if(0==s%3){var c={idx:o.idx,faceId:n};this.pickedParticles[n]=c,n++}return this._multimaterialEnabled&&this.setMultiMaterial(this._materials),this._expandable||(this._depthSort||this._multimaterialEnabled||(this._indices=null),this._positions=null,this._normals=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0)),this._isNotBuilt=!1,this.recomputeNormals=!1,this.mesh},e.prototype.digest=function(e,t){var i=t&&t.facetNb||1,n=t&&t.number||0,r=t&&t.delta||0,o=e.getVerticesData(ji.b.PositionKind),s=e.getIndices(),c=e.getVerticesData(ji.b.UVKind),l=e.getVerticesData(ji.b.ColorKind),u=e.getVerticesData(ji.b.NormalKind),h=t&&t.storage?t.storage:null,d=0,f=s.length/3;n?(n=n>f?f:n,i=Math.round(f/n),r=0):i=i>f?f:i;for(var p=[],_=[],m=[],g=[],v=[],b=a.e.Zero(),y=i;d<f;){d>f-(i=y+Math.floor((1+r)*Math.random()))&&(i=f-d),p.length=0,_.length=0,m.length=0,g.length=0,v.length=0;for(var T=0,E=3*d;E<3*(d+i);E++){m.push(T);var S=s[E],A=3*S;if(p.push(o[A],o[A+1],o[A+2]),_.push(u[A],u[A+1],u[A+2]),c){var P=2*S;g.push(c[P],c[P+1])}if(l){var C=4*S;v.push(l[C],l[C+1],l[C+2],l[C+3])}T++}var R,x=this.nbParticles,O=this._posToShape(p),M=this._uvsToShapeUV(g),I=Ce.b.Slice(m),D=Ce.b.Slice(v),N=Ce.b.Slice(_);for(b.copyFromFloats(0,0,0),R=0;R<O.length;R++)b.addInPlace(O[R]);b.scaleInPlace(1/O.length);var L,w=new a.e(1/0,1/0,1/0),F=new a.e(-1/0,-1/0,-1/0);for(R=0;R<O.length;R++)O[R].subtractInPlace(b),w.minimizeInPlaceFromFloats(O[R].x,O[R].y,O[R].z),F.maximizeInPlaceFromFloats(O[R].x,O[R].y,O[R].z);this._particlesIntersect&&(L=new _n.a(w,F));var B=null;this._useModelMaterial&&(B=e.material?e.material:this._setDefaultMaterial());var U=new zu(this._shapeCounter,O,I,N,D,M,null,null,B),V=this._positions.length,k=this._indices.length;this._meshBuilder(this._index,k,O,this._positions,I,this._indices,g,this._uvs,D,this._colors,N,this._normals,x,0,null,U),this._addParticle(x,this._lastParticleId,V,k,U,this._shapeCounter,0,L,h),this.particles[this.nbParticles].position.addInPlace(b),h||(this._index+=O.length,x++,this.nbParticles++,this._lastParticleId++),this._shapeCounter++,d+=i}return this._isNotBuilt=!0,this},e.prototype._unrotateFixedNormals=function(){for(var e=0,t=0,i=a.c.Vector3[0],n=a.c.Quaternion[0],r=a.c.Matrix[0],o=0;o<this.particles.length;o++){var s=this.particles[o],c=s._model._shape;if(s.rotationQuaternion)s.rotationQuaternion.conjugateToRef(n);else{var l=s.rotation;a.b.RotationYawPitchRollToRef(l.y,l.x,l.z,n),n.conjugateInPlace()}n.toRotationMatrix(r);for(var u=0;u<c.length;u++)t=e+3*u,a.e.TransformNormalFromFloatsToRef(this._normals32[t],this._normals32[t+1],this._normals32[t+2],r,i),i.toArray(this._fixedNormal32,t);e=t+3}},e.prototype._resetCopy=function(){var e=this._copy;e.position.setAll(0),e.rotation.setAll(0),e.rotationQuaternion=null,e.scaling.setAll(1),e.uvs.copyFromFloats(0,0,1,1),e.color=null,e.translateFromPivot=!1,e.shapeId=0,e.materialIndex=null},e.prototype._meshBuilder=function(e,t,i,n,r,o,s,c,l,u,h,d,f,p,_,m){var g,v=0,b=0,y=0;this._resetCopy();var T=this._copy,E=!(!_||!_.storage);if(T.idx=f,T.idxInShape=p,T.shapeId=m.shapeID,this._useModelMaterial){var S=m._material.uniqueId,A=this._materialIndexesById;A.hasOwnProperty(S)||(A[S]=this._materials.length,this._materials.push(m._material));var P=A[S];T.materialIndex=P}if(_&&_.positionFunction&&(_.positionFunction(T,f,p),this._mustUnrotateFixedNormals=!0),E)return T;var C=a.c.Matrix[0],R=this._tmpVertex,x=R.position,O=R.color,M=R.uv,I=a.c.Vector3[1],D=a.c.Vector3[2],N=a.c.Vector3[3];a.a.IdentityToRef(C),T.getRotationMatrix(C),T.pivot.multiplyToRef(T.scaling,N),T.translateFromPivot?D.setAll(0):D.copyFrom(N);var L=_&&_.vertexFunction;for(g=0;g<i.length;g++){if(x.copyFrom(i[g]),T.color&&O.copyFrom(T.color),s&&M.copyFromFloats(s[v],s[v+1]),L&&_.vertexFunction(T,R,g),x.multiplyInPlace(T.scaling).subtractInPlace(N),a.e.TransformCoordinatesToRef(x,C,I),I.addInPlace(D).addInPlace(T.position),n.push(I.x,I.y,I.z),s){var w=T.uvs;c.push((w.z-w.x)*M.x+w.x,(w.w-w.y)*M.y+w.y),v+=2}if(T.color)this._color.copyFrom(O);else{var F=this._color;l&&void 0!==l[b]?(F.r=l[b],F.g=l[b+1],F.b=l[b+2],F.a=l[b+3]):(F.r=1,F.g=1,F.b=1,F.a=1)}u.push(this._color.r,this._color.g,this._color.b,this._color.a),b+=4,!this.recomputeNormals&&h&&(a.e.TransformNormalFromFloatsToRef(h[y],h[y+1],h[y+2],C,x),d.push(x.x,x.y,x.z),y+=3)}for(g=0;g<r.length;g++){var B=e+r[g];o.push(B),B>65535&&(this._needs32Bits=!0)}if(this._depthSort||this._multimaterialEnabled){var U=null!==T.materialIndex?T.materialIndex:0;this.depthSortedParticles.push(new ju(f,t,r.length,U))}return T},e.prototype._posToShape=function(e){for(var t=[],i=0;i<e.length;i+=3)t.push(a.e.FromArray(e,i));return t},e.prototype._uvsToShapeUV=function(e){var t=[];if(e)for(var i=0;i<e.length;i++)t.push(e[i]);return t},e.prototype._addParticle=function(e,t,i,n,r,o,a,s,c){void 0===s&&(s=null),void 0===c&&(c=null);var l=new Gu(e,t,i,n,r,o,a,this,s);return(c||this.particles).push(l),l},e.prototype.addShape=function(e,t,i){var n=e.getVerticesData(ji.b.PositionKind),r=e.getIndices(),o=e.getVerticesData(ji.b.UVKind),a=e.getVerticesData(ji.b.ColorKind),s=e.getVerticesData(ji.b.NormalKind);this.recomputeNormals=!s;var c=Ce.b.SliceToArray(r),l=Ce.b.SliceToArray(s),u=a?Ce.b.SliceToArray(a):[],h=i&&i.storage?i.storage:null,d=null;this._particlesIntersect&&(d=e.getBoundingInfo());var f=this._posToShape(n),p=this._uvsToShapeUV(o),_=i?i.positionFunction:null,m=i?i.vertexFunction:null,g=null;this._useModelMaterial&&(g=e.material?e.material:this._setDefaultMaterial());for(var v=new zu(this._shapeCounter,f,c,l,u,p,_,m,g),b=0;b<t;b++)this._insertNewParticle(this.nbParticles,b,v,f,r,o,a,s,d,h,i);return this._shapeCounter++,this._isNotBuilt=!0,this._shapeCounter-1},e.prototype._rebuildParticle=function(e,t){void 0===t&&(t=!1),this._resetCopy();var i=this._copy;e._model._positionFunction&&e._model._positionFunction(i,e.idx,e.idxInShape);var n=a.c.Matrix[0],r=a.c.Vector3[0],o=a.c.Vector3[1],s=a.c.Vector3[2],c=a.c.Vector3[3];i.getRotationMatrix(n),e.pivot.multiplyToRef(e.scaling,c),i.translateFromPivot?s.copyFromFloats(0,0,0):s.copyFrom(c);for(var l=e._model._shape,u=0;u<l.length;u++)r.copyFrom(l[u]),e._model._vertexFunction&&e._model._vertexFunction(i,r,u),r.multiplyInPlace(i.scaling).subtractInPlace(c),a.e.TransformCoordinatesToRef(r,n,o),o.addInPlace(s).addInPlace(i.position).toArray(this._positions32,e._pos+3*u);t&&(e.position.setAll(0),e.rotation.setAll(0),e.rotationQuaternion=null,e.scaling.setAll(1),e.uvs.setAll(0),e.pivot.setAll(0),e.translateFromPivot=!1,e.parentId=null)},e.prototype.rebuildMesh=function(e){void 0===e&&(e=!1);for(var t=0;t<this.particles.length;t++)this._rebuildParticle(this.particles[t],e);return this.mesh.updateVerticesData(ji.b.PositionKind,this._positions32,!1,!1),this},e.prototype.removeParticles=function(e,t){var i=t-e+1;if(!this._expandable||i<=0||i>=this.nbParticles||!this._updatable)return[];var n=this.particles,r=this.nbParticles;if(t<r-1)for(var o=t+1,a=n[o]._pos-n[e]._pos,s=n[o]._ind-n[e]._ind,c=o;c<r;c++){var l=n[c];l._pos-=a,l._ind-=s}var u=n.splice(e,i);this._positions.length=0,this._indices.length=0,this._colors.length=0,this._uvs.length=0,this._normals.length=0,this._index=0,this._idxOfId.length=0,(this._depthSort||this._multimaterialEnabled)&&(this.depthSortedParticles=[]);for(var h=0,d=n.length,f=0;f<d;f++){var p=n[f],_=p._model,m=_._shape,g=_._indices,v=_._normals,b=_._shapeColors,y=_._shapeUV;p.idx=f,this._idxOfId[p.id]=f,this._meshBuilder(this._index,h,m,this._positions,g,this._indices,y,this._uvs,b,this._colors,v,this._normals,p.idx,p.idxInShape,null,_),this._index+=m.length,h+=g.length}return this.nbParticles-=i,this._isNotBuilt=!0,u},e.prototype.insertParticlesFromArray=function(e){if(!this._expandable)return this;for(var t=0,i=e[0].shapeId,n=e.length,r=0;r<n;r++){var o=e[r],a=o._model,s=a._shape,c=a._indices,l=a._shapeUV,u=a._shapeColors,h=a._normals,d=!h;this.recomputeNormals=d||this.recomputeNormals;var f=o._boundingInfo,p=this._insertNewParticle(this.nbParticles,t,a,s,c,l,u,h,f,null,null);o.copyToRef(p),t++,i!=o.shapeId&&(i=o.shapeId,t=0)}return this._isNotBuilt=!0,this},e.prototype._insertNewParticle=function(e,t,i,n,r,o,a,s,c,l,u){var h=this._positions.length,d=this._indices.length,f=this._meshBuilder(this._index,d,n,this._positions,r,this._indices,o,this._uvs,a,this._colors,s,this._normals,e,t,u,i),p=null;return this._updatable&&((p=this._addParticle(this.nbParticles,this._lastParticleId,h,d,i,this._shapeCounter,t,c,l)).position.copyFrom(f.position),p.rotation.copyFrom(f.rotation),f.rotationQuaternion&&(p.rotationQuaternion?p.rotationQuaternion.copyFrom(f.rotationQuaternion):p.rotationQuaternion=f.rotationQuaternion.clone()),f.color&&(p.color?p.color.copyFrom(f.color):p.color=f.color.clone()),p.scaling.copyFrom(f.scaling),p.uvs.copyFrom(f.uvs),null!==f.materialIndex&&(p.materialIndex=f.materialIndex),this.expandable&&(this._idxOfId[p.id]=p.idx)),l||(this._index+=n.length,this.nbParticles++,this._lastParticleId++),p},e.prototype.setParticles=function(e,t,i){if(void 0===e&&(e=0),void 0===t&&(t=this.nbParticles-1),void 0===i&&(i=!0),!this._updatable||this._isNotBuilt)return this;this.beforeUpdateParticles(e,t,i);var n=a.c.Matrix[0],r=a.c.Matrix[1],o=this.mesh,s=this._colors32,c=this._positions32,l=this._normals32,u=this._uvs32,h=this._indices32,d=this._indices,f=this._fixedNormal32,p=a.c.Vector3,_=p[5].copyFromFloats(1,0,0),m=p[6].copyFromFloats(0,1,0),g=p[7].copyFromFloats(0,0,1),v=p[8].setAll(Number.MAX_VALUE),b=p[9].setAll(-Number.MAX_VALUE),y=p[10].setAll(0),T=this._tmpVertex,E=T.position,S=T.color,A=T.uv;if((this.billboard||this._depthSort)&&(this.mesh.computeWorldMatrix(!0),this.mesh._worldMatrix.invertToRef(r)),this.billboard){var P=p[0];this._camera.getDirectionToRef(J.a.Z,P),a.e.TransformNormalToRef(P,r,g),g.normalize();var C=this._camera.getViewMatrix(!0);a.e.TransformNormalFromFloatsToRef(C.m[1],C.m[5],C.m[9],r,m),a.e.CrossToRef(m,g,_),m.normalize(),_.normalize()}this._depthSort&&a.e.TransformCoordinatesToRef(this._camera.globalPosition,r,y),a.a.IdentityToRef(n);var R=0,x=0,O=0,M=0,I=0,D=0,N=0;if(this.mesh.isFacetDataEnabled&&(this._computeBoundingBox=!0),t=t>=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){var L=this.mesh._boundingInfo;L&&(v.copyFrom(L.minimum),b.copyFrom(L.maximum))}var w=(x=this.particles[e]._pos)/3|0;M=4*w,D=2*w;for(var F=e;F<=t;F++){var B=this.particles[F];this.updateParticle(B);var U=B._model._shape,V=B._model._shapeUV,k=B._rotationMatrix,G=B.position,z=B.rotation,j=B.scaling,W=B._globalPosition;if(this._depthSort&&this._depthSortParticles){var H=this.depthSortedParticles[F];H.idx=B.idx,H.ind=B._ind,H.indicesLength=B._model._indicesLength,H.sqDistance=a.e.DistanceSquared(B.position,y)}if(!B.alive||B._stillInvisible&&!B.isVisible)x+=3*(N=U.length),M+=4*N,D+=2*N;else{if(B.isVisible){B._stillInvisible=!1;var X=p[12];if(B.pivot.multiplyToRef(j,X),this.billboard&&(z.x=0,z.y=0),(this._computeParticleRotation||this.billboard)&&B.getRotationMatrix(n),null!==B.parentId){var Y=this.getParticleById(B.parentId);if(Y){var K=Y._rotationMatrix,Q=Y._globalPosition,q=G.x*K[1]+G.y*K[4]+G.z*K[7],Z=G.x*K[0]+G.y*K[3]+G.z*K[6],$=G.x*K[2]+G.y*K[5]+G.z*K[8];if(W.x=Q.x+Z,W.y=Q.y+q,W.z=Q.z+$,this._computeParticleRotation||this.billboard){var ee=n.m;k[0]=ee[0]*K[0]+ee[1]*K[3]+ee[2]*K[6],k[1]=ee[0]*K[1]+ee[1]*K[4]+ee[2]*K[7],k[2]=ee[0]*K[2]+ee[1]*K[5]+ee[2]*K[8],k[3]=ee[4]*K[0]+ee[5]*K[3]+ee[6]*K[6],k[4]=ee[4]*K[1]+ee[5]*K[4]+ee[6]*K[7],k[5]=ee[4]*K[2]+ee[5]*K[5]+ee[6]*K[8],k[6]=ee[8]*K[0]+ee[9]*K[3]+ee[10]*K[6],k[7]=ee[8]*K[1]+ee[9]*K[4]+ee[10]*K[7],k[8]=ee[8]*K[2]+ee[9]*K[5]+ee[10]*K[8]}}else B.parentId=null}else W.x=G.x,W.y=G.y,W.z=G.z,(this._computeParticleRotation||this.billboard)&&(ee=n.m,k[0]=ee[0],k[1]=ee[1],k[2]=ee[2],k[3]=ee[4],k[4]=ee[5],k[5]=ee[6],k[6]=ee[8],k[7]=ee[9],k[8]=ee[10]);var te=p[11];for(B.translateFromPivot?te.setAll(0):te.copyFrom(X),N=0;N<U.length;N++){R=x+3*N,O=M+4*N,I=D+2*N;var ie=2*N,ne=ie+1;E.copyFrom(U[N]),this._computeParticleColor&&B.color&&S.copyFrom(B.color),this._computeParticleTexture&&A.copyFromFloats(V[ie],V[ne]),this._computeParticleVertex&&this.updateParticleVertex(B,T,N);var re=E.x*j.x-X.x,oe=E.y*j.y-X.y,ae=E.z*j.z-X.z;Z=re*k[0]+oe*k[3]+ae*k[6],q=re*k[1]+oe*k[4]+ae*k[7],$=re*k[2]+oe*k[5]+ae*k[8],Z+=te.x,q+=te.y,$+=te.z;var se=c[R]=W.x+_.x*Z+m.x*q+g.x*$,ce=c[R+1]=W.y+_.y*Z+m.y*q+g.y*$,le=c[R+2]=W.z+_.z*Z+m.z*q+g.z*$;if(this._computeBoundingBox&&(v.minimizeInPlaceFromFloats(se,ce,le),b.maximizeInPlaceFromFloats(se,ce,le)),!this._computeParticleVertex){var ue=f[R],he=f[R+1],de=f[R+2],fe=ue*k[0]+he*k[3]+de*k[6],pe=ue*k[1]+he*k[4]+de*k[7],_e=ue*k[2]+he*k[5]+de*k[8];l[R]=_.x*fe+m.x*pe+g.x*_e,l[R+1]=_.y*fe+m.y*pe+g.y*_e,l[R+2]=_.z*fe+m.z*pe+g.z*_e}if(this._computeParticleColor&&B.color){var me=this._colors32;me[O]=S.r,me[O+1]=S.g,me[O+2]=S.b,me[O+3]=S.a}if(this._computeParticleTexture){var ge=B.uvs;u[I]=A.x*(ge.z-ge.x)+ge.x,u[I+1]=A.y*(ge.w-ge.y)+ge.y}}}else for(B._stillInvisible=!0,N=0;N<U.length;N++){if(O=M+4*N,I=D+2*N,c[R=x+3*N]=c[R+1]=c[R+2]=0,l[R]=l[R+1]=l[R+2]=0,this._computeParticleColor&&B.color){var ve=B.color;s[O]=ve.r,s[O+1]=ve.g,s[O+2]=ve.b,s[O+3]=ve.a}this._computeParticleTexture&&(ge=B.uvs,u[I]=V[2*N]*(ge.z-ge.x)+ge.x,u[I+1]=V[2*N+1]*(ge.w-ge.y)+ge.y)}if(this._particlesIntersect){var be=B._boundingInfo,ye=be.boundingBox,Te=be.boundingSphere,Ee=B._modelBoundingInfo;if(!this._bSphereOnly){var Se=Ee.boundingBox.vectors,Ae=p[1],Pe=p[2];Ae.setAll(Number.MAX_VALUE),Pe.setAll(-Number.MAX_VALUE);for(var Ce=0;Ce<8;Ce++){var Re=Se[Ce].x*j.x,xe=Se[Ce].y*j.y,Oe=Se[Ce].z*j.z,Me=(Z=Re*k[0]+xe*k[3]+Oe*k[6],q=Re*k[1]+xe*k[4]+Oe*k[7],$=Re*k[2]+xe*k[5]+Oe*k[8],G.x+_.x*Z+m.x*q+g.x*$),Ie=G.y+_.y*Z+m.y*q+g.y*$,De=G.z+_.z*Z+m.z*q+g.z*$;Ae.minimizeInPlaceFromFloats(Me,Ie,De),Pe.maximizeInPlaceFromFloats(Me,Ie,De)}ye.reConstruct(Ae,Pe,o._worldMatrix)}var Ne=Ee.minimum.multiplyToRef(j,p[1]),Le=Ee.maximum.multiplyToRef(j,p[2]),we=Le.addToRef(Ne,p[3]).scaleInPlace(.5).addInPlace(W),Fe=Le.subtractToRef(Ne,p[4]).scaleInPlace(.5*this._bSphereRadiusFactor),Be=we.subtractToRef(Fe,p[1]),Ue=we.addToRef(Fe,p[2]);Te.reConstruct(Be,Ue,o._worldMatrix)}x=R+3,M=O+4,D=I+2}}if(i){if(this._computeParticleColor&&o.updateVerticesData(ji.b.ColorKind,s,!1,!1),this._computeParticleTexture&&o.updateVerticesData(ji.b.UVKind,u,!1,!1),o.updateVerticesData(ji.b.PositionKind,c,!1,!1),!o.areNormalsFrozen||o.isFacetDataEnabled){if(this._computeParticleVertex||o.isFacetDataEnabled){var Ve=o.isFacetDataEnabled?o.getFacetDataParameters():null;zi.a.ComputeNormals(c,h,l,Ve);for(var ke=0;ke<l.length;ke++)f[ke]=l[ke]}o.areNormalsFrozen||o.updateVerticesData(ji.b.NormalKind,l,!1,!1)}if(this._depthSort&&this._depthSortParticles){var Ge=this.depthSortedParticles;Ge.sort(this._depthSortFunction);for(var ze=Ge.length,je=0,We=0,He=0;He<ze;He++){var Xe=Ge[He],Ye=Xe.indicesLength,Ke=Xe.ind;for(ke=0;ke<Ye;ke++)if(h[je]=d[Ke+ke],je++,this._pickable&&0==ke%3){var Qe=this.pickedParticles[We];Qe.idx=Xe.idx,Qe.faceId=We,We++}}o.updateIndices(h)}}return this._computeBoundingBox&&(o._boundingInfo?o._boundingInfo.reConstruct(v,b,o._worldMatrix):o._boundingInfo=new _n.a(v,b,o._worldMatrix)),this._autoUpdateSubMeshes&&this.computeSubMeshes(),this.afterUpdateParticles(e,t,i),this},e.prototype.dispose=function(){this.mesh.dispose(),this.vars=null,this._positions=null,this._indices=null,this._normals=null,this._uvs=null,this._colors=null,this._indices32=null,this._positions32=null,this._normals32=null,this._fixedNormal32=null,this._uvs32=null,this._colors32=null,this.pickedParticles=null,this.pickedBySubMesh=null,this._materials=null,this._materialIndexes=null,this._indicesByMaterial=null,this._idxOfId=null},e.prototype.pickedParticle=function(e){if(e.hit){var t=e.subMeshId,i=e.faceId,n=this.pickedBySubMesh;if(n[t]&&n[t][i])return n[t][i]}return null},e.prototype.getParticleById=function(e){var t=this.particles[e];if(t&&t.id==e)return t;var i=this.particles,n=this._idxOfId[e];if(void 0!==n)return i[n];for(var r=0,o=this.nbParticles;r<o;){var a=i[r];if(a.id==e)return a;r++}return null},e.prototype.getParticlesByShapeId=function(e){var t=[];return this.getParticlesByShapeIdToRef(e,t),t},e.prototype.getParticlesByShapeIdToRef=function(e,t){t.length=0;for(var i=0;i<this.nbParticles;i++){var n=this.particles[i];n.shapeId==e&&t.push(n)}return this},e.prototype.computeSubMeshes=function(){if(!this.mesh||!this._multimaterialEnabled)return this;var e=this.depthSortedParticles;if(this.particles.length>0)for(var t=0;t<this.particles.length;t++){var i=this.particles[t];i.materialIndex||(i.materialIndex=0);var n=e[t];n.materialIndex=i.materialIndex,n.ind=i._ind,n.indicesLength=i._model._indicesLength,n.idx=i.idx}this._sortParticlesByMaterial();var r=this._indicesByMaterial,o=this._materialIndexes,a=this.mesh;a.subMeshes=[];for(var s=a.getTotalVertices(),c=0;c<o.length;c++){var l=r[c],u=r[c+1]-l,h=o[c];new jl.a(h,0,s,l,u,a)}return this},e.prototype._sortParticlesByMaterial=function(){var e=[0];this._indicesByMaterial=e;var t=[];this._materialIndexes=t;var i=this.depthSortedParticles;i.sort(this._materialSortFunction);var n=i.length,r=this._indices32,o=this._indices,a=0,s=0,c=0,l=i[0].materialIndex;t.push(l),this._pickable&&(this.pickedBySubMesh=[[]],this.pickedParticles=this.pickedBySubMesh[0]);for(var u=0;u<n;u++){var h=i[u],d=h.indicesLength,f=h.ind;h.materialIndex!==l&&(l=h.materialIndex,e.push(c),t.push(l),this._pickable&&(a++,this.pickedBySubMesh[a]=[],s=0));for(var p=0,_=0;_<d;_++){if(r[c]=o[f+_],this._pickable&&0==_%3){var m=this.pickedBySubMesh[a][s];m?(m.idx=h.idx,m.faceId=p):this.pickedBySubMesh[a][s]={idx:h.idx,faceId:p},s++,p++}c++}}return e.push(r.length),this._updatable&&this.mesh.updateIndices(r),this},e.prototype._setMaterialIndexesById=function(){this._materialIndexesById={};for(var e=0;e<this._materials.length;e++){var t=this._materials[e].uniqueId;this._materialIndexesById[t]=e}},e.prototype._filterUniqueMaterialId=function(e){return e.filter(function(e,t,i){return i.indexOf(e)===t})},e.prototype._setDefaultMaterial=function(){return this._defaultMaterial||(this._defaultMaterial=new Ui.a(this.name+"DefaultMaterial",this._scene)),this._defaultMaterial},e.prototype.refreshVisibleSize=function(){return this._isVisibilityBoxLocked||this.mesh.refreshBoundingInfo(),this},e.prototype.setVisibilityBox=function(e){var t=e/2;this.mesh._boundingInfo=new _n.a(new a.e(-t,-t,-t),new a.e(t,t,t))},Object.defineProperty(e.prototype,"isAlwaysVisible",{get:function(){return this._alwaysVisible},set:function(e){this._alwaysVisible=e,this.mesh.alwaysSelectAsActiveMesh=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVisibilityBoxLocked",{get:function(){return this._isVisibilityBoxLocked},set:function(e){this._isVisibilityBoxLocked=e,this.mesh.getBoundingInfo().isLocked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleRotation",{get:function(){return this._computeParticleRotation},set:function(e){this._computeParticleRotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleColor",{get:function(){return this._computeParticleColor},set:function(e){this._computeParticleColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleTexture",{get:function(){return this._computeParticleTexture},set:function(e){this._computeParticleTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleVertex",{get:function(){return this._computeParticleVertex},set:function(e){this._computeParticleVertex=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeBoundingBox",{get:function(){return this._computeBoundingBox},set:function(e){this._computeBoundingBox=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthSortParticles",{get:function(){return this._depthSortParticles},set:function(e){this._depthSortParticles=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"expandable",{get:function(){return this._expandable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multimaterialEnabled",{get:function(){return this._multimaterialEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useModelMaterial",{get:function(){return this._useModelMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"materials",{get:function(){return this._materials},enumerable:!1,configurable:!0}),e.prototype.setMultiMaterial=function(e){this._materials=this._filterUniqueMaterialId(e),this._setMaterialIndexesById(),this._multimaterial&&this._multimaterial.dispose(),this._multimaterial=new Da.a(this.name+"MultiMaterial",this._scene);for(var t=0;t<this._materials.length;t++)this._multimaterial.subMaterials.push(this._materials[t]);this.computeSubMeshes(),this.mesh.material=this._multimaterial},Object.defineProperty(e.prototype,"multimaterial",{get:function(){return this._multimaterial},set:function(e){this._multimaterial=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdateSubMeshes",{get:function(){return this._autoUpdateSubMeshes},set:function(e){this._autoUpdateSubMeshes=e},enumerable:!1,configurable:!0}),e.prototype.initParticles=function(){},e.prototype.recycleParticle=function(e){return e},e.prototype.updateParticle=function(e){return e},e.prototype.updateParticleVertex=function(e,t,i){return this},e.prototype.beforeUpdateParticles=function(e,t,i){},e.prototype.afterUpdateParticles=function(e,t,i){},e}(),Xu=function(){function e(e,t,i,n,r){this.idx=0,this.color=new s.b(1,1,1,1),this.position=a.e.Zero(),this.rotation=a.e.Zero(),this.uv=new a.d(0,0),this.velocity=a.e.Zero(),this.pivot=a.e.Zero(),this.translateFromPivot=!1,this._pos=0,this._ind=0,this.groupId=0,this.idxInGroup=0,this._stillInvisible=!1,this._rotationMatrix=[1,0,0,0,1,0,0,0,1],this.parentId=null,this._globalPosition=a.e.Zero(),this.idx=e,this._group=t,this.groupId=i,this.idxInGroup=n,this._pcs=r}return Object.defineProperty(e.prototype,"size",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quaternion",{get:function(){return this.rotationQuaternion},set:function(e){this.rotationQuaternion=e},enumerable:!1,configurable:!0}),e.prototype.intersectsMesh=function(e,t){if(!e._boundingInfo)return!1;if(t=t||!1)return e.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));var i,n,r,o,a,s;i=e.getBoundingInfo().boundingBox.maximumWorld.x,n=e.getBoundingInfo().boundingBox.minimumWorld.x,r=e.getBoundingInfo().boundingBox.maximumWorld.y,o=e.getBoundingInfo().boundingBox.minimumWorld.y,a=e.getBoundingInfo().boundingBox.maximumWorld.z,s=e.getBoundingInfo().boundingBox.minimumWorld.z;var c=this.position.x+this._pcs.mesh.position.x,l=this.position.y+this._pcs.mesh.position.y,u=this.position.z+this._pcs.mesh.position.z;return n<=c&&c<=i&&o<=l&&l<=r&&s<=u&&u<=a},e.prototype.getRotationMatrix=function(e){var t;if(this.rotationQuaternion)t=this.rotationQuaternion;else{t=a.c.Quaternion[0];var i=this.rotation;a.b.RotationYawPitchRollToRef(i.y,i.x,i.z,t)}t.toRotationMatrix(e)},e}(),Yu=function(e,t){this.groupID=e,this._positionFunction=t};!function(e){e[e.Color=2]="Color",e[e.UV=1]="UV",e[e.Random=0]="Random",e[e.Stated=3]="Stated"}(ku||(ku={}));var Ku=function(){function e(e,t,i,n){this.particles=new Array,this.nbParticles=0,this.counter=0,this.vars={},this._promises=[],this._positions=new Array,this._indices=new Array,this._normals=new Array,this._colors=new Array,this._uvs=new Array,this._updatable=!0,this._isVisibilityBoxLocked=!1,this._alwaysVisible=!1,this._groups=new Array,this._groupCounter=0,this._computeParticleColor=!0,this._computeParticleTexture=!0,this._computeParticleRotation=!0,this._computeBoundingBox=!1,this._isReady=!1,this.name=e,this._size=t,this._scene=i||x.a.LastCreatedScene,n&&void 0!==n.updatable?this._updatable=n.updatable:this._updatable=!0}return e.prototype.buildMeshAsync=function(){var e=this;return Promise.all(this._promises).then(function(){return e._isReady=!0,e._buildMesh()})},e.prototype._buildMesh=function(){0===this.nbParticles&&this.addPoints(1),this._positions32=new Float32Array(this._positions),this._uvs32=new Float32Array(this._uvs),this._colors32=new Float32Array(this._colors);var e=new zi.a;e.set(this._positions32,ji.b.PositionKind),this._uvs32.length>0&&e.set(this._uvs32,ji.b.UVKind);var t=0;this._colors32.length>0&&(t=1,e.set(this._colors32,ji.b.ColorKind));var i=new be.a(this.name,this._scene);e.applyToMesh(i,this._updatable),this.mesh=i,this._positions=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0);var n=new Ui.a("point cloud material",this._scene);return n.emissiveColor=new s.a(t,t,t),n.disableLighting=!0,n.pointsCloud=!0,n.pointSize=this._size,i.material=n,new Promise(function(e){return e(i)})},e.prototype._addParticle=function(e,t,i,n){var r=new Xu(e,t,i,n,this);return this.particles.push(r),r},e.prototype._randomUnitVector=function(e){e.position=new a.e(Math.random(),Math.random(),Math.random()),e.color=new s.b(1,1,1,1)},e.prototype._getColorIndicesForCoord=function(e,t,i,n){var r=e._groupImageData,o=i*(4*n)+4*t,a=[o,o+1,o+2,o+3],c=a[1],l=a[2],u=a[3],h=r[a[0]],d=r[c],f=r[l],p=r[u];return new s.b(h/255,d/255,f/255,p)},e.prototype._setPointsColorOrUV=function(e,t,i,n,r,o,c){i&&e.updateFacetData();var l=2*e.getBoundingInfo().boundingSphere.radius,u=e.getVerticesData(ji.b.PositionKind),h=e.getIndices(),d=e.getVerticesData(ji.b.UVKind),f=e.getVerticesData(ji.b.ColorKind),p=a.e.Zero();e.computeWorldMatrix();var _=e.getWorldMatrix();if(!_.isIdentity())for(var m=0;m<u.length/3;m++)a.e.TransformCoordinatesFromFloatsToRef(u[3*m],u[3*m+1],u[3*m+2],_,p),u[3*m]=p.x,u[3*m+1]=p.y,u[3*m+2]=p.z;var g,v,b=0,y=0,T=0,E=0,S=0,A=0,P=0,C=0,R=0,x=0,O=0,M=0,I=0,D=0,N=a.e.Zero(),w=a.e.Zero(),F=a.e.Zero(),B=a.e.Zero(),U=a.e.Zero(),V=0,k=0,G=0,z=0,j=0,W=0,H=a.d.Zero(),X=a.d.Zero(),Y=a.d.Zero(),K=a.d.Zero(),Q=a.d.Zero(),q=0,Z=0,J=0,$=0,ee=0,te=0,ie=0,ne=0,re=0,oe=0,ae=0,se=0,ce=a.f.Zero(),le=a.f.Zero(),ue=a.f.Zero(),he=a.f.Zero(),de=a.f.Zero(),fe=0,pe=0;c=c||0;var _e,me=new a.f(0,0,0,0),ge=a.e.Zero(),ve=a.e.Zero(),be=a.e.Zero(),ye=0,Te=a.e.Zero(),Ee=0,Se=0,Ae=new Xt.a(a.e.Zero(),new a.e(1,0,0)),Pe=a.e.Zero();for(y=0;y<h.length/3;y++){var Ce,Re,xe,Oe,Me,Ie,De,Ne;T=h[3*y],E=h[3*y+1],S=h[3*y+2],A=u[3*T],P=u[3*T+1],C=u[3*T+2],R=u[3*E],x=u[3*E+1],O=u[3*E+2],M=u[3*S],I=u[3*S+1],D=u[3*S+2],N.set(A,P,C),w.set(R,x,O),F.set(M,I,D),w.subtractToRef(N,B),F.subtractToRef(w,U),d&&(V=d[2*T],k=d[2*T+1],G=d[2*E],z=d[2*E+1],j=d[2*S],W=d[2*S+1],H.set(V,k),X.set(G,z),Y.set(j,W),X.subtractToRef(H,K),Y.subtractToRef(X,Q)),f&&n&&(q=f[4*T],Z=f[4*T+1],J=f[4*T+2],$=f[4*T+3],ee=f[4*E],te=f[4*E+1],ie=f[4*E+2],ne=f[4*E+3],re=f[4*S],oe=f[4*S+1],ae=f[4*S+2],se=f[4*S+3],ce.set(q,Z,J,$),le.set(ee,te,ie,ne),ue.set(re,oe,ae,se),le.subtractToRef(ce,he),ue.subtractToRef(le,de));for(var Le,we,Fe=new s.a(0,0,0),Be=new s.a(0,0,0),Ue=0;Ue<t._groupDensity[y];Ue++)b=this.particles.length,this._addParticle(b,t,this._groupCounter,y+Ue),we=this.particles[b],fe=L.a.RandomRange(0,1),pe=L.a.RandomRange(0,1),g=N.add(B.scale(fe)).add(U.scale(fe*pe)),i&&(ge=e.getFacetNormal(y).normalize().scale(-1),ve=B.clone().normalize(),be=a.e.Cross(ge,ve),ye=L.a.RandomRange(0,2*Math.PI),Te=ve.scale(Math.cos(ye)).add(be.scale(Math.sin(ye))),ye=L.a.RandomRange(.1,Math.PI/2),Pe=Te.scale(Math.cos(ye)).add(ge.scale(Math.sin(ye))),Ae.origin=g.add(Pe.scale(1e-5)),Ae.direction=Pe,Ae.length=l,(_e=Ae.intersectsMesh(e)).hit&&(Se=_e.pickedPoint.subtract(g).length(),Ee=L.a.RandomRange(0,1)*Se,g.addInPlace(Pe.scale(Ee)))),we.position=g.clone(),this._positions.push(we.position.x,we.position.y,we.position.z),void 0!==n?d&&(v=H.add(K.scale(fe)).add(Q.scale(fe*pe)),n?r&&null!==t._groupImageData?(Ce=t._groupImgWidth,Re=t._groupImgHeight,Le=this._getColorIndicesForCoord(t,Math.round(v.x*Ce),Math.round(v.y*Re),Ce),we.color=Le,this._colors.push(Le.r,Le.g,Le.b,Le.a)):f?(me=ce.add(he.scale(fe)).add(de.scale(fe*pe)),we.color=new s.b(me.x,me.y,me.z,me.w),this._colors.push(me.x,me.y,me.z,me.w)):(me=ce.set(Math.random(),Math.random(),Math.random(),1),we.color=new s.b(me.x,me.y,me.z,me.w),this._colors.push(me.x,me.y,me.z,me.w)):(we.uv=v.clone(),this._uvs.push(we.uv.x,we.uv.y))):(o?(Fe.set(o.r,o.g,o.b),xe=L.a.RandomRange(-c,c),Oe=L.a.RandomRange(-c,c),Me=(Ne=Fe.toHSV()).r,(Ie=Ne.g+xe)<0&&(Ie=0),Ie>1&&(Ie=1),(De=Ne.b+Oe)<0&&(De=0),De>1&&(De=1),s.a.HSVtoRGBToRef(Me,Ie,De,Be),me.set(Be.r,Be.g,Be.b,1)):me=ce.set(Math.random(),Math.random(),Math.random(),1),we.color=new s.b(me.x,me.y,me.z,me.w),this._colors.push(me.x,me.y,me.z,me.w))}},e.prototype._colorFromTexture=function(e,t,i){var n=this;if(null===e.material)return m.a.Warn(e.name+"has no material."),t._groupImageData=null,void this._setPointsColorOrUV(e,t,i,!0,!1);var r=e.material.getActiveTextures();if(0===r.length)return m.a.Warn(e.name+"has no useable texture."),t._groupImageData=null,void this._setPointsColorOrUV(e,t,i,!0,!1);var o=e.clone();o.setEnabled(!1),this._promises.push(new Promise(function(e){Hn.a.WhenAllReady(r,function(){var a=t._textureNb;return a<0&&(a=0),a>r.length-1&&(a=r.length-1),t._groupImageData=r[a].readPixels(),t._groupImgWidth=r[a].getSize().width,t._groupImgHeight=r[a].getSize().height,n._setPointsColorOrUV(o,t,i,!0,!0),o.dispose(),e()})}))},e.prototype._calculateDensity=function(e,t,i){for(var n,r,o,s,c,l,u,h,d,f,p,_,m,g,v,b,y,T=new Array,E=a.e.Zero(),S=a.e.Zero(),A=a.e.Zero(),P=a.e.Zero(),C=a.e.Zero(),R=a.e.Zero(),x=new Array,O=0,M=i.length/3,I=0;I<M;I++)n=i[3*I],r=i[3*I+1],o=i[3*I+2],s=t[3*n],c=t[3*n+1],l=t[3*n+2],u=t[3*r],h=t[3*r+1],d=t[3*r+2],f=t[3*o],p=t[3*o+1],_=t[3*o+2],E.set(s,c,l),S.set(u,h,d),A.set(f,p,_),S.subtractToRef(E,P),A.subtractToRef(S,C),A.subtractToRef(E,R),b=((m=P.length())+(g=C.length())+(v=R.length()))/2,O+=y=Math.sqrt(b*(b-m)*(b-g)*(b-v)),x[I]=y;var D=0;for(I=0;I<M;I++)T[I]=Math.floor(e*x[I]/O),D+=T[I];var N=e-D,L=Math.floor(N/M),w=N%M;for(L>0&&(T=T.map(function(e){return e+L})),I=0;I<w;I++)T[I]+=1;return T},e.prototype.addPoints=function(e,t){void 0===t&&(t=this._randomUnitVector);for(var i,n=new Yu(this._groupCounter,t),r=this.nbParticles,o=0;o<e;o++)i=this._addParticle(r,n,this._groupCounter,o),n&&n._positionFunction&&n._positionFunction(i,r,o),this._positions.push(i.position.x,i.position.y,i.position.z),i.color&&this._colors.push(i.color.r,i.color.g,i.color.b,i.color.a),i.uv&&this._uvs.push(i.uv.x,i.uv.y),r++;return this.nbParticles+=e,this._groupCounter++,this._groupCounter},e.prototype.addSurfacePoints=function(e,t,i,n,r){var o=i||ku.Random;(isNaN(o)||o<0||o>3)&&(o=ku.Random);var a=e.getVerticesData(ji.b.PositionKind),c=e.getIndices();this._groups.push(this._groupCounter);var l=new Yu(this._groupCounter,null);switch(l._groupDensity=this._calculateDensity(t,a,c),o===ku.Color?l._textureNb=n||0:n=n||new s.b(1,1,1,1),o){case ku.Color:this._colorFromTexture(e,l,!1);break;case ku.UV:this._setPointsColorOrUV(e,l,!1,!1,!1);break;case ku.Random:this._setPointsColorOrUV(e,l,!1);break;case ku.Stated:this._setPointsColorOrUV(e,l,!1,void 0,void 0,n,r)}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1},e.prototype.addVolumePoints=function(e,t,i,n,r){var o=i||ku.Random;(isNaN(o)||o<0||o>3)&&(o=ku.Random);var a=e.getVerticesData(ji.b.PositionKind),c=e.getIndices();this._groups.push(this._groupCounter);var l=new Yu(this._groupCounter,null);switch(l._groupDensity=this._calculateDensity(t,a,c),o===ku.Color?l._textureNb=n||0:n=n||new s.b(1,1,1,1),o){case ku.Color:this._colorFromTexture(e,l,!0);break;case ku.UV:this._setPointsColorOrUV(e,l,!0,!1,!1);break;case ku.Random:this._setPointsColorOrUV(e,l,!0);break;case ku.Stated:this._setPointsColorOrUV(e,l,!0,void 0,void 0,n,r)}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1},e.prototype.setParticles=function(e,t,i){if(void 0===e&&(e=0),void 0===t&&(t=this.nbParticles-1),void 0===i&&(i=!0),!this._updatable||!this._isReady)return this;this.beforeUpdateParticles(e,t,i);var n=a.c.Matrix[0],r=this.mesh,o=this._colors32,s=this._positions32,c=this._uvs32,l=a.c.Vector3,u=l[5].copyFromFloats(1,0,0),h=l[6].copyFromFloats(0,1,0),d=l[7].copyFromFloats(0,0,1),f=l[8].setAll(Number.MAX_VALUE),p=l[9].setAll(-Number.MAX_VALUE);a.a.IdentityToRef(n);var _=0;if(this.mesh.isFacetDataEnabled&&(this._computeBoundingBox=!0),t=t>=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){var m=this.mesh._boundingInfo;m&&(f.copyFrom(m.minimum),p.copyFrom(m.maximum))}_=0;for(var g=0,v=0,b=0,y=e;y<=t;y++){var T=this.particles[y];g=3*(_=T.idx),v=4*_,b=2*_,this.updateParticle(T);var E=T._rotationMatrix,S=T.position,A=T._globalPosition;if(this._computeParticleRotation&&T.getRotationMatrix(n),null!==T.parentId){var P=this.particles[T.parentId],C=P._rotationMatrix,R=P._globalPosition,x=S.x*C[1]+S.y*C[4]+S.z*C[7],O=S.x*C[0]+S.y*C[3]+S.z*C[6],M=S.x*C[2]+S.y*C[5]+S.z*C[8];if(A.x=R.x+O,A.y=R.y+x,A.z=R.z+M,this._computeParticleRotation){var I=n.m;E[0]=I[0]*C[0]+I[1]*C[3]+I[2]*C[6],E[1]=I[0]*C[1]+I[1]*C[4]+I[2]*C[7],E[2]=I[0]*C[2]+I[1]*C[5]+I[2]*C[8],E[3]=I[4]*C[0]+I[5]*C[3]+I[6]*C[6],E[4]=I[4]*C[1]+I[5]*C[4]+I[6]*C[7],E[5]=I[4]*C[2]+I[5]*C[5]+I[6]*C[8],E[6]=I[8]*C[0]+I[9]*C[3]+I[10]*C[6],E[7]=I[8]*C[1]+I[9]*C[4]+I[10]*C[7],E[8]=I[8]*C[2]+I[9]*C[5]+I[10]*C[8]}}else A.x=0,A.y=0,A.z=0,this._computeParticleRotation&&(I=n.m,E[0]=I[0],E[1]=I[1],E[2]=I[2],E[3]=I[4],E[4]=I[5],E[5]=I[6],E[6]=I[8],E[7]=I[9],E[8]=I[10]);var D=l[11];T.translateFromPivot?D.setAll(0):D.copyFrom(T.pivot);var N=l[0];N.copyFrom(T.position);var L=N.x-T.pivot.x,w=N.y-T.pivot.y,F=N.z-T.pivot.z,B=L*E[0]+w*E[3]+F*E[6],U=L*E[1]+w*E[4]+F*E[7],V=L*E[2]+w*E[5]+F*E[8];B+=D.x,U+=D.y,V+=D.z;var k=s[g]=A.x+u.x*B+h.x*U+d.x*V,G=s[g+1]=A.y+u.y*B+h.y*U+d.y*V,z=s[g+2]=A.z+u.z*B+h.z*U+d.z*V;if(this._computeBoundingBox&&(f.minimizeInPlaceFromFloats(k,G,z),p.maximizeInPlaceFromFloats(k,G,z)),this._computeParticleColor&&T.color){var j=T.color,W=this._colors32;W[v]=j.r,W[v+1]=j.g,W[v+2]=j.b,W[v+3]=j.a}if(this._computeParticleTexture&&T.uv){var H=T.uv,X=this._uvs32;X[b]=H.x,X[b+1]=H.y}}return i&&(this._computeParticleColor&&r.updateVerticesData(ji.b.ColorKind,o,!1,!1),this._computeParticleTexture&&r.updateVerticesData(ji.b.UVKind,c,!1,!1),r.updateVerticesData(ji.b.PositionKind,s,!1,!1)),this._computeBoundingBox&&(r._boundingInfo?r._boundingInfo.reConstruct(f,p,r._worldMatrix):r._boundingInfo=new _n.a(f,p,r._worldMatrix)),this.afterUpdateParticles(e,t,i),this},e.prototype.dispose=function(){this.mesh.dispose(),this.vars=null,this._positions=null,this._indices=null,this._normals=null,this._uvs=null,this._colors=null,this._indices32=null,this._positions32=null,this._uvs32=null,this._colors32=null},e.prototype.refreshVisibleSize=function(){return this._isVisibilityBoxLocked||this.mesh.refreshBoundingInfo(),this},e.prototype.setVisibilityBox=function(e){var t=e/2;this.mesh._boundingInfo=new _n.a(new a.e(-t,-t,-t),new a.e(t,t,t))},Object.defineProperty(e.prototype,"isAlwaysVisible",{get:function(){return this._alwaysVisible},set:function(e){this._alwaysVisible=e,this.mesh.alwaysSelectAsActiveMesh=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleRotation",{set:function(e){this._computeParticleRotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleColor",{get:function(){return this._computeParticleColor},set:function(e){this._computeParticleColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleTexture",{get:function(){return this._computeParticleTexture},set:function(e){this._computeParticleTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeBoundingBox",{get:function(){return this._computeBoundingBox},set:function(e){this._computeBoundingBox=e},enumerable:!1,configurable:!0}),e.prototype.initParticles=function(){},e.prototype.recycleParticle=function(e){return e},e.prototype.updateParticle=function(e){return e},e.prototype.beforeUpdateParticles=function(e,t,i){},e.prototype.afterUpdateParticles=function(e,t,i){},e}();Q.a.prototype.getPhysicsEngine=function(){return this._physicsEngine},Q.a.prototype.enablePhysics=function(e,t){if(void 0===e&&(e=null),this._physicsEngine)return!0;var i=this._getComponent(Me.a.NAME_PHYSICSENGINE);i||(i=new Zu(this),this._addComponent(i));try{return this._physicsEngine=new ja(e,t),this._physicsTimeAccumulator=0,!0}catch(e){return m.a.Error(e.message),!1}},Q.a.prototype.disablePhysicsEngine=function(){this._physicsEngine&&(this._physicsEngine.dispose(),this._physicsEngine=null)},Q.a.prototype.isPhysicsEnabled=function(){return void 0!==this._physicsEngine},Q.a.prototype.deleteCompoundImpostor=function(e){var t=e.parts[0].mesh;t.physicsImpostor&&(t.physicsImpostor.dispose(),t.physicsImpostor=null)},Q.a.prototype._advancePhysicsEngineStep=function(e){if(this._physicsEngine){var t=this._physicsEngine.getSubTimeStep();if(t>0)for(this._physicsTimeAccumulator+=e;this._physicsTimeAccumulator>t;)this.onBeforePhysicsObservable.notifyObservers(this),this._physicsEngine._step(t/1e3),this.onAfterPhysicsObservable.notifyObservers(this),this._physicsTimeAccumulator-=t;else this.onBeforePhysicsObservable.notifyObservers(this),this._physicsEngine._step(e/1e3),this.onAfterPhysicsObservable.notifyObservers(this)}},Object.defineProperty(ze.a.prototype,"physicsImpostor",{get:function(){return this._physicsImpostor},set:function(e){var t=this;this._physicsImpostor!==e&&(this._disposePhysicsObserver&&this.onDisposeObservable.remove(this._disposePhysicsObserver),this._physicsImpostor=e,e&&(this._disposePhysicsObserver=this.onDisposeObservable.add(function(){t.physicsImpostor&&(t.physicsImpostor.dispose(),t.physicsImpostor=null)})))},enumerable:!0,configurable:!0}),ze.a.prototype.getPhysicsImpostor=function(){return this.physicsImpostor},ze.a.prototype.applyImpulse=function(e,t){return this.physicsImpostor?(this.physicsImpostor.applyImpulse(e,t),this):this},ze.a.prototype.setPhysicsLinkWith=function(e,t,i,n){return this.physicsImpostor&&e.physicsImpostor?(this.physicsImpostor.createJoint(e.physicsImpostor,za.e.HingeJoint,{mainPivot:t,connectedPivot:i,nativeParams:n}),this):this};var Qu,qu,Zu=function(){function e(e){var t=this;this.name=Me.a.NAME_PHYSICSENGINE,this.scene=e,this.scene.onBeforePhysicsObservable=new o.c,this.scene.onAfterPhysicsObservable=new o.c,this.scene.getDeterministicFrameTime=function(){return t.scene._physicsEngine?1e3*t.scene._physicsEngine.getTimeStep():1e3/60}}return e.prototype.register=function(){},e.prototype.rebuild=function(){},e.prototype.dispose=function(){this.scene.onBeforePhysicsObservable.clear(),this.scene.onAfterPhysicsObservable.clear(),this.scene._physicsEngine&&this.scene.disablePhysicsEngine()},e}(),Ju=function(){function e(e){this._scene=e,this._physicsEngine=this._scene.getPhysicsEngine(),this._physicsEngine||m.a.Warn("Physics engine not enabled. Please enable the physics before you can use the methods.")}return e.prototype.applyRadialExplosionImpulse=function(e,t,i,n){if(!this._physicsEngine)return m.a.Warn("Physics engine not enabled. Please enable the physics before you call this method."),null;var r=this._physicsEngine.getImpostors();if(0===r.length)return null;"number"==typeof t&&((t=new nh).radius=t,t.strength=i||t.strength,t.falloff=n||t.falloff);var o=new $u(this._scene,t),a=Array();return r.forEach(function(t){var i=o.getImpostorHitData(t,e);i&&(t.applyImpulse(i.force,i.contactPoint),a.push({impostor:t,hitData:i}))}),o.triggerAffectedImpostorsCallback(a),o.dispose(!1),o},e.prototype.applyRadialExplosionForce=function(e,t,i,n){if(!this._physicsEngine)return m.a.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;var r=this._physicsEngine.getImpostors();if(0===r.length)return null;"number"==typeof t&&((t=new nh).radius=t,t.strength=i||t.strength,t.falloff=n||t.falloff);var o=new $u(this._scene,t),a=Array();return r.forEach(function(t){var i=o.getImpostorHitData(t,e);i&&(t.applyForce(i.force,i.contactPoint),a.push({impostor:t,hitData:i}))}),o.triggerAffectedImpostorsCallback(a),o.dispose(!1),o},e.prototype.gravitationalField=function(e,t,i,n){if(!this._physicsEngine)return m.a.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new nh).radius=t,t.strength=i||t.strength,t.falloff=n||t.falloff);var r=new eh(this,this._scene,e,t);return r.dispose(!1),r},e.prototype.updraft=function(e,t,i,n,r){if(!this._physicsEngine)return m.a.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new rh).radius=t,t.strength=i||t.strength,t.height=n||t.height,t.updraftMode=r||t.updraftMode);var o=new th(this._scene,e,t);return o.dispose(!1),o},e.prototype.vortex=function(e,t,i,n){if(!this._physicsEngine)return m.a.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new oh).radius=t,t.strength=i||t.strength,t.height=n||t.height);var r=new ih(this._scene,e,t);return r.dispose(!1),r},e}(),$u=function(){function e(e,t){this._scene=e,this._options=t,this._dataFetched=!1,this._options=Object(h.a)(Object(h.a)({},new nh),this._options)}return e.prototype.getData=function(){return this._dataFetched=!0,{sphere:this._sphere}},e.prototype.getImpostorHitData=function(e,t){if(0===e.mass)return null;if(!this._intersectsWithSphere(e,t,this._options.radius))return null;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return null;var i=e.getObjectCenter().subtract(t),n=new Xt.a(t,i,this._options.radius).intersectsMesh(e.object).pickedPoint;if(!n)return null;var r=a.e.Distance(t,n);if(r>this._options.radius)return null;var o=this._options.falloff===Qu.Constant?this._options.strength:this._options.strength*(1-r/this._options.radius);return{force:i.multiplyByFloats(o,o,o),contactPoint:n,distanceFromOrigin:r}},e.prototype.triggerAffectedImpostorsCallback=function(e){this._options.affectedImpostorsCallback&&this._options.affectedImpostorsCallback(e)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._sphere.dispose():setTimeout(function(){t._dataFetched||t._sphere.dispose()},0)},e.prototype._prepareSphere=function(){this._sphere||(this._sphere=yr.a.CreateSphere("radialExplosionEventSphere",this._options.sphere,this._scene),this._sphere.isVisible=!1)},e.prototype._intersectsWithSphere=function(e,t,i){var n=e.object;return this._prepareSphere(),this._sphere.position=t,this._sphere.scaling=new a.e(2*i,2*i,2*i),this._sphere._updateBoundingInfo(),this._sphere.computeWorldMatrix(!0),this._sphere.intersectsMesh(n,!0)},e}(),eh=function(){function e(e,t,i,n){this._physicsHelper=e,this._scene=t,this._origin=i,this._options=n,this._dataFetched=!1,this._options=Object(h.a)(Object(h.a)({},new nh),this._options),this._tickCallback=this._tick.bind(this),this._options.strength=-1*this._options.strength}return e.prototype.getData=function(){return this._dataFetched=!0,{sphere:this._sphere}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._sphere.dispose():setTimeout(function(){t._dataFetched||t._sphere.dispose()},0)},e.prototype._tick=function(){if(this._sphere)this._physicsHelper.applyRadialExplosionForce(this._origin,this._options);else{var e=this._physicsHelper.applyRadialExplosionForce(this._origin,this._options);e&&(this._sphere=e.getData().sphere.clone("radialExplosionEventSphereClone"))}},e}(),th=function(){function e(e,t,i){this._scene=e,this._origin=t,this._options=i,this._originTop=a.e.Zero(),this._originDirection=a.e.Zero(),this._cylinderPosition=a.e.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._options=Object(h.a)(Object(h.a)({},new rh),this._options),this._origin.addToRef(new a.e(0,this._options.height/2,0),this._cylinderPosition),this._origin.addToRef(new a.e(0,this._options.height,0),this._originTop),this._options.updraftMode===qu.Perpendicular&&(this._originDirection=this._origin.subtract(this._originTop).normalize()),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),this._cylinder&&(e?this._cylinder.dispose():setTimeout(function(){t._dataFetched||t._cylinder.dispose()},0))},e.prototype.getImpostorHitData=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;var t=e.getObjectCenter();if(this._options.updraftMode===qu.Perpendicular)var i=this._originDirection;else i=t.subtract(this._originTop);var n=a.e.Distance(this._origin,t),r=-1*this._options.strength;return{force:i.multiplyByFloats(r,r,r),contactPoint:t,distanceFromOrigin:n}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var i=e.getImpostorHitData(t);i&&t.applyForce(i.force,i.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=qi.a.CreateCylinder("updraftEventCylinder",{height:this._options.height,diameter:2*this._options.radius},this._scene),this._cylinder.isVisible=!1)},e.prototype._intersectsWithCylinder=function(e){var t=e.object;return this._cylinder.position=this._cylinderPosition,this._cylinder.intersectsMesh(t,!0)},e}(),ih=function(){function e(e,t,i){this._scene=e,this._origin=t,this._options=i,this._originTop=a.e.Zero(),this._cylinderPosition=a.e.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._options=Object(h.a)(Object(h.a)({},new oh),this._options),this._origin.addToRef(new a.e(0,this._options.height/2,0),this._cylinderPosition),this._origin.addToRef(new a.e(0,this._options.height,0),this._originTop),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._cylinder.dispose():setTimeout(function(){t._dataFetched||t._cylinder.dispose()},0)},e.prototype.getImpostorHitData=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return null;var t=e.getObjectCenter(),i=new a.e(this._origin.x,t.y,this._origin.z),n=t.subtract(i),r=new Xt.a(i,n,this._options.radius).intersectsMesh(e.object),o=r.pickedPoint;if(!o)return null;var s=r.distance/this._options.radius,c=o.normalize();if(s>this._options.centripetalForceThreshold&&(c=c.negate()),s>this._options.centripetalForceThreshold)var l=c.x*this._options.centripetalForceMultiplier,u=c.y*this._options.updraftForceMultiplier,h=c.z*this._options.centripetalForceMultiplier;else{var d=a.e.Cross(i,t).normalize();l=(d.x+c.x)*this._options.centrifugalForceMultiplier,u=this._originTop.y*this._options.updraftForceMultiplier,h=(d.z+c.z)*this._options.centrifugalForceMultiplier}var f=new a.e(l,u,h);return{force:f=f.multiplyByFloats(this._options.strength,this._options.strength,this._options.strength),contactPoint:t,distanceFromOrigin:s}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var i=e.getImpostorHitData(t);i&&t.applyForce(i.force,i.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=qi.a.CreateCylinder("vortexEventCylinder",{height:this._options.height,diameter:2*this._options.radius},this._scene),this._cylinder.isVisible=!1)},e.prototype._intersectsWithCylinder=function(e){var t=e.object;return this._cylinder.position=this._cylinderPosition,this._cylinder.intersectsMesh(t,!0)},e}(),nh=function(){this.radius=5,this.strength=10,this.falloff=Qu.Constant,this.sphere={segments:32,diameter:1}},rh=function(){this.radius=5,this.strength=10,this.height=10,this.updraftMode=qu.Center},oh=function(){this.radius=5,this.strength=10,this.height=10,this.centripetalForceThreshold=.7,this.centripetalForceMultiplier=5,this.centrifugalForceMultiplier=.5,this.updraftForceMultiplier=.02};!function(e){e[e.Constant=0]="Constant",e[e.Linear=1]="Linear"}(Qu||(Qu={})),function(e){e[e.Center=0]="Center",e[e.Perpendicular=1]="Perpendicular"}(qu||(qu={}));ai.a.ShadersStore.blackAndWhitePixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float degree;\nvoid main(void)\n{\nvec3 color=texture2D(textureSampler,vUV).rgb;\nfloat luminance=dot(color,vec3(0.3,0.59,0.11));\nvec3 blackAndWhite=vec3(luminance,luminance,luminance);\ngl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);\n}";var ah=function(e){function t(t,i,n,r,o,a){var s=e.call(this,t,"blackAndWhite",["degree"],null,i,n,r,o,a)||this;return s.degree=1,s.onApplyObservable.add(function(e){e.setFloat("degree",s.degree)}),s}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"BlackAndWhitePostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"degree",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.BlackAndWhitePostProcess"]=ah;var sh=function(){function e(e,t,i,n){this._name=t,this._singleInstance=n||!0,this._getPostProcesses=i,this._cameras={},this._indicesForCamera={},this._postProcesses={}}return Object.defineProperty(e.prototype,"isSupported",{get:function(){for(var e in this._postProcesses)if(this._postProcesses.hasOwnProperty(e))for(var t=this._postProcesses[e],i=0;i<t.length;i++)if(!t[i].isSupported)return!1;return!0},enumerable:!1,configurable:!0}),e.prototype._update=function(){},e.prototype._attachCameras=function(e){var t,i=this,n=Ce.b.MakeArray(e||this._cameras);if(n)for(var r=0;r<n.length;r++){var o=n[r];if(o){var a=o.name;if(t=this._singleInstance?0:a,!this._postProcesses[t]){var s=this._getPostProcesses();s&&(this._postProcesses[t]=Array.isArray(s)?s:[s])}this._indicesForCamera[a]||(this._indicesForCamera[a]=[]),this._postProcesses[t].forEach(function(e){var t=o.attachPostProcess(e);i._indicesForCamera[a].push(t)}),this._cameras[a]||(this._cameras[a]=o)}}},e.prototype._detachCameras=function(e){var t=Ce.b.MakeArray(e||this._cameras);if(t)for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=this._postProcesses[this._singleInstance?0:r];o&&o.forEach(function(e){n.detachPostProcess(e)}),this._cameras[r]&&(this._cameras[r]=null)}},e.prototype._enable=function(e){var t=this,i=Ce.b.MakeArray(e||this._cameras);if(i)for(var n=0;n<i.length;n++)for(var r=i[n],o=r.name,a=0;a<this._indicesForCamera[o].length;a++)void 0!==r._postProcesses[this._indicesForCamera[o][a]]&&null!==r._postProcesses[this._indicesForCamera[o][a]]||this._postProcesses[this._singleInstance?0:o].forEach(function(e){i[n].attachPostProcess(e,t._indicesForCamera[o][a])})},e.prototype._disable=function(e){var t=Ce.b.MakeArray(e||this._cameras);if(t)for(var i=0;i<t.length;i++){var n=t[i],r=n.name;this._postProcesses[this._singleInstance?0:r].forEach(function(e){n.detachPostProcess(e)})}},e.prototype.getPostProcesses=function(e){return this._singleInstance?this._postProcesses[0]:e?this._postProcesses[e.name]:null},e}();ai.a.ShadersStore.extractHighlightsPixelShader="#include<helperFunctions>\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float threshold;\nuniform float exposure;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nfloat luma=getLuminance(gl_FragColor.rgb*exposure);\ngl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;\n}";var ch=function(e){function t(t,i,n,r,o,a,s,c){void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var l=e.call(this,t,"extractHighlights",["threshold","exposure"],null,i,n,r,o,a,null,s,void 0,null,c)||this;return l.threshold=.9,l._exposure=1,l._inputPostProcess=null,l.onApplyObservable.add(function(e){l._inputPostProcess&&e.setTextureFromPostProcess("textureSampler",l._inputPostProcess),e.setFloat("threshold",Math.pow(l.threshold,Nt.b)),e.setFloat("exposure",l._exposure)}),l}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ExtractHighlightsPostProcess"},Object(h.c)([Object(w.c)()],t.prototype,"threshold",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.ExtractHighlightsPostProcess"]=ch;ai.a.ShadersStore.bloomMergePixelShader="uniform sampler2D textureSampler;\nuniform sampler2D bloomBlur;\nvarying vec2 vUV;\nuniform float bloomWeight;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec3 blurred=texture2D(bloomBlur,vUV).rgb;\ngl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight);\n}\n";var lh=function(e){function t(t,i,n,r,o,a,s,c,l,u,h){void 0===u&&(u=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=!1);var d=e.call(this,t,"bloomMerge",["bloomWeight"],["circleOfConfusionSampler","blurStep0","blurStep1","blurStep2","bloomBlur"],o,a,s,c,l,null,u,void 0,null,!0)||this;return d.weight=1,d.weight=r,d.onApplyObservable.add(function(e){e.setTextureFromPostProcess("textureSampler",i),e.setTextureFromPostProcessOutput("bloomBlur",n),e.setFloat("bloomWeight",d.weight)}),h||d.updateEffect(),d}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"BloomMergePostProcess"},Object(h.c)([Object(w.c)()],t.prototype,"weight",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.BloomMergePostProcess"]=lh;var uh=function(e){function t(t,i,n,r,o,s){void 0===o&&(o=0),void 0===s&&(s=!1);var c=e.call(this,t.getEngine(),"bloom",function(){return c._effects},!0)||this;return c.bloomScale=i,c._effects=[],c._downscale=new ch("highlights",1,null,Ke.a.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,o,s),c._blurX=new Gr("horizontal blur",new a.d(1,0),10,i,null,Ke.a.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,o,void 0,s),c._blurX.alwaysForcePOT=!0,c._blurX.autoClear=!1,c._blurY=new Gr("vertical blur",new a.d(0,1),10,i,null,Ke.a.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,o,void 0,s),c._blurY.alwaysForcePOT=!0,c._blurY.autoClear=!1,c.kernel=r,c._effects=[c._downscale,c._blurX,c._blurY],c._merge=new lh("bloomMerge",c._downscale,c._blurY,n,i,null,Ke.a.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,o,s),c._merge.autoClear=!1,c._effects.push(c._merge),c}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"threshold",{get:function(){return this._downscale.threshold},set:function(e){this._downscale.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this._merge.weight},set:function(e){this._merge.weight=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kernel",{get:function(){return this._blurX.kernel/this.bloomScale},set:function(e){this._blurX.kernel=e*this.bloomScale,this._blurY.kernel=e*this.bloomScale},enumerable:!1,configurable:!0}),t.prototype.disposeEffects=function(e){for(var t=0;t<this._effects.length;t++)this._effects[t].dispose(e)},t.prototype._updateEffects=function(){for(var e=0;e<this._effects.length;e++)this._effects[e].updateEffect()},t.prototype._isReady=function(){for(var e=0;e<this._effects.length;e++)if(!this._effects[e].isReady())return!1;return!0},t}(sh);ai.a.ShadersStore.chromaticAberrationPixelShader="\nuniform sampler2D textureSampler;\n\nuniform float chromatic_aberration;\nuniform float radialIntensity;\nuniform vec2 direction;\nuniform vec2 centerPosition;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\nvoid main(void)\n{\nvec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);\nvec2 directionOfEffect=direction;\nif(directionOfEffect.x == 0. && directionOfEffect.y == 0.){\ndirectionOfEffect=normalize(centered_screen_pos);\n}\nfloat radius2=centered_screen_pos.x*centered_screen_pos.x\n+centered_screen_pos.y*centered_screen_pos.y;\nfloat radius=sqrt(radius2);\nvec4 original=texture2D(textureSampler,vUV);\n\nvec3 ref_indices=vec3(-0.3,0.0,0.3);\nfloat ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;\nfloat ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;\n\nvec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);\nvec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);\nvec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);\noriginal.r=texture2D(textureSampler,ref_coords_r).r;\noriginal.g=texture2D(textureSampler,ref_coords_g).g;\noriginal.b=texture2D(textureSampler,ref_coords_b).b;\noriginal.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);\ngl_FragColor=original;\n}";var hh=function(e){function t(t,i,n,r,o,s,c,l,u,h){void 0===u&&(u=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=!1);var d=e.call(this,t,"chromaticAberration",["chromatic_aberration","screen_width","screen_height","direction","radialIntensity","centerPosition"],[],r,o,s,c,l,null,u,void 0,null,h)||this;return d.aberrationAmount=30,d.radialIntensity=0,d.direction=new a.d(.707,.707),d.centerPosition=new a.d(.5,.5),d.screenWidth=i,d.screenHeight=n,d.onApplyObservable.add(function(e){e.setFloat("chromatic_aberration",d.aberrationAmount),e.setFloat("screen_width",i),e.setFloat("screen_height",n),e.setFloat("radialIntensity",d.radialIntensity),e.setFloat2("direction",d.direction.x,d.direction.y),e.setFloat2("centerPosition",d.centerPosition.x,d.centerPosition.y)}),d}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ChromaticAberrationPostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.screenWidth,e.screenHeight,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable,e.textureType,!1)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"aberrationAmount",void 0),Object(h.c)([Object(w.c)()],t.prototype,"radialIntensity",void 0),Object(h.c)([Object(w.c)()],t.prototype,"direction",void 0),Object(h.c)([Object(w.c)()],t.prototype,"centerPosition",void 0),Object(h.c)([Object(w.c)()],t.prototype,"screenWidth",void 0),Object(h.c)([Object(w.c)()],t.prototype,"screenHeight",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.ChromaticAberrationPostProcess"]=hh;ai.a.ShadersStore.circleOfConfusionPixelShader="\nuniform sampler2D depthSampler;\n\nvarying vec2 vUV;\n\nuniform vec2 cameraMinMaxZ;\n\nuniform float focusDistance;\nuniform float cocPrecalculation;\nvoid main(void)\n{\nfloat depth=texture2D(depthSampler,vUV).r;\nfloat pixelDistance=(cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth)*1000.0;\nfloat coc=abs(cocPrecalculation* ((focusDistance-pixelDistance)/pixelDistance));\ncoc=clamp(coc,0.0,1.0);\ngl_FragColor=vec4(coc,depth,coc,1.0);\n}\n";var dh=function(e){function t(t,i,n,r,o,a,s,c,l){void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1);var u=e.call(this,t,"circleOfConfusion",["cameraMinMaxZ","focusDistance","cocPrecalculation"],["depthSampler"],n,r,o,a,s,null,c,void 0,null,l)||this;return u.lensSize=50,u.fStop=1.4,u.focusDistance=2e3,u.focalLength=50,u._depthTexture=null,u._depthTexture=i,u.onApplyObservable.add(function(e){if(u._depthTexture){e.setTexture("depthSampler",u._depthTexture);var t=u.lensSize/u.fStop*u.focalLength/(u.focusDistance-u.focalLength);e.setFloat("focusDistance",u.focusDistance),e.setFloat("cocPrecalculation",t),e.setFloat2("cameraMinMaxZ",u._depthTexture.activeCamera.minZ,u._depthTexture.activeCamera.maxZ)}else m.a.Warn("No depth texture set on CircleOfConfusionPostProcess")}),u}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"CircleOfConfusionPostProcess"},Object.defineProperty(t.prototype,"depthTexture",{set:function(e){this._depthTexture=e},enumerable:!1,configurable:!0}),Object(h.c)([Object(w.c)()],t.prototype,"lensSize",void 0),Object(h.c)([Object(w.c)()],t.prototype,"fStop",void 0),Object(h.c)([Object(w.c)()],t.prototype,"focusDistance",void 0),Object(h.c)([Object(w.c)()],t.prototype,"focalLength",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.CircleOfConfusionPostProcess"]=dh;ai.a.ShadersStore.colorCorrectionPixelShader="\nuniform sampler2D textureSampler;\nuniform sampler2D colorTable;\n\nvarying vec2 vUV;\n\nconst float SLICE_COUNT=16.0;\n\nvec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {\nfloat sliceSize=1.0/width;\nfloat slicePixelSize=sliceSize/width;\nfloat sliceInnerSize=slicePixelSize*(width-1.0);\nfloat zSlice0=min(floor(uv.z*width),width-1.0);\nfloat zSlice1=min(zSlice0+1.0,width-1.0);\nfloat xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;\nfloat s0=xOffset+(zSlice0*sliceSize);\nfloat s1=xOffset+(zSlice1*sliceSize);\nvec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));\nvec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));\nfloat zOffset=mod(uv.z*width,1.0);\nvec4 result=mix(slice0Color,slice1Color,zOffset);\nreturn result;\n}\nvoid main(void)\n{\nvec4 screen_color=texture2D(textureSampler,vUV);\ngl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);\n}";var fh=function(e){function t(t,i,n,r,o,a,s){var c=e.call(this,t,"colorCorrection",null,["colorTable"],n,r,o,a,s)||this;return c._colorTableTexture=new Ke.a(i,r.getScene(),!0,!1,Ke.a.TRILINEAR_SAMPLINGMODE),c._colorTableTexture.anisotropicFilteringLevel=1,c._colorTableTexture.wrapU=Ke.a.CLAMP_ADDRESSMODE,c._colorTableTexture.wrapV=Ke.a.CLAMP_ADDRESSMODE,c.colorTableUrl=i,c.onApply=function(e){e.setTexture("colorTable",c._colorTableTexture)},c}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ColorCorrectionPostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.colorTableUrl,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"colorTableUrl",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.ColorCorrectionPostProcess"]=fh;ai.a.ShadersStore.convolutionPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform float kernel[9];\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 colorSum =\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];\nfloat kernelWeight =\nkernel[0] +\nkernel[1] +\nkernel[2] +\nkernel[3] +\nkernel[4] +\nkernel[5] +\nkernel[6] +\nkernel[7] +\nkernel[8];\nif (kernelWeight<=0.0) {\nkernelWeight=1.0;\n}\ngl_FragColor=vec4((colorSum/kernelWeight).rgb,1);\n}";var ph=function(e){function t(t,i,n,r,o,a,s,c){void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT);var l=e.call(this,t,"convolution",["kernel","screenSize"],null,n,r,o,a,s,null,c)||this;return l.kernel=i,l.onApply=function(e){e.setFloat2("screenSize",l.width,l.height),e.setArray("kernel",l.kernel)},l}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ConvolutionPostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.kernel,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable,e.textureType)},e,n,r)},t.EdgeDetect0Kernel=[1,0,-1,0,0,0,-1,0,1],t.EdgeDetect1Kernel=[0,1,0,1,-4,1,0,1,0],t.EdgeDetect2Kernel=[-1,-1,-1,-1,8,-1,-1,-1,-1],t.SharpenKernel=[0,-1,0,-1,5,-1,0,-1,0],t.EmbossKernel=[-2,-1,0,-1,1,1,0,1,2],t.GaussianKernel=[0,1,0,1,1,1,0,1,0],Object(h.c)([Object(w.c)()],t.prototype,"kernel",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.ConvolutionPostProcess"]=ph;var _h=function(e){function t(t,i,n,r,o,a,s,c,l,u,h,d,f){void 0===c&&(c=null),void 0===l&&(l=Ke.a.BILINEAR_SAMPLINGMODE),void 0===d&&(d=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===f&&(f=!1);var p=e.call(this,t,n,r,o,a,l=g.a.TEXTURE_BILINEAR_SAMPLINGMODE,u,h,d=g.a.TEXTURETYPE_UNSIGNED_INT,"#define DOF 1\r\n",f)||this;return p.direction=n,p.onApplyObservable.add(function(e){null!=c&&e.setTextureFromPostProcess("textureSampler",c),e.setTextureFromPostProcessOutput("circleOfConfusionSampler",s),i.activeCamera&&e.setFloat2("cameraMinMaxZ",i.activeCamera.minZ,i.activeCamera.maxZ)}),p}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DepthOfFieldBlurPostProcess"},Object(h.c)([Object(w.c)()],t.prototype,"direction",void 0),t}(Gr);c.a.RegisteredTypes["BABYLON.DepthOfFieldBlurPostProcess"]=_h;ai.a.ShadersStore.depthOfFieldMergePixelShader="uniform sampler2D textureSampler;\nvarying vec2 vUV;\nuniform sampler2D circleOfConfusionSampler;\nuniform sampler2D blurStep0;\n#if BLUR_LEVEL>0\nuniform sampler2D blurStep1;\n#endif\n#if BLUR_LEVEL>1\nuniform sampler2D blurStep2;\n#endif\nvoid main(void)\n{\nfloat coc=texture2D(circleOfConfusionSampler,vUV).r;\n#if BLUR_LEVEL == 0\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred0=texture2D(blurStep0,vUV);\ngl_FragColor=mix(original,blurred0,coc);\n#endif\n#if BLUR_LEVEL == 1\nif(coc<0.5){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(original,blurred1,coc/0.5);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);\n}\n#endif\n#if BLUR_LEVEL == 2\nif(coc<0.33){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(original,blurred2,coc/0.33);\n}else if(coc<0.66){\nvec4 blurred1=texture2D(blurStep1,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);\n}\n#endif\n}\n";var mh,gh=function(){},vh=function(e){function t(t,i,n,r,o,a,s,c,l,u,h){void 0===u&&(u=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=!1);var d=e.call(this,t,"depthOfFieldMerge",[],["circleOfConfusionSampler","blurStep0","blurStep1","blurStep2"],o,a,s,c,l,null,u,void 0,null,!0)||this;return d.blurSteps=r,d.onApplyObservable.add(function(e){e.setTextureFromPostProcess("textureSampler",i),e.setTextureFromPostProcessOutput("circleOfConfusionSampler",n),r.forEach(function(t,i){e.setTextureFromPostProcessOutput("blurStep"+(r.length-i-1),t)})}),h||d.updateEffect(),d}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DepthOfFieldMergePostProcess"},t.prototype.updateEffect=function(t,i,n,r,o,a){void 0===t&&(t=null),void 0===i&&(i=null),void 0===n&&(n=null),t||(t="",t+="#define BLUR_LEVEL "+(this.blurSteps.length-1)+"\n"),e.prototype.updateEffect.call(this,t,i,n,r,o,a)},t}(ci);!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(mh||(mh={}));var bh=function(e){function t(t,i,n,r,o){void 0===n&&(n=mh.Low),void 0===r&&(r=0),void 0===o&&(o=!1);var s=e.call(this,t.getEngine(),"depth of field",function(){return s._effects},!0)||this;s._effects=[],s._circleOfConfusion=new dh("circleOfConfusion",i,1,null,Ke.a.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,r,o),s._depthOfFieldBlurY=[],s._depthOfFieldBlurX=[];var c=1,l=15;switch(n){case mh.High:c=3,l=51;break;case mh.Medium:c=2,l=31;break;default:l=15,c=1}for(var u=l/Math.pow(2,c-1),h=1,d=0;d<c;d++){var f=new _h("verticle blur",t,new a.d(0,1),u,h,null,s._circleOfConfusion,0==d?s._circleOfConfusion:null,Ke.a.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,r,o);f.autoClear=!1,h=.75/Math.pow(2,d);var p=new _h("horizontal blur",t,new a.d(1,0),u,h,null,s._circleOfConfusion,null,Ke.a.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,r,o);p.autoClear=!1,s._depthOfFieldBlurY.push(f),s._depthOfFieldBlurX.push(p)}for(s._effects=[s._circleOfConfusion],d=0;d<s._depthOfFieldBlurX.length;d++)s._effects.push(s._depthOfFieldBlurY[d]),s._effects.push(s._depthOfFieldBlurX[d]);return s._dofMerge=new vh("dofMerge",s._circleOfConfusion,s._circleOfConfusion,s._depthOfFieldBlurX,h,null,Ke.a.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,r,o),s._dofMerge.autoClear=!1,s._effects.push(s._dofMerge),s}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"focalLength",{get:function(){return this._circleOfConfusion.focalLength},set:function(e){this._circleOfConfusion.focalLength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fStop",{get:function(){return this._circleOfConfusion.fStop},set:function(e){this._circleOfConfusion.fStop=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"focusDistance",{get:function(){return this._circleOfConfusion.focusDistance},set:function(e){this._circleOfConfusion.focusDistance=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lensSize",{get:function(){return this._circleOfConfusion.lensSize},set:function(e){this._circleOfConfusion.lensSize=e},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"DepthOfFieldEffect"},Object.defineProperty(t.prototype,"depthTexture",{set:function(e){this._circleOfConfusion.depthTexture=e},enumerable:!1,configurable:!0}),t.prototype.disposeEffects=function(e){for(var t=0;t<this._effects.length;t++)this._effects[t].dispose(e)},t.prototype._updateEffects=function(){for(var e=0;e<this._effects.length;e++)this._effects[e].updateEffect()},t.prototype._isReady=function(){for(var e=0;e<this._effects.length;e++)if(!this._effects[e].isReady())return!1;return!0},t}(sh);ai.a.ShadersStore.displayPassPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D passSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(passSampler,vUV);\n}";var yh=function(e){function t(t,i,n,r,o,a){return e.call(this,t,"displayPass",["passSampler"],["passSampler"],i,n,r,o,a)||this}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"DisplayPassPostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},t}(ci);c.a.RegisteredTypes["BABYLON.DisplayPassPostProcess"]=yh;ai.a.ShadersStore.filterPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform mat4 kernelMatrix;\nvoid main(void)\n{\nvec3 baseColor=texture2D(textureSampler,vUV).rgb;\nvec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;\ngl_FragColor=vec4(updatedColor,1.0);\n}";var Th=function(e){function t(t,i,n,r,o,a,s){var c=e.call(this,t,"filter",["kernelMatrix"],null,n,r,o,a,s)||this;return c.kernelMatrix=i,c.onApply=function(e){e.setMatrix("kernelMatrix",c.kernelMatrix)},c}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FilterPostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.kernelMatrix,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},Object(h.c)([Object(w.j)()],t.prototype,"kernelMatrix",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.FilterPostProcess"]=Th;ai.a.ShadersStore.fxaaPixelShader="uniform sampler2D textureSampler;\nuniform vec2 texelSize;\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst float fxaaQualitySubpix=1.0;\nconst float fxaaQualityEdgeThreshold=0.166;\nconst float fxaaQualityEdgeThresholdMin=0.0833;\nconst vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);\n#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)\nvoid main(){\nvec2 posM;\nposM.x=vUV.x;\nposM.y=vUV.y;\nvec4 rgbyM=texture2D(textureSampler,vUV,0.0);\nfloat lumaM=FxaaLuma(rgbyM);\nfloat lumaS=FxaaLuma(texture2D(textureSampler,sampleCoordS,0.0));\nfloat lumaE=FxaaLuma(texture2D(textureSampler,sampleCoordE,0.0));\nfloat lumaN=FxaaLuma(texture2D(textureSampler,sampleCoordN,0.0));\nfloat lumaW=FxaaLuma(texture2D(textureSampler,sampleCoordW,0.0));\nfloat maxSM=max(lumaS,lumaM);\nfloat minSM=min(lumaS,lumaM);\nfloat maxESM=max(lumaE,maxSM);\nfloat minESM=min(lumaE,minSM);\nfloat maxWN=max(lumaN,lumaW);\nfloat minWN=min(lumaN,lumaW);\nfloat rangeMax=max(maxWN,maxESM);\nfloat rangeMin=min(minWN,minESM);\nfloat rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;\nfloat range=rangeMax-rangeMin;\nfloat rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range<rangeMaxClamped)\n{\ngl_FragColor=rgbyM;\nreturn;\n}\n#endif\nfloat lumaNW=FxaaLuma(texture2D(textureSampler,sampleCoordNW,0.0));\nfloat lumaSE=FxaaLuma(texture2D(textureSampler,sampleCoordSE,0.0));\nfloat lumaNE=FxaaLuma(texture2D(textureSampler,sampleCoordNE,0.0));\nfloat lumaSW=FxaaLuma(texture2D(textureSampler,sampleCoordSW,0.0));\nfloat lumaNS=lumaN+lumaS;\nfloat lumaWE=lumaW+lumaE;\nfloat subpixRcpRange=1.0/range;\nfloat subpixNSWE=lumaNS+lumaWE;\nfloat edgeHorz1=(-2.0*lumaM)+lumaNS;\nfloat edgeVert1=(-2.0*lumaM)+lumaWE;\nfloat lumaNESE=lumaNE+lumaSE;\nfloat lumaNWNE=lumaNW+lumaNE;\nfloat edgeHorz2=(-2.0*lumaE)+lumaNESE;\nfloat edgeVert2=(-2.0*lumaN)+lumaNWNE;\nfloat lumaNWSW=lumaNW+lumaSW;\nfloat lumaSWSE=lumaSW+lumaSE;\nfloat edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);\nfloat edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);\nfloat edgeHorz3=(-2.0*lumaW)+lumaNWSW;\nfloat edgeVert3=(-2.0*lumaS)+lumaSWSE;\nfloat edgeHorz=abs(edgeHorz3)+edgeHorz4;\nfloat edgeVert=abs(edgeVert3)+edgeVert4;\nfloat subpixNWSWNESE=lumaNWSW+lumaNESE;\nfloat lengthSign=texelSize.x;\nbool horzSpan=edgeHorz>=edgeVert;\nfloat subpixA=subpixNSWE*2.0+subpixNWSWNESE;\nif (!horzSpan)\n{\nlumaN=lumaW;\n}\nif (!horzSpan)\n{\nlumaS=lumaE;\n}\nif (horzSpan)\n{\nlengthSign=texelSize.y;\n}\nfloat subpixB=(subpixA*(1.0/12.0))-lumaM;\nfloat gradientN=lumaN-lumaM;\nfloat gradientS=lumaS-lumaM;\nfloat lumaNN=lumaN+lumaM;\nfloat lumaSS=lumaS+lumaM;\nbool pairN=abs(gradientN)>=abs(gradientS);\nfloat gradient=max(abs(gradientN),abs(gradientS));\nif (pairN)\n{\nlengthSign=-lengthSign;\n}\nfloat subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);\nvec2 posB;\nposB.x=posM.x;\nposB.y=posM.y;\nvec2 offNP;\noffNP.x=(!horzSpan) ? 0.0 : texelSize.x;\noffNP.y=(horzSpan) ? 0.0 : texelSize.y;\nif (!horzSpan)\n{\nposB.x+=lengthSign*0.5;\n}\nif (horzSpan)\n{\nposB.y+=lengthSign*0.5;\n}\nvec2 posN;\nposN.x=posB.x-offNP.x*1.5;\nposN.y=posB.y-offNP.y*1.5;\nvec2 posP;\nposP.x=posB.x+offNP.x*1.5;\nposP.y=posB.y+offNP.y*1.5;\nfloat subpixD=((-2.0)*subpixC)+3.0;\nfloat lumaEndN=FxaaLuma(texture2D(textureSampler,posN,0.0));\nfloat subpixE=subpixC*subpixC;\nfloat lumaEndP=FxaaLuma(texture2D(textureSampler,posP,0.0));\nif (!pairN)\n{\nlumaNN=lumaSS;\n}\nfloat gradientScaled=gradient*1.0/4.0;\nfloat lumaMM=lumaM-lumaNN*0.5;\nfloat subpixF=subpixD*subpixE;\nbool lumaMLTZero=lumaMM<0.0;\nlumaEndN-=lumaNN*0.5;\nlumaEndP-=lumaNN*0.5;\nbool doneN=abs(lumaEndN)>=gradientScaled;\nbool doneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN)\n{\nposN.x-=offNP.x*3.0;\n}\nif (!doneN)\n{\nposN.y-=offNP.y*3.0;\n}\nbool doneNP=(!doneN) || (!doneP);\nif (!doneP)\n{\nposP.x+=offNP.x*3.0;\n}\nif (!doneP)\n{\nposP.y+=offNP.y*3.0;\n}\nif (doneNP)\n{\nif (!doneN) lumaEndN=FxaaLuma(texture2D(textureSampler,posN.xy,0.0));\nif (!doneP) lumaEndP=FxaaLuma(texture2D(textureSampler,posP.xy,0.0));\nif (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;\nif (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;\ndoneN=abs(lumaEndN)>=gradientScaled;\ndoneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN) posN.x-=offNP.x*12.0;\nif (!doneN) posN.y-=offNP.y*12.0;\ndoneNP=(!doneN) || (!doneP);\nif (!doneP) posP.x+=offNP.x*12.0;\nif (!doneP) posP.y+=offNP.y*12.0;\n}\nfloat dstN=posM.x-posN.x;\nfloat dstP=posP.x-posM.x;\nif (!horzSpan)\n{\ndstN=posM.y-posN.y;\n}\nif (!horzSpan)\n{\ndstP=posP.y-posM.y;\n}\nbool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;\nfloat spanLength=(dstP+dstN);\nbool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;\nfloat spanLengthRcp=1.0/spanLength;\nbool directionN=dstN<dstP;\nfloat dst=min(dstN,dstP);\nbool goodSpan=directionN ? goodSpanN : goodSpanP;\nfloat subpixG=subpixF*subpixF;\nfloat pixelOffset=(dst*(-spanLengthRcp))+0.5;\nfloat subpixH=subpixG*fxaaQualitySubpix;\nfloat pixelOffsetGood=goodSpan ? pixelOffset : 0.0;\nfloat pixelOffsetSubpix=max(pixelOffsetGood,subpixH);\nif (!horzSpan)\n{\nposM.x+=pixelOffsetSubpix*lengthSign;\n}\nif (horzSpan)\n{\nposM.y+=pixelOffsetSubpix*lengthSign;\n}\n#ifdef MALI\nif(range<rangeMaxClamped)\n{\ngl_FragColor=rgbyM;\n}\nelse\n{\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n}\n#else\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n#endif\n}";ai.a.ShadersStore.fxaaVertexShader="\nattribute vec2 position;\nuniform vec2 texelSize;\n\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd);\nsampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;\nsampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;\nsampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;\nsampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;\nsampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;\nsampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;\nsampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;\nsampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;\ngl_Position=vec4(position,0.0,1.0);\n}";var Eh=function(e){function t(t,i,n,r,o,a,s){void 0===n&&(n=null),void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT);var c=e.call(this,t,"fxaa",["texelSize"],null,i,n,r||Ke.a.BILINEAR_SAMPLINGMODE,o,a,null,s,"fxaa",void 0,!0)||this,l=c._getDefines();return c.updateEffect(l),c.onApplyObservable.add(function(e){var t=c.texelSize;e.setFloat2("texelSize",t.x,t.y)}),c}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"FxaaPostProcess"},t.prototype._getDefines=function(){var e=this.getEngine();if(!e)return null;var t=e.getGlInfo();return t&&t.renderer&&t.renderer.toLowerCase().indexOf("mali")>-1?"#define MALI 1\n":null},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},t}(ci);c.a.RegisteredTypes["BABYLON.FxaaPostProcess"]=Eh;ai.a.ShadersStore.grainPixelShader="#include<helperFunctions>\n\nuniform sampler2D textureSampler;\n\nuniform float intensity;\nuniform float animatedSeed;\n\nvarying vec2 vUV;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec2 seed=vUV*(animatedSeed);\nfloat grain=dither(seed,intensity);\n\nfloat lum=getLuminance(gl_FragColor.rgb);\nfloat grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;\ngl_FragColor.rgb+=grain*grainAmount;\ngl_FragColor.rgb=max(gl_FragColor.rgb,0.0);\n}";var Sh=function(e){function t(t,i,n,r,o,a,s,c){void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var l=e.call(this,t,"grain",["intensity","animatedSeed"],[],i,n,r,o,a,null,s,void 0,null,c)||this;return l.intensity=30,l.animated=!1,l.onApplyObservable.add(function(e){e.setFloat("intensity",l.intensity),e.setFloat("animatedSeed",l.animated?Math.random()+1:1)}),l}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"GrainPostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"intensity",void 0),Object(h.c)([Object(w.c)()],t.prototype,"animated",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.GrainPostProcess"]=Sh;ai.a.ShadersStore.highlightsPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nconst vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\nvoid main(void)\n{\nvec4 tex=texture2D(textureSampler,vUV);\nvec3 c=tex.rgb;\nfloat luma=dot(c.rgb,RGBLuminanceCoefficients);\n\n\ngl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a);\n}";var Ah=function(e){function t(t,i,n,r,o,a,s){return void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT),e.call(this,t,"highlights",null,null,i,n,r,o,a,null,s)||this}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"HighlightsPostProcess"},t}(ci);ai.a.IncludesShadersStore.mrtFragmentDeclaration="#if __VERSION__>=200\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n";ai.a.ShadersStore.geometryPixelShader="#extension GL_EXT_draw_buffers : require\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\nprecision highp float;\nprecision highp int;\n#ifdef BUMP\nvarying mat4 vWorldView;\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#ifdef VELOCITY\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#ifdef NEED_UV\nvarying vec2 vUV;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef REFLECTIVITY\nvarying vec2 vReflectivityUV;\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef ALPHATEST\nuniform sampler2D diffuseSampler;\n#endif\n#include<mrtFragmentDeclaration>[RENDER_TARGET_COUNT]\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\nvoid main() {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nvec3 normalOutput;\n#ifdef BUMP\nvec3 normalW=normalize(vNormalW);\n#include<bumpFragment>\nnormalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0)));\n#else\nnormalOutput=normalize(vNormalV);\n#endif\n#ifdef PREPASS\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[DEPTHNORMAL_INDEX]=vec4(vViewPos.z/vViewPos.w,normalOutput);\n#endif\n#else\ngl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);\ngl_FragData[1]=vec4(normalOutput,1.0);\n#endif\n#ifdef POSITION\ngl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef REFLECTIVITY\n#ifdef HAS_SPECULAR\n\nvec4 reflectivity=texture2D(reflectivitySampler,vReflectivityUV);\n#elif HAS_REFLECTIVITY\n\nvec4 reflectivity=vec4(texture2D(reflectivitySampler,vReflectivityUV).rgb,1.0);\n#else\nvec4 reflectivity=vec4(0.0,0.0,0.0,1.0);\n#endif\ngl_FragData[REFLECTIVITY_INDEX]=reflectivity;\n#endif\n}";ai.a.ShadersStore.geometryVertexShader="precision highp float;\nprecision highp int;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\nattribute vec3 position;\nattribute vec3 normal;\n#ifdef NEED_UV\nvarying vec2 vUV;\n#ifdef ALPHATEST\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef BUMP\nuniform mat4 bumpMatrix;\nvarying vec2 vBumpUV;\n#endif\n#ifdef REFLECTIVITY\nuniform mat4 reflectivityMatrix;\nvarying vec2 vReflectivityUV;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef BUMP\nvarying mat4 vWorldView;\n#endif\n#ifdef BUMP\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#ifdef VELOCITY\nuniform mat4 previousWorld;\nuniform mat4 previousViewProjection;\n#ifdef BONES_VELOCITY_ENABLED\n#if NUM_BONE_INFLUENCERS>0\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#endif\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\nvec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if defined(VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 pos=vec4(finalWorld*vec4(positionUpdated,1.0));\n#ifdef BUMP\nvWorldView=view*finalWorld;\nvNormalW=normalUpdated;\n#else\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));\n#endif\nvViewPos=view*pos;\n#if defined(VELOCITY) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;\npreviousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*previousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvPositionW=pos.xyz/pos.w;\n#endif\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#ifdef NEED_UV\n#ifdef UV1\n#ifdef ALPHATEST\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#else\nvUV=uv;\n#endif\n#ifdef BUMP\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#endif\n#ifdef UV2\n#ifdef ALPHATEST\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#else\nvUV=uv2;\n#endif\n#ifdef BUMP\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n";var Ph=function(){function e(t,i){void 0===i&&(i=1),this._previousTransformationMatrices={},this._previousBonesTransformationMatrices={},this.excludedSkinnedMeshesFromVelocity=[],this.renderTransparentMeshes=!0,this._resizeObserver=null,this._enablePosition=!1,this._enableVelocity=!1,this._enableReflectivity=!1,this._positionIndex=-1,this._velocityIndex=-1,this._reflectivityIndex=-1,this._depthNormalIndex=-1,this._linkedWithPrePass=!1,this._scene=t,this._ratio=i,e._SceneComponentInitialization(this._scene),this._createRenderTargets()}return e.prototype._linkPrePassRenderer=function(e){this._linkedWithPrePass=!0,this._prePassRenderer=e,this._multiRenderTarget&&(this._multiRenderTarget.onClearObservable.clear(),this._multiRenderTarget.onClearObservable.add(function(e){}))},e.prototype._unlinkPrePassRenderer=function(){this._linkedWithPrePass=!1,this._createRenderTargets()},e.prototype._resetLayout=function(){this._enablePosition=!1,this._enableReflectivity=!1,this._enableVelocity=!1,this._attachments=[]},e.prototype._forceTextureType=function(t,i){t===e.POSITION_TEXTURE_TYPE?(this._positionIndex=i,this._enablePosition=!0):t===e.VELOCITY_TEXTURE_TYPE?(this._velocityIndex=i,this._enableVelocity=!0):t===e.REFLECTIVITY_TEXTURE_TYPE?(this._reflectivityIndex=i,this._enableReflectivity=!0):t===e.DEPTHNORMAL_TEXTURE_TYPE&&(this._depthNormalIndex=i)},e.prototype._setAttachments=function(e){this._attachments=e},e.prototype._linkInternalTexture=function(e){this._multiRenderTarget._texture=e},Object.defineProperty(e.prototype,"renderList",{get:function(){return this._multiRenderTarget.renderList},set:function(e){this._multiRenderTarget.renderList=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._multiRenderTarget.isSupported},enumerable:!1,configurable:!0}),e.prototype.getTextureIndex=function(t){switch(t){case e.POSITION_TEXTURE_TYPE:return this._positionIndex;case e.VELOCITY_TEXTURE_TYPE:return this._velocityIndex;case e.REFLECTIVITY_TEXTURE_TYPE:return this._reflectivityIndex;default:return-1}},Object.defineProperty(e.prototype,"enablePosition",{get:function(){return this._enablePosition},set:function(e){this._enablePosition=e,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enableVelocity",{get:function(){return this._enableVelocity},set:function(e){this._enableVelocity=e,e||(this._previousTransformationMatrices={}),this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enableReflectivity",{get:function(){return this._enableReflectivity},set:function(e){this._enableReflectivity=e,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ratio",{get:function(){return this._ratio},enumerable:!1,configurable:!0}),e.prototype.isReady=function(e,t){var i=e.getMaterial();if(i&&i.disableDepthWrite)return!1;var n=[],r=[ji.b.PositionKind,ji.b.NormalKind],o=e.getMesh();if(i){var a=!1;i.needAlphaTesting()&&(n.push("#define ALPHATEST"),a=!0),i.bumpTexture&&Ui.a.BumpTextureEnabled&&(n.push("#define BUMP"),n.push("#define BUMPDIRECTUV 0"),a=!0),this._enableReflectivity&&(i instanceof Ui.a&&i.specularTexture?(n.push("#define HAS_SPECULAR"),a=!0):i instanceof mo&&i.reflectivityTexture&&(n.push("#define HAS_REFLECTIVITY"),a=!0)),a&&(n.push("#define NEED_UV"),o.isVerticesDataPresent(ji.b.UVKind)&&(r.push(ji.b.UVKind),n.push("#define UV1")),o.isVerticesDataPresent(ji.b.UV2Kind)&&(r.push(ji.b.UV2Kind),n.push("#define UV2")))}this._linkedWithPrePass&&(n.push("#define PREPASS"),-1!==this._depthNormalIndex&&(n.push("#define DEPTHNORMAL_INDEX "+this._depthNormalIndex),n.push("#define PREPASS_DEPTHNORMAL"))),this._enablePosition&&(n.push("#define POSITION"),n.push("#define POSITION_INDEX "+this._positionIndex)),this._enableVelocity&&(n.push("#define VELOCITY"),n.push("#define VELOCITY_INDEX "+this._velocityIndex),-1===this.excludedSkinnedMeshesFromVelocity.indexOf(o)&&n.push("#define BONES_VELOCITY_ENABLED")),this._enableReflectivity&&(n.push("#define REFLECTIVITY"),n.push("#define REFLECTIVITY_INDEX "+this._reflectivityIndex)),o.useBones&&o.computeBonesUsingShaders?(r.push(ji.b.MatricesIndicesKind),r.push(ji.b.MatricesWeightsKind),o.numBoneInfluencers>4&&(r.push(ji.b.MatricesIndicesExtraKind),r.push(ji.b.MatricesWeightsExtraKind)),n.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),n.push("#define BonesPerMesh "+(o.skeleton?o.skeleton.bones.length+1:0))):n.push("#define NUM_BONE_INFLUENCERS 0");var s=o.morphTargetManager,c=0;s&&s.numInfluencers>0&&(c=s.numInfluencers,n.push("#define MORPHTARGETS"),n.push("#define NUM_MORPH_INFLUENCERS "+c),Hr.a.PrepareAttributesForMorphTargetsInfluencers(r,o,c)),t&&(n.push("#define INSTANCES"),Hr.a.PushAttributesForInstances(r),e.getRenderingMesh().hasThinInstances&&n.push("#define THIN_INSTANCES")),this._linkedWithPrePass?n.push("#define RENDER_TARGET_COUNT "+this._attachments.length):n.push("#define RENDER_TARGET_COUNT "+this._multiRenderTarget.textures.length);var l=n.join("\n");return this._cachedDefines!==l&&(this._cachedDefines=l,this._effect=this._scene.getEngine().createEffect("geometry",r,["world","mBones","viewProjection","diffuseMatrix","view","previousWorld","previousViewProjection","mPreviousBones","morphTargetInfluences","bumpMatrix","reflectivityMatrix","vTangentSpaceParams","vBumpInfos"],["diffuseSampler","bumpSampler","reflectivitySampler"],l,void 0,void 0,void 0,{buffersCount:this._multiRenderTarget.textures.length-1,maxSimultaneousMorphTargets:c})),this._effect.isReady()},e.prototype.getGBuffer=function(){return this._multiRenderTarget},Object.defineProperty(e.prototype,"samples",{get:function(){return this._multiRenderTarget.samples},set:function(e){this._multiRenderTarget.samples=e},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._resizeObserver&&(this._scene.getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this.getGBuffer().dispose()},e.prototype._assignRenderTargetIndices=function(){var e=2;return this._enablePosition&&(this._positionIndex=e,e++),this._enableVelocity&&(this._velocityIndex=e,e++),this._enableReflectivity&&(this._reflectivityIndex=e,e++),e},e.prototype._createRenderTargets=function(){var e=this,t=this._scene.getEngine(),i=this._assignRenderTargetIndices();if(this._multiRenderTarget=new ys("gBuffer",{width:t.getRenderWidth()*this._ratio,height:t.getRenderHeight()*this._ratio},i,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,defaultType:g.a.TEXTURETYPE_FLOAT}),this.isSupported){this._multiRenderTarget.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._multiRenderTarget.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._multiRenderTarget.refreshRate=1,this._multiRenderTarget.renderParticles=!1,this._multiRenderTarget.renderList=null,this._multiRenderTarget.onClearObservable.add(function(e){e.clear(new s.b(0,0,0,1),!0,!0,!0)}),this._resizeObserver=t.onResizeObservable.add(function(){e._multiRenderTarget&&e._multiRenderTarget.resize({width:t.getRenderWidth()*e._ratio,height:t.getRenderHeight()*e._ratio})});var n=function(t){var i=t.getRenderingMesh(),n=t.getEffectiveMesh(),r=e._scene,o=r.getEngine(),s=t.getMaterial();if(s){if(n._internalAbstractMeshDataInfo._isActiveIntermediate=!1,e._enableVelocity&&!e._previousTransformationMatrices[n.uniqueId]&&(e._previousTransformationMatrices[n.uniqueId]={world:a.a.Identity(),viewProjection:r.getTransformMatrix()},i.skeleton)){var c=i.skeleton.getTransformMatrices(i);e._previousBonesTransformationMatrices[i.uniqueId]=e._copyBonesTransformationMatrices(c,new Float32Array(c.length))}var l=i._getInstancesRenderList(t._id,!!t.getReplacementMesh());if(!l.mustReturn){var u=o.getCaps().instancedArrays&&(null!==l.visibleInstances[t._id]||i.hasThinInstances),h=n.getWorldMatrix();if(e.isReady(t,u)){if(o.enableEffect(e._effect),i._bind(t,e._effect,s.fillMode),e._effect.setMatrix("viewProjection",r.getTransformMatrix()),e._effect.setMatrix("view",r.getViewMatrix()),s){var d,f=n._instanceDataStorage;if(f.isFrozen||!s.backFaceCulling&&null===s.overrideMaterialSideOrientation)d=f.sideOrientation;else{var p=n._getWorldMatrixDeterminant();null==(d=s.overrideMaterialSideOrientation)&&(d=s.sideOrientation),p<0&&(d=d===lo.a.ClockWiseSideOrientation?lo.a.CounterClockWiseSideOrientation:lo.a.ClockWiseSideOrientation)}if(s._preBind(e._effect,d),s.needAlphaTesting()){var _=s.getAlphaTestTexture();_&&(e._effect.setTexture("diffuseSampler",_),e._effect.setMatrix("diffuseMatrix",_.getTextureMatrix()))}s.bumpTexture&&r.getEngine().getCaps().standardDerivatives&&Ui.a.BumpTextureEnabled&&(e._effect.setFloat3("vBumpInfos",s.bumpTexture.coordinatesIndex,1/s.bumpTexture.level,s.parallaxScaleBias),e._effect.setMatrix("bumpMatrix",s.bumpTexture.getTextureMatrix()),e._effect.setTexture("bumpSampler",s.bumpTexture),e._effect.setFloat2("vTangentSpaceParams",s.invertNormalMapX?-1:1,s.invertNormalMapY?-1:1)),e._enableReflectivity&&(s instanceof Ui.a&&s.specularTexture?(e._effect.setMatrix("reflectivityMatrix",s.specularTexture.getTextureMatrix()),e._effect.setTexture("reflectivitySampler",s.specularTexture)):s instanceof mo&&s.reflectivityTexture&&(e._effect.setMatrix("reflectivityMatrix",s.reflectivityTexture.getTextureMatrix()),e._effect.setTexture("reflectivitySampler",s.reflectivityTexture)))}i.useBones&&i.computeBonesUsingShaders&&i.skeleton&&(e._effect.setMatrices("mBones",i.skeleton.getTransformMatrices(i)),e._enableVelocity&&e._effect.setMatrices("mPreviousBones",e._previousBonesTransformationMatrices[i.uniqueId])),Hr.a.BindMorphTargetParameters(i,e._effect),e._enableVelocity&&(e._effect.setMatrix("previousWorld",e._previousTransformationMatrices[n.uniqueId].world),e._effect.setMatrix("previousViewProjection",e._previousTransformationMatrices[n.uniqueId].viewProjection)),i._processRendering(n,t,e._effect,s.fillMode,l,u,function(t,i){return e._effect.setMatrix("world",i)})}e._enableVelocity&&(e._previousTransformationMatrices[n.uniqueId].world=h.clone(),e._previousTransformationMatrices[n.uniqueId].viewProjection=e._scene.getTransformMatrix().clone(),i.skeleton&&e._copyBonesTransformationMatrices(i.skeleton.getTransformMatrices(i),e._previousBonesTransformationMatrices[n.uniqueId]))}}};this._multiRenderTarget.customRenderFunction=function(i,r,o,a){var s;if(e._linkedWithPrePass){if(!e._prePassRenderer.enabled)return;e._scene.getEngine().bindAttachments(e._attachments)}if(a.length){for(t.setColorWrite(!1),s=0;s<a.length;s++)n(a.data[s]);t.setColorWrite(!0)}for(s=0;s<i.length;s++)n(i.data[s]);for(s=0;s<r.length;s++)n(r.data[s]);if(e.renderTransparentMeshes)for(s=0;s<o.length;s++)n(o.data[s])}}},e.prototype._copyBonesTransformationMatrices=function(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t},e.DEPTHNORMAL_TEXTURE_TYPE=0,e.POSITION_TEXTURE_TYPE=1,e.VELOCITY_TEXTURE_TYPE=2,e.REFLECTIVITY_TEXTURE_TYPE=3,e._SceneComponentInitialization=function(e){throw Re.a.WarnImport("GeometryBufferRendererSceneComponent")},e}(),Ch=function(){this.enabled=!1,this.name="motionBlur",this.texturesRequired=[g.a.PREPASS_VELOCITY_TEXTURE_TYPE]};Object.defineProperty(Q.a.prototype,"geometryBufferRenderer",{get:function(){this._geometryBufferRenderer},set:function(e){e&&e.isSupported&&(this._geometryBufferRenderer=e)},enumerable:!0,configurable:!0}),Q.a.prototype.enableGeometryBufferRenderer=function(e){return void 0===e&&(e=1),this._geometryBufferRenderer||(this._geometryBufferRenderer=new Ph(this,e),this._geometryBufferRenderer.isSupported||(this._geometryBufferRenderer=null)),this._geometryBufferRenderer},Q.a.prototype.disableGeometryBufferRenderer=function(){this._geometryBufferRenderer&&(this._geometryBufferRenderer.dispose(),this._geometryBufferRenderer=null)};var Rh=function(){function e(e){this.name=Me.a.NAME_GEOMETRYBUFFERRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(Me.a.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER,this,this._gatherRenderTargets)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype._gatherRenderTargets=function(e){this.scene._geometryBufferRenderer&&e.push(this.scene._geometryBufferRenderer.getGBuffer())},e}();Ph._SceneComponentInitialization=function(e){var t=e._getComponent(Me.a.NAME_GEOMETRYBUFFERRENDERER);t||(t=new Rh(e),e._addComponent(t))};ai.a.ShadersStore.motionBlurPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float motionStrength;\nuniform float motionScale;\nuniform vec2 screenSize;\n#ifdef OBJECT_BASED\nuniform sampler2D velocitySampler;\n#else\nuniform sampler2D depthSampler;\nuniform mat4 inverseViewProjection;\nuniform mat4 prevViewProjection;\n#endif\nvoid main(void)\n{\n#ifdef GEOMETRY_SUPPORTED\n#ifdef OBJECT_BASED\nvec2 texelSize=1.0/screenSize;\nvec2 velocityColor=texture2D(velocitySampler,vUV).rg*2.0-1.0;\nvec2 velocity=vec2(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0));\nvelocity*=motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint samplesCount=int(clamp(speed,1.0,SAMPLES));\nvelocity=normalize(velocity)*texelSize;\nfloat hlim=float(-samplesCount)*0.5+0.5;\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(SAMPLES); ++i)\n{\nif (i>=samplesCount)\nbreak;\nvec2 offset=vUV+velocity*(hlim+float(i));\nresult+=texture2D(textureSampler,offset);\n}\ngl_FragColor=result/float(samplesCount);\ngl_FragColor.a=1.0;\n#else\nvec2 texelSize=1.0/screenSize;\nfloat depth=texture2D(depthSampler,vUV).r;\nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\ncpos=cpos*inverseViewProjection;\nvec4 ppos=cpos*prevViewProjection;\nppos.xyz/=ppos.w;\nppos.xy=ppos.xy*0.5+0.5;\nvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint nSamples=int(clamp(speed,1.0,SAMPLES));\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(SAMPLES); ++i) {\nif (i>=nSamples)\nbreak;\nvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\nresult+=texture2D(textureSampler,offset1);\n}\ngl_FragColor=result/float(nSamples);\n#endif\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n";var xh=function(e){function t(t,i,n,r,o,a,s,c,l,u){void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1),void 0===u&&(u=!0);var h=e.call(this,t,"motionBlur",["motionStrength","motionScale","screenSize","inverseViewProjection","prevViewProjection"],["velocitySampler"],n,r,o,a,s,"#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0\n#define OBJECT_BASED",c,void 0,null,l)||this;return h.motionStrength=1,h._motionBlurSamples=32,h._isObjectBased=!0,h._forceGeometryBuffer=!1,h._geometryBufferRenderer=null,h._prePassRenderer=null,h._invViewProjection=null,h._previousViewProjection=null,h._forceGeometryBuffer=u,h._forceGeometryBuffer?(h._geometryBufferRenderer=i.enableGeometryBufferRenderer(),h._geometryBufferRenderer&&(h._geometryBufferRenderer.enableVelocity=!0)):(h._prePassRenderer=i.enablePrePassRenderer(),h._prePassRenderer&&(h._prePassRenderer.markAsDirty(),h._prePassEffectConfiguration=new Ch)),h._applyMode(),h}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"motionBlurSamples",{get:function(){return this._motionBlurSamples},set:function(e){this._motionBlurSamples=e,this._updateEffect()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isObjectBased",{get:function(){return this._isObjectBased},set:function(e){this._isObjectBased!==e&&(this._isObjectBased=e,this._applyMode())},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"MotionBlurPostProcess"},t.prototype.excludeSkinnedMesh=function(e){if(e.skeleton){var t=void 0;if(this._geometryBufferRenderer)t=this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;else{if(!this._prePassRenderer)return;t=this._prePassRenderer.excludedSkinnedMesh}t.push(e)}},t.prototype.removeExcludedSkinnedMesh=function(e){if(e.skeleton){var t=void 0;if(this._geometryBufferRenderer)t=this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;else{if(!this._prePassRenderer)return;t=this._prePassRenderer.excludedSkinnedMesh}var i=t.indexOf(e);-1!==i&&t.splice(i,1)}},t.prototype.dispose=function(t){this._geometryBufferRenderer&&(this._geometryBufferRenderer._previousTransformationMatrices={},this._geometryBufferRenderer._previousBonesTransformationMatrices={},this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity=[]),e.prototype.dispose.call(this,t)},t.prototype._applyMode=function(){var e=this;if(!this._geometryBufferRenderer&&!this._prePassRenderer)return m.a.Warn("Multiple Render Target support needed to compute object based motion blur"),this.updateEffect();this._updateEffect(),this._invViewProjection=null,this._previousViewProjection=null,this.isObjectBased?(this._prePassRenderer&&this._prePassEffectConfiguration&&(this._prePassEffectConfiguration.texturesRequired[0]=g.a.PREPASS_VELOCITY_TEXTURE_TYPE),this.onApply=function(t){return e._onApplyObjectBased(t)}):(this._invViewProjection=a.a.Identity(),this._previousViewProjection=a.a.Identity(),this._prePassRenderer&&this._prePassEffectConfiguration&&(this._prePassEffectConfiguration.texturesRequired[0]=g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE),this.onApply=function(t){return e._onApplyScreenBased(t)})},t.prototype._onApplyObjectBased=function(e){if(e.setVector2("screenSize",new a.d(this.width,this.height)),e.setFloat("motionScale",this._scene.getAnimationRatio()),e.setFloat("motionStrength",this.motionStrength),this._geometryBufferRenderer){var t=this._geometryBufferRenderer.getTextureIndex(Ph.VELOCITY_TEXTURE_TYPE);e.setTexture("velocitySampler",this._geometryBufferRenderer.getGBuffer().textures[t])}else this._prePassRenderer&&(t=this._prePassRenderer.getIndex(g.a.PREPASS_VELOCITY_TEXTURE_TYPE),e.setTexture("velocitySampler",this._prePassRenderer.prePassRT.textures[t]))},t.prototype._onApplyScreenBased=function(e){var t=this._scene.getProjectionMatrix().multiply(this._scene.getViewMatrix());if(t.invertToRef(this._invViewProjection),e.setMatrix("inverseViewProjection",this._invViewProjection),e.setMatrix("prevViewProjection",this._previousViewProjection),this._previousViewProjection=t,e.setVector2("screenSize",new a.d(this.width,this.height)),e.setFloat("motionScale",this._scene.getAnimationRatio()),e.setFloat("motionStrength",this.motionStrength),this._geometryBufferRenderer){var i=this._geometryBufferRenderer.getTextureIndex(Ph.DEPTHNORMAL_TEXTURE_TYPE);e.setTexture("depthSampler",this._geometryBufferRenderer.getGBuffer().textures[i])}else this._prePassRenderer&&(i=this._prePassRenderer.getIndex(g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE),e.setTexture("depthSampler",this._prePassRenderer.prePassRT.textures[i]))},t.prototype._updateEffect=function(){if(this._geometryBufferRenderer||this._prePassRenderer){var e=["#define GEOMETRY_SUPPORTED","#define SAMPLES "+this._motionBlurSamples.toFixed(1),this._isObjectBased?"#define OBJECT_BASED":"#define SCREEN_BASED"];this.updateEffect(e.join("\n"))}},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,n,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable,e.textureType,!1)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"motionStrength",void 0),Object(h.c)([Object(w.c)()],t.prototype,"motionBlurSamples",null),Object(h.c)([Object(w.c)()],t.prototype,"isObjectBased",null),t}(ci);c.a.RegisteredTypes["BABYLON.MotionBlurPostProcess"]=xh;ai.a.ShadersStore.refractionPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D refractionSampler;\n\nuniform vec3 baseColor;\nuniform float depth;\nuniform float colorLevel;\nvoid main() {\nfloat ref=1.0-texture2D(refractionSampler,vUV).r;\nvec2 uv=vUV-vec2(0.5);\nvec2 offset=uv*depth*ref;\nvec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;\ngl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);\n}";var Oh=function(e){function t(t,i,n,r,o,a,s,c,l,u){var h=e.call(this,t,"refraction",["baseColor","depth","colorLevel"],["refractionSampler"],a,s,c,l,u)||this;return h._ownRefractionTexture=!0,h.color=n,h.depth=r,h.colorLevel=o,h.refractionTextureUrl=i,h.onActivateObservable.add(function(e){h._refTexture=h._refTexture||new Ke.a(i,e.getScene())}),h.onApplyObservable.add(function(e){e.setColor3("baseColor",h.color),e.setFloat("depth",h.depth),e.setFloat("colorLevel",h.colorLevel),e.setTexture("refractionSampler",h._refTexture)}),h}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"refractionTexture",{get:function(){return this._refTexture},set:function(e){this._refTexture&&this._ownRefractionTexture&&this._refTexture.dispose(),this._refTexture=e,this._ownRefractionTexture=!1},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"RefractionPostProcess"},t.prototype.dispose=function(t){this._refTexture&&this._ownRefractionTexture&&(this._refTexture.dispose(),this._refTexture=null),e.prototype.dispose.call(this,t)},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.refractionTextureUrl,e.color,e.depth,e.colorLevel,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.reusable)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"color",void 0),Object(h.c)([Object(w.c)()],t.prototype,"depth",void 0),Object(h.c)([Object(w.c)()],t.prototype,"colorLevel",void 0),Object(h.c)([Object(w.c)()],t.prototype,"refractionTextureUrl",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.RefractionPostProcess"]=Oh;ai.a.ShadersStore.sharpenPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform vec2 sharpnessAmounts;\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 color=texture2D(textureSampler,vUV);\nvec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1)) -\ncolor*4.0;\ngl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);\n}";var Mh=function(e){function t(t,i,n,r,o,a,s,c){void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var l=e.call(this,t,"sharpen",["sharpnessAmounts","screenSize"],null,i,n,r,o,a,null,s,void 0,null,c)||this;return l.colorAmount=1,l.edgeAmount=.3,l.onApply=function(e){e.setFloat2("screenSize",l.width,l.height),e.setFloat2("sharpnessAmounts",l.edgeAmount,l.colorAmount)},l}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"SharpenPostProcess"},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.textureType,e.reusable)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"colorAmount",void 0),Object(h.c)([Object(w.c)()],t.prototype,"edgeAmount",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.SharpenPostProcess"]=Mh;var Ih=function(){function e(e,t){this.engine=e,this._name=t,this._renderEffects={},this._renderEffectsForIsolatedPass=new Array,this._cameras=[]}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cameras",{get:function(){return this._cameras},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"PostProcessRenderPipeline"},Object.defineProperty(e.prototype,"isSupported",{get:function(){for(var e in this._renderEffects)if(this._renderEffects.hasOwnProperty(e)&&!this._renderEffects[e].isSupported)return!1;return!0},enumerable:!1,configurable:!0}),e.prototype.addEffect=function(e){this._renderEffects[e._name]=e},e.prototype._rebuild=function(){},e.prototype._enableEffect=function(e,t){var i=this._renderEffects[e];i&&i._enable(Ce.b.MakeArray(t||this._cameras))},e.prototype._disableEffect=function(e,t){var i=this._renderEffects[e];i&&i._disable(Ce.b.MakeArray(t||this._cameras))},e.prototype._attachCameras=function(e,t){var i=Ce.b.MakeArray(e||this._cameras);if(i){var n,r=[];for(n=0;n<i.length;n++){var o=i[n];if(o){var a=o.name;-1===this._cameras.indexOf(o)?this._cameras[a]=o:t&&r.push(n)}}for(n=0;n<r.length;n++)e.splice(r[n],1);for(var s in this._renderEffects)this._renderEffects.hasOwnProperty(s)&&this._renderEffects[s]._attachCameras(i)}},e.prototype._detachCameras=function(e){var t=Ce.b.MakeArray(e||this._cameras);if(t){for(var i in this._renderEffects)this._renderEffects.hasOwnProperty(i)&&this._renderEffects[i]._detachCameras(t);for(var n=0;n<t.length;n++)this._cameras.splice(this._cameras.indexOf(t[n]),1)}},e.prototype._update=function(){for(var e in this._renderEffects)this._renderEffects.hasOwnProperty(e)&&this._renderEffects[e]._update();for(var t=0;t<this._cameras.length;t++)if(this._cameras[t]){var i=this._cameras[t].name;this._renderEffectsForIsolatedPass[i]&&this._renderEffectsForIsolatedPass[i]._update()}},e.prototype._reset=function(){this._renderEffects={},this._renderEffectsForIsolatedPass=new Array},e.prototype._enableMSAAOnFirstPostProcess=function(e){if(1===this.engine.webGLVersion)return!1;var t=Object.keys(this._renderEffects);if(t.length>0){var i=this._renderEffects[t[0]].getPostProcesses();i&&(i[0].samples=e)}return!0},e.prototype.setPrePassRenderer=function(e){return!1},e.prototype.dispose=function(){},Object(h.c)([Object(w.c)()],e.prototype,"_name",void 0),e}(),Dh=function(){function e(){this._renderPipelines={}}return Object.defineProperty(e.prototype,"supportedPipelines",{get:function(){var e=[];for(var t in this._renderPipelines)if(this._renderPipelines.hasOwnProperty(t)){var i=this._renderPipelines[t];i.isSupported&&e.push(i)}return e},enumerable:!1,configurable:!0}),e.prototype.addPipeline=function(e){this._renderPipelines[e._name]=e},e.prototype.attachCamerasToRenderPipeline=function(e,t,i){void 0===i&&(i=!1);var n=this._renderPipelines[e];n&&n._attachCameras(t,i)},e.prototype.detachCamerasFromRenderPipeline=function(e,t){var i=this._renderPipelines[e];i&&i._detachCameras(t)},e.prototype.enableEffectInPipeline=function(e,t,i){var n=this._renderPipelines[e];n&&n._enableEffect(t,i)},e.prototype.disableEffectInPipeline=function(e,t,i){var n=this._renderPipelines[e];n&&n._disableEffect(t,i)},e.prototype.update=function(){for(var e in this._renderPipelines)if(this._renderPipelines.hasOwnProperty(e)){var t=this._renderPipelines[e];t.isSupported?t._update():(t.dispose(),delete this._renderPipelines[e])}},e.prototype._rebuild=function(){for(var e in this._renderPipelines)this._renderPipelines.hasOwnProperty(e)&&this._renderPipelines[e]._rebuild()},e.prototype.dispose=function(){for(var e in this._renderPipelines)this._renderPipelines.hasOwnProperty(e)&&this._renderPipelines[e].dispose()},e}();Object.defineProperty(Q.a.prototype,"postProcessRenderPipelineManager",{get:function(){if(!this._postProcessRenderPipelineManager){var e=this._getComponent(Me.a.NAME_POSTPROCESSRENDERPIPELINEMANAGER);e||(e=new Nh(this),this._addComponent(e)),this._postProcessRenderPipelineManager=new Dh}return this._postProcessRenderPipelineManager},enumerable:!0,configurable:!0});var Nh=function(){function e(e){this.name=Me.a.NAME_POSTPROCESSRENDERPIPELINEMANAGER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(Me.a.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER,this,this._gatherRenderTargets)},e.prototype.rebuild=function(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager._rebuild()},e.prototype.dispose=function(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.dispose()},e.prototype._gatherRenderTargets=function(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.update()},e}(),Lh=function(e){function t(t,i,n,r,a){void 0===t&&(t=""),void 0===i&&(i=!0),void 0===n&&(n=x.a.LastCreatedScene),void 0===a&&(a=!0);var s=e.call(this,n.getEngine(),t)||this;s._camerasToBeAttached=[],s.SharpenPostProcessId="SharpenPostProcessEffect",s.ImageProcessingPostProcessId="ImageProcessingPostProcessEffect",s.FxaaPostProcessId="FxaaPostProcessEffect",s.ChromaticAberrationPostProcessId="ChromaticAberrationPostProcessEffect",s.GrainPostProcessId="GrainPostProcessEffect",s._glowLayer=null,s.animations=[],s._imageProcessingConfigurationObserver=null,s._sharpenEnabled=!1,s._bloomEnabled=!1,s._depthOfFieldEnabled=!1,s._depthOfFieldBlurLevel=mh.Low,s._fxaaEnabled=!1,s._imageProcessingEnabled=!0,s._bloomScale=.5,s._chromaticAberrationEnabled=!1,s._grainEnabled=!1,s._buildAllowed=!0,s.onBuildObservable=new o.c,s._resizeObserver=null,s._hardwareScaleLevel=1,s._bloomKernel=64,s._bloomWeight=.15,s._bloomThreshold=.9,s._samples=1,s._hasCleared=!1,s._prevPostProcess=null,s._prevPrevPostProcess=null,s._depthOfFieldSceneObserver=null,s._cameras=r||n.cameras,s._cameras=s._cameras.slice(),s._camerasToBeAttached=s._cameras.slice(),s._buildAllowed=a,s._scene=n;var c=s._scene.getEngine().getCaps();s._hdr=i&&(c.textureHalfFloatRender||c.textureFloatRender),s._hdr?c.textureHalfFloatRender?s._defaultPipelineTextureType=g.a.TEXTURETYPE_HALF_FLOAT:c.textureFloatRender&&(s._defaultPipelineTextureType=g.a.TEXTURETYPE_FLOAT):s._defaultPipelineTextureType=g.a.TEXTURETYPE_UNSIGNED_INT,n.postProcessRenderPipelineManager.addPipeline(s);var l=s._scene.getEngine();return s.sharpen=new Mh("sharpen",1,null,Ke.a.BILINEAR_SAMPLINGMODE,l,!1,s._defaultPipelineTextureType,!0),s._sharpenEffect=new sh(l,s.SharpenPostProcessId,function(){return s.sharpen},!0),s.depthOfField=new bh(s._scene,null,s._depthOfFieldBlurLevel,s._defaultPipelineTextureType,!0),s.bloom=new uh(s._scene,s._bloomScale,s._bloomWeight,s.bloomKernel,s._defaultPipelineTextureType,!0),s.chromaticAberration=new hh("ChromaticAberration",l.getRenderWidth(),l.getRenderHeight(),1,null,Ke.a.BILINEAR_SAMPLINGMODE,l,!1,s._defaultPipelineTextureType,!0),s._chromaticAberrationEffect=new sh(l,s.ChromaticAberrationPostProcessId,function(){return s.chromaticAberration},!0),s.grain=new Sh("Grain",1,null,Ke.a.BILINEAR_SAMPLINGMODE,l,!1,s._defaultPipelineTextureType,!0),s._grainEffect=new sh(l,s.GrainPostProcessId,function(){return s.grain},!0),s._resizeObserver=l.onResizeObservable.add(function(){s._hardwareScaleLevel=l.getHardwareScalingLevel(),s.bloomKernel=s.bloomKernel}),s._imageProcessingConfigurationObserver=s._scene.imageProcessingConfiguration.onUpdateParameters.add(function(){s.bloom._downscale._exposure=s._scene.imageProcessingConfiguration.exposure,s.imageProcessingEnabled!==s._scene.imageProcessingConfiguration.isEnabled&&(s._imageProcessingEnabled=s._scene.imageProcessingConfiguration.isEnabled,s._buildPipeline())}),s._buildPipeline(),s}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sharpenEnabled",{get:function(){return this._sharpenEnabled},set:function(e){this._sharpenEnabled!==e&&(this._sharpenEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomKernel",{get:function(){return this._bloomKernel},set:function(e){this._bloomKernel=e,this.bloom.kernel=e/this._hardwareScaleLevel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomWeight",{get:function(){return this._bloomWeight},set:function(e){this._bloomWeight!==e&&(this.bloom.weight=e,this._bloomWeight=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomThreshold",{get:function(){return this._bloomThreshold},set:function(e){this._bloomThreshold!==e&&(this.bloom.threshold=e,this._bloomThreshold=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomScale",{get:function(){return this._bloomScale},set:function(e){this._bloomScale!==e&&(this._bloomScale=e,this._rebuildBloom(),this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomEnabled",{get:function(){return this._bloomEnabled},set:function(e){this._bloomEnabled!==e&&(this._bloomEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),t.prototype._rebuildBloom=function(){var e=this.bloom;this.bloom=new uh(this._scene,this.bloomScale,this._bloomWeight,this.bloomKernel,this._defaultPipelineTextureType,!1),this.bloom.threshold=e.threshold;for(var t=0;t<this._cameras.length;t++)e.disposeEffects(this._cameras[t])},Object.defineProperty(t.prototype,"depthOfFieldEnabled",{get:function(){return this._depthOfFieldEnabled},set:function(e){this._depthOfFieldEnabled!==e&&(this._depthOfFieldEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthOfFieldBlurLevel",{get:function(){return this._depthOfFieldBlurLevel},set:function(e){if(this._depthOfFieldBlurLevel!==e){this._depthOfFieldBlurLevel=e;var t=this.depthOfField;this.depthOfField=new bh(this._scene,null,this._depthOfFieldBlurLevel,this._defaultPipelineTextureType,!1),this.depthOfField.focalLength=t.focalLength,this.depthOfField.focusDistance=t.focusDistance,this.depthOfField.fStop=t.fStop,this.depthOfField.lensSize=t.lensSize;for(var i=0;i<this._cameras.length;i++)t.disposeEffects(this._cameras[i]);this._buildPipeline()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fxaaEnabled",{get:function(){return this._fxaaEnabled},set:function(e){this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples!==e&&(this._samples=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingEnabled",{get:function(){return this._imageProcessingEnabled},set:function(e){this._imageProcessingEnabled!==e&&(this._scene.imageProcessingConfiguration.isEnabled=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glowLayerEnabled",{get:function(){return null!=this._glowLayer},set:function(e){e&&!this._glowLayer?this._glowLayer=new sa("",this._scene):!e&&this._glowLayer&&(this._glowLayer.dispose(),this._glowLayer=null)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glowLayer",{get:function(){return this._glowLayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"chromaticAberrationEnabled",{get:function(){return this._chromaticAberrationEnabled},set:function(e){this._chromaticAberrationEnabled!==e&&(this._chromaticAberrationEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grainEnabled",{get:function(){return this._grainEnabled},set:function(e){this._grainEnabled!==e&&(this._grainEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"DefaultRenderingPipeline"},t.prototype.prepare=function(){var e=this._buildAllowed;this._buildAllowed=!0,this._buildPipeline(),this._buildAllowed=e},t.prototype._setAutoClearAndTextureSharing=function(e,t){void 0===t&&(t=!1),this._hasCleared?e.autoClear=!1:(e.autoClear=!0,this._scene.autoClear=!1,this._hasCleared=!0),t||(this._prevPrevPostProcess?e.shareOutputWith(this._prevPrevPostProcess):e.useOwnOutput(),this._prevPostProcess&&(this._prevPrevPostProcess=this._prevPostProcess),this._prevPostProcess=e)},t.prototype._buildPipeline=function(){var e=this;if(this._buildAllowed){this._scene.autoClear=!0;var t=this._scene.getEngine();if(this._disposePostProcesses(),null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()),this._reset(),this._prevPostProcess=null,this._prevPrevPostProcess=null,this._hasCleared=!1,this.depthOfFieldEnabled){if(this._cameras.length>1){for(var i=0,n=this._cameras;i<n.length;i++){var r=n[i];(o=this._scene.enableDepthRenderer(r)).useOnlyInActiveCamera=!0}this._depthOfFieldSceneObserver=this._scene.onAfterRenderTargetsRenderObservable.add(function(t){e._cameras.indexOf(t.activeCamera)>-1&&(e.depthOfField.depthTexture=t.enableDepthRenderer(t.activeCamera).getDepthMap())})}else{this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);var o=this._scene.enableDepthRenderer(this._cameras[0]);this.depthOfField.depthTexture=o.getDepthMap()}this.depthOfField._isReady()||this.depthOfField._updateEffects(),this.addEffect(this.depthOfField),this._setAutoClearAndTextureSharing(this.depthOfField._effects[0],!0)}else this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);this.bloomEnabled&&(this.bloom._isReady()||this.bloom._updateEffects(),this.addEffect(this.bloom),this._setAutoClearAndTextureSharing(this.bloom._effects[0],!0)),this._imageProcessingEnabled&&(this.imageProcessing=new Gi("imageProcessing",1,null,Ke.a.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this._hdr?(this.addEffect(new sh(t,this.ImageProcessingPostProcessId,function(){return e.imageProcessing},!0)),this._setAutoClearAndTextureSharing(this.imageProcessing)):this._scene.imageProcessingConfiguration.applyByPostProcess=!1,this.cameras&&0!==this.cameras.length||(this._scene.imageProcessingConfiguration.applyByPostProcess=!1),this.imageProcessing.getEffect()||this.imageProcessing._updateParameters()),this.sharpenEnabled&&(this.sharpen.isReady()||this.sharpen.updateEffect(),this.addEffect(this._sharpenEffect),this._setAutoClearAndTextureSharing(this.sharpen)),this.grainEnabled&&(this.grain.isReady()||this.grain.updateEffect(),this.addEffect(this._grainEffect),this._setAutoClearAndTextureSharing(this.grain)),this.chromaticAberrationEnabled&&(this.chromaticAberration.isReady()||this.chromaticAberration.updateEffect(),this.addEffect(this._chromaticAberrationEffect),this._setAutoClearAndTextureSharing(this.chromaticAberration)),this.fxaaEnabled&&(this.fxaa=new Eh("fxaa",1,null,Ke.a.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this.addEffect(new sh(t,this.FxaaPostProcessId,function(){return e.fxaa},!0)),this._setAutoClearAndTextureSharing(this.fxaa,!0)),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),this._scene.activeCameras&&this._scene.activeCameras.length>1&&(this._scene.autoClear=!0),!this._enableMSAAOnFirstPostProcess(this.samples)&&this.samples>1&&m.a.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0"),this.onBuildObservable.notifyObservers(this)}},t.prototype._disposePostProcesses=function(e){void 0===e&&(e=!1);for(var t=0;t<this._cameras.length;t++){var i=this._cameras[t];this.imageProcessing&&this.imageProcessing.dispose(i),this.fxaa&&this.fxaa.dispose(i),e&&(this.sharpen&&this.sharpen.dispose(i),this.depthOfField&&(this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver),this.depthOfField.disposeEffects(i)),this.bloom&&this.bloom.disposeEffects(i),this.chromaticAberration&&this.chromaticAberration.dispose(i),this.grain&&this.grain.dispose(i),this._glowLayer&&this._glowLayer.dispose())}this.imageProcessing=null,this.fxaa=null,e&&(this.sharpen=null,this._sharpenEffect=null,this.depthOfField=null,this.bloom=null,this.chromaticAberration=null,this._chromaticAberrationEffect=null,this.grain=null,this._grainEffect=null,this._glowLayer=null)},t.prototype.addCamera=function(e){this._camerasToBeAttached.push(e),this._buildPipeline()},t.prototype.removeCamera=function(e){var t=this._camerasToBeAttached.indexOf(e);this._camerasToBeAttached.splice(t,1),this._buildPipeline()},t.prototype.dispose=function(){this.onBuildObservable.clear(),this._disposePostProcesses(!0),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._scene.autoClear=!0,this._resizeObserver&&(this._scene.getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver),e.prototype.dispose.call(this)},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="DefaultRenderingPipeline",e},t.Parse=function(e,i,n){return w.a.Parse(function(){return new t(e._name,e._name._hdr,i)},e,i,n)},Object(h.c)([Object(w.c)()],t.prototype,"sharpenEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"bloomKernel",null),Object(h.c)([Object(w.c)()],t.prototype,"_bloomWeight",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_bloomThreshold",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_hdr",void 0),Object(h.c)([Object(w.c)()],t.prototype,"bloomWeight",null),Object(h.c)([Object(w.c)()],t.prototype,"bloomThreshold",null),Object(h.c)([Object(w.c)()],t.prototype,"bloomScale",null),Object(h.c)([Object(w.c)()],t.prototype,"bloomEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"depthOfFieldEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"depthOfFieldBlurLevel",null),Object(h.c)([Object(w.c)()],t.prototype,"fxaaEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"samples",null),Object(h.c)([Object(w.c)()],t.prototype,"imageProcessingEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"glowLayerEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"chromaticAberrationEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"grainEnabled",null),t}(Ih);c.a.RegisteredTypes["BABYLON.DefaultRenderingPipeline"]=Lh;ai.a.ShadersStore.lensHighlightsPixelShader="\nuniform sampler2D textureSampler;\n\nuniform float gain;\nuniform float threshold;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\n\nvec4 highlightColor(vec4 color) {\nvec4 highlight=color;\nfloat luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));\nfloat lum_threshold;\nif (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }\nelse { lum_threshold=0.5+0.44*threshold; }\nluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);\nhighlight*=luminance*gain;\nhighlight.a=1.0;\nreturn highlight;\n}\nvoid main(void)\n{\nvec4 original=texture2D(textureSampler,vUV);\n\nif (gain == -1.0) {\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\nreturn;\n}\nfloat w=2.0/screen_width;\nfloat h=2.0/screen_height;\nfloat weight=1.0;\n\nvec4 blurred=vec4(0.0,0.0,0.0,0.0);\n#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\n#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\n#endif\nblurred/=39.0;\ngl_FragColor=blurred;\n\n}";ai.a.ShadersStore.depthOfFieldPixelShader="\n\n\n\n\nuniform sampler2D textureSampler;\nuniform sampler2D highlightsSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D grainSampler;\n\nuniform float grain_amount;\nuniform bool blur_noise;\nuniform float screen_width;\nuniform float screen_height;\nuniform float distortion;\nuniform bool dof_enabled;\n\nuniform float screen_distance;\nuniform float aperture;\nuniform float darken;\nuniform float edge_blur;\nuniform bool highlights;\n\nuniform float near;\nuniform float far;\n\nvarying vec2 vUV;\n\n#define PI 3.14159265\n#define TWOPI 6.28318530\n#define inverse_focal_length 0.1\n\nvec2 centered_screen_pos;\nvec2 distorted_coords;\nfloat radius2;\nfloat radius;\n\nvec2 rand(vec2 co)\n{\nfloat noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));\nfloat noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));\nreturn clamp(vec2(noise1,noise2),0.0,1.0);\n}\n\nvec2 getDistortedCoords(vec2 coords) {\nif (distortion == 0.0) { return coords; }\nvec2 direction=1.0*normalize(centered_screen_pos);\nvec2 dist_coords=vec2(0.5,0.5);\ndist_coords.x=0.5+direction.x*radius2*1.0;\ndist_coords.y=0.5+direction.y*radius2*1.0;\nfloat dist_amount=clamp(distortion*0.23,0.0,1.0);\ndist_coords=mix(coords,dist_coords,dist_amount);\nreturn dist_coords;\n}\n\nfloat sampleScreen(inout vec4 color,const in vec2 offset,const in float weight) {\n\nvec2 coords=distorted_coords;\nfloat angle=rand(coords*100.0).x*TWOPI;\ncoords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));\ncolor+=texture2D(textureSampler,coords)*weight;\nreturn weight;\n}\n\nfloat getBlurLevel(float size) {\nreturn min(3.0,ceil(size/1.0));\n}\n\nvec4 getBlurColor(float size) {\nvec4 col=texture2D(textureSampler,distorted_coords);\nif (size == 0.0) { return col; }\n\n\nfloat blur_level=getBlurLevel(size);\nfloat w=(size/screen_width);\nfloat h=(size/screen_height);\nfloat total_weight=1.0;\nvec2 sample_coords;\ntotal_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);\ntotal_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);\ntotal_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);\ntotal_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);\ntotal_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);\ntotal_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);\ntotal_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);\ntotal_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);\ntotal_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);\nif (blur_level>1.0) {\ntotal_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);\ntotal_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);\ntotal_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);\ntotal_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);\ntotal_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);\ntotal_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);\ntotal_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);\ntotal_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);\ntotal_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);\n}\nif (blur_level>2.0) {\ntotal_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);\ntotal_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);\ntotal_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);\ntotal_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);\ntotal_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);\ntotal_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);\ntotal_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);\ntotal_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);\ntotal_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);\n}\ncol/=total_weight;\n\nif (darken>0.0) {\ncol.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);\n}\n\n\n\n\nreturn col;\n}\nvoid main(void)\n{\n\ncentered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);\nradius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;\nradius=sqrt(radius2);\ndistorted_coords=getDistortedCoords(vUV);\nvec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height);\nfloat depth=texture2D(depthSampler,distorted_coords).r;\nfloat distance=near+(far-near)*depth;\nvec4 color=texture2D(textureSampler,vUV);\n\n\nfloat coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));\n\nif (dof_enabled == false || coc<0.07) { coc=0.0; }\n\nfloat edge_blur_amount=0.0;\nif (edge_blur>0.0) {\nedge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;\n}\n\nfloat blur_amount=max(edge_blur_amount,coc);\n\nif (blur_amount == 0.0) {\ngl_FragColor=texture2D(textureSampler,distorted_coords);\n}\nelse {\n\ngl_FragColor=getBlurColor(blur_amount*1.7);\n\nif (highlights) {\ngl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;\n}\nif (blur_noise) {\n\nvec2 noise=rand(distorted_coords)*0.01*blur_amount;\nvec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);\ngl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;\n}\n}\n\nif (grain_amount>0.0) {\nvec4 grain_color=texture2D(grainSampler,texels_coords*0.003);\ngl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;\n}\n}\n";var wh=function(e){function t(t,i,n,r,o){void 0===r&&(r=1);var a=e.call(this,n.getEngine(),t)||this;return a.LensChromaticAberrationEffect="LensChromaticAberrationEffect",a.HighlightsEnhancingEffect="HighlightsEnhancingEffect",a.LensDepthOfFieldEffect="LensDepthOfFieldEffect",a._pentagonBokehIsEnabled=!1,a._scene=n,a._depthTexture=n.enableDepthRenderer().getDepthMap(),i.grain_texture?a._grainTexture=i.grain_texture:a._createGrainTexture(),a._edgeBlur=i.edge_blur?i.edge_blur:0,a._grainAmount=i.grain_amount?i.grain_amount:0,a._chromaticAberration=i.chromatic_aberration?i.chromatic_aberration:0,a._distortion=i.distortion?i.distortion:0,a._highlightsGain=void 0!==i.dof_gain?i.dof_gain:-1,a._highlightsThreshold=i.dof_threshold?i.dof_threshold:1,a._dofDistance=void 0!==i.dof_focus_distance?i.dof_focus_distance:-1,a._dofAperture=i.dof_aperture?i.dof_aperture:1,a._dofDarken=i.dof_darken?i.dof_darken:0,a._dofPentagon=void 0===i.dof_pentagon||i.dof_pentagon,a._blurNoise=void 0===i.blur_noise||i.blur_noise,a._createChromaticAberrationPostProcess(r),a._createHighlightsPostProcess(r),a._createDepthOfFieldPostProcess(r/4),a.addEffect(new sh(n.getEngine(),a.LensChromaticAberrationEffect,function(){return a._chromaticAberrationPostProcess},!0)),a.addEffect(new sh(n.getEngine(),a.HighlightsEnhancingEffect,function(){return a._highlightsPostProcess},!0)),a.addEffect(new sh(n.getEngine(),a.LensDepthOfFieldEffect,function(){return a._depthOfFieldPostProcess},!0)),-1===a._highlightsGain&&a._disableEffect(a.HighlightsEnhancingEffect,null),n.postProcessRenderPipelineManager.addPipeline(a),o&&n.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t,o),a}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"LensRenderingPipeline"},Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeBlur",{get:function(){return this._edgeBlur},set:function(e){this.setEdgeBlur(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grainAmount",{get:function(){return this._grainAmount},set:function(e){this.setGrainAmount(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"chromaticAberration",{get:function(){return this._chromaticAberration},set:function(e){this.setChromaticAberration(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dofAperture",{get:function(){return this._dofAperture},set:function(e){this.setAperture(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeDistortion",{get:function(){return this._distortion},set:function(e){this.setEdgeDistortion(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dofDistortion",{get:function(){return this._dofDistance},set:function(e){this.setFocusDistance(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"darkenOutOfFocus",{get:function(){return this._dofDarken},set:function(e){this.setDarkenOutOfFocus(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurNoise",{get:function(){return this._blurNoise},set:function(e){this._blurNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pentagonBokeh",{get:function(){return this._pentagonBokehIsEnabled},set:function(e){e?this.enablePentagonBokeh():this.disablePentagonBokeh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightsGain",{get:function(){return this._highlightsGain},set:function(e){this.setHighlightsGain(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightsThreshold",{get:function(){return this._highlightsThreshold},set:function(e){this.setHighlightsThreshold(e)},enumerable:!1,configurable:!0}),t.prototype.setEdgeBlur=function(e){this._edgeBlur=e},t.prototype.disableEdgeBlur=function(){this._edgeBlur=0},t.prototype.setGrainAmount=function(e){this._grainAmount=e},t.prototype.disableGrain=function(){this._grainAmount=0},t.prototype.setChromaticAberration=function(e){this._chromaticAberration=e},t.prototype.disableChromaticAberration=function(){this._chromaticAberration=0},t.prototype.setEdgeDistortion=function(e){this._distortion=e},t.prototype.disableEdgeDistortion=function(){this._distortion=0},t.prototype.setFocusDistance=function(e){this._dofDistance=e},t.prototype.disableDepthOfField=function(){this._dofDistance=-1},t.prototype.setAperture=function(e){this._dofAperture=e},t.prototype.setDarkenOutOfFocus=function(e){this._dofDarken=e},t.prototype.enablePentagonBokeh=function(){this._highlightsPostProcess.updateEffect("#define PENTAGON\n"),this._pentagonBokehIsEnabled=!0},t.prototype.disablePentagonBokeh=function(){this._pentagonBokehIsEnabled=!1,this._highlightsPostProcess.updateEffect()},t.prototype.enableNoiseBlur=function(){this._blurNoise=!0},t.prototype.disableNoiseBlur=function(){this._blurNoise=!1},t.prototype.setHighlightsGain=function(e){this._highlightsGain=e},t.prototype.setHighlightsThreshold=function(e){-1===this._highlightsGain&&(this._highlightsGain=1),this._highlightsThreshold=e},t.prototype.disableHighlights=function(){this._highlightsGain=-1},t.prototype.dispose=function(e){void 0===e&&(e=!1),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),this._chromaticAberrationPostProcess=null,this._highlightsPostProcess=null,this._depthOfFieldPostProcess=null,this._grainTexture.dispose(),e&&this._scene.disableDepthRenderer()},t.prototype._createChromaticAberrationPostProcess=function(e){var t=this;this._chromaticAberrationPostProcess=new ci("LensChromaticAberration","chromaticAberration",["chromatic_aberration","screen_width","screen_height","direction","radialIntensity","centerPosition"],[],e,null,Ke.a.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._chromaticAberrationPostProcess.onApply=function(e){e.setFloat("chromatic_aberration",t._chromaticAberration),e.setFloat("screen_width",t._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",t._scene.getEngine().getRenderHeight()),e.setFloat("radialIntensity",1),e.setFloat2("direction",17,17),e.setFloat2("centerPosition",.5,.5)}},t.prototype._createHighlightsPostProcess=function(e){var t=this;this._highlightsPostProcess=new ci("LensHighlights","lensHighlights",["gain","threshold","screen_width","screen_height"],[],e,null,Ke.a.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,this._dofPentagon?"#define PENTAGON\n":""),this._highlightsPostProcess.onApply=function(e){e.setFloat("gain",t._highlightsGain),e.setFloat("threshold",t._highlightsThreshold),e.setTextureFromPostProcess("textureSampler",t._chromaticAberrationPostProcess),e.setFloat("screen_width",t._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",t._scene.getEngine().getRenderHeight())}},t.prototype._createDepthOfFieldPostProcess=function(e){var t=this;this._depthOfFieldPostProcess=new ci("LensDepthOfField","depthOfField",["grain_amount","blur_noise","screen_width","screen_height","distortion","dof_enabled","screen_distance","aperture","darken","edge_blur","highlights","near","far"],["depthSampler","grainSampler","highlightsSampler"],e,null,Ke.a.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._depthOfFieldPostProcess.onApply=function(e){e.setTexture("depthSampler",t._depthTexture),e.setTexture("grainSampler",t._grainTexture),e.setTextureFromPostProcess("textureSampler",t._highlightsPostProcess),e.setTextureFromPostProcess("highlightsSampler",t._depthOfFieldPostProcess),e.setFloat("grain_amount",t._grainAmount),e.setBool("blur_noise",t._blurNoise),e.setFloat("screen_width",t._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",t._scene.getEngine().getRenderHeight()),e.setFloat("distortion",t._distortion),e.setBool("dof_enabled",-1!==t._dofDistance),e.setFloat("screen_distance",1/(.1-1/t._dofDistance)),e.setFloat("aperture",t._dofAperture),e.setFloat("darken",t._dofDarken),e.setFloat("edge_blur",t._edgeBlur),e.setBool("highlights",-1!==t._highlightsGain),t._scene.activeCamera&&(e.setFloat("near",t._scene.activeCamera.minZ),e.setFloat("far",t._scene.activeCamera.maxZ))}},t.prototype._createGrainTexture=function(){this._grainTexture=new Vi.a("LensNoiseTexture",512,this._scene,!1,Ke.a.BILINEAR_SAMPLINGMODE),this._grainTexture.wrapU=Ke.a.WRAP_ADDRESSMODE,this._grainTexture.wrapV=Ke.a.WRAP_ADDRESSMODE;for(var e,t=this._grainTexture.getContext(),i=0;i<512;i++)for(var n=0;n<512;n++)e=Math.floor(255*(.42,.58,Math.random()*(.58-.42)+.42)),t.fillStyle="rgb("+e+", "+e+", "+e+")",t.fillRect(i,n,1,1);this._grainTexture.update(!1)},t}(Ih),Fh=function(){this.enabled=!1,this.name="ssao2",this.texturesRequired=[g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE]};ai.a.ShadersStore.ssao2PixelShader="\nprecision highp float;\nuniform sampler2D textureSampler;\nuniform float near;\nuniform float far;\nuniform float radius;\nfloat scales[16]=float[16](\n0.1,\n0.11406250000000001,\n0.131640625,\n0.15625,\n0.187890625,\n0.2265625,\n0.272265625,\n0.325,\n0.384765625,\n0.4515625,\n0.525390625,\n0.60625,\n0.694140625,\n0.7890625,\n0.891015625,\n1.0\n);\nvarying vec2 vUV;\nfloat perspectiveDepthToViewZ( const in float invClipZ,const in float near,const in float far ) {\nreturn ( near*far )/( ( far-near )*invClipZ-far );\n}\nfloat viewZToPerspectiveDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( near*far/viewZ+far)/( far-near );\n}\nfloat viewZToOrthographicDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( viewZ+near )/( near-far );\n}\n#ifdef SSAO\nuniform sampler2D randomSampler;\n#ifndef GEOMETRYBUFFER\nuniform sampler2D depthNormalSampler;\n#else\nuniform sampler2D depthSampler;\nuniform sampler2D normalSampler;\n#endif\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float base;\nuniform float xViewport;\nuniform float yViewport;\nuniform float maxZ;\nuniform float minZAspect;\nuniform vec2 texelSize;\nuniform mat4 projection;\nvoid main()\n{\nvec3 random=texture2D(randomSampler,vUV*randTextureTiles).rgb;\n#ifndef GEOMETRYBUFFER\nfloat depth=texture2D(depthNormalSampler,vUV).r;\n#else\nfloat depth=texture2D(depthSampler,vUV).r;\n#endif\nfloat depthSign=depth/abs(depth);\ndepth=depth*depthSign;\n#ifndef GEOMETRYBUFFER\nvec3 normal=texture2D(depthNormalSampler,vUV).gba;\n#else\nvec3 normal=texture2D(normalSampler,vUV).rgb;\n#endif\nfloat occlusion=0.0;\nfloat correctedRadius=min(radius,minZAspect*depth/near);\nvec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);\nvec3 origin=vViewRay*depth;\nvec3 rvec=random*2.0-1.0;\nrvec.z=0.0;\n\nfloat dotProduct=dot(rvec,normal);\nrvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);\nvec3 tangent=normalize(rvec-normal*dot(rvec,normal));\nvec3 bitangent=cross(normal,tangent);\nmat3 tbn=mat3(tangent,bitangent,normal);\nfloat difference;\nfor (int i=0; i<SAMPLES; ++i) {\n\nvec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];\nsamplePosition=samplePosition*correctedRadius+origin;\n\nvec4 offset=vec4(samplePosition,1.0);\noffset=projection*offset;\noffset.xyz/=offset.w;\noffset.xy=offset.xy*0.5+0.5;\nif (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {\ncontinue;\n}\n\n#ifndef GEOMETRYBUFFER\nfloat sampleDepth=abs(texture2D(depthNormalSampler,offset.xy).r);\n#else\nfloat sampleDepth=abs(texture2D(depthSampler,offset.xy).r);\n#endif\n\ndifference=depthSign*samplePosition.z-sampleDepth;\nfloat rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);\nocclusion+=(difference>=0.0 ? 1.0 : 0.0)*rangeCheck;\n}\nocclusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor=vec4(vec3(result),1.0);\n}\n#endif\n#ifdef BILATERAL_BLUR\nuniform sampler2D depthNormalSampler;\nuniform float outSize;\nuniform float samplerOffsets[SAMPLES];\nvec4 blur9(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.3846153846)*direction;\nvec2 off2=vec2(3.2307692308)*direction;\ncolor+=texture2D(image,uv)*0.2270270270;\ncolor+=texture2D(image,uv+(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv-(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv+(off2/resolution))*0.0702702703;\ncolor+=texture2D(image,uv-(off2/resolution))*0.0702702703;\nreturn color;\n}\nvec4 blur13(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\ncolor+=texture2D(image,uv)*0.1964825501511404;\ncolor+=texture2D(image,uv+(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv-(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv+(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv-(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv+(off3/resolution))*0.010381362401148057;\ncolor+=texture2D(image,uv-(off3/resolution))*0.010381362401148057;\nreturn color;\n}\nvec4 blur13Bilateral(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\nfloat compareDepth=abs(texture2D(depthNormalSampler,uv).r);\nfloat sampleDepth;\nfloat weight;\nfloat weightSum=30.0;\ncolor+=texture2D(image,uv)*30.0;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off3/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off3/resolution))*weight;\nreturn color/weightSum;\n}\nvoid main()\n{\n#if EXPENSIVE\nfloat compareDepth=abs(texture2D(depthNormalSampler,vUV).r);\nfloat texelsize=1.0/outSize;\nfloat result=0.0;\nfloat weightSum=0.0;\nfor (int i=0; i<SAMPLES; ++i)\n{\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\nvec2 sampleOffset=vec2(texelsize*samplerOffsets[i],0.0);\n#else\nvec2 direction=vec2(0.0,1.0);\nvec2 sampleOffset=vec2(0.0,texelsize*samplerOffsets[i]);\n#endif\nvec2 samplePos=vUV+sampleOffset;\nfloat sampleDepth=abs(texture2D(depthNormalSampler,samplePos).r);\nfloat weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30000.0);\nresult+=texture2D(textureSampler,samplePos).r*weight;\nweightSum+=weight;\n}\nresult/=weightSum;\ngl_FragColor.rgb=vec3(result);\ngl_FragColor.a=1.0;\n#else\nvec4 color;\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#else\nvec2 direction=vec2(0.0,1.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#endif\ngl_FragColor.rgb=vec3(color.r);\ngl_FragColor.a=1.0;\n#endif\n}\n#endif\n";ai.a.ShadersStore.ssaoCombinePixelShader="uniform sampler2D textureSampler;\nuniform sampler2D originalColor;\nuniform vec4 viewport;\nvarying vec2 vUV;\nvoid main(void) {\nvec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);\nvec4 sceneColor=texture2D(originalColor,vUV);\ngl_FragColor=sceneColor*ssaoColor;\n}\n";var Bh=function(e){function t(t,i,n,r,o){void 0===o&&(o=!0);var a=e.call(this,i.getEngine(),t)||this;if(a.SSAOOriginalSceneColorEffect="SSAOOriginalSceneColorEffect",a.SSAORenderEffect="SSAORenderEffect",a.SSAOBlurHRenderEffect="SSAOBlurHRenderEffect",a.SSAOBlurVRenderEffect="SSAOBlurVRenderEffect",a.SSAOCombineRenderEffect="SSAOCombineRenderEffect",a.totalStrength=1,a.maxZ=100,a.minZAspect=.2,a._samples=8,a._textureSamples=1,a._forceGeometryBuffer=!1,a._expensiveBlur=!0,a.radius=2,a.base=0,a._bits=new Uint32Array(1),a._scene=i,a._ratio=n,a._forceGeometryBuffer=o,!a.isSupported)return m.a.Error("SSAO 2 needs WebGL 2 support."),a;var s=a._ratio.ssaoRatio||n,c=a._ratio.blurRatio||n;return a._forceGeometryBuffer?i.enableGeometryBufferRenderer():a._prePassRenderer=i.enablePrePassRenderer(),a._createRandomTexture(),a._originalColorPostProcess=new li("SSAOOriginalSceneColor",1,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1),a._originalColorPostProcess.samples=a.textureSamples,a._createSSAOPostProcess(1),a._createBlurPostProcess(s,c),a._createSSAOCombinePostProcess(c),a.addEffect(new sh(i.getEngine(),a.SSAOOriginalSceneColorEffect,function(){return a._originalColorPostProcess},!0)),a.addEffect(new sh(i.getEngine(),a.SSAORenderEffect,function(){return a._ssaoPostProcess},!0)),a.addEffect(new sh(i.getEngine(),a.SSAOBlurHRenderEffect,function(){return a._blurHPostProcess},!0)),a.addEffect(new sh(i.getEngine(),a.SSAOBlurVRenderEffect,function(){return a._blurVPostProcess},!0)),a.addEffect(new sh(i.getEngine(),a.SSAOCombineRenderEffect,function(){return a._ssaoCombinePostProcess},!0)),i.postProcessRenderPipelineManager.addPipeline(a),r&&i.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t,r),a}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples=e,this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO()),this._sampleSphere=this._generateHemisphere()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textureSamples",{get:function(){return this._textureSamples},set:function(e){this._textureSamples=e,this._originalColorPostProcess.samples=e,this._blurHPostProcess.samples=e,this._blurVPostProcess.samples=e,this._ssaoPostProcess.samples=e,this._ssaoCombinePostProcess.samples=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"expensiveBlur",{get:function(){return this._expensiveBlur},set:function(e){this._blurHPostProcess.updateEffect("#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE "+(e?"1":"0")+"\n",null,["textureSampler","depthNormalSampler"]),this._blurVPostProcess.updateEffect("#define BILATERAL_BLUR\n#define SAMPLES 16\n#define EXPENSIVE "+(e?"1":"0")+"\n",null,["textureSampler","depthNormalSampler"]),this._expensiveBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"IsSupported",{get:function(){var e=x.a.LastCreatedEngine;return!!e&&e.webGLVersion>=2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"SSAO2RenderingPipeline"},t.prototype.dispose=function(t){void 0===t&&(t=!1);for(var i=0;i<this._scene.cameras.length;i++){var n=this._scene.cameras[i];this._originalColorPostProcess.dispose(n),this._ssaoPostProcess.dispose(n),this._blurHPostProcess.dispose(n),this._blurVPostProcess.dispose(n),this._ssaoCombinePostProcess.dispose(n)}this._randomTexture.dispose(),t&&this._scene.disableGeometryBufferRenderer(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),e.prototype.dispose.call(this)},t.prototype._createBlurPostProcess=function(e,t){var i=this;this._samplerOffsets=[];for(var n=this.expensiveBlur,r=-8;r<8;r++)this._samplerOffsets.push(2*r+.5);this._blurHPostProcess=new ci("BlurH","ssao2",["outSize","samplerOffsets","near","far","radius"],["depthNormalSampler"],e,null,Ke.a.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE "+(n?"1":"0")+"\n"),this._blurHPostProcess.onApply=function(e){i._scene.activeCamera&&(e.setFloat("outSize",i._ssaoCombinePostProcess.width>0?i._ssaoCombinePostProcess.width:i._originalColorPostProcess.width),e.setFloat("near",i._scene.activeCamera.minZ),e.setFloat("far",i._scene.activeCamera.maxZ),e.setFloat("radius",i.radius),i._forceGeometryBuffer?e.setTexture("depthNormalSampler",i._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]):e.setTexture("depthNormalSampler",i._prePassRenderer.prePassRT.textures[i._prePassRenderer.getIndex(g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]),e.setArray("samplerOffsets",i._samplerOffsets))},this._blurVPostProcess=new ci("BlurV","ssao2",["outSize","samplerOffsets","near","far","radius"],["depthNormalSampler"],t,null,Ke.a.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define BILATERAL_BLUR\n#define BILATERAL_BLUR_V\n#define SAMPLES 16\n#define EXPENSIVE "+(n?"1":"0")+"\n"),this._blurVPostProcess.onApply=function(e){i._scene.activeCamera&&(e.setFloat("outSize",i._ssaoCombinePostProcess.height>0?i._ssaoCombinePostProcess.height:i._originalColorPostProcess.height),e.setFloat("near",i._scene.activeCamera.minZ),e.setFloat("far",i._scene.activeCamera.maxZ),e.setFloat("radius",i.radius),i._forceGeometryBuffer?e.setTexture("depthNormalSampler",i._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]):e.setTexture("depthNormalSampler",i._prePassRenderer.prePassRT.textures[i._prePassRenderer.getIndex(g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]),e.setArray("samplerOffsets",i._samplerOffsets))},this._blurHPostProcess.samples=this.textureSamples,this._blurVPostProcess.samples=this.textureSamples},t.prototype._rebuild=function(){e.prototype._rebuild.call(this)},t.prototype._radicalInverse_VdC=function(e){return this._bits[0]=e,this._bits[0]=(this._bits[0]<<16|this._bits[0]>>16)>>>0,this._bits[0]=(1431655765&this._bits[0])<<1|(2863311530&this._bits[0])>>>1>>>0,this._bits[0]=(858993459&this._bits[0])<<2|(3435973836&this._bits[0])>>>2>>>0,this._bits[0]=(252645135&this._bits[0])<<4|(4042322160&this._bits[0])>>>4>>>0,this._bits[0]=(16711935&this._bits[0])<<8|(4278255360&this._bits[0])>>>8>>>0,2.3283064365386963e-10*this._bits[0]},t.prototype._hammersley=function(e,t){return[e/t,this._radicalInverse_VdC(e)]},t.prototype._hemisphereSample_uniform=function(e,t){var i=2*t*Math.PI,n=1-(.85*e+.15),r=Math.sqrt(1-n*n);return new a.e(Math.cos(i)*r,Math.sin(i)*r,n)},t.prototype._generateHemisphere=function(){for(var e,t=this.samples,i=[],n=0;n<t;){if(t<16)e=this._hemisphereSample_uniform(Math.random(),Math.random());else{var r=this._hammersley(n,t);e=this._hemisphereSample_uniform(r[0],r[1])}i.push(e.x,e.y,e.z),n++}return i},t.prototype._getDefinesForSSAO=function(){var e="#define SAMPLES "+this.samples+"\n#define SSAO";return this._forceGeometryBuffer&&(e+="\n#define GEOMETRYBUFFER"),e},t.prototype._createSSAOPostProcess=function(e){var t=this;this._sampleSphere=this._generateHemisphere();var i,n=this._getDefinesForSSAO();i=this._forceGeometryBuffer?["randomSampler","depthSampler","normalSampler"]:["randomSampler","depthNormalSampler"],this._ssaoPostProcess=new ci("ssao2","ssao2",["sampleSphere","samplesFactor","randTextureTiles","totalStrength","radius","base","range","projection","near","far","texelSize","xViewport","yViewport","maxZ","minZAspect"],i,e,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._ssaoPostProcess.onApply=function(e){t._scene.activeCamera&&(e.setArray3("sampleSphere",t._sampleSphere),e.setFloat("randTextureTiles",32),e.setFloat("samplesFactor",1/t.samples),e.setFloat("totalStrength",t.totalStrength),e.setFloat2("texelSize",1/t._ssaoPostProcess.width,1/t._ssaoPostProcess.height),e.setFloat("radius",t.radius),e.setFloat("maxZ",t.maxZ),e.setFloat("minZAspect",t.minZAspect),e.setFloat("base",t.base),e.setFloat("near",t._scene.activeCamera.minZ),e.setFloat("far",t._scene.activeCamera.maxZ),e.setFloat("xViewport",Math.tan(t._scene.activeCamera.fov/2)*t._scene.getEngine().getAspectRatio(t._scene.activeCamera,!0)),e.setFloat("yViewport",Math.tan(t._scene.activeCamera.fov/2)),e.setMatrix("projection",t._scene.getProjectionMatrix()),t._forceGeometryBuffer?(e.setTexture("depthSampler",t._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]),e.setTexture("normalSampler",t._scene.enableGeometryBufferRenderer().getGBuffer().textures[1])):e.setTexture("depthNormalSampler",t._prePassRenderer.prePassRT.textures[t._prePassRenderer.getIndex(g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]),e.setTexture("randomSampler",t._randomTexture))},this._ssaoPostProcess.samples=this.textureSamples},t.prototype._createSSAOCombinePostProcess=function(e){var t=this;this._ssaoCombinePostProcess=new ci("ssaoCombine","ssaoCombine",[],["originalColor","viewport"],e,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._ssaoCombinePostProcess.onApply=function(e){var i=t._scene.activeCamera.viewport;e.setVector4("viewport",a.c.Vector4[0].copyFromFloats(i.x,i.y,i.width,i.height)),e.setTextureFromPostProcessOutput("originalColor",t._originalColorPostProcess)},this._ssaoCombinePostProcess.samples=this.textureSamples,this._forceGeometryBuffer||(this._ssaoCombinePostProcess._prePassEffectConfiguration=new Fh)},t.prototype._createRandomTexture=function(){this._randomTexture=new Vi.a("SSAORandomTexture",128,this._scene,!1,Ke.a.TRILINEAR_SAMPLINGMODE),this._randomTexture.wrapU=Ke.a.WRAP_ADDRESSMODE,this._randomTexture.wrapV=Ke.a.WRAP_ADDRESSMODE;for(var e=this._randomTexture.getContext(),t=function(e,t){return Math.random()*(t-e)+e},i=a.e.Zero(),n=0;n<128;n++)for(var r=0;r<128;r++)i.x=t(0,1),i.y=t(0,1),i.z=0,i.normalize(),i.scaleInPlace(255),i.x=Math.floor(i.x),i.y=Math.floor(i.y),e.fillStyle="rgb("+i.x+", "+i.y+", "+i.z+")",e.fillRect(n,r,1,1);this._randomTexture.update(!1)},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="SSAO2RenderingPipeline",e},t.Parse=function(e,i,n){return w.a.Parse(function(){return new t(e._name,i,e._ratio)},e,i,n)},Object(h.c)([Object(w.c)()],t.prototype,"totalStrength",void 0),Object(h.c)([Object(w.c)()],t.prototype,"maxZ",void 0),Object(h.c)([Object(w.c)()],t.prototype,"minZAspect",void 0),Object(h.c)([Object(w.c)("samples")],t.prototype,"_samples",void 0),Object(h.c)([Object(w.c)("textureSamples")],t.prototype,"_textureSamples",void 0),Object(h.c)([Object(w.c)()],t.prototype,"_ratio",void 0),Object(h.c)([Object(w.c)("expensiveBlur")],t.prototype,"_expensiveBlur",void 0),Object(h.c)([Object(w.c)()],t.prototype,"radius",void 0),Object(h.c)([Object(w.c)()],t.prototype,"base",void 0),t}(Ih);c.a.RegisteredTypes["BABYLON.SSAO2RenderingPipeline"]=Bh;ai.a.ShadersStore.ssaoPixelShader="\nuniform sampler2D textureSampler;\nvarying vec2 vUV;\n#ifdef SSAO\nuniform sampler2D randomSampler;\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float radius;\nuniform float area;\nuniform float fallOff;\nuniform float base;\nvec3 normalFromDepth(float depth,vec2 coords)\n{\nvec2 offset1=vec2(0.0,radius);\nvec2 offset2=vec2(radius,0.0);\nfloat depth1=texture2D(textureSampler,coords+offset1).r;\nfloat depth2=texture2D(textureSampler,coords+offset2).r;\nvec3 p1=vec3(offset1,depth1-depth);\nvec3 p2=vec3(offset2,depth2-depth);\nvec3 normal=cross(p1,p2);\nnormal.z=-normal.z;\nreturn normalize(normal);\n}\nvoid main()\n{\nvec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);\nfloat depth=texture2D(textureSampler,vUV).r;\nvec3 position=vec3(vUV,depth);\nvec3 normal=normalFromDepth(depth,vUV);\nfloat radiusDepth=radius/depth;\nfloat occlusion=0.0;\nvec3 ray;\nvec3 hemiRay;\nfloat occlusionDepth;\nfloat difference;\nfor (int i=0; i<SAMPLES; i++)\n{\nray=radiusDepth*reflect(sampleSphere[i],random);\nhemiRay=position+sign(dot(ray,normal))*ray;\nocclusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;\ndifference=depth-occlusionDepth;\nocclusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));\n}\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor.r=result;\ngl_FragColor.g=result;\ngl_FragColor.b=result;\ngl_FragColor.a=1.0;\n}\n#endif\n";var Uh=function(e){function t(t,i,n,r){var o=e.call(this,i.getEngine(),t)||this;o.SSAOOriginalSceneColorEffect="SSAOOriginalSceneColorEffect",o.SSAORenderEffect="SSAORenderEffect",o.SSAOBlurHRenderEffect="SSAOBlurHRenderEffect",o.SSAOBlurVRenderEffect="SSAOBlurVRenderEffect",o.SSAOCombineRenderEffect="SSAOCombineRenderEffect",o.totalStrength=1,o.radius=1e-4,o.area=.0075,o.fallOff=1e-6,o.base=.5,o._firstUpdate=!0,o._scene=i,o._createRandomTexture(),o._depthTexture=i.enableDepthRenderer().getDepthMap();var a=n.ssaoRatio||n,s=n.combineRatio||n;return o._originalColorPostProcess=new li("SSAOOriginalSceneColor",s,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1),o._createSSAOPostProcess(a),o._createBlurPostProcess(a),o._createSSAOCombinePostProcess(s),o.addEffect(new sh(i.getEngine(),o.SSAOOriginalSceneColorEffect,function(){return o._originalColorPostProcess},!0)),o.addEffect(new sh(i.getEngine(),o.SSAORenderEffect,function(){return o._ssaoPostProcess},!0)),o.addEffect(new sh(i.getEngine(),o.SSAOBlurHRenderEffect,function(){return o._blurHPostProcess},!0)),o.addEffect(new sh(i.getEngine(),o.SSAOBlurVRenderEffect,function(){return o._blurVPostProcess},!0)),o.addEffect(new sh(i.getEngine(),o.SSAOCombineRenderEffect,function(){return o._ssaoCombinePostProcess},!0)),i.postProcessRenderPipelineManager.addPipeline(o),r&&i.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t,r),o}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"SSAORenderingPipeline"},t.prototype.dispose=function(t){void 0===t&&(t=!1);for(var i=0;i<this._scene.cameras.length;i++){var n=this._scene.cameras[i];this._originalColorPostProcess.dispose(n),this._ssaoPostProcess.dispose(n),this._blurHPostProcess.dispose(n),this._blurVPostProcess.dispose(n),this._ssaoCombinePostProcess.dispose(n)}this._randomTexture.dispose(),t&&this._scene.disableDepthRenderer(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),e.prototype.dispose.call(this)},t.prototype._createBlurPostProcess=function(e){var t=this;this._blurHPostProcess=new Gr("BlurH",new a.d(1,0),16,e,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,g.a.TEXTURETYPE_UNSIGNED_INT),this._blurVPostProcess=new Gr("BlurV",new a.d(0,1),16,e,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,g.a.TEXTURETYPE_UNSIGNED_INT),this._blurHPostProcess.onActivateObservable.add(function(){var e=t._blurHPostProcess.width/t._scene.getEngine().getRenderWidth();t._blurHPostProcess.kernel=16*e}),this._blurVPostProcess.onActivateObservable.add(function(){var e=t._blurVPostProcess.height/t._scene.getEngine().getRenderHeight();t._blurVPostProcess.kernel=16*e})},t.prototype._rebuild=function(){this._firstUpdate=!0,e.prototype._rebuild.call(this)},t.prototype._createSSAOPostProcess=function(e){var t=this,i=[.5381,.1856,-.4319,.1379,.2486,.443,.3371,.5679,-.0057,-.6999,-.0451,-.0019,.0689,-.1598,-.8547,.056,.0069,-.1843,-.0146,.1402,.0762,.01,-.1924,-.0344,-.3577,-.5301,-.4358,-.3169,.1063,.0158,.0103,-.5869,.0046,-.0897,-.494,.3287,.7119,-.0154,-.0918,-.0533,.0596,-.5411,.0352,-.0631,.546,-.4776,.2847,-.0271];this._ssaoPostProcess=new ci("ssao","ssao",["sampleSphere","samplesFactor","randTextureTiles","totalStrength","radius","area","fallOff","base","range","viewport"],["randomSampler"],e,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define SAMPLES 16\n#define SSAO"),this._ssaoPostProcess.onApply=function(e){t._firstUpdate&&(e.setArray3("sampleSphere",i),e.setFloat("samplesFactor",1/16),e.setFloat("randTextureTiles",4)),e.setFloat("totalStrength",t.totalStrength),e.setFloat("radius",t.radius),e.setFloat("area",t.area),e.setFloat("fallOff",t.fallOff),e.setFloat("base",t.base),e.setTexture("textureSampler",t._depthTexture),e.setTexture("randomSampler",t._randomTexture)}},t.prototype._createSSAOCombinePostProcess=function(e){var t=this;this._ssaoCombinePostProcess=new ci("ssaoCombine","ssaoCombine",[],["originalColor","viewport"],e,null,Ke.a.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._ssaoCombinePostProcess.onApply=function(e){e.setVector4("viewport",a.c.Vector4[0].copyFromFloats(0,0,1,1)),e.setTextureFromPostProcess("originalColor",t._originalColorPostProcess)}},t.prototype._createRandomTexture=function(){this._randomTexture=new Vi.a("SSAORandomTexture",512,this._scene,!1,Ke.a.TRILINEAR_SAMPLINGMODE),this._randomTexture.wrapU=Ke.a.WRAP_ADDRESSMODE,this._randomTexture.wrapV=Ke.a.WRAP_ADDRESSMODE;for(var e=this._randomTexture.getContext(),t=function(e,t){return Math.random()*(t-e)+e},i=a.e.Zero(),n=0;n<512;n++)for(var r=0;r<512;r++)i.x=Math.floor(255*t(-1,1)),i.y=Math.floor(255*t(-1,1)),i.z=Math.floor(255*t(-1,1)),e.fillStyle="rgb("+i.x+", "+i.y+", "+i.z+")",e.fillRect(n,r,1,1);this._randomTexture.update(!1)},Object(h.c)([Object(w.c)()],t.prototype,"totalStrength",void 0),Object(h.c)([Object(w.c)()],t.prototype,"radius",void 0),Object(h.c)([Object(w.c)()],t.prototype,"area",void 0),Object(h.c)([Object(w.c)()],t.prototype,"fallOff",void 0),Object(h.c)([Object(w.c)()],t.prototype,"base",void 0),t}(Ih),Vh=function(){this.enabled=!1,this.name="screenSpaceReflections",this.texturesRequired=[g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE,g.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE,g.a.PREPASS_POSITION_TEXTURE_TYPE]};ai.a.ShadersStore.screenSpaceReflectionPixelShader="\n\nuniform sampler2D textureSampler;\nuniform sampler2D normalSampler;\nuniform sampler2D positionSampler;\nuniform sampler2D reflectivitySampler;\nuniform mat4 view;\nuniform mat4 projection;\nuniform float step;\nuniform float strength;\nuniform float threshold;\nuniform float roughnessFactor;\nuniform float reflectionSpecularFalloffExponent;\n\nvarying vec2 vUV;\n\nstruct ReflectionInfo {\nvec3 color;\nvec4 coords;\n};\n\nvec3 fresnelSchlick(float cosTheta,vec3 F0)\n{\nreturn F0+(1.0-F0)*pow(1.0-cosTheta,5.0);\n}\n\nReflectionInfo smoothReflectionInfo(vec3 dir,vec3 hitCoord)\n{\nReflectionInfo info;\ninfo.color=vec3(0.0);\nvec4 projectedCoord;\nfloat sampledDepth;\nfor(int i=0; i<SMOOTH_STEPS; i++)\n{\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\nsampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;\nfloat depth=sampledDepth-hitCoord.z;\ndir*=0.5;\nif(depth>0.0)\nhitCoord-=dir;\nelse\nhitCoord+=dir;\ninfo.color+=texture2D(textureSampler,projectedCoord.xy).rgb;\n}\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\n\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,1.0);\ninfo.color+=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.color/=float(SMOOTH_STEPS+1);\nreturn info;\n}\n\nReflectionInfo getReflectionInfo(vec3 dir,vec3 hitCoord)\n{\nReflectionInfo info;\nvec4 projectedCoord;\nfloat sampledDepth;\ndir*=step;\nfor(int i=0; i<REFLECTION_SAMPLES; i++)\n{\nhitCoord+=dir;\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\nsampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;\nfloat depth=sampledDepth-hitCoord.z;\nif(((depth-dir.z)<threshold) && depth<=0.0)\n{\n#ifdef ENABLE_SMOOTH_REFLECTIONS\nreturn smoothReflectionInfo(dir,hitCoord);\n#else\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,0.0);\nreturn info;\n#endif\n}\n}\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,0.0);\nreturn info;\n}\nvec3 hash(vec3 a)\n{\na=fract(a*0.8);\na+=dot(a,a.yxz+19.19);\nreturn fract((a.xxy+a.yxx)*a.zyx);\n}\nvoid main()\n{\n#ifdef SSR_SUPPORTED\n\nvec4 albedoFull=texture2D(textureSampler,vUV);\nvec3 albedo=albedoFull.rgb;\nfloat spec=texture2D(reflectivitySampler,vUV).r;\nif (spec == 0.0) {\ngl_FragColor=albedoFull;\nreturn;\n}\n\n#ifdef PREPASS_LAYOUT\nvec3 normal=(texture2D(normalSampler,vUV)).gba;\n#else\nvec3 normal=(texture2D(normalSampler,vUV)).xyz;\n#endif\nvec3 position=(view*texture2D(positionSampler,vUV)).xyz;\nvec3 reflected=normalize(reflect(normalize(position),normalize(normal)));\nfloat roughness=1.0-texture2D(reflectivitySampler,vUV).a;\nvec3 jitt=mix(vec3(0.0),hash(position),roughness)*roughnessFactor;\nReflectionInfo info=getReflectionInfo(jitt+reflected,position);\n\nvec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-info.coords.xy));\nfloat screenEdgefactor=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);\n\nvec3 F0=vec3(0.04);\nF0=mix(F0,albedo,spec);\nvec3 fresnel=fresnelSchlick(max(dot(normalize(normal),normalize(position)),0.0),F0);\n\nfloat reflectionMultiplier=clamp(pow(spec*strength,reflectionSpecularFalloffExponent)*screenEdgefactor*reflected.z,0.0,0.9);\nfloat albedoMultiplier=1.0-reflectionMultiplier;\nvec3 SSR=info.color*fresnel;\ngl_FragColor=vec4((albedo*albedoMultiplier)+(SSR*reflectionMultiplier),albedoFull.a);\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n";var kh=function(e){function t(t,i,n,r,o,a,s,c,l,u){void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1),void 0===u&&(u=!0);var h=e.call(this,t,"screenSpaceReflection",["projection","view","threshold","reflectionSpecularFalloffExponent","strength","step","roughnessFactor"],["textureSampler","normalSampler","positionSampler","reflectivitySampler"],n,r,o,a,s,"#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n",c,void 0,null,l)||this;if(h.threshold=1.2,h.strength=1,h.reflectionSpecularFalloffExponent=3,h.step=1,h.roughnessFactor=.2,h._forceGeometryBuffer=!1,h._enableSmoothReflections=!1,h._reflectionSamples=64,h._smoothSteps=5,h._forceGeometryBuffer=u,h._forceGeometryBuffer){var d=i.enableGeometryBufferRenderer();d&&d.isSupported&&(d.enablePosition=!0,d.enableReflectivity=!0,h._geometryBufferRenderer=d)}else h._prePassRenderer=i.enablePrePassRenderer(),h._prePassRenderer.markAsDirty(),h._prePassEffectConfiguration=new Vh;return h._updateEffectDefines(),h.onApply=function(e){var t=h._geometryBufferRenderer,n=h._prePassRenderer;if(n||t){if(t){var r=t.getTextureIndex(Ph.POSITION_TEXTURE_TYPE),o=t.getTextureIndex(Ph.REFLECTIVITY_TEXTURE_TYPE);e.setTexture("normalSampler",t.getGBuffer().textures[1]),e.setTexture("positionSampler",t.getGBuffer().textures[r]),e.setTexture("reflectivitySampler",t.getGBuffer().textures[o])}else{r=n.getIndex(g.a.PREPASS_POSITION_TEXTURE_TYPE),o=n.getIndex(g.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE);var a=n.getIndex(g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE);e.setTexture("normalSampler",n.prePassRT.textures[a]),e.setTexture("positionSampler",n.prePassRT.textures[r]),e.setTexture("reflectivitySampler",n.prePassRT.textures[o])}var s=i.activeCamera;if(s){var c=s.getViewMatrix(),l=s.getProjectionMatrix();e.setMatrix("projection",l),e.setMatrix("view",c),e.setFloat("threshold",h.threshold),e.setFloat("reflectionSpecularFalloffExponent",h.reflectionSpecularFalloffExponent),e.setFloat("strength",h.strength),e.setFloat("step",h.step),e.setFloat("roughnessFactor",h.roughnessFactor)}}},h}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ScreenSpaceReflectionPostProcess"},Object.defineProperty(t.prototype,"enableSmoothReflections",{get:function(){return this._enableSmoothReflections},set:function(e){e!==this._enableSmoothReflections&&(this._enableSmoothReflections=e,this._updateEffectDefines())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionSamples",{get:function(){return this._reflectionSamples},set:function(e){e!==this._reflectionSamples&&(this._reflectionSamples=e,this._updateEffectDefines())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"smoothSteps",{get:function(){return this._smoothSteps},set:function(e){e!==this._smoothSteps&&(this._smoothSteps=e,this._updateEffectDefines())},enumerable:!1,configurable:!0}),t.prototype._updateEffectDefines=function(){var e=[];(this._geometryBufferRenderer||this._prePassRenderer)&&(e.push("#define SSR_SUPPORTED"),this._prePassRenderer&&e.push("#define PREPASS_LAYOUT")),this._enableSmoothReflections&&e.push("#define ENABLE_SMOOTH_REFLECTIONS"),e.push("#define REFLECTION_SAMPLES "+(this._reflectionSamples>>0)),e.push("#define SMOOTH_STEPS "+(this._smoothSteps>>0)),this.updateEffect(e.join("\n"))},t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,n,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.textureType,e.reusable)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"threshold",void 0),Object(h.c)([Object(w.c)()],t.prototype,"strength",void 0),Object(h.c)([Object(w.c)()],t.prototype,"reflectionSpecularFalloffExponent",void 0),Object(h.c)([Object(w.c)()],t.prototype,"step",void 0),Object(h.c)([Object(w.c)()],t.prototype,"roughnessFactor",void 0),Object(h.c)([Object(w.c)()],t.prototype,"enableSmoothReflections",null),Object(h.c)([Object(w.c)()],t.prototype,"reflectionSamples",null),Object(h.c)([Object(w.c)()],t.prototype,"smoothSteps",null),t}(ci);c.a.RegisteredTypes["BABYLON.ScreenSpaceReflectionPostProcess"]=kh;ai.a.ShadersStore.standardPixelShader="uniform sampler2D textureSampler;\nvarying vec2 vUV;\n#if defined(PASS_POST_PROCESS)\nvoid main(void)\n{\nvec4 color=texture2D(textureSampler,vUV);\ngl_FragColor=color;\n}\n#endif\n#if defined(DOWN_SAMPLE_X4)\nuniform vec2 dsOffsets[16];\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+dsOffsets[0]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[1]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[2]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[3]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[4]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[5]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[6]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[7]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[8]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[9]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[10]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[11]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[12]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[13]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[14]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[15]);\naverage/=16.0;\ngl_FragColor=average;\n}\n#endif\n#if defined(BRIGHT_PASS)\nuniform vec2 dsOffsets[4];\nuniform float brightThreshold;\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));\naverage*=0.25;\nfloat luminance=length(average.rgb);\nif (luminance<brightThreshold) {\naverage=vec4(0.0,0.0,0.0,1.0);\n}\ngl_FragColor=average;\n}\n#endif\n#if defined(TEXTURE_ADDER)\nuniform sampler2D otherSampler;\nuniform sampler2D lensSampler;\nuniform float exposure;\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\ncolour*=exposure;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\ncolour+=colour*texture2D(lensSampler,vUV).rgb;\nvec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);\ngl_FragColor=finalColor;\n}\n#endif\n#if defined(VLS)\n#define PI 3.1415926535897932384626433832795\nuniform mat4 shadowViewProjection;\nuniform mat4 lightWorld;\nuniform vec3 cameraPosition;\nuniform vec3 sunDirection;\nuniform vec3 sunColor;\nuniform vec2 depthValues;\nuniform float scatteringCoefficient;\nuniform float scatteringPower;\nuniform sampler2D shadowMapSampler;\nuniform sampler2D positionSampler;\nfloat computeScattering(float lightDotView)\n{\nfloat result=1.0-scatteringCoefficient*scatteringCoefficient;\nresult/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));\nreturn result;\n}\nvoid main(void)\n{\n\nvec3 worldPos=texture2D(positionSampler,vUV).rgb;\nvec3 startPosition=cameraPosition;\nvec3 rayVector=worldPos-startPosition;\nfloat rayLength=length(rayVector);\nvec3 rayDirection=rayVector/rayLength;\nfloat stepLength=rayLength/NB_STEPS;\nvec3 stepL=rayDirection*stepLength;\nvec3 currentPosition=startPosition;\nvec3 accumFog=vec3(0.0);\nfor (int i=0; i<int(NB_STEPS); i++)\n{\nvec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);\nfloat depthMetric=(worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depthMetric,0.0,1.0);\nworldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;\nworldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);\nfloat shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;\nif (shadowMapValue>shadowPixelDepth)\naccumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));\ncurrentPosition+=stepL;\n}\naccumFog/=NB_STEPS;\nvec3 color=accumFog*scatteringPower;\ngl_FragColor=vec4(color*exp(color) ,1.0);\n}\n#endif\n#if defined(VLSMERGE)\nuniform sampler2D originalSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);\n}\n#endif\n#if defined(LUMINANCE)\nuniform vec2 lumOffsets[4];\nvoid main()\n{\nfloat average=0.0;\nvec4 color=vec4(0.0);\nfloat maximum=-1e20;\nvec3 weight=vec3(0.299,0.587,0.114);\nfor (int i=0; i<4; i++)\n{\ncolor=texture2D(textureSampler,vUV+ lumOffsets[i]);\n\nfloat GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));\n\n#ifdef WEIGHTED_AVERAGE\nfloat GreyValue=dot(color.rgb,weight);\n#endif\n#ifdef BRIGHTNESS\nfloat GreyValue=max(color.r,max(color.g,color.b));\n#endif\n#ifdef HSL_COMPONENT\nfloat GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));\n#endif\n#ifdef MAGNITUDE\nfloat GreyValue=length(color.rgb);\n#endif\nmaximum=max(maximum,GreyValue);\naverage+=(0.25*log(1e-5+GreyValue));\n}\naverage=exp(average);\ngl_FragColor=vec4(average,maximum,0.0,1.0);\n}\n#endif\n#if defined(LUMINANCE_DOWN_SAMPLE)\nuniform vec2 dsOffsets[9];\nuniform float halfDestPixelSize;\n#ifdef FINAL_DOWN_SAMPLER\n#include<packingFunctions>\n#endif\nvoid main()\n{\nvec4 color=vec4(0.0);\nfloat average=0.0;\nfor (int i=0; i<9; i++)\n{\ncolor=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);\naverage+=color.r;\n}\naverage/=9.0;\n#ifdef FINAL_DOWN_SAMPLER\ngl_FragColor=pack(average);\n#else\ngl_FragColor=vec4(average,average,0.0,1.0);\n#endif\n}\n#endif\n#if defined(HDR)\nuniform sampler2D textureAdderSampler;\nuniform float averageLuminance;\nvoid main()\n{\nvec4 color=texture2D(textureAdderSampler,vUV);\n#ifndef AUTO_EXPOSURE\nvec4 adjustedColor=color/averageLuminance;\ncolor=adjustedColor;\ncolor.a=1.0;\n#endif\ngl_FragColor=color;\n}\n#endif\n#if defined(LENS_FLARE)\n#define GHOSTS 3\nuniform sampler2D lensColorSampler;\nuniform float strength;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform vec2 resolution;\nuniform float distortionStrength;\nfloat hash(vec2 p)\n{\nfloat h=dot(p,vec2(127.1,311.7));\nreturn -1.0+2.0*fract(sin(h)*43758.5453123);\n}\nfloat noise(in vec2 p)\n{\nvec2 i=floor(p);\nvec2 f=fract(p);\nvec2 u=f*f*(3.0-2.0*f);\nreturn mix(mix(hash(i+vec2(0.0,0.0)),\nhash(i+vec2(1.0,0.0)),u.x),\nmix(hash(i+vec2(0.0,1.0)),\nhash(i+vec2(1.0,1.0)),u.x),u.y);\n}\nfloat fbm(vec2 p)\n{\nfloat f=0.0;\nf+=0.5000*noise(p); p*=2.02;\nf+=0.2500*noise(p); p*=2.03;\nf+=0.1250*noise(p); p*=2.01;\nf+=0.0625*noise(p); p*=2.04;\nf/=0.9375;\nreturn f;\n}\nvec3 pattern(vec2 uv)\n{\nvec2 p=-1.0+2.0*uv;\nfloat p2=dot(p,p);\nfloat f=fbm(vec2(15.0*p2))/2.0;\nfloat r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));\nfloat g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));\nfloat b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));\nreturn (1.0-f)*vec3(r,g,b);\n}\nfloat luminance(vec3 color)\n{\nreturn dot(color.rgb,vec3(0.2126,0.7152,0.0722));\n}\nvec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)\n{\nreturn vec4(\ntexture2D(tex,texcoord+direction*distortion.r).r,\ntexture2D(tex,texcoord+direction*distortion.g).g,\ntexture2D(tex,texcoord+direction*distortion.b).b,\n1.0\n);\n}\nvoid main(void)\n{\nvec2 uv=-vUV+vec2(1.0);\nvec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;\nvec2 texelSize=1.0/resolution;\nvec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);\nvec4 result=vec4(0.0);\nfloat ghostIndice=1.0;\nfor (int i=0; i<GHOSTS; ++i)\n{\nvec2 offset=fract(uv+ghostDir*ghostIndice);\nfloat weight=length(vec2(0.5)-offset)/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;\nghostIndice+=1.0;\n}\nvec2 haloVec=normalize(ghostDir)*haloWidth;\nfloat weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;\nresult*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));\ngl_FragColor=result;\n}\n#endif\n#if defined(LENS_FLARE_COMPOSE)\nuniform sampler2D otherSampler;\nuniform sampler2D lensDirtSampler;\nuniform sampler2D lensStarSampler;\nuniform mat4 lensStarMatrix;\nvoid main(void)\n{\nvec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;\nvec4 lensMod=texture2D(lensDirtSampler,vUV);\nlensMod+=texture2D(lensStarSampler,vUV);\nvec4 result=texture2D(textureSampler,vUV)*lensMod;\ngl_FragColor=texture2D(otherSampler,vUV)+result;\n}\n#endif\n#if defined(DEPTH_OF_FIELD)\nuniform sampler2D otherSampler;\nuniform sampler2D depthSampler;\nuniform float distance;\nvoid main(void)\n{\nvec4 sharp=texture2D(otherSampler,vUV);\nvec4 blur=texture2D(textureSampler,vUV);\nfloat dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);\nfloat factor=0.0;\nif (dist<0.05)\nfactor=1.0;\nelse if (dist<0.1)\nfactor=20.0*(0.1-dist);\nelse if (dist<0.5)\nfactor=0.0;\nelse\nfactor=2.0*(dist-0.5);\nfactor=clamp(factor,0.0,0.90);\ngl_FragColor=mix(sharp,blur,factor);\n}\n#endif\n#if defined(MOTION_BLUR)\nuniform mat4 inverseViewProjection;\nuniform mat4 prevViewProjection;\nuniform vec2 screenSize;\nuniform float motionScale;\nuniform float motionStrength;\nuniform sampler2D depthSampler;\nvoid main(void)\n{\nvec2 texelSize=1.0/screenSize;\nfloat depth=texture2D(depthSampler,vUV).r;\nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\ncpos=cpos*inverseViewProjection;\nvec4 ppos=cpos*prevViewProjection;\nppos.xyz/=ppos.w;\nppos.xy=ppos.xy*0.5+0.5;\nvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {\nif (i>=nSamples)\nbreak;\nvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\nresult+=texture2D(textureSampler,offset1);\n}\ngl_FragColor=result/float(nSamples);\n}\n#endif\n";var Gh=function(e){function t(t,i,n,r,o){void 0===r&&(r=null);var a=e.call(this,i.getEngine(),t)||this;return a.downSampleX4PostProcess=null,a.brightPassPostProcess=null,a.blurHPostProcesses=[],a.blurVPostProcesses=[],a.textureAdderPostProcess=null,a.volumetricLightPostProcess=null,a.volumetricLightSmoothXPostProcess=null,a.volumetricLightSmoothYPostProcess=null,a.volumetricLightMergePostProces=null,a.volumetricLightFinalPostProcess=null,a.luminancePostProcess=null,a.luminanceDownSamplePostProcesses=[],a.hdrPostProcess=null,a.textureAdderFinalPostProcess=null,a.lensFlareFinalPostProcess=null,a.hdrFinalPostProcess=null,a.lensFlarePostProcess=null,a.lensFlareComposePostProcess=null,a.motionBlurPostProcess=null,a.depthOfFieldPostProcess=null,a.fxaaPostProcess=null,a.screenSpaceReflectionPostProcess=null,a.brightThreshold=1,a.blurWidth=512,a.horizontalBlur=!1,a.lensTexture=null,a.volumetricLightCoefficient=.2,a.volumetricLightPower=4,a.volumetricLightBlurScale=64,a.sourceLight=null,a.hdrMinimumLuminance=1,a.hdrDecreaseRate=.5,a.hdrIncreaseRate=.5,a.lensColorTexture=null,a.lensFlareStrength=20,a.lensFlareGhostDispersal=1.4,a.lensFlareHaloWidth=.7,a.lensFlareDistortionStrength=16,a.lensFlareBlurWidth=512,a.lensStarTexture=null,a.lensFlareDirtTexture=null,a.depthOfFieldDistance=10,a.depthOfFieldBlurWidth=64,a.animations=[],a._currentDepthOfFieldSource=null,a._fixedExposure=1,a._currentExposure=1,a._hdrAutoExposure=!1,a._hdrCurrentLuminance=1,a._motionStrength=1,a._isObjectBasedMotionBlur=!1,a._camerasToBeAttached=[],a._bloomEnabled=!1,a._depthOfFieldEnabled=!1,a._vlsEnabled=!1,a._lensFlareEnabled=!1,a._hdrEnabled=!1,a._motionBlurEnabled=!1,a._fxaaEnabled=!1,a._screenSpaceReflectionsEnabled=!1,a._motionBlurSamples=64,a._volumetricLightStepsCount=50,a._samples=1,a._cameras=o||i.cameras,a._cameras=a._cameras.slice(),a._camerasToBeAttached=a._cameras.slice(),a._scene=i,a._basePostProcess=r,a._ratio=n,a._floatTextureType=i.getEngine().getCaps().textureFloatRender?g.a.TEXTURETYPE_FLOAT:g.a.TEXTURETYPE_HALF_FLOAT,i.postProcessRenderPipelineManager.addPipeline(a),a._buildPipeline(),a}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"exposure",{get:function(){return this._fixedExposure},set:function(e){this._fixedExposure=e,this._currentExposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hdrAutoExposure",{get:function(){return this._hdrAutoExposure},set:function(e){if(this._hdrAutoExposure=e,this.hdrPostProcess){var t=["#define HDR"];e&&t.push("#define AUTO_EXPOSURE"),this.hdrPostProcess.updateEffect(t.join("\n"))}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"motionStrength",{get:function(){return this._motionStrength},set:function(e){this._motionStrength=e,this._isObjectBasedMotionBlur&&this.motionBlurPostProcess&&(this.motionBlurPostProcess.motionStrength=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objectBasedMotionBlur",{get:function(){return this._isObjectBasedMotionBlur},set:function(e){var t=this._isObjectBasedMotionBlur!==e;this._isObjectBasedMotionBlur=e,t&&this._buildPipeline()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BloomEnabled",{get:function(){return this._bloomEnabled},set:function(e){this._bloomEnabled!==e&&(this._bloomEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DepthOfFieldEnabled",{get:function(){return this._depthOfFieldEnabled},set:function(e){this._depthOfFieldEnabled!==e&&(this._depthOfFieldEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LensFlareEnabled",{get:function(){return this._lensFlareEnabled},set:function(e){this._lensFlareEnabled!==e&&(this._lensFlareEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HDREnabled",{get:function(){return this._hdrEnabled},set:function(e){this._hdrEnabled!==e&&(this._hdrEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VLSEnabled",{get:function(){return this._vlsEnabled},set:function(e){if(this._vlsEnabled!==e){if(e&&!this._scene.enableGeometryBufferRenderer())return void m.a.Warn("Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline");this._vlsEnabled=e,this._buildPipeline()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"MotionBlurEnabled",{get:function(){return this._motionBlurEnabled},set:function(e){this._motionBlurEnabled!==e&&(this._motionBlurEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fxaaEnabled",{get:function(){return this._fxaaEnabled},set:function(e){this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenSpaceReflectionsEnabled",{get:function(){return this._screenSpaceReflectionsEnabled},set:function(e){this._screenSpaceReflectionsEnabled!==e&&(this._screenSpaceReflectionsEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volumetricLightStepsCount",{get:function(){return this._volumetricLightStepsCount},set:function(e){this.volumetricLightPostProcess&&this.volumetricLightPostProcess.updateEffect("#define VLS\n#define NB_STEPS "+e.toFixed(1)),this._volumetricLightStepsCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"motionBlurSamples",{get:function(){return this._motionBlurSamples},set:function(e){this.motionBlurPostProcess&&(this._isObjectBasedMotionBlur?this.motionBlurPostProcess.motionBlurSamples=e:this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+e.toFixed(1))),this._motionBlurSamples=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples!==e&&(this._samples=e,this._buildPipeline())},enumerable:!1,configurable:!0}),t.prototype._buildPipeline=function(){var e=this,t=this._ratio,i=this._scene;this._disposePostProcesses(),null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()),this._reset(),this._screenSpaceReflectionsEnabled&&(this.screenSpaceReflectionPostProcess=new kh("HDRPass",i,t,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1,this._floatTextureType),this.screenSpaceReflectionPostProcess.onApplyObservable.add(function(){e._currentDepthOfFieldSource=e.screenSpaceReflectionPostProcess}),this.addEffect(new sh(i.getEngine(),"HDRScreenSpaceReflections",function(){return e.screenSpaceReflectionPostProcess},!0))),this._basePostProcess?this.originalPostProcess=this._basePostProcess:this.originalPostProcess=new ci("HDRPass","standard",[],[],t,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1,"#define PASS_POST_PROCESS",this._floatTextureType),this.originalPostProcess.autoClear=!this.screenSpaceReflectionPostProcess,this.originalPostProcess.onApplyObservable.add(function(){e._currentDepthOfFieldSource=e.originalPostProcess}),this.addEffect(new sh(i.getEngine(),"HDRPassPostProcess",function(){return e.originalPostProcess},!0)),this._bloomEnabled&&(this._createDownSampleX4PostProcess(i,t/4),this._createBrightPassPostProcess(i,t/4),this._createBlurPostProcesses(i,t/4,1),this._createTextureAdderPostProcess(i,t),this.textureAdderFinalPostProcess=new ci("HDRDepthOfFieldSource","standard",[],[],t,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1,"#define PASS_POST_PROCESS",g.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new sh(i.getEngine(),"HDRBaseDepthOfFieldSource",function(){return e.textureAdderFinalPostProcess},!0))),this._vlsEnabled&&(this._createVolumetricLightPostProcess(i,t),this.volumetricLightFinalPostProcess=new ci("HDRVLSFinal","standard",[],[],t,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1,"#define PASS_POST_PROCESS",g.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new sh(i.getEngine(),"HDRVLSFinal",function(){return e.volumetricLightFinalPostProcess},!0))),this._lensFlareEnabled&&(this._createLensFlarePostProcess(i,t),this.lensFlareFinalPostProcess=new ci("HDRPostLensFlareDepthOfFieldSource","standard",[],[],t,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1,"#define PASS_POST_PROCESS",g.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new sh(i.getEngine(),"HDRPostLensFlareDepthOfFieldSource",function(){return e.lensFlareFinalPostProcess},!0))),this._hdrEnabled&&(this._createLuminancePostProcesses(i,this._floatTextureType),this._createHdrPostProcess(i,t),this.hdrFinalPostProcess=new ci("HDRPostHDReDepthOfFieldSource","standard",[],[],t,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1,"#define PASS_POST_PROCESS",g.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new sh(i.getEngine(),"HDRPostHDReDepthOfFieldSource",function(){return e.hdrFinalPostProcess},!0))),this._depthOfFieldEnabled&&(this._createBlurPostProcesses(i,t/2,3,"depthOfFieldBlurWidth"),this._createDepthOfFieldPostProcess(i,t)),this._motionBlurEnabled&&this._createMotionBlurPostProcess(i,t),this._fxaaEnabled&&(this.fxaaPostProcess=new Eh("fxaa",1,null,Ke.a.BILINEAR_SAMPLINGMODE,i.getEngine(),!1,g.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new sh(i.getEngine(),"HDRFxaa",function(){return e.fxaaPostProcess},!0))),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),!this._enableMSAAOnFirstPostProcess(this._samples)&&this._samples>1&&m.a.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")},t.prototype._createDownSampleX4PostProcess=function(e,t){var i=this,n=new Array(32);this.downSampleX4PostProcess=new ci("HDRDownSampleX4","standard",["dsOffsets"],[],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DOWN_SAMPLE_X4",this._floatTextureType),this.downSampleX4PostProcess.onApply=function(e){for(var t=0,r=i.downSampleX4PostProcess.width,o=i.downSampleX4PostProcess.height,a=-2;a<2;a++)for(var s=-2;s<2;s++)n[t]=(a+.5)*(1/r),n[t+1]=(s+.5)*(1/o),t+=2;e.setArray2("dsOffsets",n)},this.addEffect(new sh(e.getEngine(),"HDRDownSampleX4",function(){return i.downSampleX4PostProcess},!0))},t.prototype._createBrightPassPostProcess=function(e,t){var i=this,n=new Array(8);this.brightPassPostProcess=new ci("HDRBrightPass","standard",["dsOffsets","brightThreshold"],[],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define BRIGHT_PASS",this._floatTextureType),this.brightPassPostProcess.onApply=function(e){var t=1/i.brightPassPostProcess.width,r=1/i.brightPassPostProcess.height;n[0]=-.5*t,n[1]=.5*r,n[2]=.5*t,n[3]=.5*r,n[4]=-.5*t,n[5]=-.5*r,n[6]=.5*t,n[7]=-.5*r,e.setArray2("dsOffsets",n),e.setFloat("brightThreshold",i.brightThreshold)},this.addEffect(new sh(e.getEngine(),"HDRBrightPass",function(){return i.brightPassPostProcess},!0))},t.prototype._createBlurPostProcesses=function(e,t,i,n){var r=this;void 0===n&&(n="blurWidth");var o=e.getEngine(),s=new Gr("HDRBlurH_"+i,new a.d(1,0),this[n],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,this._floatTextureType),c=new Gr("HDRBlurV_"+i,new a.d(0,1),this[n],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,this._floatTextureType);s.onActivateObservable.add(function(){var e=s.width/o.getRenderWidth();s.kernel=r[n]*e}),c.onActivateObservable.add(function(){var e=c.height/o.getRenderHeight();c.kernel=r.horizontalBlur?64*e:r[n]*e}),this.addEffect(new sh(e.getEngine(),"HDRBlurH"+i,function(){return s},!0)),this.addEffect(new sh(e.getEngine(),"HDRBlurV"+i,function(){return c},!0)),this.blurHPostProcesses.push(s),this.blurVPostProcesses.push(c)},t.prototype._createTextureAdderPostProcess=function(e,t){var i=this;this.textureAdderPostProcess=new ci("HDRTextureAdder","standard",["exposure"],["otherSampler","lensSampler"],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define TEXTURE_ADDER",this._floatTextureType),this.textureAdderPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",i._vlsEnabled?i._currentDepthOfFieldSource:i.originalPostProcess),e.setTexture("lensSampler",i.lensTexture),e.setFloat("exposure",i._currentExposure),i._currentDepthOfFieldSource=i.textureAdderFinalPostProcess},this.addEffect(new sh(e.getEngine(),"HDRTextureAdder",function(){return i.textureAdderPostProcess},!0))},t.prototype._createVolumetricLightPostProcess=function(e,t){var i=this,n=e.enableGeometryBufferRenderer();n.enablePosition=!0;var r=n.getGBuffer();this.volumetricLightPostProcess=new ci("HDRVLS","standard",["shadowViewProjection","cameraPosition","sunDirection","sunColor","scatteringCoefficient","scatteringPower","depthValues"],["shadowMapSampler","positionSampler"],t/8,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLS\n#define NB_STEPS "+this._volumetricLightStepsCount.toFixed(1));var o=a.d.Zero();this.volumetricLightPostProcess.onApply=function(e){if(i.sourceLight&&i.sourceLight.getShadowGenerator()&&i._scene.activeCamera){var t=i.sourceLight.getShadowGenerator();e.setTexture("shadowMapSampler",t.getShadowMap()),e.setTexture("positionSampler",r.textures[2]),e.setColor3("sunColor",i.sourceLight.diffuse),e.setVector3("sunDirection",i.sourceLight.getShadowDirection()),e.setVector3("cameraPosition",i._scene.activeCamera.globalPosition),e.setMatrix("shadowViewProjection",t.getTransformMatrix()),e.setFloat("scatteringCoefficient",i.volumetricLightCoefficient),e.setFloat("scatteringPower",i.volumetricLightPower),o.x=i.sourceLight.getDepthMinZ(i._scene.activeCamera),o.y=i.sourceLight.getDepthMaxZ(i._scene.activeCamera),e.setVector2("depthValues",o)}},this.addEffect(new sh(e.getEngine(),"HDRVLS",function(){return i.volumetricLightPostProcess},!0)),this._createBlurPostProcesses(e,t/4,0,"volumetricLightBlurScale"),this.volumetricLightMergePostProces=new ci("HDRVLSMerge","standard",[],["originalSampler"],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLSMERGE"),this.volumetricLightMergePostProces.onApply=function(e){e.setTextureFromPostProcess("originalSampler",i._bloomEnabled?i.textureAdderFinalPostProcess:i.originalPostProcess),i._currentDepthOfFieldSource=i.volumetricLightFinalPostProcess},this.addEffect(new sh(e.getEngine(),"HDRVLSMerge",function(){return i.volumetricLightMergePostProces},!0))},t.prototype._createLuminancePostProcesses=function(e,i){var n=this,r=Math.pow(3,t.LuminanceSteps);this.luminancePostProcess=new ci("HDRLuminance","standard",["lumOffsets"],[],{width:r,height:r},null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LUMINANCE",i);var o=[];this.luminancePostProcess.onApply=function(e){var t=1/n.luminancePostProcess.width,i=1/n.luminancePostProcess.height;o[0]=-.5*t,o[1]=.5*i,o[2]=.5*t,o[3]=.5*i,o[4]=-.5*t,o[5]=-.5*i,o[6]=.5*t,o[7]=-.5*i,e.setArray2("lumOffsets",o)},this.addEffect(new sh(e.getEngine(),"HDRLuminance",function(){return n.luminancePostProcess},!0));for(var s=t.LuminanceSteps-1;s>=0;s--){r=Math.pow(3,s);var c="#define LUMINANCE_DOWN_SAMPLE\n";0===s&&(c+="#define FINAL_DOWN_SAMPLER");var l=new ci("HDRLuminanceDownSample"+s,"standard",["dsOffsets","halfDestPixelSize"],[],{width:r,height:r},null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,c,i);this.luminanceDownSamplePostProcesses.push(l)}var u=this.luminancePostProcess;this.luminanceDownSamplePostProcesses.forEach(function(t,i){var r=new Array(18);t.onApply=function(e){if(u){for(var o=0,a=-1;a<2;a++)for(var s=-1;s<2;s++)r[o]=a/u.width,r[o+1]=s/u.height,o+=2;e.setArray2("dsOffsets",r),e.setFloat("halfDestPixelSize",.5/u.width),u=i===n.luminanceDownSamplePostProcesses.length-1?n.luminancePostProcess:t}},i===n.luminanceDownSamplePostProcesses.length-1&&(t.onAfterRender=function(){var t=e.getEngine().readPixels(0,0,1,1),i=new a.f(1/16581375,1/65025,1/255,1);n._hdrCurrentLuminance=(t[0]*i.x+t[1]*i.y+t[2]*i.z+t[3]*i.w)/100}),n.addEffect(new sh(e.getEngine(),"HDRLuminanceDownSample"+i,function(){return t},!0))})},t.prototype._createHdrPostProcess=function(e,t){var i=this,n=["#define HDR"];this._hdrAutoExposure&&n.push("#define AUTO_EXPOSURE"),this.hdrPostProcess=new ci("HDR","standard",["averageLuminance"],["textureAdderSampler"],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,n.join("\n"),g.a.TEXTURETYPE_UNSIGNED_INT);var r=1,o=0,a=0;this.hdrPostProcess.onApply=function(t){if(t.setTextureFromPostProcess("textureAdderSampler",i._currentDepthOfFieldSource),o+=e.getEngine().getDeltaTime(),r<0)r=i._hdrCurrentLuminance;else{var n=(a-o)/1e3;i._hdrCurrentLuminance<r+i.hdrDecreaseRate*n?r+=i.hdrDecreaseRate*n:i._hdrCurrentLuminance>r-i.hdrIncreaseRate*n?r-=i.hdrIncreaseRate*n:r=i._hdrCurrentLuminance}i.hdrAutoExposure?i._currentExposure=i._fixedExposure/r:(r=L.a.Clamp(r,i.hdrMinimumLuminance,1e20),t.setFloat("averageLuminance",r)),a=o,i._currentDepthOfFieldSource=i.hdrFinalPostProcess},this.addEffect(new sh(e.getEngine(),"HDR",function(){return i.hdrPostProcess},!0))},t.prototype._createLensFlarePostProcess=function(e,t){var i=this;this.lensFlarePostProcess=new ci("HDRLensFlare","standard",["strength","ghostDispersal","haloWidth","resolution","distortionStrength"],["lensColorSampler"],t/2,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE",g.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new sh(e.getEngine(),"HDRLensFlare",function(){return i.lensFlarePostProcess},!0)),this._createBlurPostProcesses(e,t/4,2,"lensFlareBlurWidth"),this.lensFlareComposePostProcess=new ci("HDRLensFlareCompose","standard",["lensStarMatrix"],["otherSampler","lensDirtSampler","lensStarSampler"],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE_COMPOSE",g.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new sh(e.getEngine(),"HDRLensFlareCompose",function(){return i.lensFlareComposePostProcess},!0));var n=new a.d(0,0);this.lensFlarePostProcess.onApply=function(e){e.setTextureFromPostProcess("textureSampler",i._bloomEnabled?i.blurHPostProcesses[0]:i.originalPostProcess),e.setTexture("lensColorSampler",i.lensColorTexture),e.setFloat("strength",i.lensFlareStrength),e.setFloat("ghostDispersal",i.lensFlareGhostDispersal),e.setFloat("haloWidth",i.lensFlareHaloWidth),n.x=i.lensFlarePostProcess.width,n.y=i.lensFlarePostProcess.height,e.setVector2("resolution",n),e.setFloat("distortionStrength",i.lensFlareDistortionStrength)};var r=a.a.FromValues(2,0,-1,0,0,2,-1,0,0,0,1,0,0,0,0,1),o=a.a.FromValues(.5,0,.5,0,0,.5,.5,0,0,0,1,0,0,0,0,1);this.lensFlareComposePostProcess.onApply=function(e){if(i._scene.activeCamera){e.setTextureFromPostProcess("otherSampler",i.lensFlarePostProcess),e.setTexture("lensDirtSampler",i.lensFlareDirtTexture),e.setTexture("lensStarSampler",i.lensStarTexture);var t=i._scene.activeCamera.getViewMatrix().getRow(0),n=i._scene.activeCamera.getViewMatrix().getRow(2),s=a.e.Dot(t.toVector3(),new a.e(1,0,0))+a.e.Dot(n.toVector3(),new a.e(0,0,1));s*=4;var c=a.a.FromValues(.5*Math.cos(s),-Math.sin(s),0,0,Math.sin(s),.5*Math.cos(s),0,0,0,0,1,0,0,0,0,1),l=o.multiply(c).multiply(r);e.setMatrix("lensStarMatrix",l),i._currentDepthOfFieldSource=i.lensFlareFinalPostProcess}}},t.prototype._createDepthOfFieldPostProcess=function(e,t){var i=this;this.depthOfFieldPostProcess=new ci("HDRDepthOfField","standard",["distance"],["otherSampler","depthSampler"],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DEPTH_OF_FIELD",g.a.TEXTURETYPE_UNSIGNED_INT),this.depthOfFieldPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",i._currentDepthOfFieldSource),e.setTexture("depthSampler",i._getDepthTexture()),e.setFloat("distance",i.depthOfFieldDistance)},this.addEffect(new sh(e.getEngine(),"HDRDepthOfField",function(){return i.depthOfFieldPostProcess},!0))},t.prototype._createMotionBlurPostProcess=function(e,t){var i=this;if(this._isObjectBasedMotionBlur){var n=new xh("HDRMotionBlur",e,t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,g.a.TEXTURETYPE_UNSIGNED_INT);n.motionStrength=this.motionStrength,n.motionBlurSamples=this.motionBlurSamples,this.motionBlurPostProcess=n}else{this.motionBlurPostProcess=new ci("HDRMotionBlur","standard",["inverseViewProjection","prevViewProjection","screenSize","motionScale","motionStrength"],["depthSampler"],t,null,Ke.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+this.motionBlurSamples.toFixed(1),g.a.TEXTURETYPE_UNSIGNED_INT);var r=0,o=a.a.Identity(),s=a.a.Identity(),c=a.a.Identity(),l=a.d.Zero();this.motionBlurPostProcess.onApply=function(t){(c=e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(s),t.setMatrix("inverseViewProjection",s),t.setMatrix("prevViewProjection",o),o=c,l.x=i.motionBlurPostProcess.width,l.y=i.motionBlurPostProcess.height,t.setVector2("screenSize",l),r=e.getEngine().getFps()/60,t.setFloat("motionScale",r),t.setFloat("motionStrength",i.motionStrength),t.setTexture("depthSampler",i._getDepthTexture())}}this.addEffect(new sh(e.getEngine(),"HDRMotionBlur",function(){return i.motionBlurPostProcess},!0))},t.prototype._getDepthTexture=function(){return this._scene.getEngine().getCaps().drawBuffersExtension?this._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]:this._scene.enableDepthRenderer().getDepthMap()},t.prototype._disposePostProcesses=function(){for(var e=0;e<this._cameras.length;e++){var t=this._cameras[e];this.originalPostProcess&&this.originalPostProcess.dispose(t),this.screenSpaceReflectionPostProcess&&this.screenSpaceReflectionPostProcess.dispose(t),this.downSampleX4PostProcess&&this.downSampleX4PostProcess.dispose(t),this.brightPassPostProcess&&this.brightPassPostProcess.dispose(t),this.textureAdderPostProcess&&this.textureAdderPostProcess.dispose(t),this.volumetricLightPostProcess&&this.volumetricLightPostProcess.dispose(t),this.volumetricLightSmoothXPostProcess&&this.volumetricLightSmoothXPostProcess.dispose(t),this.volumetricLightSmoothYPostProcess&&this.volumetricLightSmoothYPostProcess.dispose(t),this.volumetricLightMergePostProces&&this.volumetricLightMergePostProces.dispose(t),this.volumetricLightFinalPostProcess&&this.volumetricLightFinalPostProcess.dispose(t),this.lensFlarePostProcess&&this.lensFlarePostProcess.dispose(t),this.lensFlareComposePostProcess&&this.lensFlareComposePostProcess.dispose(t);for(var i=0;i<this.luminanceDownSamplePostProcesses.length;i++)this.luminanceDownSamplePostProcesses[i].dispose(t);for(this.luminancePostProcess&&this.luminancePostProcess.dispose(t),this.hdrPostProcess&&this.hdrPostProcess.dispose(t),this.hdrFinalPostProcess&&this.hdrFinalPostProcess.dispose(t),this.depthOfFieldPostProcess&&this.depthOfFieldPostProcess.dispose(t),this.motionBlurPostProcess&&this.motionBlurPostProcess.dispose(t),this.fxaaPostProcess&&this.fxaaPostProcess.dispose(t),i=0;i<this.blurHPostProcesses.length;i++)this.blurHPostProcesses[i].dispose(t);for(i=0;i<this.blurVPostProcesses.length;i++)this.blurVPostProcesses[i].dispose(t)}this.originalPostProcess=null,this.downSampleX4PostProcess=null,this.brightPassPostProcess=null,this.textureAdderPostProcess=null,this.textureAdderFinalPostProcess=null,this.volumetricLightPostProcess=null,this.volumetricLightSmoothXPostProcess=null,this.volumetricLightSmoothYPostProcess=null,this.volumetricLightMergePostProces=null,this.volumetricLightFinalPostProcess=null,this.lensFlarePostProcess=null,this.lensFlareComposePostProcess=null,this.luminancePostProcess=null,this.hdrPostProcess=null,this.hdrFinalPostProcess=null,this.depthOfFieldPostProcess=null,this.motionBlurPostProcess=null,this.fxaaPostProcess=null,this.screenSpaceReflectionPostProcess=null,this.luminanceDownSamplePostProcesses=[],this.blurHPostProcesses=[],this.blurVPostProcesses=[]},t.prototype.dispose=function(){this._disposePostProcesses(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),e.prototype.dispose.call(this)},t.prototype.serialize=function(){var e=w.a.Serialize(this);return this.sourceLight&&(e.sourceLightId=this.sourceLight.id),this.screenSpaceReflectionPostProcess&&(e.screenSpaceReflectionPostProcess=w.a.Serialize(this.screenSpaceReflectionPostProcess)),e.customType="StandardRenderingPipeline",e},t.Parse=function(e,i,n){var r=w.a.Parse(function(){return new t(e._name,i,e._ratio)},e,i,n);return e.sourceLightId&&(r.sourceLight=i.getLightByID(e.sourceLightId)),e.screenSpaceReflectionPostProcess&&w.a.Parse(function(){return r.screenSpaceReflectionPostProcess},e.screenSpaceReflectionPostProcess,i,n),r},t.LuminanceSteps=6,Object(h.c)([Object(w.c)()],t.prototype,"brightThreshold",void 0),Object(h.c)([Object(w.c)()],t.prototype,"blurWidth",void 0),Object(h.c)([Object(w.c)()],t.prototype,"horizontalBlur",void 0),Object(h.c)([Object(w.c)()],t.prototype,"exposure",null),Object(h.c)([Object(w.m)("lensTexture")],t.prototype,"lensTexture",void 0),Object(h.c)([Object(w.c)()],t.prototype,"volumetricLightCoefficient",void 0),Object(h.c)([Object(w.c)()],t.prototype,"volumetricLightPower",void 0),Object(h.c)([Object(w.c)()],t.prototype,"volumetricLightBlurScale",void 0),Object(h.c)([Object(w.c)()],t.prototype,"hdrMinimumLuminance",void 0),Object(h.c)([Object(w.c)()],t.prototype,"hdrDecreaseRate",void 0),Object(h.c)([Object(w.c)()],t.prototype,"hdrIncreaseRate",void 0),Object(h.c)([Object(w.c)()],t.prototype,"hdrAutoExposure",null),Object(h.c)([Object(w.m)("lensColorTexture")],t.prototype,"lensColorTexture",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lensFlareStrength",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lensFlareGhostDispersal",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lensFlareHaloWidth",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lensFlareDistortionStrength",void 0),Object(h.c)([Object(w.c)()],t.prototype,"lensFlareBlurWidth",void 0),Object(h.c)([Object(w.m)("lensStarTexture")],t.prototype,"lensStarTexture",void 0),Object(h.c)([Object(w.m)("lensFlareDirtTexture")],t.prototype,"lensFlareDirtTexture",void 0),Object(h.c)([Object(w.c)()],t.prototype,"depthOfFieldDistance",void 0),Object(h.c)([Object(w.c)()],t.prototype,"depthOfFieldBlurWidth",void 0),Object(h.c)([Object(w.c)()],t.prototype,"motionStrength",null),Object(h.c)([Object(w.c)()],t.prototype,"objectBasedMotionBlur",null),Object(h.c)([Object(w.c)()],t.prototype,"_ratio",void 0),Object(h.c)([Object(w.c)()],t.prototype,"BloomEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"DepthOfFieldEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"LensFlareEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"HDREnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"VLSEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"MotionBlurEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"fxaaEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"screenSpaceReflectionsEnabled",null),Object(h.c)([Object(w.c)()],t.prototype,"volumetricLightStepsCount",null),Object(h.c)([Object(w.c)()],t.prototype,"motionBlurSamples",null),Object(h.c)([Object(w.c)()],t.prototype,"samples",null),t}(Ih);c.a.RegisteredTypes["BABYLON.StandardRenderingPipeline"]=Gh;ai.a.ShadersStore.stereoscopicInterlacePixelShader="const vec3 TWO=vec3(2.0,2.0,2.0);\nvarying vec2 vUV;\nuniform sampler2D camASampler;\nuniform sampler2D textureSampler;\nuniform vec2 stepSize;\nvoid main(void)\n{\nbool useCamA;\nbool useCamB;\nvec2 texCoord1;\nvec2 texCoord2;\nvec3 frag1;\nvec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;\nuseCamA=!useCamB;\ntexCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);\ntexCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\n#ifdef IS_STEREOSCOPIC_INTERLACED\nfloat rowNum=floor(vUV.y/stepSize.y);\nuseCamA=mod(rowNum,2.0) == 1.0;\nuseCamB=mod(rowNum,2.0) == 0.0;\ntexCoord1=vec2(vUV.x,vUV.y);\ntexCoord2=vec2(vUV.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;\nuseCamA=!useCamB;\ntexCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);\ntexCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n#endif\n\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else if (useCamA){\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}else {\ndiscard;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}\n";var zh,jh=function(e){function t(t,i,n,r,o,s,c){var l=e.call(this,t,"stereoscopicInterlace",["stepSize"],["camASampler"],1,i[1],o,s,c,r?"#define IS_STEREOSCOPIC_INTERLACED 1":n?"#define IS_STEREOSCOPIC_HORIZ 1":void 0)||this;return l._passedProcess=i[0]._rigPostProcess,l._stepSize=new a.d(1/l.width,1/l.height),l.onSizeChangedObservable.add(function(){l._stepSize=new a.d(1/l.width,1/l.height)}),l.onApplyObservable.add(function(e){e.setTextureFromPostProcess("camASampler",l._passedProcess),e.setFloat2("stepSize",l._stepSize.x,l._stepSize.y)}),l}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"StereoscopicInterlacePostProcessI"},t}(ci),Wh=function(e){function t(t,i,n,r,o,s){var c=e.call(this,t,"stereoscopicInterlace",["stepSize"],["camASampler"],1,i[1],r,o,s,n?"#define IS_STEREOSCOPIC_HORIZ 1":void 0)||this;return c._passedProcess=i[0]._rigPostProcess,c._stepSize=new a.d(1/c.width,1/c.height),c.onSizeChangedObservable.add(function(){c._stepSize=new a.d(1/c.width,1/c.height)}),c.onApplyObservable.add(function(e){e.setTextureFromPostProcess("camASampler",c._passedProcess),e.setFloat2("stepSize",c._stepSize.x,c._stepSize.y)}),c}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"StereoscopicInterlacePostProcess"},t}(ci);ai.a.ShadersStore.tonemapPixelShader="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform float _ExposureAdjustment;\n#if defined(HABLE_TONEMAPPING)\nconst float A=0.15;\nconst float B=0.50;\nconst float C=0.10;\nconst float D=0.20;\nconst float E=0.02;\nconst float F=0.30;\nconst float W=11.2;\n#endif\nfloat Luminance(vec3 c)\n{\nreturn dot(c,vec3(0.22,0.707,0.071));\n}\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nfloat lum=Luminance(colour.rgb);\nfloat lumTm=lum*_ExposureAdjustment;\nfloat scale=lumTm/(1.0+lumTm);\ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nconst float ExposureBias=2.0;\nvec3 x=ExposureBias*colour;\nvec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\nx=vec3(W,W,W);\nvec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);\ncolour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour=vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);\n#endif\ngl_FragColor=vec4(colour.rgb,1.0);\n}",function(e){e[e.Hable=0]="Hable",e[e.Reinhard=1]="Reinhard",e[e.HejiDawson=2]="HejiDawson",e[e.Photographic=3]="Photographic"}(zh||(zh={}));var Hh=function(e){function t(t,i,n,r,o,a,s){void 0===o&&(o=g.a.TEXTURE_BILINEAR_SAMPLINGMODE),void 0===s&&(s=g.a.TEXTURETYPE_UNSIGNED_INT);var c=e.call(this,t,"tonemap",["_ExposureAdjustment"],null,1,r,o,a,!0,null,s)||this;c._operator=i,c.exposureAdjustment=n;var l="#define ";return c._operator===zh.Hable?l+="HABLE_TONEMAPPING":c._operator===zh.Reinhard?l+="REINHARD_TONEMAPPING":c._operator===zh.HejiDawson?l+="OPTIMIZED_HEJIDAWSON_TONEMAPPING":c._operator===zh.Photographic&&(l+="PHOTOGRAPHIC_TONEMAPPING"),c.updateEffect(l),c.onApply=function(e){e.setFloat("_ExposureAdjustment",c.exposureAdjustment)},c}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"TonemapPostProcess"},t}(ci);ai.a.ShadersStore.volumetricLightScatteringPixelShader="uniform sampler2D textureSampler;\nuniform sampler2D lightScatteringSampler;\nuniform float decay;\nuniform float exposure;\nuniform float weight;\nuniform float density;\nuniform vec2 meshPositionOnScreen;\nvarying vec2 vUV;\nvoid main(void) {\nvec2 tc=vUV;\nvec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);\ndeltaTexCoord*=1.0/float(NUM_SAMPLES)*density;\nfloat illuminationDecay=1.0;\nvec4 color=texture2D(lightScatteringSampler,tc)*0.4;\nfor(int i=0; i<NUM_SAMPLES; i++) {\ntc-=deltaTexCoord;\nvec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;\ndataSample*=illuminationDecay*weight;\ncolor+=dataSample;\nilluminationDecay*=decay;\n}\nvec4 realColor=texture2D(textureSampler,vUV);\ngl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),1))+(realColor*(1.5-0.4)));\n}\n";ai.a.ShadersStore.volumetricLightScatteringPassVertexShader="\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV1)\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n";ai.a.ShadersStore.volumetricLightScatteringPassPixelShader="#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\n#endif\n#if defined(ALPHATEST)\nuniform sampler2D diffuseSampler;\n#endif\nvoid main(void)\n{\n#if defined(ALPHATEST)\nvec4 diffuseColor=texture2D(diffuseSampler,vUV);\nif (diffuseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\n}\n";var Xh=function(e){function t(i,n,r,o,s,c,l,u,h){void 0===s&&(s=100),void 0===c&&(c=Ke.a.BILINEAR_SAMPLINGMODE);var d=e.call(this,i,"volumetricLightScattering",["decay","exposure","weight","meshPositionOnScreen","density"],["lightScatteringSampler"],n.postProcessRatio||n,r,c,l,u,"#define NUM_SAMPLES "+s)||this;return d._screenCoordinates=a.d.Zero(),d.customMeshPosition=a.e.Zero(),d.useCustomMeshPosition=!1,d.invert=!0,d.excludedMeshes=new Array,d.exposure=.3,d.decay=.96815,d.weight=.58767,d.density=.926,l=(h=null===r?h:r.getScene()).getEngine(),d._viewPort=new mi.a(0,0,1,1).toGlobal(l.getRenderWidth(),l.getRenderHeight()),d.mesh=null!==o?o:t.CreateDefaultMesh("VolumetricLightScatteringMesh",h),d._createPass(h,n.passRatio||n),d.onActivate=function(e){d.isSupported||d.dispose(e),d.onActivate=null},d.onApplyObservable.add(function(e){d._updateMeshScreenCoordinates(h),e.setTexture("lightScatteringSampler",d._volumetricLightScatteringRTT),e.setFloat("exposure",d.exposure),e.setFloat("decay",d.decay),e.setFloat("weight",d.weight),e.setFloat("density",d.density),e.setVector2("meshPositionOnScreen",d._screenCoordinates)}),d}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"useDiffuseColor",{get:function(){return m.a.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"),!1},set:function(e){m.a.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead")},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"VolumetricLightScatteringPostProcess"},t.prototype._isReady=function(e,t){var i=e.getMesh();if(i===this.mesh&&i.material)return i.material.isReady(i);var n=[],r=[ji.b.PositionKind],o=e.getMaterial();o&&(o.needAlphaTesting()&&n.push("#define ALPHATEST"),i.isVerticesDataPresent(ji.b.UVKind)&&(r.push(ji.b.UVKind),n.push("#define UV1")),i.isVerticesDataPresent(ji.b.UV2Kind)&&(r.push(ji.b.UV2Kind),n.push("#define UV2"))),i.useBones&&i.computeBonesUsingShaders?(r.push(ji.b.MatricesIndicesKind),r.push(ji.b.MatricesWeightsKind),n.push("#define NUM_BONE_INFLUENCERS "+i.numBoneInfluencers),n.push("#define BonesPerMesh "+(i.skeleton?i.skeleton.bones.length+1:0))):n.push("#define NUM_BONE_INFLUENCERS 0"),t&&(n.push("#define INSTANCES"),Hr.a.PushAttributesForInstances(r),e.getRenderingMesh().hasThinInstances&&n.push("#define THIN_INSTANCES"));var a=n.join("\n");return this._cachedDefines!==a&&(this._cachedDefines=a,this._volumetricLightScatteringPass=i.getScene().getEngine().createEffect("volumetricLightScatteringPass",r,["world","mBones","viewProjection","diffuseMatrix"],["diffuseSampler"],a,void 0,void 0,void 0,{maxSimultaneousMorphTargets:i.numBoneInfluencers})),this._volumetricLightScatteringPass.isReady()},t.prototype.setCustomMeshPosition=function(e){this.customMeshPosition=e},t.prototype.getCustomMeshPosition=function(){return this.customMeshPosition},t.prototype.dispose=function(t){var i=t.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);-1!==i&&t.getScene().customRenderTargets.splice(i,1),this._volumetricLightScatteringRTT.dispose(),e.prototype.dispose.call(this,t)},t.prototype.getPass=function(){return this._volumetricLightScatteringRTT},t.prototype._meshExcluded=function(e){return this.excludedMeshes.length>0&&-1!==this.excludedMeshes.indexOf(e)},t.prototype._createPass=function(e,t){var i=this,n=e.getEngine();this._volumetricLightScatteringRTT=new Ri("volumetricLightScatteringMap",{width:n.getRenderWidth()*t,height:n.getRenderHeight()*t},e,!1,!0,g.a.TEXTURETYPE_UNSIGNED_INT),this._volumetricLightScatteringRTT.wrapU=Ke.a.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.renderList=null,this._volumetricLightScatteringRTT.renderParticles=!1,this._volumetricLightScatteringRTT.ignoreCameraViewport=!0;var r=this.getCamera();r?r.customRenderTargets.push(this._volumetricLightScatteringRTT):e.customRenderTargets.push(this._volumetricLightScatteringRTT);var o,a=function(e){var t=e.getRenderingMesh(),n=e.getEffectiveMesh();if(!i._meshExcluded(t)){n._internalAbstractMeshDataInfo._isActiveIntermediate=!1;var r=e.getMaterial();if(r){var o=t.getScene(),a=o.getEngine();a.setState(r.backFaceCulling);var s=t._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(!s.mustReturn){var c=a.getCaps().instancedArrays&&(null!==s.visibleInstances[e._id]||t.hasThinInstances);if(i._isReady(e,c)){var l=i._volumetricLightScatteringPass;if(t===i.mesh&&(l=e.effect?e.effect:r.getEffect()),a.enableEffect(l),t._bind(e,l,r.fillMode),t===i.mesh)r.bind(n.getWorldMatrix(),t);else{if(i._volumetricLightScatteringPass.setMatrix("viewProjection",o.getTransformMatrix()),r&&r.needAlphaTesting()){var u=r.getAlphaTestTexture();i._volumetricLightScatteringPass.setTexture("diffuseSampler",u),u&&i._volumetricLightScatteringPass.setMatrix("diffuseMatrix",u.getTextureMatrix())}t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&i._volumetricLightScatteringPass.setMatrices("mBones",t.skeleton.getTransformMatrices(t))}t._processRendering(n,e,i._volumetricLightScatteringPass,lo.a.TriangleFillMode,s,c,function(e,t){return l.setMatrix("world",t)})}}}}},c=new s.b(0,0,0,1);this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function(){o=e.clearColor,e.clearColor=c}),this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function(){e.clearColor=o}),this._volumetricLightScatteringRTT.customRenderFunction=function(t,i,n,r){var o,s=e.getEngine();if(r.length){for(s.setColorWrite(!1),o=0;o<r.length;o++)a(r.data[o]);s.setColorWrite(!0)}for(o=0;o<t.length;o++)a(t.data[o]);for(o=0;o<i.length;o++)a(i.data[o]);if(n.length){for(o=0;o<n.length;o++){var c=n.data[o],l=c.getBoundingInfo();l&&e.activeCamera&&(c._alphaIndex=c.getMesh().alphaIndex,c._distanceToCamera=l.boundingSphere.centerWorld.subtract(e.activeCamera.position).length())}var u=n.data.slice(0,n.length);for(u.sort(function(e,t){return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0}),s.setAlphaMode(g.a.ALPHA_COMBINE),o=0;o<u.length;o++)a(u[o]);s.setAlphaMode(g.a.ALPHA_DISABLE)}}},t.prototype._updateMeshScreenCoordinates=function(e){var t,i=e.getTransformMatrix();t=this.useCustomMeshPosition?this.customMeshPosition:this.attachedNode?this.attachedNode.position:this.mesh.parent?this.mesh.getAbsolutePosition():this.mesh.position;var n=a.e.Project(t,a.a.Identity(),i,this._viewPort);this._screenCoordinates.x=n.x/this._viewPort.width,this._screenCoordinates.y=n.y/this._viewPort.height,this.invert&&(this._screenCoordinates.y=1-this._screenCoordinates.y)},t.CreateDefaultMesh=function(e,t){var i=be.a.CreatePlane(e,1,t);i.billboardMode=ze.a.BILLBOARDMODE_ALL;var n=new Ui.a(e+"Material",t);return n.emissiveColor=new s.a(1,1,1),i.material=n,i},Object(h.c)([Object(w.o)()],t.prototype,"customMeshPosition",void 0),Object(h.c)([Object(w.c)()],t.prototype,"useCustomMeshPosition",void 0),Object(h.c)([Object(w.c)()],t.prototype,"invert",void 0),Object(h.c)([Object(w.k)()],t.prototype,"mesh",void 0),Object(h.c)([Object(w.c)()],t.prototype,"excludedMeshes",void 0),Object(h.c)([Object(w.c)()],t.prototype,"exposure",void 0),Object(h.c)([Object(w.c)()],t.prototype,"decay",void 0),Object(h.c)([Object(w.c)()],t.prototype,"weight",void 0),Object(h.c)([Object(w.c)()],t.prototype,"density",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.VolumetricLightScatteringPostProcess"]=Xh;ai.a.ShadersStore.screenSpaceCurvaturePixelShader="\n\nprecision highp float;\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D normalSampler;\nuniform float curvature_ridge;\nuniform float curvature_valley;\n#ifndef CURVATURE_OFFSET\n#define CURVATURE_OFFSET 1\n#endif\nfloat curvature_soft_clamp(float curvature,float control)\n{\nif (curvature<0.5/control)\nreturn curvature*(1.0-curvature*control);\nreturn 0.25/control;\n}\nfloat calculate_curvature(ivec2 texel,float ridge,float valley)\n{\nvec2 normal_up=texelFetchOffset(normalSampler,texel,0,ivec2(0,CURVATURE_OFFSET)).rb;\nvec2 normal_down=texelFetchOffset(normalSampler,texel,0,ivec2(0,-CURVATURE_OFFSET)).rb;\nvec2 normal_left=texelFetchOffset(normalSampler,texel,0,ivec2(-CURVATURE_OFFSET,0)).rb;\nvec2 normal_right=texelFetchOffset(normalSampler,texel,0,ivec2( CURVATURE_OFFSET,0)).rb;\nfloat normal_diff=((normal_up.g-normal_down.g)+(normal_right.r-normal_left.r));\nif (normal_diff<0.0)\nreturn -2.0*curvature_soft_clamp(-normal_diff,valley);\nreturn 2.0*curvature_soft_clamp(normal_diff,ridge);\n}\nvoid main(void)\n{\nivec2 texel=ivec2(gl_FragCoord.xy);\nvec4 baseColor=texture2D(textureSampler,vUV);\nfloat curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);\nbaseColor.rgb*=curvature+1.0;\ngl_FragColor=baseColor;\n}";var Yh=function(e){function t(t,i,n,r,o,a,s,c,l){void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1);var u=e.call(this,t,"screenSpaceCurvature",["curvature_ridge","curvature_valley"],["textureSampler","normalSampler"],n,r,o,a,s,void 0,c,void 0,null,l)||this;return u.ridge=1,u.valley=1,u._geometryBufferRenderer=i.enableGeometryBufferRenderer(),u._geometryBufferRenderer?u.onApply=function(e){e.setFloat("curvature_ridge",.5/Math.max(u.ridge*u.ridge,1e-4)),e.setFloat("curvature_valley",.7/Math.max(u.valley*u.valley,1e-4));var t=u._geometryBufferRenderer.getGBuffer().textures[1];e.setTexture("normalSampler",t)}:m.a.Error("Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first."),u}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"ScreenSpaceCurvaturePostProcess"},Object.defineProperty(t,"IsSupported",{get:function(){var e=x.a.LastCreatedEngine;return!!e&&(e.webGLVersion>1||e.getCaps().drawBuffersExtension)},enumerable:!1,configurable:!0}),t._Parse=function(e,i,n,r){return w.a.Parse(function(){return new t(e.name,n,e.options,i,e.renderTargetSamplingMode,n.getEngine(),e.textureType,e.reusable)},e,n,r)},Object(h.c)([Object(w.c)()],t.prototype,"ridge",void 0),Object(h.c)([Object(w.c)()],t.prototype,"valley",void 0),t}(ci);c.a.RegisteredTypes["BABYLON.ScreenSpaceCurvaturePostProcess"]=Yh,i(166),i(167),Object.defineProperty(Q.a.prototype,"forceShowBoundingBoxes",{get:function(){return this._forceShowBoundingBoxes||!1},set:function(e){this._forceShowBoundingBoxes=e,e&&this.getBoundingBoxRenderer()},enumerable:!0,configurable:!0}),Q.a.prototype.getBoundingBoxRenderer=function(){return this._boundingBoxRenderer||(this._boundingBoxRenderer=new Kh(this)),this._boundingBoxRenderer},Object.defineProperty(ze.a.prototype,"showBoundingBox",{get:function(){return this._showBoundingBox||!1},set:function(e){this._showBoundingBox=e,e&&this.getScene().getBoundingBoxRenderer()},enumerable:!0,configurable:!0});var Kh=function(){function e(e){this.name=Me.a.NAME_BOUNDINGBOXRENDERER,this.frontColor=new s.a(1,1,1),this.backColor=new s.a(.1,.1,.1),this.showBackLines=!0,this.onBeforeBoxRenderingObservable=new o.c,this.onAfterBoxRenderingObservable=new o.c,this.onResourcesReadyObservable=new o.c,this.enabled=!0,this.renderList=new oi.a(32),this._vertexBuffers={},this._fillIndexBuffer=null,this._fillIndexData=null,this.scene=e,e._addComponent(this)}return e.prototype.register=function(){this.scene._beforeEvaluateActiveMeshStage.registerStep(Me.a.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER,this,this.reset),this.scene._preActiveMeshStage.registerStep(Me.a.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER,this,this._preActiveMesh),this.scene._evaluateSubMeshStage.registerStep(Me.a.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER,this,this._evaluateSubMesh),this.scene._afterRenderingGroupDrawStage.registerStep(Me.a.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER,this,this.render)},e.prototype._evaluateSubMesh=function(e,t){if(e.showSubMeshesBoundingBox){var i=t.getBoundingInfo();null!=i&&(i.boundingBox._tag=e.renderingGroupId,this.renderList.push(i.boundingBox))}},e.prototype._preActiveMesh=function(e){if(e.showBoundingBox||this.scene.forceShowBoundingBoxes){var t=e.getBoundingInfo();t.boundingBox._tag=e.renderingGroupId,this.renderList.push(t.boundingBox)}},e.prototype._prepareResources=function(){if(!this._colorShader){this._colorShader=new ls.a("colorShader",this.scene,"color",{attributes:[ji.b.PositionKind],uniforms:["world","viewProjection","color"]}),this._colorShader.reservedDataStore={hidden:!0};var e=this.scene.getEngine(),t=zi.a.CreateBox({size:1});this._vertexBuffers[ji.b.PositionKind]=new ji.b(e,t.positions,ji.b.PositionKind,!1),this._createIndexBuffer(),this._fillIndexData=t.indices,this.onResourcesReadyObservable.notifyObservers(this)}},e.prototype._createIndexBuffer=function(){var e=this.scene.getEngine();this._indexBuffer=e.createIndexBuffer([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,7,1,6,2,5,3,4])},e.prototype.rebuild=function(){var e=this._vertexBuffers[ji.b.PositionKind];e&&e._rebuild(),this._createIndexBuffer()},e.prototype.reset=function(){this.renderList.reset()},e.prototype.render=function(e){if(0!==this.renderList.length&&this.enabled&&(this._prepareResources(),this._colorShader.isReady())){var t=this.scene.getEngine();t.setDepthWrite(!1),this._colorShader._preBind();for(var i=0;i<this.renderList.length;i++){var n=this.renderList.data[i];if(n._tag===e){this.onBeforeBoxRenderingObservable.notifyObservers(n);var r=n.minimum,o=n.maximum.subtract(r),s=r.add(o.scale(.5)),c=a.a.Scaling(o.x,o.y,o.z).multiply(a.a.Translation(s.x,s.y,s.z)).multiply(n.getWorldMatrix());t.bindBuffers(this._vertexBuffers,this._indexBuffer,this._colorShader.getEffect()),this.showBackLines&&(t.setDepthFunctionToGreaterOrEqual(),this.scene.resetCachedMaterial(),this._colorShader.setColor4("color",this.backColor.toColor4()),this._colorShader.bind(c),t.drawElementsType(lo.a.LineListDrawMode,0,24)),t.setDepthFunctionToLess(),this.scene.resetCachedMaterial(),this._colorShader.setColor4("color",this.frontColor.toColor4()),this._colorShader.bind(c),t.drawElementsType(lo.a.LineListDrawMode,0,24),this.onAfterBoxRenderingObservable.notifyObservers(n)}}this._colorShader.unbind(),t.setDepthFunctionToLessOrEqual(),t.setDepthWrite(!0)}},e.prototype.renderOcclusionBoundingBox=function(e){if(this._prepareResources(),this._colorShader.isReady()&&e._boundingInfo){var t=this.scene.getEngine();this._fillIndexBuffer||(this._fillIndexBuffer=t.createIndexBuffer(this._fillIndexData)),t.setDepthWrite(!1),t.setColorWrite(!1),this._colorShader._preBind();var i=e._boundingInfo.boundingBox,n=i.minimum,r=i.maximum.subtract(n),o=n.add(r.scale(.5)),s=a.a.Scaling(r.x,r.y,r.z).multiply(a.a.Translation(o.x,o.y,o.z)).multiply(i.getWorldMatrix());t.bindBuffers(this._vertexBuffers,this._fillIndexBuffer,this._colorShader.getEffect()),t.setDepthFunctionToLess(),this.scene.resetCachedMaterial(),this._colorShader.bind(s),t.drawElementsType(lo.a.TriangleFillMode,0,36),this._colorShader.unbind(),t.setDepthFunctionToLessOrEqual(),t.setDepthWrite(!0),t.setColorWrite(!0)}},e.prototype.dispose=function(){if(this._colorShader){this.onBeforeBoxRenderingObservable.clear(),this.onAfterBoxRenderingObservable.clear(),this.onResourcesReadyObservable.clear(),this.renderList.dispose(),this._colorShader.dispose();var e=this._vertexBuffers[ji.b.PositionKind];e&&(e.dispose(),this._vertexBuffers[ji.b.PositionKind]=null),this.scene.getEngine()._releaseBuffer(this._indexBuffer),this._fillIndexBuffer&&(this.scene.getEngine()._releaseBuffer(this._fillIndexBuffer),this._fillIndexBuffer=null)}},e}();Q.a.prototype.enableDepthRenderer=function(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=!1),!(e=e||this.activeCamera))throw"No camera available to enable depth renderer";if(this._depthRenderer||(this._depthRenderer={}),!this._depthRenderer[e.id]){var n,r=!!this.getEngine().getCaps().textureFloatRender;n=!this.getEngine().getCaps().textureHalfFloatRender||i&&r?r?g.a.TEXTURETYPE_FLOAT:g.a.TEXTURETYPE_UNSIGNED_BYTE:g.a.TEXTURETYPE_HALF_FLOAT,this._depthRenderer[e.id]=new va(this,n,e,t)}return this._depthRenderer[e.id]},Q.a.prototype.disableDepthRenderer=function(e){(e=e||this.activeCamera)&&this._depthRenderer&&this._depthRenderer[e.id]&&(this._depthRenderer[e.id].dispose(),delete this._depthRenderer[e.id])};var Qh=function(){function e(e){this.name=Me.a.NAME_DEPTHRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(Me.a.STEP_GATHERRENDERTARGETS_DEPTHRENDERER,this,this._gatherRenderTargets),this.scene._gatherActiveCameraRenderTargetsStage.registerStep(Me.a.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER,this,this._gatherActiveCameraRenderTargets)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){for(var e in this.scene._depthRenderer)this.scene._depthRenderer[e].dispose()},e.prototype._gatherRenderTargets=function(e){if(this.scene._depthRenderer)for(var t in this.scene._depthRenderer){var i=this.scene._depthRenderer[t];i.enabled&&!i.useOnlyInActiveCamera&&e.push(i.getDepthMap())}},e.prototype._gatherActiveCameraRenderTargets=function(e){if(this.scene._depthRenderer)for(var t in this.scene._depthRenderer){var i=this.scene._depthRenderer[t];i.enabled&&i.useOnlyInActiveCamera&&this.scene.activeCamera.id===t&&e.push(i.getDepthMap())}},e}();va._SceneComponentInitialization=function(e){var t=e._getComponent(Me.a.NAME_DEPTHRENDERER);t||(t=new Qh(e),e._addComponent(t))},ai.a.ShadersStore.linePixelShader="uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}";ai.a.ShadersStore.lineVertexShader="#include<instancesDeclaration>\n\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 viewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\n#include<instancesVertex>\nmat4 worldViewProjection=viewProjection*finalWorld;\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n}",ze.a.prototype.disableEdgesRendering=function(){return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this},ze.a.prototype.enableEdgesRendering=function(e,t,i){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new Zh(this,e,t,!0,i),this},Object.defineProperty(ze.a.prototype,"edgesRenderer",{get:function(){return this._edgesRenderer},enumerable:!0,configurable:!0}),Jl.b.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new Jh(this,e,t),this},Jl.a.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),Jl.b.prototype.enableEdgesRendering.apply(this,arguments),this};var qh=function(){this.edges=new Array,this.edgesConnectedCount=0},Zh=function(){function e(e,t,i,n,r){var o,a=this;void 0===t&&(t=.95),void 0===i&&(i=!1),void 0===n&&(n=!0),this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._buffersForInstances={},this._checkVerticesInsteadOfIndices=!1,this.isEnabled=!0,this.customInstances=new oi.a(32),this._source=e,this._checkVerticesInsteadOfIndices=i,this._options=null!=r?r:null,this._epsilon=t,this._prepareRessources(),n&&(null===(o=null==r?void 0:r.useAlternateEdgeFinder)||void 0===o||o?this._generateEdgesLinesAlternate():this._generateEdgesLines()),this._meshRebuildObserver=this._source.onRebuildObservable.add(function(){a._rebuild()}),this._meshDisposeObserver=this._source.onDisposeObservable.add(function(){a.dispose()})}return Object.defineProperty(e.prototype,"linesPositions",{get:function(){return this._linesPositions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesNormals",{get:function(){return this._linesNormals},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesIndices",{get:function(){return this._linesIndices},enumerable:!1,configurable:!0}),e.GetShader=function(e){if(!e._edgeRenderLineShader){var t=new ls.a("lineShader",e,"line",{attributes:["position","normal"],uniforms:["world","viewProjection","color","width","aspectRatio"]});t.disableDepthWrite=!0,t.backFaceCulling=!1,e._edgeRenderLineShader=t}return e._edgeRenderLineShader},e.prototype._prepareRessources=function(){this._lineShader||(this._lineShader=e.GetShader(this._source.getScene()))},e.prototype._rebuild=function(){var e=this._buffers[ji.b.PositionKind];e&&e._rebuild(),(e=this._buffers[ji.b.NormalKind])&&e._rebuild();var t=this._source.getScene().getEngine();this._ib=t.createIndexBuffer(this._linesIndices)},e.prototype.dispose=function(){this._source.onRebuildObservable.remove(this._meshRebuildObserver),this._source.onDisposeObservable.remove(this._meshDisposeObserver);var e=this._buffers[ji.b.PositionKind];e&&(e.dispose(),this._buffers[ji.b.PositionKind]=null),(e=this._buffers[ji.b.NormalKind])&&(e.dispose(),this._buffers[ji.b.NormalKind]=null),this._ib&&this._source.getScene().getEngine()._releaseBuffer(this._ib),this._lineShader.dispose()},e.prototype._processEdgeForAdjacencies=function(e,t,i,n,r){return e===i&&t===n||e===n&&t===i?0:e===n&&t===r||e===r&&t===n?1:e===r&&t===i||e===i&&t===r?2:-1},e.prototype._processEdgeForAdjacenciesWithVertices=function(e,t,i,n,r){var o=1e-10;return e.equalsWithEpsilon(i,o)&&t.equalsWithEpsilon(n,o)||e.equalsWithEpsilon(n,o)&&t.equalsWithEpsilon(i,o)?0:e.equalsWithEpsilon(n,o)&&t.equalsWithEpsilon(r,o)||e.equalsWithEpsilon(r,o)&&t.equalsWithEpsilon(n,o)?1:e.equalsWithEpsilon(r,o)&&t.equalsWithEpsilon(i,o)||e.equalsWithEpsilon(i,o)&&t.equalsWithEpsilon(r,o)?2:-1},e.prototype._checkEdge=function(e,t,i,n,r){(void 0===t||a.e.Dot(i[e],i[t])<this._epsilon)&&this.createLine(n,r,this._linesPositions.length/3)},e.prototype.createLine=function(e,t,i){this._linesPositions.push(e.x,e.y,e.z,e.x,e.y,e.z,t.x,t.y,t.z,t.x,t.y,t.z),this._linesNormals.push(t.x,t.y,t.z,-1,t.x,t.y,t.z,1,e.x,e.y,e.z,-1,e.x,e.y,e.z,1),this._linesIndices.push(i,i+1,i+2,i,i+2,i+3)},e.prototype._tessellateTriangle=function(e,t,i,n){var r=function(e,t,i){i>=0&&t.push(i);for(var n=0;n<e.length;++n)t.push(e[n][0])},o=0;e[1].length>=e[0].length&&e[1].length>=e[2].length?o=1:e[2].length>=e[0].length&&e[2].length>=e[1].length&&(o=2);for(var a=0;a<3;++a)a===o?e[a].sort(function(e,t){return e[1]<t[1]?-1:e[1]>t[1]?1:0}):e[a].sort(function(e,t){return e[1]>t[1]?-1:e[1]<t[1]?1:0});var s=[],c=[];r(e[o],s,-1);for(var l=s.length,u=o+2;u>=o+1;--u)r(e[u%3],c,u!==o+2?n[i[t+(u+1)%3]]:-1);var h=c.length;i.push(n[i[t+o]],s[0],c[0]),i.push(n[i[t+(o+1)%3]],c[h-1],s[l-1]);for(var d=l<=h,f=d?l:h,p=d?h:l,_=d?l-1:h-1,m=d?0:1,g=l+h-2,v=0,b=0,y=d?s:c,T=d?c:s,E=0;g-- >0;){m?i.push(y[v],T[b]):i.push(T[b],y[v]);var S=void 0;(E+=f)>=p&&v<_?(S=y[++v],E-=p):S=T[++b],i.push(S)}i[t+0]=i[i.length-3],i[t+1]=i[i.length-2],i[t+2]=i[i.length-1],i.length=i.length-3},e.prototype._generateEdgesLinesAlternate=function(){var e,t,i,n,r,o,s,c,l,u=this._source.getVerticesData(ji.b.PositionKind),h=this._source.getIndices();if(h&&u){Array.isArray(h)||(h=Ce.b.SliceToArray(h));var d=null===(t=null===(e=this._options)||void 0===e?void 0:e.useFastVertexMerger)||void 0===t||t,f=d?Math.round(-Math.log(null!==(n=null===(i=this._options)||void 0===i?void 0:i.epsilonVertexMerge)&&void 0!==n?n:1e-6)/Math.log(10)):null!==(o=null===(r=this._options)||void 0===r?void 0:r.epsilonVertexMerge)&&void 0!==o?o:1e-6,p=[],_=[];if(d)for(var m={},g=0;g<u.length;g+=3){var v=u[g+0],b=u[g+1],y=u[g+2];if(void 0!==m[ee=v.toFixed(f)+"|"+b.toFixed(f)+"|"+y.toFixed(f)])p.push(m[ee]);else{var T=g/3;m[ee]=T,p.push(T),_.push(T)}}else for(g=0;g<u.length;g+=3){v=u[g+0],b=u[g+1],y=u[g+2];for(var E=!1,S=0;S<g&&!E;S+=3){var A=u[S+0],P=u[S+1],C=u[S+2];if(Math.abs(v-A)<f&&Math.abs(b-P)<f&&Math.abs(y-C)<f){p.push(S/3),E=!0;break}}E||(p.push(g/3),_.push(g/3))}if(null===(s=this._options)||void 0===s?void 0:s.applyTessellation){for(var R=null!==(l=null===(c=this._options)||void 0===c?void 0:c.epsilonVertexAligned)&&void 0!==l?l:1e-6,x=[],O=0;O<h.length;O+=3)for(var M=void 0,I=0;I<3;++I){var D=p[h[O+I]],N=p[h[O+(I+1)%3]],L=p[h[O+(I+2)%3]];if(D!==N)for(var w=u[3*D+0],F=u[3*D+1],B=u[3*D+2],U=u[3*N+0],V=u[3*N+1],k=u[3*N+2],G=Math.sqrt((U-w)*(U-w)+(V-F)*(V-F)+(k-B)*(k-B)),z=0;z<_.length-1;z++){var j=_[z];if(j!==D&&j!==N&&j!==L){var W=u[3*j+0],H=u[3*j+1],X=u[3*j+2],Y=Math.sqrt((W-w)*(W-w)+(H-F)*(H-F)+(X-B)*(X-B)),K=Math.sqrt((W-U)*(W-U)+(H-V)*(H-V)+(X-k)*(X-k));Math.abs(Y+K-G)<R&&(M||(M={index:O,edgesPoints:[[],[],[]]},x.push(M)),M.edgesPoints[I].push([j,Y]))}}}for(var Q=0;Q<x.length;++Q){var q=x[Q];this._tessellateTriangle(q.edgesPoints,q.index,h,p)}x=null}var Z={};for(O=0;O<h.length;O+=3){var J=void 0;for(I=0;I<3;++I)if(D=p[h[O+I]],N=p[h[O+(I+1)%3]],L=p[h[O+(I+2)%3]],D!==N){if(a.c.Vector3[0].copyFromFloats(u[3*D+0],u[3*D+1],u[3*D+2]),a.c.Vector3[1].copyFromFloats(u[3*N+0],u[3*N+1],u[3*N+2]),a.c.Vector3[2].copyFromFloats(u[3*L+0],u[3*L+1],u[3*L+2]),J||(a.c.Vector3[1].subtractToRef(a.c.Vector3[0],a.c.Vector3[3]),a.c.Vector3[2].subtractToRef(a.c.Vector3[1],a.c.Vector3[4]),(J=a.e.Cross(a.c.Vector3[3],a.c.Vector3[4])).normalize()),D>N){var $=D;D=N,N=$}(te=Z[ee=D+"_"+N])?te.done||(a.e.Dot(J,te.normal)<this._epsilon&&this.createLine(a.c.Vector3[0],a.c.Vector3[1],this._linesPositions.length/3),te.done=!0):Z[ee]={normal:J,done:!1,index:O,i:I}}}for(var ee in Z){var te;(te=Z[ee]).done||(D=p[h[te.index+te.i]],N=p[h[te.index+(te.i+1)%3]],a.c.Vector3[0].copyFromFloats(u[3*D+0],u[3*D+1],u[3*D+2]),a.c.Vector3[1].copyFromFloats(u[3*N+0],u[3*N+1],u[3*N+2]),this.createLine(a.c.Vector3[0],a.c.Vector3[1],this._linesPositions.length/3))}var ie=this._source.getScene().getEngine();this._buffers[ji.b.PositionKind]=new ji.b(ie,this._linesPositions,ji.b.PositionKind,!1),this._buffers[ji.b.NormalKind]=new ji.b(ie,this._linesNormals,ji.b.NormalKind,!1,!1,4),this._buffersForInstances[ji.b.PositionKind]=this._buffers[ji.b.PositionKind],this._buffersForInstances[ji.b.NormalKind]=this._buffers[ji.b.NormalKind],this._ib=ie.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}},e.prototype._generateEdgesLines=function(){var e=this._source.getVerticesData(ji.b.PositionKind),t=this._source.getIndices();if(t&&e){var i,n,r=new Array,o=new Array;for(i=0;i<t.length;i+=3){n=new qh;var s=t[i],c=t[i+1],l=t[i+2];n.p0=new a.e(e[3*s],e[3*s+1],e[3*s+2]),n.p1=new a.e(e[3*c],e[3*c+1],e[3*c+2]),n.p2=new a.e(e[3*l],e[3*l+1],e[3*l+2]);var u=a.e.Cross(n.p1.subtract(n.p0),n.p2.subtract(n.p1));u.normalize(),o.push(u),r.push(n)}for(i=0;i<r.length;i++){n=r[i];for(var h=i+1;h<r.length;h++){var d=r[h];if(3===n.edgesConnectedCount)break;if(3!==d.edgesConnectedCount)for(var f=t[3*h],p=t[3*h+1],_=t[3*h+2],m=0;m<3;m++){var g=0;if(void 0===n.edges[m]){switch(m){case 0:g=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p0,n.p1,d.p0,d.p1,d.p2):this._processEdgeForAdjacencies(t[3*i],t[3*i+1],f,p,_);break;case 1:g=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p1,n.p2,d.p0,d.p1,d.p2):this._processEdgeForAdjacencies(t[3*i+1],t[3*i+2],f,p,_);break;case 2:g=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p2,n.p0,d.p0,d.p1,d.p2):this._processEdgeForAdjacencies(t[3*i+2],t[3*i],f,p,_)}if(-1!==g&&(n.edges[m]=h,d.edges[g]=i,n.edgesConnectedCount++,d.edgesConnectedCount++,3===n.edgesConnectedCount))break}}}}for(i=0;i<r.length;i++){var v=r[i];this._checkEdge(i,v.edges[0],o,v.p0,v.p1),this._checkEdge(i,v.edges[1],o,v.p1,v.p2),this._checkEdge(i,v.edges[2],o,v.p2,v.p0)}var b=this._source.getScene().getEngine();this._buffers[ji.b.PositionKind]=new ji.b(b,this._linesPositions,ji.b.PositionKind,!1),this._buffers[ji.b.NormalKind]=new ji.b(b,this._linesNormals,ji.b.NormalKind,!1,!1,4),this._buffersForInstances[ji.b.PositionKind]=this._buffers[ji.b.PositionKind],this._buffersForInstances[ji.b.NormalKind]=this._buffers[ji.b.NormalKind],this._ib=b.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}},e.prototype.isReady=function(){return this._lineShader.isReady(this._source,this._source.hasInstances&&this.customInstances.length>0||this._source.hasThinInstances)},e.prototype.render=function(){var e=this._source.getScene();if(this.isReady()&&e.activeCamera){var t=e.getEngine();this._lineShader._preBind(),1!==this._source.edgesColor.a?t.setAlphaMode(g.a.ALPHA_COMBINE):t.setAlphaMode(g.a.ALPHA_DISABLE);var i=this._source.hasInstances&&this.customInstances.length>0,n=i||this._source.hasThinInstances,r=0;if(n)if(this._buffersForInstances.world0=this._source.getVertexBuffer("world0"),this._buffersForInstances.world1=this._source.getVertexBuffer("world1"),this._buffersForInstances.world2=this._source.getVertexBuffer("world2"),this._buffersForInstances.world3=this._source.getVertexBuffer("world3"),i){var o=this._source._instanceDataStorage;if(r=this.customInstances.length,!o.isFrozen){for(var a=0,s=0;s<r;++s)this.customInstances.data[s].copyToArray(o.instancesData,a),a+=16;o.instancesBuffer.updateDirectly(o.instancesData,0,r)}}else r=this._source.thinInstanceCount;t.bindBuffers(n?this._buffersForInstances:this._buffers,this._ib,this._lineShader.getEffect()),e.resetCachedMaterial(),this._lineShader.setColor4("color",this._source.edgesColor),e.activeCamera.mode===je.a.ORTHOGRAPHIC_CAMERA?this._lineShader.setFloat("width",this._source.edgesWidth/this.edgesWidthScalerForOrthographic):this._lineShader.setFloat("width",this._source.edgesWidth/this.edgesWidthScalerForPerspective),this._lineShader.setFloat("aspectRatio",t.getAspectRatio(e.activeCamera)),this._lineShader.bind(this._source.getWorldMatrix()),t.drawElementsType(lo.a.TriangleFillMode,0,this._indicesCount,r),this._lineShader.unbind(),n&&t.unbindInstanceAttributes(),this._source.getScene()._activeMeshesFrozen||this.customInstances.reset()}},e}(),Jh=function(e){function t(t,i,n){void 0===i&&(i=.95),void 0===n&&(n=!1);var r=e.call(this,t,i,n,!1)||this;return r._generateEdgesLines(),r}return Object(h.d)(t,e),t.prototype._generateEdgesLines=function(){var e=this._source.getVerticesData(ji.b.PositionKind),t=this._source.getIndices();if(t&&e){for(var i=a.c.Vector3[0],n=a.c.Vector3[1],r=t.length-1,o=0,s=0;o<r;o+=2,s+=4)a.e.FromArrayToRef(e,3*t[o],i),a.e.FromArrayToRef(e,3*t[o+1],n),this.createLine(i,n,s);var c=this._source.getScene().getEngine();this._buffers[ji.b.PositionKind]=new ji.b(c,this._linesPositions,ji.b.PositionKind,!1),this._buffers[ji.b.NormalKind]=new ji.b(c,this._linesNormals,ji.b.NormalKind,!1,!1,4),this._ib=c.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}},t}(Zh),$h=function(){function e(t){this._textureFormats=[{type:g.a.PREPASS_IRRADIANCE_TEXTURE_TYPE,format:g.a.TEXTURETYPE_HALF_FLOAT},{type:g.a.PREPASS_POSITION_TEXTURE_TYPE,format:g.a.TEXTURETYPE_HALF_FLOAT},{type:g.a.PREPASS_VELOCITY_TEXTURE_TYPE,format:g.a.TEXTURETYPE_HALF_FLOAT},{type:g.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE,format:g.a.TEXTURETYPE_UNSIGNED_INT},{type:g.a.PREPASS_COLOR_TEXTURE_TYPE,format:g.a.TEXTURETYPE_HALF_FLOAT},{type:g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE,format:g.a.TEXTURETYPE_HALF_FLOAT},{type:g.a.PREPASS_ALBEDO_TEXTURE_TYPE,format:g.a.TEXTURETYPE_UNSIGNED_INT}],this.excludedSkinnedMesh=[],this.excludedMaterials=[],this._textureIndices=[],this._isDirty=!1,this.mrtCount=0,this._postProcesses=[],this._clearColor=new s.b(0,0,0,0),this._effectConfigurations=[],this._mrtFormats=[],this._enabled=!1,this._useGeometryBufferFallback=!1,this.disableGammaTransform=!1,this._scene=t,this._engine=t.getEngine(),e._SceneComponentInitialization(this._scene),this._resetLayout()}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"samples",{get:function(){return this.prePassRT.samples},set:function(e){this.imageProcessingPostProcess||this._createCompositionEffect(),this.prePassRT.samples=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useGeometryBufferFallback",{get:function(){return this._useGeometryBufferFallback},set:function(e){if(this._useGeometryBufferFallback=e,e){if(this._geometryBuffer=this._scene.enableGeometryBufferRenderer(),!this._geometryBuffer)return void(this._useGeometryBufferFallback=!1);this._geometryBuffer.renderList=[],this._geometryBuffer._linkPrePassRenderer(this),this._updateGeometryBufferLayout()}else this._geometryBuffer&&this._geometryBuffer._unlinkPrePassRenderer(),this._geometryBuffer=null,this._scene.disableGeometryBufferRenderer()},enumerable:!1,configurable:!0}),e.prototype._initializeAttachments=function(){for(var e=[],t=[!1],i=[!0],n=0;n<this.mrtCount;n++)e.push(!0),n>0&&(t.push(!0),i.push(!1));this._multiRenderAttachments=this._engine.buildTextureLayout(e),this._clearAttachments=this._engine.buildTextureLayout(t),this._defaultAttachments=this._engine.buildTextureLayout(i)},e.prototype._createCompositionEffect=function(){this.prePassRT=new ys("sceneprePassRT",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},this.mrtCount,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,defaultType:g.a.TEXTURETYPE_UNSIGNED_INT,types:this._mrtFormats}),this.prePassRT.samples=1,this._initializeAttachments(),this._useGeometryBufferFallback&&!this._geometryBuffer&&(this.useGeometryBufferFallback=!0),this.imageProcessingPostProcess=new Gi("sceneCompositionPass",1,null,void 0,this._engine),this.imageProcessingPostProcess.autoClear=!1},Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._engine.webGLVersion>1||this._scene.getEngine().getCaps().drawBuffersExtension},enumerable:!1,configurable:!0}),e.prototype.bindAttachmentsForEffect=function(e,t){if(this.enabled)if(e._multiTarget)this._engine.bindAttachments(this._multiRenderAttachments);else if(this._engine.bindAttachments(this._defaultAttachments),this._geometryBuffer){var i=t.getMaterial();i&&-1===this.excludedMaterials.indexOf(i)&&this._geometryBuffer.renderList.push(t.getRenderingMesh())}},e.prototype.restoreAttachments=function(){this.enabled&&this._defaultAttachments&&this._engine.bindAttachments(this._defaultAttachments)},e.prototype._beforeCameraDraw=function(){this._isDirty&&this._update(),this._geometryBuffer&&(this._geometryBuffer.renderList.length=0),this._bindFrameBuffer()},e.prototype._afterCameraDraw=function(){if(this._enabled){var e=this._scene.activeCamera&&this._scene.activeCamera._getFirstPostProcess();e&&this._postProcesses.length&&this._scene.postProcessManager._prepareFrame(),this._scene.postProcessManager.directRender(this._postProcesses,e?e.inputTexture:null)}},e.prototype._checkRTSize=function(){var e=this._engine.getRenderWidth(!0),t=this._engine.getRenderHeight(!0),i=this.prePassRT.getRenderWidth(),n=this.prePassRT.getRenderHeight();i===e&&n===t||(this.prePassRT.resize({width:e,height:t}),this._updateGeometryBufferLayout(),this._bindPostProcessChain())},e.prototype._bindFrameBuffer=function(){if(this._enabled){this._checkRTSize();var e=this.prePassRT.getInternalTexture();e&&this._engine.bindFramebuffer(e)}},e.prototype.clear=function(){this._enabled&&(this._bindFrameBuffer(),this._engine.clear(this._scene.clearColor,this._scene.autoClear||this._scene.forceWireframe||this._scene.forcePointsCloud,this._scene.autoClearDepthAndStencil,this._scene.autoClearDepthAndStencil),this._engine.bindAttachments(this._clearAttachments),this._engine.clear(this._clearColor,!0,!1,!1),this._engine.bindAttachments(this._defaultAttachments))},e.prototype._setState=function(e){this._enabled=e,this._scene.prePass=e,this.imageProcessingPostProcess&&(this.imageProcessingPostProcess.imageProcessingConfiguration.applyByPostProcess=e)},e.prototype._updateGeometryBufferLayout=function(){if(this._geometryBuffer){this._geometryBuffer._resetLayout();for(var e=[],t=0;t<this._mrtLayout.length;t++)e.push(!1);this._geometryBuffer._linkInternalTexture(this.prePassRT.getInternalTexture());var i=[{prePassConstant:g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE,geometryBufferConstant:Ph.DEPTHNORMAL_TEXTURE_TYPE},{prePassConstant:g.a.PREPASS_POSITION_TEXTURE_TYPE,geometryBufferConstant:Ph.POSITION_TEXTURE_TYPE},{prePassConstant:g.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE,geometryBufferConstant:Ph.REFLECTIVITY_TEXTURE_TYPE},{prePassConstant:g.a.PREPASS_VELOCITY_TEXTURE_TYPE,geometryBufferConstant:Ph.VELOCITY_TEXTURE_TYPE}];for(t=0;t<i.length;t++){var n=this._mrtLayout.indexOf(i[t].prePassConstant);-1!==n&&(this._geometryBuffer._forceTextureType(i[t].geometryBufferConstant,n),e[n]=!0)}this._geometryBuffer._setAttachments(this._engine.buildTextureLayout(e))}},e.prototype.addEffectConfiguration=function(e){for(var t=0;t<this._effectConfigurations.length;t++)if(this._effectConfigurations[t].name===e.name)return this._effectConfigurations[t];return this._effectConfigurations.push(e),e},e.prototype.getIndex=function(e){return this._textureIndices[e]},e.prototype._enable=function(){for(var e,t,i=this.mrtCount,n=0;n<this._effectConfigurations.length;n++)this._effectConfigurations[n].enabled&&this._enableTextures(this._effectConfigurations[n].texturesRequired);for(this.prePassRT&&this.mrtCount!==i&&this.prePassRT.updateCount(this.mrtCount,{types:this._mrtFormats}),this._updateGeometryBufferLayout(),this._resetPostProcessChain(),n=0;n<this._effectConfigurations.length;n++)this._effectConfigurations[n].enabled&&(!this._effectConfigurations[n].postProcess&&this._effectConfigurations[n].createPostProcess&&this._effectConfigurations[n].createPostProcess(),this._effectConfigurations[n].postProcess&&this._postProcesses.push(this._effectConfigurations[n].postProcess));this._initializeAttachments(),this.imageProcessingPostProcess||this._createCompositionEffect();var r=!1;if(null===(e=this._scene.activeCamera)||void 0===e?void 0:e._postProcesses)for(n=0;n<this._scene.activeCamera._postProcesses.length;n++)"ImageProcessingPostProcess"===(null===(t=this._scene.activeCamera._postProcesses[n])||void 0===t?void 0:t.getClassName())&&(r=!0);r||this.disableGammaTransform||this._postProcesses.push(this.imageProcessingPostProcess),this._bindPostProcessChain(),this._setState(!0)},e.prototype._disable=function(){this._setState(!1),this._resetLayout();for(var e=0;e<this._effectConfigurations.length;e++)this._effectConfigurations[e].enabled=!1},e.prototype._resetLayout=function(){for(var e=0;e<this._textureFormats.length;e++)this._textureIndices[this._textureFormats[e].type]=-1;this._textureIndices[g.a.PREPASS_COLOR_TEXTURE_TYPE]=0,this._mrtLayout=[g.a.PREPASS_COLOR_TEXTURE_TYPE],this._mrtFormats=[g.a.TEXTURETYPE_HALF_FLOAT],this.mrtCount=1},e.prototype._resetPostProcessChain=function(){this._postProcesses=[],this.imageProcessingPostProcess&&this.imageProcessingPostProcess.restoreDefaultInputTexture();for(var e=0;e<this._effectConfigurations.length;e++)this._effectConfigurations[e].postProcess&&this._effectConfigurations[e].postProcess.restoreDefaultInputTexture()},e.prototype._bindPostProcessChain=function(){var e;if(this._postProcesses.length)this._postProcesses[0].inputTexture=this.prePassRT.getInternalTexture();else{var t=null===(e=this._scene.activeCamera)||void 0===e?void 0:e._getFirstPostProcess();t&&(t.inputTexture=this.prePassRT.getInternalTexture())}},e.prototype.markAsDirty=function(){this._isDirty=!0},e.prototype._enableTextures=function(e){for(var t=0;t<e.length;t++){var i=e[t];-1===this._textureIndices[i]&&(this._textureIndices[i]=this._mrtLayout.length,this._mrtLayout.push(i),this._mrtFormats.push(this._textureFormats[i].format),this.mrtCount++)}},e.prototype._update=function(){this._disable();for(var e=!1,t=0;t<this._scene.materials.length;t++)this._scene.materials[t].setPrePassRenderer(this)&&(e=!0);var i=this._scene.activeCamera;if(i){var n=i._postProcesses.filter(function(e){return null!=e});if(n)for(t=0;t<n.length;t++)n[t].setPrePassRenderer(this)&&(e=!0);this._markAllMaterialsAsPrePassDirty(),this._isDirty=!1,e&&this._enable(),this.enabled||(this._engine.restoreDefaultFramebuffer(),this._engine.restoreSingleAttachment())}},e.prototype._markAllMaterialsAsPrePassDirty=function(){for(var e=this._scene.materials,t=0;t<e.length;t++)e[t].markAsDirty(lo.a.PrePassDirtyFlag)},e.prototype.dispose=function(){for(var e=0;e<this._effectConfigurations.length;e++)this._effectConfigurations[e].dispose&&this._effectConfigurations[e].dispose();this.imageProcessingPostProcess.dispose(),this.prePassRT.dispose()},e._SceneComponentInitialization=function(e){throw Re.a.WarnImport("PrePassRendererSceneComponent")},e}();Object.defineProperty(Q.a.prototype,"prePassRenderer",{get:function(){return this._prePassRenderer},set:function(e){e&&e.isSupported&&(this._prePassRenderer=e)},enumerable:!0,configurable:!0}),Q.a.prototype.enablePrePassRenderer=function(){return this._prePassRenderer||(this._prePassRenderer=new $h(this),this._prePassRenderer.isSupported||(this._prePassRenderer=null,m.a.Error("PrePassRenderer needs WebGL 2 support.\nMaybe you tried to use the following features that need the PrePassRenderer :\n + Subsurface Scattering"))),this._prePassRenderer},Q.a.prototype.disablePrePassRenderer=function(){this._prePassRenderer&&(this._prePassRenderer.dispose(),this._prePassRenderer=null)};var ed=function(){function e(e){this.name=Me.a.NAME_PREPASSRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._beforeCameraDrawStage.registerStep(Me.a.STEP_BEFORECAMERADRAW_PREPASS,this,this._beforeCameraDraw),this.scene._afterCameraDrawStage.registerStep(Me.a.STEP_AFTERCAMERADRAW_PREPASS,this,this._afterCameraDraw),this.scene._beforeClearStage.registerStep(Me.a.STEP_BEFORECLEARSTAGE_PREPASS,this,this._beforeClearStage),this.scene._beforeRenderingMeshStage.registerStep(Me.a.STEP_BEFORERENDERINGMESH_PREPASS,this,this._beforeRenderingMeshStage),this.scene._afterRenderingMeshStage.registerStep(Me.a.STEP_AFTERRENDERINGMESH_PREPASS,this,this._afterRenderingMeshStage)},e.prototype._beforeCameraDraw=function(){this.scene.prePassRenderer&&this.scene.prePassRenderer._beforeCameraDraw()},e.prototype._afterCameraDraw=function(){this.scene.prePassRenderer&&this.scene.prePassRenderer._afterCameraDraw()},e.prototype._beforeClearStage=function(){this.scene.prePassRenderer&&this.scene.prePassRenderer.clear()},e.prototype._beforeRenderingMeshStage=function(e,t,i,n){if(n){var r=e.getScene();r.prePassRenderer&&r.prePassRenderer.bindAttachmentsForEffect(n,t)}},e.prototype._afterRenderingMeshStage=function(e){var t=e.getScene();t.prePassRenderer&&t.prePassRenderer.restoreAttachments()},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e}();$h._SceneComponentInitialization=function(e){var t=e._getComponent(Me.a.NAME_PREPASSRENDERER);t||(t=new ed(e),e._addComponent(t))};ai.a.IncludesShadersStore.fibonacci="#define rcp(x) 1./x\n#define GOLDEN_RATIO 1.618033988749895\n#define TWO_PI 6.2831855\n\n\nvec2 Golden2dSeq(int i,float n)\n{\n\n\nreturn vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));\n}\nvec2 SampleDiskGolden(int i,int sampleCount)\n{\nvec2 f=Golden2dSeq(i,float(sampleCount));\nreturn vec2(sqrt(f.x),TWO_PI*f.y);\n}";ai.a.IncludesShadersStore.diffusionProfile="uniform vec3 diffusionS[5];\nuniform float diffusionD[5];\nuniform float filterRadii[5];";ai.a.ShadersStore.subSurfaceScatteringPixelShader="\n#include<fibonacci>\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<diffusionProfile>\nvarying vec2 vUV;\nuniform vec2 texelSize;\nuniform sampler2D textureSampler;\nuniform sampler2D irradianceSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D albedoSampler;\nuniform vec2 viewportSize;\nuniform float metersPerUnit;\nconst float LOG2_E=1.4426950408889634;\nconst float SSS_PIXELS_PER_SAMPLE=4.;\nconst int _SssSampleBudget=40;\n#define rcp(x) 1./x\n#define Sq(x) x*x\n#define SSS_BILATERAL_FILTER true\n\n\nvec3 EvalBurleyDiffusionProfile(float r,vec3 S)\n{\nvec3 exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S);\nvec3 expSum=exp_13*(1.+exp_13*exp_13);\nreturn (S*rcp(8.*PI))*expSum;\n}\n\n\n\n\n\n\nvec2 SampleBurleyDiffusionProfile(float u,float rcpS)\n{\nu=1.-u;\nfloat g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));\nfloat n=exp2(log2(g)*(-1.0/3.0));\nfloat p=(g*n)*n;\nfloat c=1.+p+n;\nfloat d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u);\nfloat x=(3./LOG2_E)*log2(c)-d;\n\n\n\n\n\n\nfloat rcpExp=((c*c)*c)*rcp((4.*u)*((c*c)+(4.*u)*(4.*u)));\nfloat r=x*rcpS;\nfloat rcpPdf=(8.*PI*rcpS)*rcpExp;\nreturn vec2(r,rcpPdf);\n}\n\n\nvec3 ComputeBilateralWeight(float xy2,float z,float mmPerUnit,vec3 S,float rcpPdf)\n{\n#ifndef SSS_BILATERAL_FILTER\nz=0.;\n#endif\n\n\n\nfloat r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));\nfloat area=rcpPdf;\n#if SSS_CLAMP_ARTIFACT\nreturn clamp(EvalBurleyDiffusionProfile(r,S)*area,0.0,1.0);\n#else\nreturn EvalBurleyDiffusionProfile(r,S)*area;\n#endif\n}\nvoid EvaluateSample(int i,int n,vec3 S,float d,vec3 centerPosVS,float mmPerUnit,float pixelsPerMm,\nfloat phase,inout vec3 totalIrradiance,inout vec3 totalWeight)\n{\n\nfloat scale=rcp(float(n));\nfloat offset=rcp(float(n))*0.5;\n\nfloat sinPhase,cosPhase;\nsinPhase=sin(phase);\ncosPhase=cos(phase);\nvec2 bdp=SampleBurleyDiffusionProfile(float(i)*scale+offset,d);\nfloat r=bdp.x;\nfloat rcpPdf=bdp.y;\nfloat phi=SampleDiskGolden(i,n).y;\nfloat sinPhi,cosPhi;\nsinPhi=sin(phi);\ncosPhi=cos(phi);\nfloat sinPsi=cosPhase*sinPhi+sinPhase*cosPhi;\nfloat cosPsi=cosPhase*cosPhi-sinPhase*sinPhi;\nvec2 vec=r*vec2(cosPsi,sinPsi);\n\nvec2 position;\nfloat xy2;\nposition=vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*texelSize;\nxy2=r*r;\nvec4 textureSample=texture2D(irradianceSampler,position);\nfloat viewZ=texture2D(depthSampler,position).r;\nvec3 irradiance=textureSample.rgb;\nif (testLightingForSSS(textureSample.a))\n{\n\nfloat relZ=viewZ-centerPosVS.z;\nvec3 weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);\ntotalIrradiance+=weight*irradiance;\ntotalWeight+=weight;\n}\nelse\n{\n\n\n\n\n\n\n}\n}\nvoid main(void)\n{\nvec4 irradianceAndDiffusionProfile=texture2D(irradianceSampler,vUV);\nvec3 centerIrradiance=irradianceAndDiffusionProfile.rgb;\nint diffusionProfileIndex=int(round(irradianceAndDiffusionProfile.a*255.));\nfloat centerDepth=0.;\nvec4 inputColor=texture2D(textureSampler,vUV);\nbool passedStencilTest=testLightingForSSS(irradianceAndDiffusionProfile.a);\nif (passedStencilTest)\n{\ncenterDepth=texture2D(depthSampler,vUV).r;\n}\nif (!passedStencilTest) {\ngl_FragColor=inputColor;\nreturn;\n}\nfloat distScale=1.;\nvec3 S=diffusionS[diffusionProfileIndex];\nfloat d=diffusionD[diffusionProfileIndex];\nfloat filterRadius=filterRadii[diffusionProfileIndex];\n\nvec2 centerPosNDC=vUV;\nvec2 cornerPosNDC=vUV+0.5*texelSize;\nvec3 centerPosVS=vec3(centerPosNDC*viewportSize,1.0)*centerDepth;\nvec3 cornerPosVS=vec3(cornerPosNDC*viewportSize,1.0)*centerDepth;\n\nfloat mmPerUnit=1000.*(metersPerUnit*rcp(distScale));\nfloat unitsPerMm=rcp(mmPerUnit);\n\n\nfloat unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);\nfloat pixelsPerMm=rcp(unitsPerPixel)*unitsPerMm;\n\nfloat filterArea=PI*Sq(filterRadius*pixelsPerMm);\nint sampleCount=int(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));\nint sampleBudget=_SssSampleBudget;\nint texturingMode=0;\nvec3 albedo=texture2D(albedoSampler,vUV).rgb;\nif (distScale == 0. || sampleCount<1)\n{\n#ifdef DEBUG_SSS_SAMPLES\nvec3 green=vec3(0.,1.,0.);\ngl_FragColor=vec4(green,1.0);\nreturn;\n#endif\ngl_FragColor=vec4(inputColor.rgb+albedo*centerIrradiance,1.0);\nreturn;\n}\n#ifdef DEBUG_SSS_SAMPLES\nvec3 red=vec3(1.,0.,0.);\nvec3 blue=vec3(0.,0.,1.);\ngl_FragColor=vec4(mix(blue,red,clamp(float(sampleCount)/float(sampleBudget),0.0,1.0)),1.0);\nreturn;\n#endif\n\nfloat phase=0.;\nint n=min(sampleCount,sampleBudget);\n\nvec3 centerWeight=vec3(0.);\nvec3 totalIrradiance=vec3(0.);\nvec3 totalWeight=vec3(0.);\nfor (int i=0; i<n; i++)\n{\n\nEvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,\nphase,totalIrradiance,totalWeight);\n}\n\ntotalWeight=max(totalWeight,HALF_MIN);\ngl_FragColor=vec4(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3(0.0)),1.);\n}";var td=function(e){function t(t,i,n,r,o,a,s,c){void 0===r&&(r=null),void 0===c&&(c=g.a.TEXTURETYPE_UNSIGNED_INT);var l=e.call(this,t,"subSurfaceScattering",["texelSize","viewportSize","metersPerUnit"],["diffusionS","diffusionD","filterRadii","irradianceSampler","depthSampler","albedoSampler"],n,r,o||Ke.a.BILINEAR_SAMPLINGMODE,a,s,null,c,"postprocess",void 0,!0)||this;return l._scene=i,l.updateEffect(),l.onApplyObservable.add(function(e){if(i.prePassRenderer&&i.subSurfaceConfiguration){var t=l.texelSize;e.setFloat("metersPerUnit",i.subSurfaceConfiguration.metersPerUnit),e.setFloat2("texelSize",t.x,t.y),e.setTexture("irradianceSampler",i.prePassRenderer.prePassRT.textures[i.prePassRenderer.getIndex(g.a.PREPASS_IRRADIANCE_TEXTURE_TYPE)]),e.setTexture("depthSampler",i.prePassRenderer.prePassRT.textures[i.prePassRenderer.getIndex(g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]),e.setTexture("albedoSampler",i.prePassRenderer.prePassRT.textures[i.prePassRenderer.getIndex(g.a.PREPASS_ALBEDO_TEXTURE_TYPE)]),e.setFloat2("viewportSize",Math.tan(i.activeCamera.fov/2)*i.getEngine().getAspectRatio(i.activeCamera,!0),Math.tan(i.activeCamera.fov/2)),e.setArray3("diffusionS",i.subSurfaceConfiguration.ssDiffusionS),e.setArray("diffusionD",i.subSurfaceConfiguration.ssDiffusionD),e.setArray("filterRadii",i.subSurfaceConfiguration.ssFilterRadii)}else m.a.Error("PrePass and subsurface configuration needs to be enabled for subsurface scattering.")}),l}return Object(h.d)(t,e),t.prototype.getClassName=function(){return"SubSurfaceScatteringPostProcess"},t}(ci),id=function(){function e(t){this._ssDiffusionS=[],this._ssFilterRadii=[],this._ssDiffusionD=[],this.enabled=!1,this.name=Me.a.NAME_SUBSURFACE,this.ssDiffusionProfileColors=[],this.metersPerUnit=1,this.texturesRequired=[g.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE,g.a.PREPASS_ALBEDO_TEXTURE_TYPE,g.a.PREPASS_COLOR_TEXTURE_TYPE,g.a.PREPASS_IRRADIANCE_TEXTURE_TYPE],this.addDiffusionProfile(new s.a(1,1,1)),this._scene=t,e._SceneComponentInitialization(this._scene)}return Object.defineProperty(e.prototype,"ssDiffusionS",{get:function(){return this._ssDiffusionS},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ssDiffusionD",{get:function(){return this._ssDiffusionD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ssFilterRadii",{get:function(){return this._ssFilterRadii},enumerable:!1,configurable:!0}),e.prototype.addDiffusionProfile=function(e){if(this.ssDiffusionD.length>=5)return m.a.Error("You already reached the maximum number of diffusion profiles."),0;for(var t=0;t<this._ssDiffusionS.length/3;t++)if(this._ssDiffusionS[3*t]===e.r&&this._ssDiffusionS[3*t+1]===e.g&&this._ssDiffusionS[3*t+2]===e.b)return t;return this._ssDiffusionS.push(e.r,e.b,e.g),this._ssDiffusionD.push(Math.max(Math.max(e.r,e.b),e.g)),this._ssFilterRadii.push(this.getDiffusionProfileParameters(e)),this.ssDiffusionProfileColors.push(e),this._ssDiffusionD.length-1},e.prototype.createPostProcess=function(){return this.postProcess=new td("subSurfaceScattering",this._scene,1,null,void 0,this._scene.getEngine()),this.postProcess.autoClear=!1,this.postProcess},e.prototype.clearAllDiffusionProfiles=function(){this._ssDiffusionD=[],this._ssDiffusionS=[],this._ssFilterRadii=[],this.ssDiffusionProfileColors=[]},e.prototype.dispose=function(){this.clearAllDiffusionProfiles(),this.postProcess.dispose()},e.prototype.getDiffusionProfileParameters=function(e){var t=Math.max(e.r,e.g,e.b);return this._sampleBurleyDiffusionProfile(.997,t)},e.prototype._sampleBurleyDiffusionProfile=function(e,t){var i=1+4*(e=1-e)*(2*e+Math.sqrt(1+4*e*e)),n=Math.pow(i,-1/3),r=1+i*n*n+n;return 3*Math.log(r/(4*e))*t},e._SceneComponentInitialization=function(e){throw Re.a.WarnImport("PrePassRendererSceneComponent")},e}();n.a.AddParser(Me.a.NAME_SUBSURFACE,function(e,t){if(void 0!==e.ssDiffusionProfileColors&&null!==e.ssDiffusionProfileColors&&(t.enableSubSurfaceForPrePass(),t.subSurfaceConfiguration))for(var i=0,n=e.ssDiffusionProfileColors.length;i<n;i++){var r=e.ssDiffusionProfileColors[i];t.subSurfaceConfiguration.addDiffusionProfile(new s.a(r.r,r.g,r.b))}}),Object.defineProperty(Q.a.prototype,"subSurfaceConfiguration",{get:function(){return this._subSurfaceConfiguration},set:function(e){e&&this.enablePrePassRenderer()&&(this._subSurfaceConfiguration=e)},enumerable:!0,configurable:!0}),Q.a.prototype.enableSubSurfaceForPrePass=function(){if(this._subSurfaceConfiguration)return this._subSurfaceConfiguration;var e=this.enablePrePassRenderer();return e?(this._subSurfaceConfiguration=new id(this),e.addEffectConfiguration(this._subSurfaceConfiguration),this._subSurfaceConfiguration):null},Q.a.prototype.disableSubSurfaceForPrePass=function(){this._subSurfaceConfiguration&&(this._subSurfaceConfiguration.dispose(),this._subSurfaceConfiguration=null)};var nd=function(){function e(e){this.name=Me.a.NAME_PREPASSRENDERER,this.scene=e}return e.prototype.register=function(){},e.prototype.serialize=function(e){if(this.scene.subSurfaceConfiguration){var t=this.scene.subSurfaceConfiguration.ssDiffusionProfileColors;e.ssDiffusionProfileColors=[];for(var i=0;i<t.length;i++)e.ssDiffusionProfileColors.push({r:t[i].r,g:t[i].g,b:t[i].b})}},e.prototype.addFromContainer=function(e){},e.prototype.removeFromContainer=function(e,t){this.scene.prePassRenderer&&this.scene.subSurfaceConfiguration&&this.scene.subSurfaceConfiguration.clearAllDiffusionProfiles()},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e}();id._SceneComponentInitialization=function(e){var t=e._getComponent(Me.a.NAME_SUBSURFACE);t||(t=new nd(e),e._addComponent(t))};ai.a.ShadersStore.outlinePixelShader="#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform vec4 color;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<logDepthDeclaration>\nvoid main(void) {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#include<logDepthFragment>\ngl_FragColor=color;\n}";ai.a.ShadersStore.outlineVertexShader="\nattribute vec3 position;\nattribute vec3 normal;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\nuniform float offset;\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<logDepthDeclaration>\nvoid main(void)\n{\nvec3 positionUpdated=position;\nvec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\nvec3 offsetPosition=positionUpdated+(normalUpdated*offset);\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(offsetPosition,1.0);\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<logDepthVertex>\n}\n",Q.a.prototype.getOutlineRenderer=function(){return this._outlineRenderer||(this._outlineRenderer=new rd(this)),this._outlineRenderer},Object.defineProperty(be.a.prototype,"renderOutline",{get:function(){return this._renderOutline},set:function(e){e&&this.getScene().getOutlineRenderer(),this._renderOutline=e},enumerable:!0,configurable:!0}),Object.defineProperty(be.a.prototype,"renderOverlay",{get:function(){return this._renderOverlay},set:function(e){e&&this.getScene().getOutlineRenderer(),this._renderOverlay=e},enumerable:!0,configurable:!0});var rd=function(){function e(e){this.name=Me.a.NAME_OUTLINERENDERER,this.zOffset=1,this.scene=e,this._engine=e.getEngine(),this.scene._addComponent(this)}return e.prototype.register=function(){this.scene._beforeRenderingMeshStage.registerStep(Me.a.STEP_BEFORERENDERINGMESH_OUTLINE,this,this._beforeRenderingMesh),this.scene._afterRenderingMeshStage.registerStep(Me.a.STEP_AFTERRENDERINGMESH_OUTLINE,this,this._afterRenderingMesh)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype.render=function(e,t,i){var n=this;void 0===i&&(i=!1);var r=this.scene,o=r.getEngine(),a=o.getCaps().instancedArrays&&(null!==t.visibleInstances[e._id]&&void 0!==t.visibleInstances[e._id]||e.getRenderingMesh().hasThinInstances);if(this.isReady(e,a)){var s=e.getMesh(),c=s._internalAbstractMeshDataInfo._actAsRegularMesh?s:null,l=e.getRenderingMesh(),u=c||l,h=e.getMaterial();if(h&&r.activeCamera){if(o.enableEffect(this._effect),h.useLogarithmicDepth&&this._effect.setFloat("logarithmicDepthConstant",2/(Math.log(r.activeCamera.maxZ+1)/Math.LN2)),this._effect.setFloat("offset",i?0:l.outlineWidth),this._effect.setColor4("color",i?l.overlayColor:l.outlineColor,i?l.overlayAlpha:h.alpha),this._effect.setMatrix("viewProjection",r.getTransformMatrix()),this._effect.setMatrix("world",u.getWorldMatrix()),l.useBones&&l.computeBonesUsingShaders&&l.skeleton&&this._effect.setMatrices("mBones",l.skeleton.getTransformMatrices(l)),Hr.a.BindMorphTargetParameters(l,this._effect),l._bind(e,this._effect,h.fillMode),h&&h.needAlphaTesting()){var d=h.getAlphaTestTexture();d&&(this._effect.setTexture("diffuseSampler",d),this._effect.setMatrix("diffuseMatrix",d.getTextureMatrix()))}o.setZOffset(-this.zOffset),l._processRendering(u,e,this._effect,h.fillMode,t,a,function(e,t){n._effect.setMatrix("world",t)}),o.setZOffset(0)}}},e.prototype.isReady=function(e,t){var i=[],n=[ji.b.PositionKind,ji.b.NormalKind],r=e.getMesh(),o=e.getMaterial();o&&(o.needAlphaTesting()&&(i.push("#define ALPHATEST"),r.isVerticesDataPresent(ji.b.UVKind)&&(n.push(ji.b.UVKind),i.push("#define UV1")),r.isVerticesDataPresent(ji.b.UV2Kind)&&(n.push(ji.b.UV2Kind),i.push("#define UV2"))),o.useLogarithmicDepth&&i.push("#define LOGARITHMICDEPTH")),r.useBones&&r.computeBonesUsingShaders?(n.push(ji.b.MatricesIndicesKind),n.push(ji.b.MatricesWeightsKind),r.numBoneInfluencers>4&&(n.push(ji.b.MatricesIndicesExtraKind),n.push(ji.b.MatricesWeightsExtraKind)),i.push("#define NUM_BONE_INFLUENCERS "+r.numBoneInfluencers),i.push("#define BonesPerMesh "+(r.skeleton?r.skeleton.bones.length+1:0))):i.push("#define NUM_BONE_INFLUENCERS 0");var a=r.morphTargetManager,s=0;a&&a.numInfluencers>0&&(s=a.numInfluencers,i.push("#define MORPHTARGETS"),i.push("#define NUM_MORPH_INFLUENCERS "+s),Hr.a.PrepareAttributesForMorphTargetsInfluencers(n,r,s)),t&&(i.push("#define INSTANCES"),Hr.a.PushAttributesForInstances(n),e.getRenderingMesh().hasThinInstances&&i.push("#define THIN_INSTANCES"));var c=i.join("\n");return this._cachedDefines!==c&&(this._cachedDefines=c,this._effect=this.scene.getEngine().createEffect("outline",n,["world","mBones","viewProjection","diffuseMatrix","offset","color","logarithmicDepthConstant","morphTargetInfluences"],["diffuseSampler"],c,void 0,void 0,void 0,{maxSimultaneousMorphTargets:s})),this._effect.isReady()},e.prototype._beforeRenderingMesh=function(t,i,n){if(this._savedDepthWrite=this._engine.getDepthWrite(),t.renderOutline){var r=i.getMaterial();r&&r.needAlphaBlendingForMesh(t)&&(this._engine.cacheStencilState(),this._engine.setDepthWrite(!1),this._engine.setColorWrite(!1),this._engine.setStencilBuffer(!0),this._engine.setStencilOperationPass(g.a.REPLACE),this._engine.setStencilFunction(g.a.ALWAYS),this._engine.setStencilMask(e._StencilReference),this._engine.setStencilFunctionReference(e._StencilReference),this.render(i,n,!0),this._engine.setColorWrite(!0),this._engine.setStencilFunction(g.a.NOTEQUAL)),this._engine.setDepthWrite(!1),this.render(i,n),this._engine.setDepthWrite(this._savedDepthWrite),r&&r.needAlphaBlendingForMesh(t)&&this._engine.restoreStencilState()}},e.prototype._afterRenderingMesh=function(e,t,i){if(e.renderOverlay){var n=this._engine.getAlphaMode(),r=this._engine.alphaState.alphaBlend;this._engine.setAlphaMode(g.a.ALPHA_COMBINE),this.render(t,i,!0),this._engine.setAlphaMode(n),this._engine.setDepthWrite(this._savedDepthWrite),this._engine.alphaState.alphaBlend=r}e.renderOutline&&this._savedDepthWrite&&(this._engine.setDepthWrite(!0),this._engine.setColorWrite(!1),this.render(t,i),this._engine.setColorWrite(!0))},e._StencilReference=4,e}(),od=i(148),ad=function(e){function t(t,i){var n=e.call(this)||this;return n.name=t,n.animations=new Array,n.isPickable=!1,n.useAlphaForPicking=!1,n.onDisposeObservable=new o.c,n._onAnimationEnd=null,n._endAnimation=function(){n._onAnimationEnd&&n._onAnimationEnd(),n.disposeWhenFinishedAnimating&&n.dispose()},n.color=new s.b(1,1,1,1),n.position=a.e.Zero(),n._manager=i,n._manager.sprites.push(n),n.uniqueId=n._manager.scene.getUniqueId(),n}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"size",{get:function(){return this.width},set:function(e){this.width=e,this.height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"manager",{get:function(){return this._manager},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"Sprite"},Object.defineProperty(t.prototype,"fromIndex",{get:function(){return this._fromIndex},set:function(e){this.playAnimation(e,this._toIndex,this._loopAnimation,this._delay,this._onAnimationEnd)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toIndex",{get:function(){return this._toIndex},set:function(e){this.playAnimation(this._fromIndex,e,this._loopAnimation,this._delay,this._onAnimationEnd)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loopAnimation",{get:function(){return this._loopAnimation},set:function(e){this.playAnimation(this._fromIndex,this._toIndex,e,this._delay,this._onAnimationEnd)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"delay",{get:function(){return Math.max(this._delay,1)},set:function(e){this.playAnimation(this._fromIndex,this._toIndex,this._loopAnimation,e,this._onAnimationEnd)},enumerable:!1,configurable:!0}),t.prototype.playAnimation=function(t,i,n,r,o){void 0===o&&(o=null),this._onAnimationEnd=o,e.prototype.playAnimation.call(this,t,i,n,r,this._endAnimation)},t.prototype.dispose=function(){for(var e=0;e<this._manager.sprites.length;e++)this._manager.sprites[e]==this&&this._manager.sprites.splice(e,1);this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},t.prototype.serialize=function(){var e={};return e.name=this.name,e.position=this.position.asArray(),e.color=this.color.asArray(),e.width=this.width,e.height=this.height,e.angle=this.angle,e.cellIndex=this.cellIndex,e.cellRef=this.cellRef,e.invertU=this.invertU,e.invertV=this.invertV,e.disposeWhenFinishedAnimating=this.disposeWhenFinishedAnimating,e.isPickable=this.isPickable,e.isVisible=this.isVisible,e.useAlphaForPicking=this.useAlphaForPicking,e.animationStarted=this.animationStarted,e.fromIndex=this.fromIndex,e.toIndex=this.toIndex,e.loopAnimation=this.loopAnimation,e.delay=this.delay,e},t.Parse=function(e,i){var n=new t(e.name,i);return n.position=a.e.FromArray(e.position),n.color=s.b.FromArray(e.color),n.width=e.width,n.height=e.height,n.angle=e.angle,n.cellIndex=e.cellIndex,n.cellRef=e.cellRef,n.invertU=e.invertU,n.invertV=e.invertV,n.disposeWhenFinishedAnimating=e.disposeWhenFinishedAnimating,n.isPickable=e.isPickable,n.isVisible=e.isVisible,n.useAlphaForPicking=e.useAlphaForPicking,n.fromIndex=e.fromIndex,n.toIndex=e.toIndex,n.loopAnimation=e.loopAnimation,n.delay=e.delay,e.animationStarted&&n.playAnimation(n.fromIndex,n.toIndex,n.loopAnimation,n.delay),n},t}(function(){function e(){this.width=1,this.height=1,this.angle=0,this.invertU=!1,this.invertV=!1,this.isVisible=!0,this._animationStarted=!1,this._loopAnimation=!1,this._fromIndex=0,this._toIndex=0,this._delay=0,this._direction=1,this._time=0,this._onBaseAnimationEnd=null,this.position={x:1,y:1,z:1},this.color={r:1,g:1,b:1,a:1}}return Object.defineProperty(e.prototype,"animationStarted",{get:function(){return this._animationStarted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fromIndex",{get:function(){return this._fromIndex},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIndex",{get:function(){return this._toIndex},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loopAnimation",{get:function(){return this._loopAnimation},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){return Math.max(this._delay,1)},enumerable:!1,configurable:!0}),e.prototype.playAnimation=function(e,t,i,n,r){this._fromIndex=e,this._toIndex=t,this._loopAnimation=i,this._delay=n||1,this._animationStarted=!0,this._onBaseAnimationEnd=r,e<t?this._direction=1:(this._direction=-1,this._toIndex=e,this._fromIndex=t),this.cellIndex=e,this._time=0},e.prototype.stopAnimation=function(){this._animationStarted=!1},e.prototype._animate=function(e){this._animationStarted&&(this._time+=e,this._time>this._delay&&(this._time=this._time%this._delay,this.cellIndex+=this._direction,(this._direction>0&&this.cellIndex>this._toIndex||this._direction<0&&this.cellIndex<this._fromIndex)&&(this._loopAnimation?this.cellIndex=this._direction>0?this._fromIndex:this._toIndex:(this.cellIndex=this._toIndex,this._animationStarted=!1,this._onBaseAnimationEnd&&this._onBaseAnimationEnd()))))},e}());Q.a.prototype._internalPickSprites=function(e,t,i,n){if(!hn.a)return null;var r=null;if(!n){if(!this.activeCamera)return null;n=this.activeCamera}if(this.spriteManagers.length>0)for(var o=0;o<this.spriteManagers.length;o++){var a=this.spriteManagers[o];if(a.isPickable){var s=a.intersects(e,n,t,i);if(s&&s.hit&&(i||null==r||!(s.distance>=r.distance))&&(r=s,i))break}}return r||new hn.a},Q.a.prototype._internalMultiPickSprites=function(e,t,i){if(!hn.a)return null;var n=new Array;if(!i){if(!this.activeCamera)return null;i=this.activeCamera}if(this.spriteManagers.length>0)for(var r=0;r<this.spriteManagers.length;r++){var o=this.spriteManagers[r];if(o.isPickable){var a=o.multiIntersects(e,i,t);null!==a&&(n=n.concat(a))}}return n},Q.a.prototype.pickSprite=function(e,t,i,n,r){return this._tempSpritePickingRay?(this.createPickingRayInCameraSpaceToRef(e,t,this._tempSpritePickingRay,r),this._internalPickSprites(this._tempSpritePickingRay,i,n,r)):null},Q.a.prototype.pickSpriteWithRay=function(e,t,i,n){if(!this._tempSpritePickingRay)return null;if(!n){if(!this.activeCamera)return null;n=this.activeCamera}return Xt.a.TransformToRef(e,n.getViewMatrix(),this._tempSpritePickingRay),this._internalPickSprites(this._tempSpritePickingRay,t,i,n)},Q.a.prototype.multiPickSprite=function(e,t,i,n){return this.createPickingRayInCameraSpaceToRef(e,t,this._tempSpritePickingRay,n),this._internalMultiPickSprites(this._tempSpritePickingRay,i,n)},Q.a.prototype.multiPickSpriteWithRay=function(e,t,i){if(!this._tempSpritePickingRay)return null;if(!i){if(!this.activeCamera)return null;i=this.activeCamera}return Xt.a.TransformToRef(e,i.getViewMatrix(),this._tempSpritePickingRay),this._internalMultiPickSprites(this._tempSpritePickingRay,t,i)},Q.a.prototype.setPointerOverSprite=function(e){this._pointerOverSprite!==e&&(this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(g.a.ACTION_OnPointerOutTrigger,u.a.CreateNewFromSprite(this._pointerOverSprite,this)),this._pointerOverSprite=e,this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(g.a.ACTION_OnPointerOverTrigger,u.a.CreateNewFromSprite(this._pointerOverSprite,this)))},Q.a.prototype.getPointerOverSprite=function(){return this._pointerOverSprite};var sd=function(){function e(e){this.name=Me.a.NAME_SPRITE,this.scene=e,this.scene.spriteManagers=new Array,this.scene._tempSpritePickingRay=Xt.a?Xt.a.Zero():null,this.scene.onBeforeSpritesRenderingObservable=new o.c,this.scene.onAfterSpritesRenderingObservable=new o.c,this._spritePredicate=function(e){return!!e.actionManager&&e.isPickable&&e.actionManager.hasPointerTriggers}}return e.prototype.register=function(){this.scene._pointerMoveStage.registerStep(Me.a.STEP_POINTERMOVE_SPRITE,this,this._pointerMove),this.scene._pointerDownStage.registerStep(Me.a.STEP_POINTERDOWN_SPRITE,this,this._pointerDown),this.scene._pointerUpStage.registerStep(Me.a.STEP_POINTERUP_SPRITE,this,this._pointerUp)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){this.scene.onBeforeSpritesRenderingObservable.clear(),this.scene.onAfterSpritesRenderingObservable.clear();for(var e=this.scene.spriteManagers;e.length;)e[0].dispose()},e.prototype._pickSpriteButKeepRay=function(e,t,i,n,r){var o=this.scene.pickSprite(t,i,this._spritePredicate,n,r);return o&&(o.ray=e?e.ray:null),o},e.prototype._pointerMove=function(e,t,i,n,r){var o=this.scene;return n?o.setPointerOverSprite(null):(i=this._pickSpriteButKeepRay(i,e,t,!1,o.cameraToUseForPointers||void 0))&&i.hit&&i.pickedSprite?(o.setPointerOverSprite(i.pickedSprite),o.doNotHandleCursors||(o._pointerOverSprite&&o._pointerOverSprite.actionManager&&o._pointerOverSprite.actionManager.hoverCursor?r.style.cursor=o._pointerOverSprite.actionManager.hoverCursor:r.style.cursor=o.hoverCursor)):o.setPointerOverSprite(null),i},e.prototype._pointerDown=function(e,t,i,n){var r=this.scene;if(r._pickedDownSprite=null,r.spriteManagers.length>0&&(i=r.pickSprite(e,t,this._spritePredicate,!1,r.cameraToUseForPointers||void 0))&&i.hit&&i.pickedSprite&&i.pickedSprite.actionManager){switch(r._pickedDownSprite=i.pickedSprite,n.button){case 0:i.pickedSprite.actionManager.processTrigger(g.a.ACTION_OnLeftPickTrigger,u.a.CreateNewFromSprite(i.pickedSprite,r,n));break;case 1:i.pickedSprite.actionManager.processTrigger(g.a.ACTION_OnCenterPickTrigger,u.a.CreateNewFromSprite(i.pickedSprite,r,n));break;case 2:i.pickedSprite.actionManager.processTrigger(g.a.ACTION_OnRightPickTrigger,u.a.CreateNewFromSprite(i.pickedSprite,r,n))}i.pickedSprite.actionManager&&i.pickedSprite.actionManager.processTrigger(g.a.ACTION_OnPickDownTrigger,u.a.CreateNewFromSprite(i.pickedSprite,r,n))}return i},e.prototype._pointerUp=function(e,t,i,n){var r=this.scene;if(r.spriteManagers.length>0){var o=r.pickSprite(e,t,this._spritePredicate,!1,r.cameraToUseForPointers||void 0);o&&(o.hit&&o.pickedSprite&&o.pickedSprite.actionManager&&(o.pickedSprite.actionManager.processTrigger(g.a.ACTION_OnPickUpTrigger,u.a.CreateNewFromSprite(o.pickedSprite,r,n)),o.pickedSprite.actionManager&&(this.scene._inputManager._isPointerSwiping()||o.pickedSprite.actionManager.processTrigger(g.a.ACTION_OnPickTrigger,u.a.CreateNewFromSprite(o.pickedSprite,r,n)))),r._pickedDownSprite&&r._pickedDownSprite.actionManager&&r._pickedDownSprite!==o.pickedSprite&&r._pickedDownSprite.actionManager.processTrigger(g.a.ACTION_OnPickOutTrigger,u.a.CreateNewFromSprite(r._pickedDownSprite,r,n)))}return i},e}();ai.a.IncludesShadersStore.imageProcessingCompatibility="#ifdef IMAGEPROCESSINGPOSTPROCESS\ngl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(2.2));\n#endif";ai.a.ShadersStore.spritesPixelShader="uniform bool alphaTest;\nvarying vec4 vColor;\n\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\nvec4 color=texture2D(diffuseSampler,vUV);\nif (alphaTest)\n{\nif (color.a<0.95)\ndiscard;\n}\ncolor*=vColor;\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}";ai.a.ShadersStore.spritesVertexShader="\nattribute vec4 position;\nattribute vec2 options;\nattribute vec2 offsets;\nattribute vec2 inverts;\nattribute vec4 cellInfo;\nattribute vec4 color;\n\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#include<fogVertexDeclaration>\nvoid main(void) {\nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz;\nvec2 cornerPos;\nfloat angle=position.w;\nvec2 size=vec2(options.x,options.y);\nvec2 offset=offsets.xy;\ncornerPos=vec2(offset.x-0.5,offset.y-0.5)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0);\n\nvColor=color;\n\nvec2 uvOffset=vec2(abs(offset.x-inverts.x),abs(1.0-offset.y-inverts.y));\nvec2 uvPlace=cellInfo.xy;\nvec2 uvSize=cellInfo.zw;\nvUV.x=uvPlace.x+uvSize.x*uvOffset.x;\nvUV.y=uvPlace.y+uvSize.y*uvOffset.y;\n\n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n}";var cd=function(){function e(e,t,i,n){if(void 0===i&&(i=.01),void 0===n&&(n=null),this.blendMode=g.a.ALPHA_COMBINE,this.autoResetAlpha=!0,this.disableDepthWrite=!1,this.fogEnabled=!0,this._useVAO=!1,this._useInstancing=!1,this._vertexBuffers={},this._capacity=t,this._epsilon=i,this._engine=e,this._useInstancing=e.getCaps().instancedArrays,this._useVAO=e.getCaps().vertexArrayObject&&!e.disableVertexArrayObjects,this._scene=n,!this._useInstancing){for(var r=[],o=0,a=0;a<t;a++)r.push(o),r.push(o+1),r.push(o+2),r.push(o),r.push(o+2),r.push(o+3),o+=4;this._indexBuffer=e.createIndexBuffer(r)}this._vertexBufferSize=this._useInstancing?16:18,this._vertexData=new Float32Array(t*this._vertexBufferSize*(this._useInstancing?1:4)),this._buffer=new ji.a(e,this._vertexData,!0,this._vertexBufferSize);var s,c=this._buffer.createVertexBuffer(ji.b.PositionKind,0,4,this._vertexBufferSize,this._useInstancing),l=this._buffer.createVertexBuffer("options",4,2,this._vertexBufferSize,this._useInstancing),u=6;if(this._useInstancing){var h=new Float32Array([0,0,1,0,1,1,0,1]);this._spriteBuffer=new ji.a(e,h,!1,2),s=this._spriteBuffer.createVertexBuffer("offsets",0,2)}else s=this._buffer.createVertexBuffer("offsets",u,2,this._vertexBufferSize,this._useInstancing),u+=2;var d=this._buffer.createVertexBuffer("inverts",u,2,this._vertexBufferSize,this._useInstancing),f=this._buffer.createVertexBuffer("cellInfo",u+2,4,this._vertexBufferSize,this._useInstancing),p=this._buffer.createVertexBuffer(ji.b.ColorKind,u+6,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[ji.b.PositionKind]=c,this._vertexBuffers.options=l,this._vertexBuffers.offsets=s,this._vertexBuffers.inverts=d,this._vertexBuffers.cellInfo=f,this._vertexBuffers[ji.b.ColorKind]=p,this._effectBase=this._engine.createEffect("sprites",[ji.b.PositionKind,"options","offsets","inverts","cellInfo",ji.b.ColorKind],["view","projection","textureInfos","alphaTest"],["diffuseSampler"],""),this._scene&&(this._effectFog=this._scene.getEngine().createEffect("sprites",[ji.b.PositionKind,"options","offsets","inverts","cellInfo",ji.b.ColorKind],["view","projection","textureInfos","alphaTest","vFogInfos","vFogColor"],["diffuseSampler"],"#define FOG"))}return Object.defineProperty(e.prototype,"capacity",{get:function(){return this._capacity},enumerable:!1,configurable:!0}),e.prototype.render=function(e,t,i,n,r){if(void 0===r&&(r=null),this.texture&&this.texture.isReady()&&e.length){var o=this._effectBase,a=!1;if(this.fogEnabled&&this._scene&&this._scene.fogEnabled&&0!==this._scene.fogMode&&(o=this._effectFog,a=!0),o.isReady()){for(var s=this._engine,c=!(!this._scene||!this._scene.useRightHandedSystem),l=this.texture.getBaseSize(),u=Math.min(this._capacity,e.length),h=0,d=!0,f=0;f<u;f++){var p=e[f];p&&p.isVisible&&(d=!1,p._animate(t),this._appendSpriteVertex(h++,p,0,0,l,c,r),this._useInstancing||(this._appendSpriteVertex(h++,p,1,0,l,c,r),this._appendSpriteVertex(h++,p,1,1,l,c,r),this._appendSpriteVertex(h++,p,0,1,l,c,r)))}if(!d){this._buffer.update(this._vertexData);var _=s.depthCullingState.cull||!0,m=s.depthCullingState.zOffset;if(c&&this._scene.getEngine().setState(_,m,!1,!1),s.enableEffect(o),o.setTexture("diffuseSampler",this.texture),o.setMatrix("view",i),o.setMatrix("projection",n),a){var v=this._scene;o.setFloat4("vFogInfos",v.fogMode,v.fogStart,v.fogEnd,v.fogDensity),o.setColor3("vFogColor",v.fogColor)}this._useVAO?(this._vertexArrayObject||(this._vertexArrayObject=s.recordVertexArrayObject(this._vertexBuffers,this._indexBuffer,o)),s.bindVertexArrayObject(this._vertexArrayObject,this._indexBuffer)):s.bindBuffers(this._vertexBuffers,this._indexBuffer,o),s.depthCullingState.depthFunc=g.a.LEQUAL,this.disableDepthWrite||(o.setBool("alphaTest",!0),s.setColorWrite(!1),this._useInstancing?s.drawArraysType(g.a.MATERIAL_TriangleFanDrawMode,0,4,h):s.drawElementsType(g.a.MATERIAL_TriangleFillMode,0,h/4*6),s.setColorWrite(!0),o.setBool("alphaTest",!1)),s.setAlphaMode(this.blendMode),this._useInstancing?s.drawArraysType(g.a.MATERIAL_TriangleFanDrawMode,0,4,h):s.drawElementsType(g.a.MATERIAL_TriangleFillMode,0,h/4*6),this.autoResetAlpha&&s.setAlphaMode(g.a.ALPHA_DISABLE),c&&this._scene.getEngine().setState(_,m,!1,!0),s.unbindInstanceAttributes()}}}},e.prototype._appendSpriteVertex=function(e,t,i,n,r,o,a){var s=e*this._vertexBufferSize;if(0===i?i=this._epsilon:1===i&&(i=1-this._epsilon),0===n?n=this._epsilon:1===n&&(n=1-this._epsilon),a)a(t,r);else{t.cellIndex||(t.cellIndex=0);var c=r.width/this.cellWidth,l=t.cellIndex/c>>0;t._xOffset=(t.cellIndex-l*c)*this.cellWidth/r.width,t._yOffset=l*this.cellHeight/r.height,t._xSize=this.cellWidth,t._ySize=this.cellHeight}this._vertexData[s]=t.position.x,this._vertexData[s+1]=t.position.y,this._vertexData[s+2]=t.position.z,this._vertexData[s+3]=t.angle,this._vertexData[s+4]=t.width,this._vertexData[s+5]=t.height,this._useInstancing?s-=2:(this._vertexData[s+6]=i,this._vertexData[s+7]=n),this._vertexData[s+8]=o?t.invertU?0:1:t.invertU?1:0,this._vertexData[s+9]=t.invertV?1:0,this._vertexData[s+10]=t._xOffset,this._vertexData[s+11]=t._yOffset,this._vertexData[s+12]=t._xSize/r.width,this._vertexData[s+13]=t._ySize/r.height,this._vertexData[s+14]=t.color.r,this._vertexData[s+15]=t.color.g,this._vertexData[s+16]=t.color.b,this._vertexData[s+17]=t.color.a},e.prototype.dispose=function(){this._buffer&&(this._buffer.dispose(),this._buffer=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._indexBuffer&&(this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this._vertexArrayObject&&(this._engine.releaseVertexArrayObject(this._vertexArrayObject),this._vertexArrayObject=null),this.texture&&(this.texture.dispose(),this.texture=null)},e}(),ld=function(){function e(e,t,i,n,r,a,s,c,l){var u=this;void 0===a&&(a=.01),void 0===s&&(s=Ke.a.TRILINEAR_SAMPLINGMODE),void 0===c&&(c=!1),void 0===l&&(l=null),this.name=e,this.sprites=new Array,this.renderingGroupId=0,this.layerMask=268435455,this.isPickable=!1,this.onDisposeObservable=new o.c,this.disableDepthWrite=!1,this._packedAndReady=!1,this._customUpdate=function(e,t){e.cellRef||(e.cellIndex=0);var i=e.cellIndex;"number"==typeof i&&isFinite(i)&&Math.floor(i)===i&&(e.cellRef=u._spriteMap[e.cellIndex]),e._xOffset=u._cellData[e.cellRef].frame.x/t.width,e._yOffset=u._cellData[e.cellRef].frame.y/t.height,e._xSize=u._cellData[e.cellRef].frame.w,e._ySize=u._cellData[e.cellRef].frame.h},r||(r=Se.a.LastCreatedScene),r._getComponent(Me.a.NAME_SPRITE)||r._addComponent(new sd(r)),this._fromPacked=c,this._scene=r;var h=this._scene.getEngine();if(this._spriteRenderer=new cd(h,i,a,r),n.width&&n.height)this.cellWidth=n.width,this.cellHeight=n.height;else{if(void 0===n)return void(this._spriteRenderer=null);this.cellWidth=n,this.cellHeight=n}this._scene.spriteManagers.push(this),this.uniqueId=this.scene.getUniqueId(),t&&(this.texture=new Ke.a(t,r,!0,!1,s)),this._fromPacked&&this._makePacked(t,l)}return Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.sprites},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capacity",{get:function(){return this._spriteRenderer.capacity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._spriteRenderer.texture},set:function(e){e.wrapU=Ke.a.CLAMP_ADDRESSMODE,e.wrapV=Ke.a.CLAMP_ADDRESSMODE,this._spriteRenderer.texture=e,this._textureContent=null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cellWidth",{get:function(){return this._spriteRenderer.cellWidth},set:function(e){this._spriteRenderer.cellWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cellHeight",{get:function(){return this._spriteRenderer.cellHeight},set:function(e){this._spriteRenderer.cellHeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fogEnabled",{get:function(){return this._spriteRenderer.fogEnabled},set:function(e){this._spriteRenderer.fogEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._spriteRenderer.blendMode},set:function(e){this._spriteRenderer.blendMode=e},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"SpriteManager"},e.prototype._makePacked=function(e,t){var i=this;if(null!==t)try{var n=void 0;if((n="string"==typeof t?JSON.parse(t):t).frames.length){for(var r={},o=0;o<n.frames.length;o++){var a=n.frames[o];if("string"!=typeof Object.keys(a)[0])throw new Error("Invalid JSON Format.  Check the frame values and make sure the name is the first parameter.");r[a[Object.keys(a)[0]]]=a}n.frames=r}var s=Reflect.ownKeys(n.frames);this._spriteMap=s,this._packedAndReady=!0,this._cellData=n.frames}catch(e){throw this._fromPacked=!1,this._packedAndReady=!1,new Error("Invalid JSON from string. Spritesheet managed with constant cell size.")}else{var c=/\./g,l=void 0;do{l=c.lastIndex,c.test(e)}while(c.lastIndex>0);var u=e.substring(0,l-1)+".json",h=new XMLHttpRequest;h.open("GET",u,!0),h.onerror=function(){m.a.Error("JSON ERROR: Unable to load JSON file."),i._fromPacked=!1,i._packedAndReady=!1},h.onload=function(){try{var e=JSON.parse(h.response),t=Reflect.ownKeys(e.frames);i._spriteMap=t,i._packedAndReady=!0,i._cellData=e.frames}catch(e){throw i._fromPacked=!1,i._packedAndReady=!1,new Error("Invalid JSON format. Please check documentation for format specifications.")}},h.send()}},e.prototype._checkTextureAlpha=function(e,t,i,n,r){if(!e.useAlphaForPicking||!this.texture)return!0;var o=this.texture.getSize();this._textureContent||(this._textureContent=new Uint8Array(o.width*o.height*4),this.texture.readPixels(0,0,this._textureContent));var s=a.c.Vector3[0];s.copyFrom(t.direction),s.normalize(),s.scaleInPlace(i),s.addInPlace(t.origin);var c=(s.x-n.x)/(r.x-n.x)-.5,l=1-(s.y-n.y)/(r.y-n.y)-.5,u=e.angle,h=c*Math.cos(u)-l*Math.sin(u)+.5,d=c*Math.sin(u)+l*Math.cos(u)+.5,f=e._xOffset*o.width+h*e._xSize|0,p=e._yOffset*o.height+d*e._ySize|0;return this._textureContent[4*(f+p*o.width)+3]>.5},e.prototype.intersects=function(e,t,i,n){for(var r=Math.min(this.capacity,this.sprites.length),o=a.e.Zero(),s=a.e.Zero(),c=Number.MAX_VALUE,l=null,u=a.c.Vector3[0],h=a.c.Vector3[1],d=t.getViewMatrix(),f=0;f<r;f++){var p=this.sprites[f];if(p){if(i){if(!i(p))continue}else if(!p.isPickable)continue;if(a.e.TransformCoordinatesToRef(p.position,d,h),o.copyFromFloats(h.x-p.width/2,h.y-p.height/2,h.z),s.copyFromFloats(h.x+p.width/2,h.y+p.height/2,h.z),e.intersectsBoxMinMax(o,s)){var _=a.e.Distance(h,e.origin);if(c>_){if(!this._checkTextureAlpha(p,e,_,o,s))continue;if(c=_,l=p,n)break}}}}if(l){var m=new hn.a;d.invertToRef(a.c.Matrix[0]),m.hit=!0,m.pickedSprite=l,m.distance=c;var g=a.c.Vector3[2];return g.copyFrom(e.direction),g.normalize(),g.scaleInPlace(c),e.origin.addToRef(g,u),m.pickedPoint=a.e.TransformCoordinates(u,a.c.Matrix[0]),m}return null},e.prototype.multiIntersects=function(e,t,i){for(var n,r=Math.min(this.capacity,this.sprites.length),o=a.e.Zero(),s=a.e.Zero(),c=[],l=a.c.Vector3[0].copyFromFloats(0,0,0),u=a.c.Vector3[1].copyFromFloats(0,0,0),h=t.getViewMatrix(),d=0;d<r;d++){var f=this.sprites[d];if(f){if(i){if(!i(f))continue}else if(!f.isPickable)continue;if(a.e.TransformCoordinatesToRef(f.position,h,u),o.copyFromFloats(u.x-f.width/2,u.y-f.height/2,u.z),s.copyFromFloats(u.x+f.width/2,u.y+f.height/2,u.z),e.intersectsBoxMinMax(o,s)){if(n=a.e.Distance(u,e.origin),!this._checkTextureAlpha(f,e,n,o,s))continue;var p=new hn.a;c.push(p),h.invertToRef(a.c.Matrix[0]),p.hit=!0,p.pickedSprite=f,p.distance=n;var _=a.c.Vector3[2];_.copyFrom(e.direction),_.normalize(),_.scaleInPlace(n),e.origin.addToRef(_,l),p.pickedPoint=a.e.TransformCoordinates(l,a.c.Matrix[0])}}}return c},e.prototype.render=function(){if(!this._fromPacked||this._packedAndReady&&this._spriteMap&&this._cellData){var e=this._scene.getEngine().getDeltaTime();this._packedAndReady?this._spriteRenderer.render(this.sprites,e,this._scene.getViewMatrix(),this._scene.getProjectionMatrix(),this._customUpdate):this._spriteRenderer.render(this.sprites,e,this._scene.getViewMatrix(),this._scene.getProjectionMatrix())}},e.prototype.dispose=function(){this._spriteRenderer&&(this._spriteRenderer.dispose(),this._spriteRenderer=null),this._textureContent=null;var e=this._scene.spriteManagers.indexOf(this);this._scene.spriteManagers.splice(e,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},e.prototype.serialize=function(e){void 0===e&&(e=!1);var t={};t.name=this.name,t.capacity=this.capacity,t.cellWidth=this.cellWidth,t.cellHeight=this.cellHeight,this.texture&&(e?t.texture=this.texture.serialize():(t.textureUrl=this.texture.name,t.invertY=this.texture._invertY)),t.sprites=[];for(var i=0,n=this.sprites;i<n.length;i++){var r=n[i];t.sprites.push(r.serialize())}return t},e.Parse=function(t,i,n){var r=new e(t.name,"",t.capacity,{width:t.cellWidth,height:t.cellHeight},i);t.texture?r.texture=Ke.a.Parse(t.texture,i,n):t.textureName&&(r.texture=new Ke.a(n+t.textureUrl,i,!1,void 0===t.invertY||t.invertY));for(var o=0,a=t.sprites;o<a.length;o++){var s=a[o];ad.Parse(s,r)}return r},e.ParseFromFileAsync=function(t,i,n,r){return void 0===r&&(r=""),new Promise(function(o,a){var s=new V.a;s.addEventListener("readystatechange",function(){if(4==s.readyState)if(200==s.status){var i=JSON.parse(s.responseText),c=e.Parse(i,n||Se.a.LastCreatedScene,r);t&&(c.name=t),o(c)}else a("Unable to load the sprite manager")}),s.open("GET",i),s.send()})},e.CreateFromSnippetAsync=function(t,i,n){var r=this;return void 0===n&&(n=""),"_BLANK"===t?Promise.resolve(new e("Default sprite manager","//playground.babylonjs.com/textures/player.png",500,64,i)):new Promise(function(o,a){var s=new V.a;s.addEventListener("readystatechange",function(){if(4==s.readyState)if(200==s.status){var r=JSON.parse(JSON.parse(s.responseText).jsonPayload),c=JSON.parse(r.spriteManager),l=e.Parse(c,i||Se.a.LastCreatedScene,n);l.snippetId=t,o(l)}else a("Unable to load the snippet "+t)}),s.open("GET",r.SnippetUrl+"/"+t.replace(/#/g,"/")),s.send()})},e.SnippetUrl="https://snippet.babylonjs.com",e}();ai.a.ShadersStore.spriteMapPixelShader="precision highp float;\nvarying vec3 vPosition;\nvarying vec2 vUV;\nvarying vec2 tUV;\nuniform float time;\nuniform float spriteCount;\nuniform sampler2D spriteSheet;\nuniform vec2 spriteMapSize;\nuniform vec2 outputSize;\nuniform vec2 stageSize;\nuniform sampler2D frameMap;\nuniform sampler2D tileMaps[LAYERS];\nuniform sampler2D animationMap;\nuniform vec3 colorMul;\nfloat mt;\nconst float fdStep=1./4.;\nconst float aFrameSteps=1./MAX_ANIMATION_FRAMES;\nmat4 getFrameData(float frameID){\nfloat fX=frameID/spriteCount;\nreturn mat4(\ntexture2D(frameMap,vec2(fX,0.),0.),\ntexture2D(frameMap,vec2(fX,fdStep*1.),0.),\ntexture2D(frameMap,vec2(fX,fdStep*2.),0.),\nvec4(0.)\n);\n}\nvoid main(){\nvec4 color=vec4(0.);\nvec2 tileUV=fract(tUV);\n#ifdef FLIPU\ntileUV.y=1.0-tileUV.y;\n#endif\nvec2 tileID=floor(tUV);\nvec2 sheetUnits=1./spriteMapSize;\nfloat spriteUnits=1./spriteCount;\nvec2 stageUnits=1./stageSize;\nfor(int i=0; i<LAYERS; i++) {\nfloat frameID;\n#define LAYER_ID_SWITCH\nvec4 animationData=texture2D(animationMap,vec2((frameID+0.5)/spriteCount,0.),0.);\nif(animationData.y>0.) {\nmt=mod(time*animationData.z,1.0);\nfor(float f=0.; f<MAX_ANIMATION_FRAMES; f++){\nif(animationData.y>mt){\nframeID=animationData.x;\nbreak;\n}\nanimationData=texture2D(animationMap,vec2((frameID+0.5)/spriteCount,aFrameSteps*f),0.);\n}\n}\n\nmat4 frameData=getFrameData(frameID+0.5);\nvec2 frameSize=(frameData[0].wz)/spriteMapSize;\nvec2 offset=frameData[0].xy*sheetUnits;\nvec2 ratio=frameData[2].xy/frameData[0].wz;\n\nif (frameData[2].z == 1.){\ntileUV.xy=tileUV.yx;\n}\nif (i == 0){\ncolor=texture2D(spriteSheet,tileUV*frameSize+offset);\n} else {\nvec4 nc=texture2D(spriteSheet,tileUV*frameSize+offset);\nfloat alpha=min(color.a+nc.a,1.0);\nvec3 mixed=mix(color.xyz,nc.xyz,nc.a);\ncolor=vec4(mixed,alpha);\n}\n}\ncolor.xyz*=colorMul;\ngl_FragColor=color;\n}";ai.a.ShadersStore.spriteMapVertexShader="precision highp float;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nvarying vec3 vPosition;\nvarying vec2 vUV;\nvarying vec2 tUV;\nvarying vec2 stageUnits;\nvarying vec2 levelUnits;\nvarying vec2 tileID;\n\nuniform float time;\nuniform mat4 worldViewProjection;\nuniform vec2 outputSize;\nuniform vec2 stageSize;\nuniform vec2 spriteMapSize;\nuniform float stageScale;\nvoid main() {\nvec4 p=vec4( position,1. );\nvPosition=p.xyz;\nvUV=uv;\ntUV=uv*stageSize;\ngl_Position=worldViewProjection*p;\n}";var ud,hd=function(){function e(e,t,i,n,r){var o=this;this.name=e,this.sprites=[],this.atlasJSON=t,this.sprites=this.atlasJSON.frames,this.spriteSheet=i,this.options=n,n.stageSize=n.stageSize||new a.d(1,1),n.outputSize=n.outputSize||n.stageSize,n.outputPosition=n.outputPosition||a.e.Zero(),n.outputRotation=n.outputRotation||a.e.Zero(),n.layerCount=n.layerCount||1,n.maxAnimationFrames=n.maxAnimationFrames||0,n.baseTile=n.baseTile||0,n.flipU=n.flipU||!1,n.colorMultiply=n.colorMultiply||new a.e(1,1,1),this._scene=r,this._frameMap=this._createFrameBuffer(),this._tileMaps=new Array;for(var s=0;s<n.layerCount;s++)this._tileMaps.push(this._createTileBuffer(null,s));this._animationMap=this._createTileAnimationBuffer(null);var c=[];c.push("#define LAYERS "+n.layerCount),n.flipU&&c.push("#define FLIPU"),c.push("#define MAX_ANIMATION_FRAMES "+n.maxAnimationFrames+".0");var l,u=ai.a.ShadersStore.spriteMapPixelShader;if(1===this._scene.getEngine().webGLVersion)for(l="",s=0;s<n.layerCount;s++)l+="if ("+s+" == i) { frameID = texture2D(tileMaps["+s+"], (tileID + 0.5) / stageSize, 0.).x; }";else{for(l="switch(i) {",s=0;s<n.layerCount;s++)l+="case "+s+" : frameID = texture(tileMaps["+s+"], (tileID + 0.5) / stageSize, 0.).x;",l+="break;";l+="}"}ai.a.ShadersStore["spriteMap"+this.name+"PixelShader"]=u.replace("#define LAYER_ID_SWITCH",l),this._material=new ls.a("spriteMap:"+this.name,this._scene,{vertex:"spriteMap",fragment:"spriteMap"+this.name},{defines:c,attributes:["position","normal","uv"],uniforms:["worldViewProjection","time","stageSize","outputSize","spriteMapSize","spriteCount","time","colorMul","mousePosition","curTile","flipU"],samplers:["spriteSheet","frameMap","tileMaps","animationMap"],needAlphaBlending:!0}),this._time=0,this._material.setFloat("spriteCount",this.spriteCount),this._material.setVector2("stageSize",n.stageSize),this._material.setVector2("outputSize",n.outputSize),this._material.setTexture("spriteSheet",this.spriteSheet),this._material.setVector2("spriteMapSize",new a.d(1,1)),this._material.setVector3("colorMul",n.colorMultiply);var h=0,d=function(){o.spriteSheet&&o.spriteSheet.isReady()&&o.spriteSheet._texture?o._material.setVector2("spriteMapSize",new a.d(o.spriteSheet._texture.baseWidth||1,o.spriteSheet._texture.baseHeight||1)):h<100&&setTimeout(function(){h++,d()},100)};d(),this._material.setVector3("colorMul",n.colorMultiply),this._material.setTexture("frameMap",this._frameMap),this._material.setTextureArray("tileMaps",this._tileMaps),this._material.setTexture("animationMap",this._animationMap),this._material.setFloat("time",this._time),this._output=be.a.CreatePlane(e+":output",1,r,!0),this._output.scaling.x=n.outputSize.x,this._output.scaling.y=n.outputSize.y,this.position=n.outputPosition,this.rotation=n.outputRotation,this._scene.onBeforeRenderObservable.add(function(){o._time+=o._scene.getEngine().getDeltaTime(),o._material.setFloat("time",o._time)}),this._output.material=this._material}return Object.defineProperty(e.prototype,"spriteCount",{get:function(){return this.sprites.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this._output.position},set:function(e){this._output.position=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this._output.rotation},set:function(e){this._output.rotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationMap",{get:function(){return this._animationMap},set:function(e){var t=e._texture._bufferView,i=this._createTileAnimationBuffer(t);this._animationMap.dispose(),this._animationMap=i,this._material.setTexture("animationMap",this._animationMap)},enumerable:!1,configurable:!0}),e.prototype.getTileID=function(){var e=this.getMousePosition();return e.multiplyInPlace(this.options.stageSize||a.d.Zero()),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e},e.prototype.getMousePosition=function(){var e=this._output,t=this._scene.pick(this._scene.pointerX,this._scene.pointerY,function(t){return t===e});return t&&t.hit&&t.getTextureCoordinates&&t.getTextureCoordinates()||new a.d(-1,-1)},e.prototype._createFrameBuffer=function(){for(var e=new Array,t=0;t<this.spriteCount;t++)e.push(0,0,0,0),e.push(0,0,0,0),e.push(0,0,0,0),e.push(0,0,0,0);for(t=0;t<this.spriteCount;t++){var i=this.sprites[t].frame,n=this.sprites[t].spriteSourceSize,r=this.sprites[t].sourceSize,o=this.sprites[t].rotated?1:0,a=this.sprites[t].trimmed?1:0;e[4*t]=i.x,e[4*t+1]=i.y,e[4*t+2]=i.w,e[4*t+3]=i.h,e[4*t+4*this.spriteCount]=n.x,e[4*t+1+4*this.spriteCount]=n.y,e[4*t+3+4*this.spriteCount]=n.h,e[4*t+8*this.spriteCount]=r.w,e[4*t+1+8*this.spriteCount]=r.h,e[4*t+2+8*this.spriteCount]=o,e[4*t+3+8*this.spriteCount]=a}var s=new Float32Array(e);return et.CreateRGBATexture(s,this.spriteCount,4,this._scene,!1,!1,Ke.a.NEAREST_NEAREST,Se.a.TEXTURETYPE_FLOAT)},e.prototype._createTileBuffer=function(e,t){void 0===t&&(t=0);var i=new Array,n=this.options.stageSize.y||0,r=this.options.stageSize.x||0;if(e)i=e;else{var o=this.options.baseTile;0!=t&&(o=0);for(var a=0;a<n;a++)for(var s=0;s<4*r;s+=4)i.push(o,0,0,0)}var c=new Float32Array(i);return et.CreateRGBATexture(c,r,n,this._scene,!1,!1,Ke.a.NEAREST_NEAREST,Se.a.TEXTURETYPE_FLOAT)},e.prototype.changeTiles=function(e,t,i){var n;if(void 0===e&&(e=0),void 0===i&&(i=0),null!==(n=this._tileMaps[e]._texture._bufferView)){var r=new Array;t instanceof a.d?r.push(t):r=t;for(var o=this.options.stageSize.x||0,s=0;s<r.length;s++){var c=r[s];c.x=Math.floor(c.x),c.y=Math.floor(c.y),n[4*c.x+c.y*(4*o)]=i}var l=this._createTileBuffer(n);this._tileMaps[e].dispose(),this._tileMaps[e]=l,this._material.setTextureArray("tileMap",this._tileMaps)}},e.prototype._createTileAnimationBuffer=function(e){var t,i=new Array;if(e)t=e;else{for(var n=0;n<this.spriteCount;n++){i.push(0,0,0,0);for(var r=1;r<(this.options.maxAnimationFrames||4);)i.push(0,0,0,0),r++}t=new Float32Array(i)}return et.CreateRGBATexture(t,this.spriteCount,this.options.maxAnimationFrames||4,this._scene,!1,!1,Ke.a.NEAREST_NEAREST,Se.a.TEXTURETYPE_FLOAT)},e.prototype.addAnimationToTile=function(e,t,i,n,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=1);var o=this._animationMap._texture._bufferView,a=4*e+4*this.spriteCount*t;if(o){o[a]=i,o[a+1]=n,o[a+2]=r;var s=this._createTileAnimationBuffer(o);this._animationMap.dispose(),this._animationMap=s,this._material.setTexture("animationMap",this._animationMap)}},e.prototype.saveTileMaps=function(){for(var e="",t=0;t<this._tileMaps.length;t++)t>0&&(e+="\n\r"),e+=this._tileMaps[t]._texture._bufferView.toString();var i=document.createElement("a");i.href="data:octet/stream;charset=utf-8,"+encodeURI(e),i.target="_blank",i.download=this.name+".tilemaps",i.click(),i.remove()},e.prototype.loadTileMaps=function(e){var t=this,i=new XMLHttpRequest;i.open("GET",e);var n=this.options.layerCount||0;i.onload=function(){for(var e=i.response.split("\n\r"),r=0;r<n;r++){var o=e[r].split(",").map(Number),a=t._createTileBuffer(o);t._tileMaps[r].dispose(),t._tileMaps[r]=a}t._material.setTextureArray("tileMap",t._tileMaps)},i.send()},e.prototype.dispose=function(){this._output.dispose(),this._material.dispose(),this._animationMap.dispose(),this._tileMaps.forEach(function(e){e.dispose()}),this._frameMap.dispose()},e}(),dd=function(e){function t(t,i,n,r,o,a,s){void 0===o&&(o=null),void 0===a&&(a=.01),void 0===s&&(s=Ke.a.TRILINEAR_SAMPLINGMODE);var c=e.call(this,t,i,n,64,r,a,s,!0,o)||this;return c.name=t,c}return Object(h.d)(t,e),t}(ld),fd=i(143),pd=i(141),_d=i(142),md=i(139);!function(e){e[e.INIT=0]="INIT",e[e.RUNNING=1]="RUNNING",e[e.DONE=2]="DONE",e[e.ERROR=3]="ERROR"}(ud||(ud={}));var gd,vd=function(){function e(e){this.name=e,this._isCompleted=!1,this._taskState=ud.INIT}return Object.defineProperty(e.prototype,"isCompleted",{get:function(){return this._isCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"taskState",{get:function(){return this._taskState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorObject",{get:function(){return this._errorObject},enumerable:!1,configurable:!0}),e.prototype._setErrorObject=function(e,t){this._errorObject||(this._errorObject={message:e,exception:t})},e.prototype.run=function(e,t,i){var n=this;this._taskState=ud.RUNNING,this.runTask(e,function(){n.onDoneCallback(t,i)},function(e,t){n.onErrorCallback(i,e,t)})},e.prototype.runTask=function(e,t,i){throw new Error("runTask is not implemented")},e.prototype.reset=function(){this._taskState=ud.INIT},e.prototype.onErrorCallback=function(e,t,i){this._taskState=ud.ERROR,this._errorObject={message:t,exception:i},this.onError&&this.onError(this,t,i),e()},e.prototype.onDoneCallback=function(e,t){try{this._taskState=ud.DONE,this._isCompleted=!0,this.onSuccess&&this.onSuccess(this),e()}catch(e){this.onErrorCallback(t,"Task is done, error executing success callback(s)",e)}},e}(),bd=function(e,t,i){this.remainingCount=e,this.totalCount=t,this.task=i},yd=function(e){function t(t,i,n,r){var o=e.call(this,t)||this;return o.name=t,o.meshesNames=i,o.rootUrl=n,o.sceneFilename=r,o}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){var n=this;ar.LoadAssetContainer(this.rootUrl,this.sceneFilename,e,function(e){n.loadedContainer=e,n.loadedMeshes=e.meshes,n.loadedParticleSystems=e.particleSystems,n.loadedSkeletons=e.skeletons,n.loadedAnimationGroups=e.animationGroups,t()},null,function(e,t,n){i(t,n)})},t}(vd),Td=function(e){function t(t,i,n,r){var o=e.call(this,t)||this;return o.name=t,o.meshesNames=i,o.rootUrl=n,o.sceneFilename=r,o}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){var n=this;ar.ImportMesh(this.meshesNames,this.rootUrl,this.sceneFilename,e,function(e,i,r,o){n.loadedMeshes=e,n.loadedParticleSystems=i,n.loadedSkeletons=r,n.loadedAnimationGroups=o,t()},null,function(e,t,n){i(t,n)})},t}(vd),Ed=function(e){function t(t,i){var n=e.call(this,t)||this;return n.name=t,n.url=i,n}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){var n=this;e._loadFile(this.url,function(e){n.text=e,t()},void 0,!1,!1,function(e,t){e&&i(e.status+" "+e.statusText,t)})},t}(vd),Sd=function(e){function t(t,i){var n=e.call(this,t)||this;return n.name=t,n.url=i,n}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){var n=this;e._loadFile(this.url,function(e){n.data=e,t()},void 0,!0,!0,function(e,t){e&&i(e.status+" "+e.statusText,t)})},t}(vd),Ad=function(e){function t(t,i){var n=e.call(this,t)||this;return n.name=t,n.url=i,n}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){var n=this,r=new Image;Ce.b.SetCorsBehavior(this.url,r),r.onload=function(){n.image=r,t()},r.onerror=function(e){i("Error loading image",e)},r.src=this.url},t}(vd),Pd=function(e){function t(t,i,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=Ke.a.TRILINEAR_SAMPLINGMODE);var a=e.call(this,t)||this;return a.name=t,a.url=i,a.noMipmap=n,a.invertY=r,a.samplingMode=o,a}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){this.texture=new Ke.a(this.url,e,this.noMipmap,this.invertY,this.samplingMode,function(){t()},function(e,t){i(e,t)})},t}(vd),Cd=function(e){function t(t,i,n,r,o){var a=e.call(this,t)||this;return a.name=t,a.url=i,a.extensions=n,a.noMipmap=r,a.files=o,a}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){this.texture=new Wr(this.url,e,this.extensions,this.noMipmap,this.files,function(){t()},function(e,t){i(e,t)})},t}(vd),Rd=function(e){function t(t,i,n,r,o,a,s){void 0===r&&(r=!1),void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=!1);var c=e.call(this,t)||this;return c.name=t,c.url=i,c.size=n,c.noMipmap=r,c.generateHarmonics=o,c.gammaSpace=a,c.reserved=s,c}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){this.texture=new Ua(this.url,e,this.size,this.noMipmap,this.generateHarmonics,this.gammaSpace,this.reserved,function(){t()},function(e,t){i(e,t)})},t}(vd),xd=function(e){function t(t,i,n,r,o){void 0===r&&(r=!1),void 0===o&&(o=!0);var a=e.call(this,t)||this;return a.name=t,a.url=i,a.size=n,a.noMipmap=r,a.gammaSpace=o,a}return Object(h.d)(t,e),t.prototype.runTask=function(e,t,i){this.texture=new hs(this.url,e,this.size,this.noMipmap,this.gammaSpace,function(){t()},function(e,t){i(e,t)})},t}(vd),Od=function(){function e(e){this._isLoading=!1,this._tasks=new Array,this._waitingTasksCount=0,this._totalTasksCount=0,this.onTaskSuccessObservable=new o.c,this.onTaskErrorObservable=new o.c,this.onTasksDoneObservable=new o.c,this.onProgressObservable=new o.c,this.useDefaultLoadingScreen=!0,this.autoHideLoadingUI=!0,this._scene=e}return e.prototype.addContainerTask=function(e,t,i,n){var r=new yd(e,t,i,n);return this._tasks.push(r),r},e.prototype.addMeshTask=function(e,t,i,n){var r=new Td(e,t,i,n);return this._tasks.push(r),r},e.prototype.addTextFileTask=function(e,t){var i=new Ed(e,t);return this._tasks.push(i),i},e.prototype.addBinaryFileTask=function(e,t){var i=new Sd(e,t);return this._tasks.push(i),i},e.prototype.addImageTask=function(e,t){var i=new Ad(e,t);return this._tasks.push(i),i},e.prototype.addTextureTask=function(e,t,i,n,r){void 0===r&&(r=Ke.a.TRILINEAR_SAMPLINGMODE);var o=new Pd(e,t,i,n,r);return this._tasks.push(o),o},e.prototype.addCubeTextureTask=function(e,t,i,n,r){var o=new Cd(e,t,i,n,r);return this._tasks.push(o),o},e.prototype.addHDRCubeTextureTask=function(e,t,i,n,r,o,a){void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===a&&(a=!1);var s=new Rd(e,t,i,n,r,o,a);return this._tasks.push(s),s},e.prototype.addEquiRectangularCubeTextureAssetTask=function(e,t,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0);var o=new xd(e,t,i,n,r);return this._tasks.push(o),o},e.prototype.removeTask=function(e){var t=this._tasks.indexOf(e);t>-1&&this._tasks.splice(t,1)},e.prototype._decreaseWaitingTasksCount=function(e){this._waitingTasksCount--;try{this.onProgress&&this.onProgress(this._waitingTasksCount,this._totalTasksCount,e),this.onProgressObservable.notifyObservers(new bd(this._waitingTasksCount,this._totalTasksCount,e))}catch(e){m.a.Error("Error running progress callbacks."),console.log(e)}if(0===this._waitingTasksCount){try{var t=this._tasks.slice();this.onFinish&&this.onFinish(t);for(var i=0,n=t;i<n.length;i++)if((e=n[i]).taskState===ud.DONE){var r=this._tasks.indexOf(e);r>-1&&this._tasks.splice(r,1)}this.onTasksDoneObservable.notifyObservers(this._tasks)}catch(e){m.a.Error("Error running tasks-done callbacks."),console.log(e)}this._isLoading=!1,this.autoHideLoadingUI&&this._scene.getEngine().hideLoadingUI()}},e.prototype._runTask=function(e){var t=this,i=function(i,n){e._setErrorObject(i,n),t.onTaskError&&t.onTaskError(e),t.onTaskErrorObservable.notifyObservers(e),t._decreaseWaitingTasksCount(e)};e.run(this._scene,function(){try{t.onTaskSuccess&&t.onTaskSuccess(e),t.onTaskSuccessObservable.notifyObservers(e),t._decreaseWaitingTasksCount(e)}catch(e){i("Error executing task success callbacks",e)}},i)},e.prototype.reset=function(){return this._isLoading=!1,this._tasks=new Array,this},e.prototype.load=function(){if(this._isLoading)return this;if(this._isLoading=!0,this._waitingTasksCount=this._tasks.length,this._totalTasksCount=this._tasks.length,0===this._waitingTasksCount)return this._isLoading=!1,this.onFinish&&this.onFinish(this._tasks),this.onTasksDoneObservable.notifyObservers(this._tasks),this;this.useDefaultLoadingScreen&&this._scene.getEngine().displayLoadingUI();for(var e=0;e<this._tasks.length;e++){var t=this._tasks[e];t.taskState===ud.INIT&&this._runTask(t)}return this},e.prototype.loadAsync=function(){var e=this;return new Promise(function(t,i){e._isLoading?t():(e.onTasksDoneObservable.addOnce(function(e){e&&e.length?i(e):t()}),e.load())})},e}(),Md=function(){function e(){var e=this;this.promise=new Promise(function(t,i){e._resolve=t,e._reject=i})}return Object.defineProperty(e.prototype,"resolve",{get:function(){return this._resolve},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reject",{get:function(){return this._reject},enumerable:!1,configurable:!0}),e}(),Id=function(){function e(e,t){this._meshesOrigins=[],this._toCenterVectors=[],this._scaledDirection=a.e.Zero(),this._newPosition=a.e.Zero(),this._centerPosition=a.e.Zero(),this._meshes=e.slice(),t?this._centerMesh=t:this._setCenterMesh();var i=this._meshes.indexOf(this._centerMesh);i>=0&&this._meshes.splice(i,1),this._centerPosition=this._centerMesh.getAbsolutePosition().clone();for(var n=0;n<this._meshes.length;n++)if(this._meshes[n]){var r=this._meshes[n];this._meshesOrigins[n]=r.getAbsolutePosition().clone(),this._toCenterVectors[n]=a.e.Zero(),r._boundingInfo&&this._centerMesh._boundingInfo&&r._boundingInfo.boundingBox.centerWorld.subtractToRef(this._centerMesh._boundingInfo.boundingBox.centerWorld,this._toCenterVectors[n])}}return e.prototype._setCenterMesh=function(){for(var e=a.e.Zero(),t=a.e.Zero(),i=Number.MAX_VALUE,n=0;n<this._meshes.length;n++)this._meshes[n]&&(o=(r=this._meshes[n]).getBoundingInfo())&&t.addInPlace(o.boundingBox.centerWorld);for(e=t.scale(1/this._meshes.length),n=0;n<this._meshes.length;n++){var r,o;if(this._meshes[n]&&(o=(r=this._meshes[n]).getBoundingInfo())){var s=o.boundingBox.centerWorld.subtract(e).lengthSquared();s<i&&(this._centerMesh=r,i=s)}}},e.prototype.getClassName=function(){return"MeshExploder"},e.prototype.getMeshes=function(){var e=this._meshes.slice();return e.unshift(this._centerMesh),e},e.prototype.explode=function(e){void 0===e&&(e=1);for(var t=0;t<this._meshes.length;t++)this._meshes[t]&&this._meshesOrigins[t]&&this._toCenterVectors[t]&&(this._toCenterVectors[t].scaleToRef(e,this._scaledDirection),this._meshesOrigins[t].addToRef(this._scaledDirection,this._newPosition),this._meshes[t].setAbsolutePosition(this._newPosition));this._centerMesh.setAbsolutePosition(this._centerPosition)},e}(),Dd=function(){function e(e,t,i,n,r,o,a,s,c){this.onProcessFileCallback=function(){return!0},this._engine=e,this._currentScene=t,this._sceneLoadedCallback=i,this._progressCallback=n,this._additionalRenderLoopLogicCallback=r,this._textureLoadingCallback=o,this._startingProcessingFilesCallback=a,this._onReloadCallback=s,this._errorCallback=c}return Object.defineProperty(e,"FilesToLoad",{get:function(){return rr.a.FilesToLoad},enumerable:!1,configurable:!0}),e.prototype.monitorElementForDragNDrop=function(e){var t=this;e&&(this._elementToMonitor=e,this._dragEnterHandler=function(e){t.drag(e)},this._dragOverHandler=function(e){t.drag(e)},this._dropHandler=function(e){t.drop(e)},this._elementToMonitor.addEventListener("dragenter",this._dragEnterHandler,!1),this._elementToMonitor.addEventListener("dragover",this._dragOverHandler,!1),this._elementToMonitor.addEventListener("drop",this._dropHandler,!1))},Object.defineProperty(e.prototype,"filesToLoad",{get:function(){return this._filesToLoad},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._elementToMonitor&&(this._elementToMonitor.removeEventListener("dragenter",this._dragEnterHandler),this._elementToMonitor.removeEventListener("dragover",this._dragOverHandler),this._elementToMonitor.removeEventListener("drop",this._dropHandler))},e.prototype.renderFunction=function(){if(this._additionalRenderLoopLogicCallback&&this._additionalRenderLoopLogicCallback(),this._currentScene){if(this._textureLoadingCallback){var e=this._currentScene.getWaitingItemsCount();e>0&&this._textureLoadingCallback(e)}this._currentScene.render()}},e.prototype.drag=function(e){e.stopPropagation(),e.preventDefault()},e.prototype.drop=function(e){e.stopPropagation(),e.preventDefault(),this.loadFiles(e)},e.prototype._traverseFolder=function(e,t,i,n){var r=this,o=e.createReader(),a=e.fullPath.replace(/^\//,"").replace(/(.+?)\/?$/,"$1/");o.readEntries(function(e){i.count+=e.length;for(var o=0,s=e;o<s.length;o++){var c=s[o];c.isFile?c.file(function(e){e.correctName=a+e.name,t.push(e),0==--i.count&&n()}):c.isDirectory&&r._traverseFolder(c,t,i,n)}0==--i.count&&n()})},e.prototype._processFiles=function(t){for(var i=0;i<t.length;i++){var n=t[i].correctName.toLowerCase(),r=n.split(".").pop();this.onProcessFileCallback(t[i],n,r)&&(ar.IsPluginForExtensionAvailable("."+r)&&(this._sceneFileToLoad=t[i]),e.FilesToLoad[n]=t[i])}},e.prototype.loadFiles=function(e){var t=this;if(e&&e.dataTransfer&&e.dataTransfer.files&&(this._filesToLoad=e.dataTransfer.files),e&&e.target&&e.target.files&&(this._filesToLoad=e.target.files),this._filesToLoad&&0!==this._filesToLoad.length&&(this._startingProcessingFilesCallback&&this._startingProcessingFilesCallback(this._filesToLoad),this._filesToLoad&&this._filesToLoad.length>0)){for(var i=new Array,n=[],r=e.dataTransfer?e.dataTransfer.items:null,o=0;o<this._filesToLoad.length;o++){var a=this._filesToLoad[o],s=a.name.toLowerCase(),c=void 0;if(a.correctName=s,r){var l=r[o];l.getAsEntry?c=l.getAsEntry():l.webkitGetAsEntry&&(c=l.webkitGetAsEntry())}c&&c.isDirectory?n.push(c):i.push(a)}if(0===n.length)this._processFiles(i),this._processReload();else for(var u={count:n.length},h=0,d=n;h<d.length;h++){var f=d[h];this._traverseFolder(f,i,u,function(){t._processFiles(i),0===u.count&&t._processReload()})}}},e.prototype._processReload=function(){this._onReloadCallback?this._onReloadCallback(this._sceneFileToLoad):this.reload()},e.prototype.reload=function(){var e=this;this._sceneFileToLoad?(this._currentScene&&(m.a.errorsCount>0&&m.a.ClearLogCache(),this._engine.stopRenderLoop()),ar.ShowLoadingScreen=!1,this._engine.displayLoadingUI(),ar.LoadAsync("file:",this._sceneFileToLoad,this._engine,function(t){e._progressCallback&&e._progressCallback(t)}).then(function(t){e._currentScene&&e._currentScene.dispose(),e._currentScene=t,e._sceneLoadedCallback&&e._sceneLoadedCallback(e._sceneFileToLoad,e._currentScene),e._currentScene.executeWhenReady(function(){e._engine.hideLoadingUI(),e._engine.runRenderLoop(function(){e.renderFunction()})})}).catch(function(t){e._engine.hideLoadingUI(),e._errorCallback&&e._errorCallback(e._sceneFileToLoad,e._currentScene,t.message)})):m.a.Error("Please provide a valid .babylon file.")},e}(),Nd=i(146),Ld=i(145),wd=function(){function e(e){void 0===e&&(e=0),this.priority=e}return e.prototype.getDescription=function(){return""},e.prototype.apply=function(e,t){return!0},e}(),Fd=function(e){function t(t,i,n){void 0===t&&(t=0),void 0===i&&(i=1024),void 0===n&&(n=.5);var r=e.call(this,t)||this;return r.priority=t,r.maximumSize=i,r.step=n,r}return Object(h.d)(t,e),t.prototype.getDescription=function(){return"Reducing render target texture size to "+this.maximumSize},t.prototype.apply=function(e,t){for(var i=!0,n=0;n<e.textures.length;n++){var r=e.textures[n];if(r.canRescale&&!r.getContext){var o=r.getSize();Math.max(o.width,o.height)>this.maximumSize&&(r.scale(this.step),i=!1)}}return i},t}(wd),Bd=function(e){function t(t,i,n){void 0===t&&(t=0),void 0===i&&(i=2),void 0===n&&(n=.25);var r=e.call(this,t)||this;return r.priority=t,r.maximumScale=i,r.step=n,r._currentScale=-1,r._directionOffset=1,r}return Object(h.d)(t,e),t.prototype.getDescription=function(){return"Setting hardware scaling level to "+this._currentScale},t.prototype.apply=function(e,t){return-1===this._currentScale&&(this._currentScale=e.getEngine().getHardwareScalingLevel(),this._currentScale>this.maximumScale&&(this._directionOffset=-1)),this._currentScale+=this._directionOffset*this.step,e.getEngine().setHardwareScalingLevel(this._currentScale),1===this._directionOffset?this._currentScale>=this.maximumScale:this._currentScale<=this.maximumScale},t}(wd),Ud=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.getDescription=function(){return"Turning shadows on/off"},t.prototype.apply=function(e,t){return e.shadowsEnabled=t.isInImprovementMode,!0},t}(wd),Vd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.getDescription=function(){return"Turning post-processes on/off"},t.prototype.apply=function(e,t){return e.postProcessesEnabled=t.isInImprovementMode,!0},t}(wd),kd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.getDescription=function(){return"Turning lens flares on/off"},t.prototype.apply=function(e,t){return e.lensFlaresEnabled=t.isInImprovementMode,!0},t}(wd),Gd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.getDescription=function(){return this.onGetDescription?this.onGetDescription():"Running user defined callback"},t.prototype.apply=function(e,t){return!this.onApply||this.onApply(e,t)},t}(wd),zd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.getDescription=function(){return"Turning particles on/off"},t.prototype.apply=function(e,t){return e.particlesEnabled=t.isInImprovementMode,!0},t}(wd),jd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(h.d)(t,e),t.prototype.getDescription=function(){return"Turning render targets off"},t.prototype.apply=function(e,t){return e.renderTargetsEnabled=t.isInImprovementMode,!0},t}(wd),Wd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._canBeMerged=function(e){if(!(e instanceof be.a))return!1;var t=e;return!(t.isDisposed()||!t.isVisible||!t.isEnabled()||t.instances.length>0||t.skeleton||t.hasLODLevels)},t}return Object(h.d)(t,e),Object.defineProperty(t,"UpdateSelectionTree",{get:function(){return t._UpdateSelectionTree},set:function(e){t._UpdateSelectionTree=e},enumerable:!1,configurable:!0}),t.prototype.getDescription=function(){return"Merging similar meshes together"},t.prototype.apply=function(e,i,n){for(var r=e.meshes.slice(0),o=r.length,a=0;a<o;a++){var s=new Array,c=r[a];if(this._canBeMerged(c)){s.push(c);for(var l=a+1;l<o;l++){var u=r[l];this._canBeMerged(u)&&u.material===c.material&&u.checkCollisions===c.checkCollisions&&(s.push(u),o--,r.splice(l,1),l--)}s.length<2||be.a.MergeMeshes(s,void 0,!0)}}var h=e;return h.createOrUpdateSelectionOctree&&(null!=n?n&&h.createOrUpdateSelectionOctree():t.UpdateSelectionTree&&h.createOrUpdateSelectionOctree()),!0},t._UpdateSelectionTree=!1,t}(wd),Hd=function(){function e(e,t){void 0===e&&(e=60),void 0===t&&(t=2e3),this.targetFrameRate=e,this.trackerDuration=t,this.optimizations=new Array}return e.prototype.addOptimization=function(e){return this.optimizations.push(e),this},e.prototype.addCustomOptimization=function(e,t,i){void 0===i&&(i=0);var n=new Gd(i);return n.onApply=e,n.onGetDescription=t,this.optimizations.push(n),this},e.LowDegradationAllowed=function(t){var i=new e(t),n=0;return i.addOptimization(new Wd(n)),i.addOptimization(new Ud(n)),i.addOptimization(new kd(n)),n++,i.addOptimization(new Vd(n)),i.addOptimization(new zd(n)),n++,i.addOptimization(new Fd(n,1024)),i},e.ModerateDegradationAllowed=function(t){var i=new e(t),n=0;return i.addOptimization(new Wd(n)),i.addOptimization(new Ud(n)),i.addOptimization(new kd(n)),n++,i.addOptimization(new Vd(n)),i.addOptimization(new zd(n)),n++,i.addOptimization(new Fd(n,512)),n++,i.addOptimization(new jd(n)),n++,i.addOptimization(new Bd(n,2)),i},e.HighDegradationAllowed=function(t){var i=new e(t),n=0;return i.addOptimization(new Wd(n)),i.addOptimization(new Ud(n)),i.addOptimization(new kd(n)),n++,i.addOptimization(new Vd(n)),i.addOptimization(new zd(n)),n++,i.addOptimization(new Fd(n,256)),n++,i.addOptimization(new jd(n)),n++,i.addOptimization(new Bd(n,4)),i},e}(),Xd=function(){function e(e,t,i,n){var r=this;if(void 0===i&&(i=!0),void 0===n&&(n=!1),this._isRunning=!1,this._currentPriorityLevel=0,this._targetFrameRate=60,this._trackerDuration=2e3,this._currentFrameRate=0,this._improvementMode=!1,this.onSuccessObservable=new o.c,this.onNewOptimizationAppliedObservable=new o.c,this.onFailureObservable=new o.c,this._options=t||new Hd,this._options.targetFrameRate&&(this._targetFrameRate=this._options.targetFrameRate),this._options.trackerDuration&&(this._trackerDuration=this._options.trackerDuration),i)for(var a=0,s=0,c=this._options.optimizations;s<c.length;s++)c[s].priority=a++;this._improvementMode=n,this._scene=e||x.a.LastCreatedScene,this._sceneDisposeObserver=this._scene.onDisposeObservable.add(function(){r._sceneDisposeObserver=null,r.dispose()})}return Object.defineProperty(e.prototype,"isInImprovementMode",{get:function(){return this._improvementMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentPriorityLevel",{get:function(){return this._currentPriorityLevel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrameRate",{get:function(){return this._currentFrameRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetFrameRate",{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackerDuration",{get:function(){return this._trackerDuration},set:function(e){this._trackerDuration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optimizations",{get:function(){return this._options.optimizations},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this._isRunning=!1},e.prototype.reset=function(){this._currentPriorityLevel=0},e.prototype.start=function(){var e=this;this._isRunning||(this._isRunning=!0,this._scene.executeWhenReady(function(){setTimeout(function(){e._checkCurrentState()},e._trackerDuration)}))},e.prototype._checkCurrentState=function(){var e=this;if(this._isRunning){var t=this._scene,i=this._options;if(this._currentFrameRate=Math.round(t.getEngine().getFps()),this._improvementMode&&this._currentFrameRate<=this._targetFrameRate||!this._improvementMode&&this._currentFrameRate>=this._targetFrameRate)return this._isRunning=!1,void this.onSuccessObservable.notifyObservers(this);for(var n=!0,r=!0,o=0;o<i.optimizations.length;o++){var a=i.optimizations[o];a.priority===this._currentPriorityLevel&&(r=!1,n=n&&a.apply(t,this),this.onNewOptimizationAppliedObservable.notifyObservers(a))}if(r)return this._isRunning=!1,void this.onFailureObservable.notifyObservers(this);n&&this._currentPriorityLevel++,t.executeWhenReady(function(){setTimeout(function(){e._checkCurrentState()},e._trackerDuration)})}},e.prototype.dispose=function(){this.stop(),this.onSuccessObservable.clear(),this.onFailureObservable.clear(),this.onNewOptimizationAppliedObservable.clear(),this._sceneDisposeObserver&&this._scene.onDisposeObservable.remove(this._sceneDisposeObserver)},e.OptimizeAsync=function(t,i,n,r){var o=new e(t,i||Hd.ModerateDegradationAllowed(),!1);return n&&o.onSuccessObservable.add(function(){n()}),r&&o.onFailureObservable.add(function(){r()}),o.start(),o},e}(),Yd=[],Kd=function(e,t){Yd[e.id]||e.doNotSerialize||(t.vertexData.push(e.serializeVerticeData()),Yd[e.id]=!0)},Qd=function(e,t){var i={},n=e._geometry;return n&&(e.getScene().getGeometryByID(n.id)||Kd(n,t.geometries)),e.serialize&&e.serialize(i),i},qd=function(){function e(){}return e.ClearCache=function(){Yd=[]},e.Serialize=function(t){var i,n,r,o={};if(e.ClearCache(),o.useDelayedTextureLoading=t.useDelayedTextureLoading,o.autoClear=t.autoClear,o.clearColor=t.clearColor.asArray(),o.ambientColor=t.ambientColor.asArray(),o.gravity=t.gravity.asArray(),o.collisionsEnabled=t.collisionsEnabled,t.fogMode&&0!==t.fogMode&&(o.fogMode=t.fogMode,o.fogColor=t.fogColor.asArray(),o.fogStart=t.fogStart,o.fogEnd=t.fogEnd,o.fogDensity=t.fogDensity),t.isPhysicsEnabled()){var a=t.getPhysicsEngine();a&&(o.physicsEnabled=!0,o.physicsGravity=a.gravity.asArray(),o.physicsEngine=a.getPhysicsPluginName())}t.metadata&&(o.metadata=t.metadata),o.morphTargetManagers=[];for(var s=0,c=t.meshes;s<c.length;s++){var l=(b=c[s]).morphTargetManager;l&&o.morphTargetManagers.push(l.serialize())}for(o.lights=[],i=0;i<t.lights.length;i++)(n=t.lights[i]).doNotSerialize||o.lights.push(n.serialize());for(o.cameras=[],i=0;i<t.cameras.length;i++){var u=t.cameras[i];u.doNotSerialize||o.cameras.push(u.serialize())}if(t.activeCamera&&(o.activeCameraID=t.activeCamera.id),w.a.AppendSerializedAnimations(t,o),t.animationGroups&&t.animationGroups.length>0){o.animationGroups=[];for(var h=0;h<t.animationGroups.length;h++){var d=t.animationGroups[h];o.animationGroups.push(d.serialize())}}if(t.reflectionProbes&&t.reflectionProbes.length>0)for(o.reflectionProbes=[],i=0;i<t.reflectionProbes.length;i++){var f=t.reflectionProbes[i];o.reflectionProbes.push(f.serialize())}for(o.materials=[],o.multiMaterials=[],i=0;i<t.materials.length;i++)(r=t.materials[i]).doNotSerialize||o.materials.push(r.serialize());for(o.multiMaterials=[],i=0;i<t.multiMaterials.length;i++){var p=t.multiMaterials[i];o.multiMaterials.push(p.serialize())}for(t.environmentTexture&&(o.environmentTexture=t.environmentTexture.name),o.environmentIntensity=t.environmentIntensity,o.skeletons=[],i=0;i<t.skeletons.length;i++){var _=t.skeletons[i];_.doNotSerialize||o.skeletons.push(_.serialize())}for(o.transformNodes=[],i=0;i<t.transformNodes.length;i++)t.transformNodes[i].doNotSerialize||o.transformNodes.push(t.transformNodes[i].serialize());o.geometries={},o.geometries.boxes=[],o.geometries.spheres=[],o.geometries.cylinders=[],o.geometries.toruses=[],o.geometries.grounds=[],o.geometries.planes=[],o.geometries.torusKnots=[],o.geometries.vertexData=[],Yd=[];var m=t.getGeometries();for(i=0;i<m.length;i++){var v=m[i];v.isReady()&&Kd(v,o.geometries)}for(o.meshes=[],i=0;i<t.meshes.length;i++){var b;if((b=t.meshes[i])instanceof be.a){var y=b;y.doNotSerialize||y.delayLoadState!==g.a.DELAYLOADSTATE_LOADED&&y.delayLoadState!==g.a.DELAYLOADSTATE_NONE||o.meshes.push(Qd(y,o))}}for(o.particleSystems=[],i=0;i<t.particleSystems.length;i++)o.particleSystems.push(t.particleSystems[i].serialize(!1));for(o.postProcesses=[],i=0;i<t.postProcesses.length;i++)o.postProcesses.push(t.postProcesses[i].serialize());t.actionManager&&(o.actions=t.actionManager.serialize("scene"));for(var T=0,E=t._serializableComponents;T<E.length;T++)E[T].serialize(o);return o},e.SerializeMesh=function(t,i,n){void 0===i&&(i=!1),void 0===n&&(n=!1);var r={};if(e.ClearCache(),t=t instanceof Array?t:[t],i||n)for(var o=0;o<t.length;++o)n&&t[o].getDescendants().forEach(function(e){e instanceof be.a&&t.indexOf(e)<0&&!e.doNotSerialize&&t.push(e)}),i&&t[o].parent&&t.indexOf(t[o].parent)<0&&!t[o].parent.doNotSerialize&&t.push(t[o].parent);return t.forEach(function(e){!function(e,t){if(e.delayLoadState===g.a.DELAYLOADSTATE_LOADED||e.delayLoadState===g.a.DELAYLOADSTATE_NONE){if(e.material&&!e.material.doNotSerialize)if(e.material instanceof Da.a){if(t.multiMaterials=t.multiMaterials||[],t.materials=t.materials||[],!t.multiMaterials.some(function(t){return t.id===e.material.id})){t.multiMaterials.push(e.material.serialize());for(var i=function(e){e&&(t.materials.some(function(t){return t.id===e.id})||t.materials.push(e.serialize()))},n=0,r=e.material.subMaterials;n<r.length;n++)i(r[n])}}else t.materials=t.materials||[],t.materials.some(function(t){return t.id===e.material.id})||t.materials.push(e.material.serialize());var o=e._geometry;o&&(t.geometries||(t.geometries={},t.geometries.boxes=[],t.geometries.spheres=[],t.geometries.cylinders=[],t.geometries.toruses=[],t.geometries.grounds=[],t.geometries.planes=[],t.geometries.torusKnots=[],t.geometries.vertexData=[]),Kd(o,t.geometries)),e.skeleton&&!e.skeleton.doNotSerialize&&(t.skeletons=t.skeletons||[],t.skeletons.push(e.skeleton.serialize())),t.meshes=t.meshes||[],t.meshes.push(Qd(e,t))}}(e,r)}),r},e}(),Zd=i(37),Jd=function(){function e(){}return e.CreateResizedCopy=function(e,t,i,n){void 0===n&&(n=!0);var r=e.getScene(),o=r.getEngine(),a=new Ri("resized"+e.name,{width:t,height:i},r,!e.noMipmap,!0,e._texture.type,!1,e.samplingMode,!1);a.wrapU=e.wrapU,a.wrapV=e.wrapV,a.uOffset=e.uOffset,a.vOffset=e.vOffset,a.uScale=e.uScale,a.vScale=e.vScale,a.uAng=e.uAng,a.vAng=e.vAng,a.wAng=e.wAng,a.coordinatesIndex=e.coordinatesIndex,a.level=e.level,a.anisotropicFilteringLevel=e.anisotropicFilteringLevel,a._texture.isReady=!1,e.wrapU=Ke.a.CLAMP_ADDRESSMODE,e.wrapV=Ke.a.CLAMP_ADDRESSMODE;var s=new li("pass",1,null,n?Ke.a.BILINEAR_SAMPLINGMODE:Ke.a.NEAREST_SAMPLINGMODE,o,!1,g.a.TEXTURETYPE_UNSIGNED_INT);return s.getEffect().executeWhenCompiled(function(){s.onApply=function(t){t.setTexture("textureSampler",e)};var t=a.getInternalTexture();t&&(r.postProcessManager.directRender([s],t),o.unBindFramebuffer(t),a.disposeFramebufferObjects(),s.dispose(),t.isReady=!0)}),a},e}(),$d=function(){function e(t,i){if(void 0===i&&(i=null),!e.IsSupported(t))throw"Your browser does not support recording so far.";var n=t.getRenderingCanvas();if(!n)throw"The babylon engine must have a canvas to be recorded";this._canvas=n,this._canvas.isRecording=!1,this._options=Object(h.a)(Object(h.a)({},e._defaultOptions),i);var r=this._canvas.captureStream(this._options.fps);if(this._options.audioTracks)for(var o=0,a=this._options.audioTracks;o<a.length;o++){var s=a[o];r.addTrack(s)}this._mediaRecorder=new MediaRecorder(r,{mimeType:this._options.mimeType}),this._mediaRecorder.ondataavailable=this._handleDataAvailable.bind(this),this._mediaRecorder.onerror=this._handleError.bind(this),this._mediaRecorder.onstop=this._handleStop.bind(this)}return e.IsSupported=function(e){var t=e.getRenderingCanvas();return!!t&&"function"==typeof t.captureStream},Object.defineProperty(e.prototype,"isRecording",{get:function(){return!!this._canvas&&this._canvas.isRecording},enumerable:!1,configurable:!0}),e.prototype.stopRecording=function(){this._canvas&&this._mediaRecorder&&this.isRecording&&(this._canvas.isRecording=!1,this._mediaRecorder.stop())},e.prototype.startRecording=function(e,t){var i=this;if(void 0===e&&(e="babylonjs.webm"),void 0===t&&(t=7),!this._canvas||!this._mediaRecorder)throw"Recorder has already been disposed";if(this.isRecording)throw"Recording already in progress";return t>0&&setTimeout(function(){i.stopRecording()},1e3*t),this._fileName=e,this._recordedChunks=[],this._resolve=null,this._reject=null,this._canvas.isRecording=!0,this._mediaRecorder.start(this._options.recordChunckSize),new Promise(function(e,t){i._resolve=e,i._reject=t})},e.prototype.dispose=function(){this._canvas=null,this._mediaRecorder=null,this._recordedChunks=[],this._fileName=null,this._resolve=null,this._reject=null},e.prototype._handleDataAvailable=function(e){e.data.size>0&&this._recordedChunks.push(e.data)},e.prototype._handleError=function(e){if(this.stopRecording(),!this._reject)throw new e.error;this._reject(e.error)},e.prototype._handleStop=function(){this.stopRecording();var e=new Blob(this._recordedChunks);this._resolve&&this._resolve(e),window.URL.createObjectURL(e),this._fileName&&Ce.b.Download(e,this._fileName)},e._defaultOptions={mimeType:"video/webm",fps:25,recordChunckSize:3e3},e}(),ef=function(){function e(){}return e.CreateScreenshot=function(t,i,n,r,o){void 0===o&&(o="image/png");var a=e._getScreenshotSize(t,i,n),s=a.height,c=a.width;if(s&&c){Ce.b._ScreenshotCanvas||(Ce.b._ScreenshotCanvas=document.createElement("canvas")),Ce.b._ScreenshotCanvas.width=c,Ce.b._ScreenshotCanvas.height=s;var l=Ce.b._ScreenshotCanvas.getContext("2d"),u=t.getRenderWidth()/t.getRenderHeight(),h=c,d=h/u;d>s&&(h=(d=s)*u);var f=Math.max(0,c-h)/2,p=Math.max(0,s-d)/2,_=t.getRenderingCanvas();l&&_&&l.drawImage(_,f,p,h,d),Ce.b.EncodeScreenshotCanvasData(r,o)}else m.a.Error("Invalid 'size' parameter !")},e.CreateScreenshotAsync=function(t,i,n,r){return void 0===r&&(r="image/png"),new Promise(function(o,a){e.CreateScreenshot(t,i,n,function(e){void 0!==e?o(e):a(new Error("Data is undefined"))},r)})},e.CreateScreenshotUsingRenderTarget=function(t,i,n,r,o,a,s,c,l,u){void 0===o&&(o="image/png"),void 0===a&&(a=1),void 0===s&&(s=!1),void 0===l&&(l=!1),void 0===u&&(u=!1);var h=e._getScreenshotSize(t,i,n),d=h.height,f=h.width,p={width:f,height:d};if(d&&f){var _=t.getRenderingCanvas();if(_){var v={width:_.width,height:_.height};t.setSize(f,d);var b=i.getScene(),y=null,T=b.activeCameras;(b.activeCamera!==i||b.activeCameras&&b.activeCameras.length)&&(y=b.activeCamera,b.activeCamera=i),b.render();var E=new Ri("screenShot",p,b,!1,!1,g.a.TEXTURETYPE_UNSIGNED_INT,!1,Ke.a.NEAREST_SAMPLINGMODE,void 0,u);E.renderList=null,E.samples=a,E.renderSprites=l,E.onAfterRenderObservable.add(function(){Ce.b.DumpFramebuffer(f,d,t,r,o,c)});var S=function(){b.incrementRenderId(),b.resetCachedMaterial(),E.render(!0),E.dispose(),y&&(b.activeCamera=y),b.activeCameras=T,t.setSize(v.width,v.height),i.getProjectionMatrix(!0)};if(s){var A=new Eh("antialiasing",1,b.activeCamera);E.addPostProcess(A),A.getEffect().isReady()?S():A.getEffect().onCompiled=function(){S()}}else S()}else m.a.Error("No rendering canvas found !")}else m.a.Error("Invalid 'size' parameter !")},e.CreateScreenshotUsingRenderTargetAsync=function(t,i,n,r,o,a,s,c){return void 0===r&&(r="image/png"),void 0===o&&(o=1),void 0===a&&(a=!1),void 0===c&&(c=!1),new Promise(function(l,u){e.CreateScreenshotUsingRenderTarget(t,i,n,function(e){void 0!==e?l(e):u(new Error("Data is undefined"))},r,o,a,s,c)})},e._getScreenshotSize=function(e,t,i){var n=0,r=0;if("object"==typeof i){var o=i.precision?Math.abs(i.precision):1;i.width&&i.height?(n=i.height*o,r=i.width*o):i.width&&!i.height?(r=i.width*o,n=Math.round(r/e.getAspectRatio(t))):i.height&&!i.width?(n=i.height*o,r=Math.round(n*e.getAspectRatio(t))):(r=Math.round(e.getRenderWidth()*o),n=Math.round(r/e.getAspectRatio(t)))}else isNaN(i)||(n=i,r=i);return r&&(r=Math.floor(r)),n&&(n=Math.floor(n)),{height:0|n,width:0|r}},e}();Ce.b.CreateScreenshot=ef.CreateScreenshot,Ce.b.CreateScreenshotAsync=ef.CreateScreenshotAsync,Ce.b.CreateScreenshotUsingRenderTarget=ef.CreateScreenshotUsingRenderTarget,Ce.b.CreateScreenshotUsingRenderTargetAsync=ef.CreateScreenshotUsingRenderTargetAsync,function(e){e[e.Checkbox=0]="Checkbox",e[e.Slider=1]="Slider",e[e.Vector3=2]="Vector3",e[e.Quaternion=3]="Quaternion",e[e.Color3=4]="Color3",e[e.String=5]="String"}(gd||(gd={}));var tf,nf=i(140),rf=function(){function e(e){this.byteOffset=0,this.buffer=e}return e.prototype.loadAsync=function(e){var t=this;return this.buffer.readAsync(this.byteOffset,e).then(function(e){t._dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),t._dataByteOffset=0})},e.prototype.readUint32=function(){var e=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,e},e.prototype.readUint8Array=function(e){var t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,e);return this._dataByteOffset+=e,this.byteOffset+=e,t},e.prototype.readString=function(e){return jr.a.Decode(this.readUint8Array(e))},e.prototype.skipBytes=function(e){this._dataByteOffset+=e,this.byteOffset+=e},e}(),of=function(){function e(){}return e._GetStorage=function(){try{return localStorage.setItem("test",""),localStorage.removeItem("test"),localStorage}catch(t){var e={};return{getItem:function(t){var i=e[t];return void 0===i?null:i},setItem:function(t,i){e[t]=i}}}},e.ReadString=function(e,t){var i=this._Storage.getItem(e);return null!==i?i:t},e.WriteString=function(e,t){this._Storage.setItem(e,t)},e.ReadBoolean=function(e,t){var i=this._Storage.getItem(e);return null!==i?"true"===i:t},e.WriteBoolean=function(e,t){this._Storage.setItem(e,t?"true":"false")},e.ReadNumber=function(e,t){var i=this._Storage.getItem(e);return null!==i?parseFloat(i):t},e.WriteNumber=function(e,t){this._Storage.setItem(e,t.toString())},e._Storage=e._GetStorage(),e}(),af=function(){function e(){this._trackedScene=null}return e.prototype.track=function(e){this._trackedScene=e,this._savedJSON=qd.Serialize(e)},e.prototype.getDelta=function(){if(!this._trackedScene)return null;var e=qd.Serialize(this._trackedScene),t={};for(var i in e)this._compareCollections(i,this._savedJSON[i],e[i],t);return t},e.prototype._compareArray=function(e,t,i,n){if(0===t.length&&0===i.length)return!0;if(t.length&&!isNaN(t[0])||i.length&&!isNaN(i[0])){if(t.length!==i.length)return!1;if(0===t.length)return!0;for(var r=0;r<t.length;r++)if(t[r]!==i[r])return n[e]=i,!1;return!0}var o=[],a=function(){var a=t[r],c=a.uniqueId;o.push(c);var l=i.filter(function(e){return e.uniqueId===c});if(l.length){var u=l[0],h={};s._compareObjects(a,u,h)||(n[e]||(n[e]=[]),h.__state={id:u.id||u.name},n[e].push(h))}else h={__state:{deleteId:a.id||a.name}},n[e].push(h)},s=this;for(r=0;r<t.length;r++)a();for(r=0;r<i.length;r++){var c=i[r],l=c.uniqueId;-1===o.indexOf(l)&&(n[e]||(n[e]=[]),n[e].push(c))}return!0},e.prototype._compareObjects=function(e,t,i){var n=!1;for(var r in e)if(e.hasOwnProperty(r)){var o=e[r],a=t[r],s=!1;Array.isArray(o)?s=JSON.stringify(o)!==JSON.stringify(a):isNaN(o)&&"[object String]"!=Object.prototype.toString.call(o)||(s=o!==a),s&&(n=!0,i[r]=a)}return!n},e.prototype._compareCollections=function(e,t,i,n){if(t!==i&&t&&i)if(Array.isArray(t)&&Array.isArray(i)){if(this._compareArray(e,t,i,n))return}else if("object"==typeof t&&"object"==typeof i){var r={};return void(this._compareObjects(t,i,r)||(n[e]=r))}},e.GetShadowGeneratorById=function(e,t){for(var i=0,n=e.lights.map(function(e){return e.getShadowGenerator()});i<n.length;i++){var r=n[i];if(r&&r.id===t)return r}return null},e.ApplyDelta=function(e,t){var i=this;"string"==typeof e&&(e=JSON.parse(e));var n=t;for(var r in e){var o=e[r],a=n[r];if(Array.isArray(a)||"shadowGenerators"===r)switch(r){case"cameras":this._ApplyDeltaForEntity(o,t,t.getCameraByID.bind(t),function(e){return je.a.Parse(e,t)});break;case"lights":this._ApplyDeltaForEntity(o,t,t.getLightByID.bind(t),function(e){return Dr.a.Parse(e,t)});break;case"shadowGenerators":this._ApplyDeltaForEntity(o,t,function(e){return i.GetShadowGeneratorById(t,e)},function(e){return ga.Parse(e,t)});break;case"meshes":this._ApplyDeltaForEntity(o,t,t.getMeshByID.bind(t),function(e){return be.a.Parse(e,t,"")});break;case"skeletons":this._ApplyDeltaForEntity(o,t,t.getSkeletonById.bind(t),function(e){return tt.Parse(e,t)});break;case"materials":this._ApplyDeltaForEntity(o,t,t.getMaterialByID.bind(t),function(e){return lo.a.Parse(e,t,"")});break;case"multiMaterials":this._ApplyDeltaForEntity(o,t,t.getMaterialByID.bind(t),function(e){return Da.a.Parse(e,t,"")});break;case"transformNodes":this._ApplyDeltaForEntity(o,t,t.getTransformNodeByID.bind(t),function(e){return Pr.a.Parse(e,t,"")});break;case"particleSystems":this._ApplyDeltaForEntity(o,t,t.getParticleSystemByID.bind(t),function(e){return Fu.Parse(e,t,"")});break;case"morphTargetManagers":this._ApplyDeltaForEntity(o,t,t.getMorphTargetById.bind(t),function(e){return ka.Parse(e,t)});break;case"postProcesses":this._ApplyDeltaForEntity(o,t,t.getPostProcessByName.bind(t),function(e){return ci.Parse(e,t,"")})}else isNaN(a)?a.fromArray&&a.fromArray(o):n[r]=o}},e._ApplyPropertiesToEntity=function(e,t){for(var i in e){var n=e[i],r=t[i];void 0!==r&&(!isNaN(r)||Array.isArray(r)?t[i]=n:r.fromArray&&r.fromArray(n))}},e._ApplyDeltaForEntity=function(e,t,i,n){for(var r=0,o=e;r<o.length;r++){var a=o[r];if(a.__state&&void 0!==a.__state.id){var s=i(a.__state.id);s&&this._ApplyPropertiesToEntity(a,s)}else if(a.__state&&void 0!==a.__state.deleteId){var c=i(a.__state.deleteId);null==c||c.dispose()}else n(a)}},e}();!function(e){var t=function(){function e(e,t,i,n){var r;void 0===t&&(t=null),void 0===i&&(i=null),void 0===n&&(n=null),t=null!=t?t:function(){return 1},i=null!=i?i:function(){return 1},n=null!=n?n:function(e,t){return e===t?0:1},this._characterToIdx=new Map,this._insertionCosts=new Array(e.length),this._deletionCosts=new Array(e.length),this._substitutionCosts=new Array(e.length);for(var o=0;o<e.length;++o){r=e[o],this._characterToIdx.set(r,o),this._insertionCosts[o]=t(r),this._deletionCosts[o]=i(r),this._substitutionCosts[o]=new Array(e.length);for(var a=o;a<e.length;++a)this._substitutionCosts[o][a]=n(r,e[a])}}return e.prototype.serialize=function(){var e={},t=new Array(this._characterToIdx.size);return this._characterToIdx.forEach(function(e,i){t[e]=i}),e.characters=t,e.insertionCosts=this._insertionCosts,e.deletionCosts=this._deletionCosts,e.substitutionCosts=this._substitutionCosts,JSON.stringify(e)},e.Deserialize=function(t){var i=JSON.parse(t),n=new e(i.characters);return n._insertionCosts=i.insertionCosts,n._deletionCosts=i.deletionCosts,n._substitutionCosts=i.substitutionCosts,n},e.prototype.getCharacterIdx=function(e){return this._characterToIdx.get(e)},e.prototype.getInsertionCost=function(e){return this._insertionCosts[e]},e.prototype.getDeletionCost=function(e){return this._deletionCosts[e]},e.prototype.getSubstitutionCost=function(e,t){var i=Math.min(e,t),n=Math.max(e,t);return this._substitutionCosts[i][n]},e}();e.Alphabet=t;var i=function(){function e(t,i){var n=this;if(t.length>e.MAX_SEQUENCE_LENGTH)throw new Error("Sequences longer than "+e.MAX_SEQUENCE_LENGTH+" not supported.");this._alphabet=i,this._characters=t.map(function(e){return n._alphabet.getCharacterIdx(e)})}return e.prototype.serialize=function(){return JSON.stringify(this._characters)},e.Deserialize=function(t,i){var n=new e([],i);return n._characters=JSON.parse(t),n},e.prototype.distance=function(t){return e._distance(this,t)},e._distance=function(t,i){var n=t._alphabet;if(n!==i._alphabet)throw new Error("Cannot Levenshtein compare Sequences built from different alphabets.");var r=t._characters,o=i._characters,a=r.length,s=o.length,c=e._costMatrix;c[0][0]=0;for(var l=0;l<a;++l)c[l+1][0]=c[l][0]+n.getInsertionCost(r[l]);for(l=0;l<s;++l)c[0][l+1]=c[0][l]+n.getInsertionCost(o[l]);for(var u=0;u<a;++u)for(var h=0;h<s;++h)e._insertionCost=c[u+1][h]+n.getInsertionCost(o[h]),e._deletionCost=c[u][h+1]+n.getDeletionCost(r[u]),e._substitutionCost=c[u][h]+n.getSubstitutionCost(r[u],o[h]),c[u+1][h+1]=Math.min(e._insertionCost,e._deletionCost,e._substitutionCost);return c[a][s]},e.MAX_SEQUENCE_LENGTH=256,e._costMatrix=Object(h.f)(Array(e.MAX_SEQUENCE_LENGTH+1)).map(function(t){return new Array(e.MAX_SEQUENCE_LENGTH+1)}),e}();e.Sequence=i}(tf||(tf={}));var sf=function(){function e(e){void 0===e&&(e=.01),this._points=[],this._segmentLength=e}return e.prototype.serialize=function(){return JSON.stringify(this)},e.Deserialize=function(t){var i=JSON.parse(t),n=new e(i._segmentLength);return n._points=i._points.map(function(e){return new a.e(e._x,e._y,e._z)}),n},e.prototype.getLength=function(){return this._points.length*this._segmentLength},e.prototype.add=function(e){var t=this,i=this._points.length;if(0===i)this._points.push(e.clone());else for(var n=function(){return t._segmentLength/a.e.Distance(t._points[i-1],e)},r=n();r<=1;r=n()){var o=this._points[i-1].scale(1-r);e.scaleAndAddToRef(r,o),this._points.push(o),++i}},e.prototype.resampleAtTargetResolution=function(t){var i=new e(this.getLength()/t);return this._points.forEach(function(e){i.add(e)}),i},e.prototype.tokenize=function(t){for(var i=[],n=new a.e,r=2;r<this._points.length;++r)e._transformSegmentDirToRef(this._points[r-2],this._points[r-1],this._points[r],n)&&i.push(e._tokenizeSegment(n,t));return i},e._transformSegmentDirToRef=function(t,i,n,r){return i.subtractToRef(t,e._forwardDir),e._forwardDir.normalize(),i.scaleToRef(-1,e._inverseFromVec),e._inverseFromVec.normalize(),!(Math.abs(a.e.Dot(e._forwardDir,e._inverseFromVec))>.98||(a.e.CrossToRef(e._forwardDir,e._inverseFromVec,e._upDir),e._upDir.normalize(),a.a.LookAtLHToRef(t,i,e._upDir,e._lookMatrix),n.subtractToRef(i,e._fromToVec),e._fromToVec.normalize(),a.e.TransformNormalToRef(e._fromToVec,e._lookMatrix,r),0))},e._tokenizeSegment=function(t,i){e._bestMatch=0,e._score=a.e.Dot(t,i[0]),e._bestScore=e._score;for(var n=1;n<i.length;++n)e._score=a.e.Dot(t,i[n]),e._score>e._bestScore&&(e._bestMatch=n,e._bestScore=e._score);return e._bestMatch},e._forwardDir=new a.e,e._inverseFromVec=new a.e,e._upDir=new a.e,e._fromToVec=new a.e,e._lookMatrix=new a.a,e}(),cf=function(){function e(e){this.chars=new Array(e)}return e.Generate=function(t,i,n,r,o){void 0===t&&(t=64),void 0===i&&(i=256),void 0===n&&(n=.1),void 0===r&&(r=.001),void 0===o&&(o=[]);for(var s,c,l=new e(t),u=0;u<t;++u)l.chars[u]=new a.e(Math.random()-.5,Math.random()-.5,Math.random()-.5),l.chars[u].normalize();for(u=0;u<o.length;++u)l.chars[u].copyFrom(o[u]);for(var h,d=new a.e,f=new a.e,p=0;p<i;++p){s=(1-(h=p/(i-1)))*n+h*r;var _=function(e){d.copyFromFloats(0,0,0),l.chars.forEach(function(t){l.chars[e].subtractToRef(t,f),(c=f.lengthSquared())>1e-6&&f.scaleAndAddToRef(1/(f.lengthSquared()*c),d)}),d.scaleInPlace(s),l.chars[e].addInPlace(d),l.chars[e].normalize()};for(u=o.length;u<l.chars.length;++u)_(u)}return l},e.prototype.serialize=function(){return JSON.stringify(this.chars)},e.Deserialize=function(t){for(var i=JSON.parse(t),n=new e(i.length),r=0;r<i.length;++r)n.chars[r]=new a.e(i[r]._x,i[r]._y,i[r]._z);return n},e}(),lf=function(){function e(){this._sequences=[]}return e.prototype.serialize=function(){return JSON.stringify(this._sequences.map(function(e){return e.serialize()}))},e.Deserialize=function(t,i){var n=new e;return n._sequences=JSON.parse(t).map(function(e){return tf.Sequence.Deserialize(e,i)}),n},e.CreateFromTrajectory=function(t,i,n){return e.CreateFromTokenizationPyramid(e._getTokenizationPyramid(t,i),n)},e.CreateFromTokenizationPyramid=function(t,i){var n=new e;return n._sequences=t.map(function(e){return new tf.Sequence(e,i)}),n},e._getTokenizationPyramid=function(t,i,n){void 0===n&&(n=e.FINEST_DESCRIPTOR_RESOLUTION);for(var r=[],o=n;o>4;o=Math.floor(o/2))r.push(t.resampleAtTargetResolution(o).tokenize(i.chars));return r},e.prototype.distance=function(e){for(var t=0,i=0;i<this._sequences.length;++i)t+=Math.pow(2,i)*this._sequences[i].distance(e._sequences[i]);return t},e.FINEST_DESCRIPTOR_RESOLUTION=32,e}(),uf=function(){function e(e){void 0===e&&(e=[]),this._descriptors=e,this._centroidIdx=-1,this._averageDistance=0,this._refreshDescription()}return e.prototype.serialize=function(){var e={};return e.descriptors=this._descriptors.map(function(e){return e.serialize()}),e.centroidIdx=this._centroidIdx,e.averageDistance=this._averageDistance,JSON.stringify(e)},e.Deserialize=function(t,i){var n=JSON.parse(t),r=new e;return r._descriptors=n.descriptors.map(function(e){return lf.Deserialize(e,i)}),r._centroidIdx=n.centroidIdx,r._averageDistance=n.averageDistance,r},e.prototype.add=function(e){this._descriptors.push(e),this._refreshDescription()},e.prototype.getMatchCost=function(e){return e.distance(this._descriptors[this._centroidIdx])/this._averageDistance},e.prototype.getMatchMinimumDistance=function(e){return Math.min.apply(Math,this._descriptors.map(function(t){return t.distance(e)}))},e.prototype._refreshDescription=function(){var t,i=this;this._centroidIdx=-1;for(var n=this._descriptors.map(function(e){return t=0,i._descriptors.forEach(function(i){t+=e.distance(i)}),t}),r=0;r<n.length;++r)(this._centroidIdx<0||n[r]<n[this._centroidIdx])&&(this._centroidIdx=r);this._averageDistance=0,this._descriptors.forEach(function(e){i._averageDistance+=e.distance(i._descriptors[i._centroidIdx])}),this._descriptors.length>0&&(this._averageDistance=Math.max(this._averageDistance/this._descriptors.length,e.MIN_AVERAGE_DISTANCE))},e.MIN_AVERAGE_DISTANCE=1,e}(),hf=function(){function e(){this._maximumAllowableMatchCost=4,this._nameToDescribedTrajectory=new Map}return e.prototype.serialize=function(){var e={};return e.maximumAllowableMatchCost=this._maximumAllowableMatchCost,e.vector3Alphabet=this._vector3Alphabet.serialize(),e.levenshteinAlphabet=this._levenshteinAlphabet.serialize(),e.nameToDescribedTrajectory=[],this._nameToDescribedTrajectory.forEach(function(t,i){e.nameToDescribedTrajectory.push(i),e.nameToDescribedTrajectory.push(t.serialize())}),JSON.stringify(e)},e.Deserialize=function(t){var i=JSON.parse(t),n=new e;n._maximumAllowableMatchCost=i.maximumAllowableMatchCost,n._vector3Alphabet=cf.Deserialize(i.vector3Alphabet),n._levenshteinAlphabet=tf.Alphabet.Deserialize(i.levenshteinAlphabet);for(var r=0;r<i.nameToDescribedTrajectory.length;r+=2)n._nameToDescribedTrajectory.set(i.nameToDescribedTrajectory[r],uf.Deserialize(i.nameToDescribedTrajectory[r+1],n._levenshteinAlphabet));return n},e.Generate=function(){for(var t=cf.Generate(64,256,.1,.001,[a.e.Forward()]),i=new Array(t.chars.length),n=0;n<i.length;++n)i[n]=n;var r=new tf.Alphabet(i,function(e){return 0===e?0:1},function(e){return 0===e?0:1},function(e,i){return Math.min(1-a.e.Dot(t.chars[e],t.chars[i]),1)}),o=new e;return o._vector3Alphabet=t,o._levenshteinAlphabet=r,o},e.prototype.addTrajectoryToClassification=function(e,t){this._nameToDescribedTrajectory.has(t)||this._nameToDescribedTrajectory.set(t,new uf),this._nameToDescribedTrajectory.get(t).add(lf.CreateFromTrajectory(e,this._vector3Alphabet,this._levenshteinAlphabet))},e.prototype.deleteClassification=function(e){return this._nameToDescribedTrajectory.delete(e)},e.prototype.classifyTrajectory=function(e){var t=this,i=lf.CreateFromTrajectory(e,this._vector3Alphabet,this._levenshteinAlphabet),n=[];if(this._nameToDescribedTrajectory.forEach(function(e,r){e.getMatchCost(i)<t._maximumAllowableMatchCost&&n.push(r)}),0===n.length)return null;for(var r,o=0,a=this._nameToDescribedTrajectory.get(n[o]).getMatchMinimumDistance(i),s=0;s<n.length;++s)(r=this._nameToDescribedTrajectory.get(n[s]).getMatchMinimumDistance(i))<a&&(a=r,o=s);return n[o]},e}(),df=i(150),ff=function(e){function t(i,n){void 0===n&&(n={});var r=e.call(this,i)||this;return r.options=n,r._direction=new a.e(0,0,-1),r._mat=new a.a,r._onSelectEnabled=!1,r._origin=new a.e(0,0,0),r.lastNativeXRHitResults=[],r.onHitTestResultObservable=new o.c,r._onHitTestResults=function(e){var t=e.map(function(e){var t=a.a.FromArray(e.hitMatrix);return r._xrSessionManager.scene.useRightHandedSystem||t.toggleModelMatrixHandInPlace(),r.options.worldParentNode&&t.multiplyToRef(r.options.worldParentNode.getWorldMatrix(),t),{xrHitResult:e,transformationMatrix:t}});r.lastNativeXRHitResults=e,r.onHitTestResultObservable.notifyObservers(t)},r._onSelect=function(e){r._onSelectEnabled&&t.XRHitTestWithSelectEvent(e,r._xrSessionManager.referenceSpace)},r.xrNativeFeatureName="hit-test",Ce.b.Warn("A newer version of this plugin is available"),r}return Object(h.d)(t,e),t.XRHitTestWithRay=function(e,t,i,n){return e.requestHitTest(t,i).then(function(e){var t=n||function(e){return!!e.hitMatrix};return e.filter(t)})},t.XRHitTestWithSelectEvent=function(e,t){var i=e.frame.getPose(e.inputSource.targetRaySpace,t);if(!i)return Promise.resolve([]);var n=new XRRay(i.transform);return this.XRHitTestWithRay(e.frame.session,n,t)},t.prototype.attach=function(){return!!e.prototype.attach.call(this)&&(this.options.testOnPointerDownOnly&&this._xrSessionManager.session.addEventListener("select",this._onSelect,!1),!0)},t.prototype.detach=function(){return!!e.prototype.detach.call(this)&&(this._onSelectEnabled=!1,this._xrSessionManager.session.removeEventListener("select",this._onSelect),!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onHitTestResultObservable.clear()},t.prototype._onXRFrame=function(e){if(this.attached&&!this.options.testOnPointerDownOnly){var i=e.getViewerPose(this._xrSessionManager.referenceSpace);if(i){a.a.FromArrayToRef(i.transform.matrix,0,this._mat),a.e.TransformCoordinatesFromFloatsToRef(0,0,0,this._mat,this._origin),a.e.TransformCoordinatesFromFloatsToRef(0,0,-1,this._mat,this._direction),this._direction.subtractInPlace(this._origin),this._direction.normalize();var n=new XRRay({x:this._origin.x,y:this._origin.y,z:this._origin.z,w:0},{x:this._direction.x,y:this._direction.y,z:this._direction.z,w:0});t.XRHitTestWithRay(this._xrSessionManager.session,n,this._xrSessionManager.referenceSpace).then(this._onHitTestResults)}}},t.Name=Mo.HIT_TEST,t.Version=1,t}(zo);Io.AddWebXRFeature(ff.Name,function(e,t){return function(){return new ff(e,t)}},ff.Version,!1);var pf=0,_f=function(e){function t(t,i){void 0===i&&(i={});var n=e.call(this,t)||this;return n._options=i,n._lastFrameDetected=new Set,n._trackedAnchors=[],n._futureAnchors=[],n.onAnchorAddedObservable=new o.c,n.onAnchorRemovedObservable=new o.c,n.onAnchorUpdatedObservable=new o.c,n._tmpVector=new a.e,n._tmpQuaternion=new a.b,n.xrNativeFeatureName="anchors",n}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"referenceSpaceForFrameAnchors",{set:function(e){this._referenceSpaceForFrameAnchors=e},enumerable:!1,configurable:!0}),t.prototype._populateTmpTransformation=function(e,t){return this._tmpVector.copyFrom(e),this._tmpQuaternion.copyFrom(t),this._xrSessionManager.scene.useRightHandedSystem||(this._tmpVector.z*=-1,this._tmpQuaternion.z*=-1,this._tmpQuaternion.w*=-1),{position:this._tmpVector,rotationQuaternion:this._tmpQuaternion}},t.prototype.addAnchorPointUsingHitTestResultAsync=function(e,t,i){return void 0===t&&(t=new a.e),void 0===i&&(i=new a.b),Object(h.b)(this,void 0,void 0,function(){var n,r,o,a=this;return Object(h.e)(this,function(s){switch(s.label){case 0:if(this._populateTmpTransformation(t,i),n=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w}),e.xrHitResult.createAnchor)return[3,1];throw this.detach(),new Error("Anchors not enabled in this environment/browser");case 1:return s.trys.push([1,3,,4]),[4,e.xrHitResult.createAnchor(n)];case 2:return r=s.sent(),[2,new Promise(function(e,t){a._futureAnchors.push({nativeAnchor:r,resolved:!1,submitted:!0,xrTransformation:n,resolve:e,reject:t})})];case 3:throw o=s.sent(),new Error(o);case 4:return[2]}})})},t.prototype.addAnchorAtPositionAndRotationAsync=function(e,t,i){return void 0===t&&(t=new a.b),void 0===i&&(i=!1),Object(h.b)(this,void 0,void 0,function(){var n,r,o,a=this;return Object(h.e)(this,function(s){switch(s.label){case 0:return this._populateTmpTransformation(e,t),n=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w}),i&&this.attached&&this._xrSessionManager.currentFrame?[4,this._createAnchorAtTransformation(n,this._xrSessionManager.currentFrame)]:[3,2];case 1:return o=s.sent(),[3,3];case 2:o=void 0,s.label=3;case 3:return r=o,[2,new Promise(function(e,t){a._futureAnchors.push({nativeAnchor:r,resolved:!1,submitted:!1,xrTransformation:n,resolve:e,reject:t})})]}})})},Object.defineProperty(t.prototype,"anchors",{get:function(){return this._trackedAnchors},enumerable:!1,configurable:!0}),t.prototype.detach=function(){if(!e.prototype.detach.call(this))return!1;if(!this._options.doNotRemoveAnchorsOnSessionEnded)for(;this._trackedAnchors.length;){var t=this._trackedAnchors.pop();if(t){try{t.remove()}catch(e){}this.onAnchorRemovedObservable.notifyObservers(t)}}return!0},t.prototype.dispose=function(){this._futureAnchors.length=0,e.prototype.dispose.call(this),this.onAnchorAddedObservable.clear(),this.onAnchorRemovedObservable.clear(),this.onAnchorUpdatedObservable.clear()},t.prototype._onXRFrame=function(e){var t=this;if(this.attached&&e){var i=e.trackedAnchors;if(i){var n=this._trackedAnchors.filter(function(e){return!i.has(e.xrAnchor)}).map(function(e){return t._trackedAnchors.indexOf(e)}),r=0;n.forEach(function(e){var i=t._trackedAnchors.splice(e-r,1)[0];t.onAnchorRemovedObservable.notifyObservers(i),r++}),i.forEach(function(i){if(t._lastFrameDetected.has(i)){var n=t._findIndexInAnchorArray(i);o=t._trackedAnchors[n];try{t._updateAnchorWithXRFrame(i,o,e),o.attachedNode&&(o.attachedNode.rotationQuaternion=o.attachedNode.rotationQuaternion||new a.b,o.transformationMatrix.decompose(o.attachedNode.scaling,o.attachedNode.rotationQuaternion,o.attachedNode.position)),t.onAnchorUpdatedObservable.notifyObservers(o)}catch(e){Ce.b.Warn("Anchor could not be updated")}}else{var r={id:pf++,xrAnchor:i,remove:i.delete},o=t._updateAnchorWithXRFrame(i,r,e);t._trackedAnchors.push(o),t.onAnchorAddedObservable.notifyObservers(o);var s=t._futureAnchors.filter(function(e){return e.nativeAnchor===i})[0];s&&(s.resolve(o),s.resolved=!0)}}),this._lastFrameDetected=i}this._futureAnchors.forEach(function(i){i.resolved||i.submitted||(t._createAnchorAtTransformation(i.xrTransformation,e).then(function(e){i.nativeAnchor=e},function(e){i.resolved=!0,i.reject(e)}),i.submitted=!0)})}},t.prototype._findIndexInAnchorArray=function(e){for(var t=0;t<this._trackedAnchors.length;++t)if(this._trackedAnchors[t].xrAnchor===e)return t;return-1},t.prototype._updateAnchorWithXRFrame=function(e,t,i){var n=i.getPose(e.anchorSpace,this._xrSessionManager.referenceSpace);if(n){var r=t.transformationMatrix||new a.a;a.a.FromArrayToRef(n.transform.matrix,0,r),this._xrSessionManager.scene.useRightHandedSystem||r.toggleModelMatrixHandInPlace(),t.transformationMatrix=r,this._options.worldParentNode&&r.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),r)}return t},t.prototype._createAnchorAtTransformation=function(e,t){var i;return Object(h.b)(this,void 0,void 0,function(){return Object(h.e)(this,function(n){if(!t.createAnchor)throw this.detach(),new Error("Anchors are not enabled in your browser");try{return[2,t.createAnchor(e,null!==(i=this._referenceSpaceForFrameAnchors)&&void 0!==i?i:this._xrSessionManager.referenceSpace)]}catch(e){throw new Error(e)}return[2]})})},t.Name=Mo.ANCHOR_SYSTEM,t.Version=1,t}(zo);Io.AddWebXRFeature(_f.Name,function(e,t){return function(){return new _f(e,t)}},_f.Version);var mf=0,gf=function(e){function t(t,i){void 0===i&&(i={});var n=e.call(this,t)||this;return n._options=i,n._detectedPlanes=[],n._enabled=!1,n._lastFrameDetected=new Set,n.onPlaneAddedObservable=new o.c,n.onPlaneRemovedObservable=new o.c,n.onPlaneUpdatedObservable=new o.c,n.xrNativeFeatureName="plane-detection",n._xrSessionManager.session?n._init():n._xrSessionManager.onXRSessionInit.addOnce(function(){n._init()}),n}return Object(h.d)(t,e),t.prototype.detach=function(){if(!e.prototype.detach.call(this))return!1;if(!this._options.doNotRemovePlanesOnSessionEnded)for(;this._detectedPlanes.length;){var t=this._detectedPlanes.pop();t&&this.onPlaneRemovedObservable.notifyObservers(t)}return!0},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onPlaneAddedObservable.clear(),this.onPlaneRemovedObservable.clear(),this.onPlaneUpdatedObservable.clear()},t.prototype.isCompatible=function(){return"undefined"!=typeof XRPlane},t.prototype._onXRFrame=function(e){var t=this;if(this.attached&&this._enabled&&e){var i=e.worldInformation.detectedPlanes;if(i){var n=this._detectedPlanes.filter(function(e){return!i.has(e.xrPlane)}).map(function(e){return t._detectedPlanes.indexOf(e)}),r=0;n.forEach(function(e){var i=t._detectedPlanes.splice(e-r,1)[0];t.onPlaneRemovedObservable.notifyObservers(i),r++}),i.forEach(function(i){if(t._lastFrameDetected.has(i)){if(i.lastChangedTime===t._xrSessionManager.currentTimestamp){var n=t.findIndexInPlaneArray(i);o=t._detectedPlanes[n],t._updatePlaneWithXRPlane(i,o,e),t.onPlaneUpdatedObservable.notifyObservers(o)}}else{var r={id:mf++,xrPlane:i,polygonDefinition:[]},o=t._updatePlaneWithXRPlane(i,r,e);t._detectedPlanes.push(o),t.onPlaneAddedObservable.notifyObservers(o)}}),this._lastFrameDetected=i}}},t.prototype._init=function(){var e,t,i=this,n=function(){i._enabled=!0,i._detectedPlanes.length&&(i._detectedPlanes.length=0)};this._xrSessionManager.session.updateWorldTrackingState?(this._xrSessionManager.session.updateWorldTrackingState({planeDetectionState:{enabled:!0}}),n()):(null===(t=null===(e=this._xrSessionManager.session.worldTrackingState)||void 0===e?void 0:e.planeDetectionState)||void 0===t?void 0:t.enabled)&&n()},t.prototype._updatePlaneWithXRPlane=function(e,t,i){var n=this;t.polygonDefinition=e.polygon.map(function(e){var t=n._xrSessionManager.scene.useRightHandedSystem?1:-1;return new a.e(e.x,e.y,e.z*t)});var r=i.getPose(e.planeSpace,this._xrSessionManager.referenceSpace);if(r){var o=t.transformationMatrix||new a.a;a.a.FromArrayToRef(r.transform.matrix,0,o),this._xrSessionManager.scene.useRightHandedSystem||o.toggleModelMatrixHandInPlace(),t.transformationMatrix=o,this._options.worldParentNode&&o.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),o)}return t},t.prototype.findIndexInPlaneArray=function(e){for(var t=0;t<this._detectedPlanes.length;++t)if(this._detectedPlanes[t].xrPlane===e)return t;return-1},t.Name=Mo.PLANE_DETECTION,t.Version=1,t}(zo);Io.AddWebXRFeature(gf.Name,function(e,t){return function(){return new gf(e,t)}},gf.Version);var vf=function(e){function t(t,i){void 0===i&&(i={});var n=e.call(this,t)||this;return n.options=i,n.onBackgroundStateChangedObservable=new o.c,n}return Object(h.d)(t,e),t.prototype.attach=function(){return this._setBackgroundState(!1),e.prototype.attach.call(this)},t.prototype.detach=function(){return this._setBackgroundState(!0),e.prototype.detach.call(this)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onBackgroundStateChangedObservable.clear()},t.prototype._onXRFrame=function(e){},t.prototype._setBackgroundState=function(e){var t=this._xrSessionManager.scene;if(!this.options.ignoreEnvironmentHelper)if(this.options.environmentHelperRemovalFlags){if(this.options.environmentHelperRemovalFlags.skyBox){var i=t.getMeshByName("BackgroundSkybox");i&&i.setEnabled(e)}if(this.options.environmentHelperRemovalFlags.ground){var n=t.getMeshByName("BackgroundPlane");n&&n.setEnabled(e)}}else{var r=t.getMeshByName("BackgroundHelper");r&&r.setEnabled(e)}this.options.backgroundMeshes&&this.options.backgroundMeshes.forEach(function(t){return t.setEnabled(e)}),this.onBackgroundStateChangedObservable.notifyObservers(e)},t.Name=Mo.BACKGROUND_REMOVER,t.Version=1,t}(zo);Io.AddWebXRFeature(vf.Name,function(e,t){return function(){return new vf(e,t)}},vf.Version,!0);var bf=function(){},yf=function(e){function t(t,i){var n=e.call(this,t)||this;return n._options=i,n._attachController=function(e){if(!n._controllers[e.uniqueId])if(n._xrSessionManager.scene.isPhysicsEnabled()||m.a.Warn("physics engine not enabled, skipped. Please add this controller manually."),n._options.physicsProperties.useControllerMesh&&e.inputSource.gamepad)e.onMotionControllerInitObservable.addOnce(function(t){t.onModelLoadedObservable.addOnce(function(){var i=new Ga.a(t.rootMesh,Ga.a.MeshImpostor,Object(h.a)({mass:0},n._options.physicsProperties)),r=e.grip||e.pointer;n._controllers[e.uniqueId]={xrController:e,impostor:i,oldPos:r.position.clone(),oldRotation:r.rotationQuaternion.clone()}})});else{var t=n._options.physicsProperties.impostorType||Ga.a.SphereImpostor,i=n._options.physicsProperties.impostorSize||.1,r=yr.a.CreateSphere("impostor-mesh-"+e.uniqueId,{diameterX:"number"==typeof i?i:i.width,diameterY:"number"==typeof i?i:i.height,diameterZ:"number"==typeof i?i:i.depth});r.isVisible=n._debugMode,r.isPickable=!1,r.rotationQuaternion=new a.b;var o=e.grip||e.pointer;r.position.copyFrom(o.position),r.rotationQuaternion.copyFrom(o.rotationQuaternion);var s=new Ga.a(r,t,Object(h.a)({mass:0},n._options.physicsProperties));n._controllers[e.uniqueId]={xrController:e,impostor:s,impostorMesh:r}}},n._controllers={},n._debugMode=!1,n._delta=0,n._lastTimestamp=0,n._tmpQuaternion=new a.b,n._tmpVector=new a.e,n._options.physicsProperties||(n._options.physicsProperties={}),n}return Object(h.d)(t,e),t.prototype._enablePhysicsDebug=function(){var e=this;this._debugMode=!0,Object.keys(this._controllers).forEach(function(t){var i=e._controllers[t];i.impostorMesh&&(i.impostorMesh.isVisible=!0)})},t.prototype.addController=function(e){this._attachController(e)},t.prototype.attach=function(){var t=this;if(!e.prototype.attach.call(this))return!1;if(!this._options.xrInput)return!0;if(this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,function(e){t._detachController(e.uniqueId)}),this._options.enableHeadsetImpostor){var i=this._options.headsetImpostorParams||{impostorType:Ga.a.SphereImpostor,restitution:.8,impostorSize:.3},n=i.impostorSize||.3;this._headsetMesh=yr.a.CreateSphere("headset-mesh",{diameterX:"number"==typeof n?n:n.width,diameterY:"number"==typeof n?n:n.height,diameterZ:"number"==typeof n?n:n.depth}),this._headsetMesh.rotationQuaternion=new a.b,this._headsetMesh.isVisible=!1,this._headsetImpostor=new Ga.a(this._headsetMesh,i.impostorType,Object(h.a)({mass:0},i))}return!0},t.prototype.detach=function(){var t=this;return!!e.prototype.detach.call(this)&&(Object.keys(this._controllers).forEach(function(e){t._detachController(e)}),this._headsetMesh&&this._headsetMesh.dispose(),!0)},t.prototype.getHeadsetImpostor=function(){return this._headsetImpostor},t.prototype.getImpostorForController=function(e){var t="string"==typeof e?e:e.uniqueId;return this._controllers[t]?this._controllers[t].impostor:null},t.prototype.setPhysicsProperties=function(e){this._options.physicsProperties=Object(h.a)(Object(h.a)({},this._options.physicsProperties),e)},t.prototype._onXRFrame=function(e){var t=this;this._delta=this._xrSessionManager.currentTimestamp-this._lastTimestamp,this._lastTimestamp=this._xrSessionManager.currentTimestamp,this._headsetMesh&&(this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.position),this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion)),Object.keys(this._controllers).forEach(function(e){var i=t._controllers[e],n=i.xrController.grip||i.xrController.pointer,r=i.oldPos||i.impostorMesh.position,o=i.oldRotation||i.impostorMesh.rotationQuaternion;if(n.position.subtractToRef(r,t._tmpVector),t._tmpVector.scaleInPlace(1e3/t._delta),i.impostor.setLinearVelocity(t._tmpVector),t._debugMode&&console.log(t._tmpVector,"linear"),!o.equalsWithEpsilon(n.rotationQuaternion)){o.conjugateInPlace().multiplyToRef(n.rotationQuaternion,t._tmpQuaternion);var a=Math.sqrt(t._tmpQuaternion.x*t._tmpQuaternion.x+t._tmpQuaternion.y*t._tmpQuaternion.y+t._tmpQuaternion.z*t._tmpQuaternion.z);if(t._tmpVector.set(t._tmpQuaternion.x,t._tmpQuaternion.y,t._tmpQuaternion.z),a<.001)t._tmpVector.scaleInPlace(2);else{var s=2*Math.atan2(a,t._tmpQuaternion.w);t._tmpVector.scaleInPlace(s/(a*(t._delta/1e3)))}i.impostor.setAngularVelocity(t._tmpVector),t._debugMode&&console.log(t._tmpVector,t._tmpQuaternion,"angular")}r.copyFrom(n.position),o.copyFrom(n.rotationQuaternion)})},t.prototype._detachController=function(e){var t=this._controllers[e];t&&(t.impostorMesh&&t.impostorMesh.dispose(),delete this._controllers[e])},t.Name=Mo.PHYSICS_CONTROLLERS,t.Version=1,t}(zo);Io.AddWebXRFeature(yf.Name,function(e,t){return function(){return new yf(e,t)}},yf.Version,!0);var Tf=function(e){function t(t,i){void 0===i&&(i={});var n=e.call(this,t)||this;return n.options=i,n._tmpMat=new a.a,n._tmpPos=new a.e,n._tmpQuat=new a.b,n.initHitTestSource=function(e){if(e){var t=new XRRay(n.options.offsetRay||{}),i={space:n.options.useReferenceSpace?e:n._xrSessionManager.viewerReferenceSpace,offsetRay:t};n.options.entityTypes&&(i.entityTypes=n.options.entityTypes),i.space?n._xrSessionManager.session.requestHitTestSource(i).then(function(e){n._xrHitTestSource&&n._xrHitTestSource.cancel(),n._xrHitTestSource=e}):Ce.b.Warn("waiting for viewer reference space to initialize")}},n.autoCloneTransformation=!1,n.onHitTestResultObservable=new o.c,n.paused=!1,n.xrNativeFeatureName="hit-test",Ce.b.Warn("Hit test is an experimental and unstable feature."),n}return Object(h.d)(t,e),t.prototype.attach=function(){var t=this;if(!e.prototype.attach.call(this))return!1;if(!this._xrSessionManager.session.requestHitTestSource)return!1;if(this.options.disablePermanentHitTest||(this._xrSessionManager.referenceSpace&&this.initHitTestSource(this._xrSessionManager.referenceSpace),this._xrSessionManager.onXRReferenceSpaceChanged.add(this.initHitTestSource)),this.options.enableTransientHitTest){var i=new XRRay(this.options.transientOffsetRay||{});this._xrSessionManager.session.requestHitTestSourceForTransientInput({profile:"generic-touchscreen",offsetRay:i,entityTypes:this.options.entityTypes}).then(function(e){t._transientXrHitTestSource=e})}return!0},t.prototype.detach=function(){return!!e.prototype.detach.call(this)&&(this._xrHitTestSource&&(this._xrHitTestSource.cancel(),this._xrHitTestSource=null),this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this.initHitTestSource),this._transientXrHitTestSource&&(this._transientXrHitTestSource.cancel(),this._transientXrHitTestSource=null),!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onHitTestResultObservable.clear()},t.prototype._onXRFrame=function(e){var t=this;if(this.attached&&!this.paused){if(this._xrHitTestSource){var i=e.getHitTestResults(this._xrHitTestSource);this._processWebXRHitTestResult(i)}this._transientXrHitTestSource&&e.getHitTestResultsForTransientInput(this._transientXrHitTestSource).forEach(function(e){t._processWebXRHitTestResult(e.results,e.inputSource)})}},t.prototype._processWebXRHitTestResult=function(e,t){var i=this,n=[];e.forEach(function(e){var r=e.getPose(i._xrSessionManager.referenceSpace);if(r){var o=r.transform.position,s=r.transform.orientation;i._tmpPos.set(o.x,o.y,o.z),i._tmpQuat.set(s.x,s.y,s.z,s.w),a.a.FromFloat32ArrayToRefScaled(r.transform.matrix,0,1,i._tmpMat),i._xrSessionManager.scene.useRightHandedSystem||(i._tmpPos.z*=-1,i._tmpQuat.z*=-1,i._tmpQuat.w*=-1,i._tmpMat.toggleModelMatrixHandInPlace());var c={position:i.autoCloneTransformation?i._tmpPos.clone():i._tmpPos,rotationQuaternion:i.autoCloneTransformation?i._tmpQuat.clone():i._tmpQuat,transformationMatrix:i.autoCloneTransformation?i._tmpMat.clone():i._tmpMat,inputSource:t,isTransient:!!t,xrHitResult:e};n.push(c)}}),this.onHitTestResultObservable.notifyObservers(n)},t.Name=Mo.HIT_TEST,t.Version=2,t}(zo);Io.AddWebXRFeature(Tf.Name,function(e,t){return function(){return new Tf(e,t)}},Tf.Version,!1);var Ef=function(e){function t(t){var i=e.call(this,t)||this;return i._enabled=!1,i._featurePointCloud=[],i.onFeaturePointsAddedObservable=new o.c,i.onFeaturePointsUpdatedObservable=new o.c,i.xrNativeFeatureName="bjsfeature-points",i._xrSessionManager.session?i._init():i._xrSessionManager.onXRSessionInit.addOnce(function(){i._init()}),i}return Object(h.d)(t,e),Object.defineProperty(t.prototype,"featurePointCloud",{get:function(){return this._featurePointCloud},enumerable:!1,configurable:!0}),t.prototype.detach=function(){return!!e.prototype.detach.call(this)&&(this.featurePointCloud.length=0,!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._featurePointCloud.length=0,this.onFeaturePointsUpdatedObservable.clear(),this.onFeaturePointsAddedObservable.clear()},t.prototype._onXRFrame=function(e){if(this.attached&&this._enabled&&e){var t=e.featurePointCloud;if(t&&0!==t.length){if(t.length%5!=0)throw new Error("Received malformed feature point cloud of length: "+t.length);for(var i=t.length/5,n=new Array,r=new Array,o=0;o<i;o++){var s=5*o,c=t[s+4];this._featurePointCloud[c]?n.push(c):(this._featurePointCloud[c]={position:new a.e,confidenceValue:0},r.push(c)),this._featurePointCloud[c].position.x=t[s],this._featurePointCloud[c].position.y=t[s+1],this._featurePointCloud[c].position.z=t[s+2],this._featurePointCloud[c].confidenceValue=t[s+3]}r.length>0&&this.onFeaturePointsAddedObservable.notifyObservers(r),n.length>0&&this.onFeaturePointsUpdatedObservable.notifyObservers(n)}}},t.prototype._init=function(){this._xrSessionManager.session.trySetFeaturePointCloudEnabled&&this._xrSessionManager.session.trySetFeaturePointCloudEnabled(!0)&&(this._enabled=!0)},t.Name=Mo.FEATURE_POINTS,t.Version=1,t}(zo);Io.AddWebXRFeature(Ef.Name,function(e){return function(){return new Ef(e)}},Ef.Version);var Sf=function(){function e(e,t,i,n,r){this.xrController=e,this.trackedMeshes=t,this._handMesh=i,this._rigMapping=n,this._defaultHandMesh=!1,this._transformNodeMapping=[],this.handPartsDefinition=this.generateHandPartsDefinition(e.inputSource.hand),this._scene=t[0].getScene(),this._handMesh&&this._rigMapping?this._defaultHandMesh=!1:r||this._generateDefaultHandMesh(),this.xrController.motionController&&(this.xrController.motionController.rootMesh?this.xrController.motionController.rootMesh.setEnabled(!1):this.xrController.motionController.onModelLoadedObservable.add(function(e){e.rootMesh&&e.rootMesh.setEnabled(!1)})),this.xrController.onMotionControllerInitObservable.add(function(e){e.onModelLoadedObservable.add(function(e){e.rootMesh&&e.rootMesh.setEnabled(!1)}),e.rootMesh&&e.rootMesh.setEnabled(!1)})}return e.prototype.generateHandPartsDefinition=function(e){var t;return(t={}).wrist=[e.WRIST],t.thumb=[e.THUMB_METACARPAL,e.THUMB_PHALANX_PROXIMAL,e.THUMB_PHALANX_DISTAL,e.THUMB_PHALANX_TIP],t.index=[e.INDEX_METACARPAL,e.INDEX_PHALANX_PROXIMAL,e.INDEX_PHALANX_INTERMEDIATE,e.INDEX_PHALANX_DISTAL,e.INDEX_PHALANX_TIP],t.middle=[e.MIDDLE_METACARPAL,e.MIDDLE_PHALANX_PROXIMAL,e.MIDDLE_PHALANX_INTERMEDIATE,e.MIDDLE_PHALANX_DISTAL,e.MIDDLE_PHALANX_TIP],t.ring=[e.RING_METACARPAL,e.RING_PHALANX_PROXIMAL,e.RING_PHALANX_INTERMEDIATE,e.RING_PHALANX_DISTAL,e.RING_PHALANX_TIP],t.little=[e.LITTLE_METACARPAL,e.LITTLE_PHALANX_PROXIMAL,e.LITTLE_PHALANX_INTERMEDIATE,e.LITTLE_PHALANX_DISTAL,e.LITTLE_PHALANX_TIP],t},e.prototype.updateFromXRFrame=function(e,t,i){var n=this;void 0===i&&(i=2);var r=this.xrController.inputSource.hand;r&&this.trackedMeshes.forEach(function(o,a){var s=r[a];if(s){var c=e.getJointPose(s,t);if(!c||!c.transform)return;var l=c.transform.position,u=c.transform.orientation;o.position.set(l.x,l.y,l.z),o.rotationQuaternion.set(u.x,u.y,u.z,u.w);var h=(c.radius||.008)*i;o.scaling.set(h,h,h),n._handMesh&&n._rigMapping&&n._rigMapping[a]&&(n._transformNodeMapping[a]=n._transformNodeMapping[a]||n._scene.getTransformNodeByName(n._rigMapping[a]),n._transformNodeMapping[a]&&(n._transformNodeMapping[a].position.copyFrom(o.position),n._transformNodeMapping[a].rotationQuaternion.copyFrom(o.rotationQuaternion),o.isVisible=!1)),o.getScene().useRightHandedSystem||(o.position.z*=-1,o.rotationQuaternion.z*=-1,o.rotationQuaternion.w*=-1)}})},e.prototype.getHandPartMeshes=function(e){var t=this;return this.handPartsDefinition[e].map(function(e){return t.trackedMeshes[e]})},e.prototype.dispose=function(){this.trackedMeshes.forEach(function(e){return e.dispose()}),this._defaultHandMesh&&this._handMesh&&this._handMesh.dispose()},e.prototype._generateDefaultHandMesh=function(){return Object(h.b)(this,void 0,void 0,function(){var e,t,i,n,r,o,a,c;return Object(h.e)(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e="right"===this.xrController.inputSource.handedness?"right":"left",t=("right"===e?"r":"l")+"_hand_"+(this._scene.useRightHandedSystem?"r":"l")+"hs.glb",[4,ar.ImportMeshAsync("","https://assets.babylonjs.com/meshes/HandMeshes/",t,this._scene)];case 1:return i=l.sent(),n={base:s.a.FromInts(116,63,203),fresnel:s.a.FromInts(149,102,229),fingerColor:s.a.FromInts(177,130,255),tipFresnel:s.a.FromInts(220,200,255)},[4,(r=new Sc("leftHandShader",this._scene,{emitComments:!1})).loadAsync("https://patrickryanms.github.io/BabylonJStextures/Demos/xrHandMesh/handsShader.json")];case 2:if(l.sent(),r.build(!1),r.needDepthPrePass=!0,r.transparencyMode=lo.a.MATERIAL_ALPHABLEND,r.alphaMode=Se.a.ALPHA_COMBINE,(o={base:r.getBlockByName("baseColor"),fresnel:r.getBlockByName("fresnelColor"),fingerColor:r.getBlockByName("fingerColor"),tipFresnel:r.getBlockByName("tipFresnelColor")}).base.value=n.base,o.fresnel.value=n.fresnel,o.fingerColor.value=n.fingerColor,o.tipFresnel.value=n.tipFresnel,i.meshes[1].material=r,this._defaultHandMesh=!0,this._handMesh=i.meshes[0],this._rigMapping=["wrist_","thumb_metacarpal_","thumb_proxPhalanx_","thumb_distPhalanx_","thumb_tip_","index_metacarpal_","index_proxPhalanx_","index_intPhalanx_","index_distPhalanx_","index_tip_","middle_metacarpal_","middle_proxPhalanx_","middle_intPhalanx_","middle_distPhalanx_","middle_tip_","ring_metacarpal_","ring_proxPhalanx_","ring_intPhalanx_","ring_distPhalanx_","ring_tip_","little_metacarpal_","little_proxPhalanx_","little_intPhalanx_","little_distPhalanx_","little_tip_"].map(function(t){return t+("right"===e?"R":"L")}),!(a=this._scene.getTransformNodeByName(this._rigMapping[0])))throw new Error("could not find the wrist node");return a.parent&&a.parent.rotate(J.a.Y,Math.PI),[3,4];case 3:return c=l.sent(),Ce.b.Error("error loading hand mesh"),console.log(c),[3,4];case 4:return[2]}})})},e}(),Af=function(e){function t(i,n){var r=e.call(this,i)||this;return r.options=n,r.onHandAddedObservable=new o.c,r.onHandRemovedObservable=new o.c,r._hands={},r._attachHand=function(e){var i,n,o,s,c,l,u,d,f,p;if(e.inputSource.hand&&!r._hands[e.uniqueId]){var _=e.inputSource.hand,m=[],g=(null===(i=r.options.jointMeshes)||void 0===i?void 0:i.sourceMesh)||yr.a.CreateSphere("jointParent",{diameter:1});g.isVisible=!!(null===(n=r.options.jointMeshes)||void 0===n?void 0:n.keepOriginalVisible);for(var v=0;v<_.length;++v){var b=g.createInstance(e.uniqueId+"-handJoint-"+v);if(null===(o=r.options.jointMeshes)||void 0===o?void 0:o.onHandJointMeshGenerated){var y=r.options.jointMeshes.onHandJointMeshGenerated(b,v,e.uniqueId);y&&y!==b&&(b.dispose(),b=y)}if(b.isPickable=!1,null===(s=r.options.jointMeshes)||void 0===s?void 0:s.enablePhysics){var T=r.options.jointMeshes.physicsProps||{},E=void 0!==T.impostorType?T.impostorType:Ga.a.SphereImpostor;b.physicsImpostor=new Ga.a(b,E,Object(h.a)({mass:0},T))}b.rotationQuaternion=new a.b,(null===(c=r.options.jointMeshes)||void 0===c?void 0:c.invisible)&&(b.isVisible=!1),m.push(b)}var S="right"===e.inputSource.handedness?"right":"left",A=(null===(l=r.options.jointMeshes)||void 0===l?void 0:l.handMeshes)&&(null===(u=r.options.jointMeshes)||void 0===u?void 0:u.handMeshes[S]),P=(null===(d=r.options.jointMeshes)||void 0===d?void 0:d.rigMapping)&&(null===(f=r.options.jointMeshes)||void 0===f?void 0:f.rigMapping[S]),C=new Sf(e,m,A,P,null===(p=r.options.jointMeshes)||void 0===p?void 0:p.disableDefaultHandMesh);r._hands[e.uniqueId]={handObject:C,id:t._idCounter++},r.onHandAddedObservable.notifyObservers(C)}},r.xrNativeFeatureName="hand-tracking",r}return Object(h.d)(t,e),t.prototype.isCompatible=function(){return"undefined"!=typeof XRHand},t.prototype.attach=function(){var t=this;return!!e.prototype.attach.call(this)&&(this.options.xrInput.controllers.forEach(this._attachHand),this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable,this._attachHand),this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable,function(e){t._detachHand(e.uniqueId)}),!0)},t.prototype.detach=function(){var t=this;return!!e.prototype.detach.call(this)&&(Object.keys(this._hands).forEach(function(e){t._detachHand(e)}),!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onHandAddedObservable.clear()},t.prototype.getHandByControllerId=function(e){var t;return(null===(t=this._hands[e])||void 0===t?void 0:t.handObject)||null},t.prototype.getHandByHandedness=function(e){var t=this,i=Object.keys(this._hands).map(function(e){return t._hands[e].handObject.xrController.inputSource.handedness}).indexOf(e);return-1!==i?this._hands[i].handObject:null},t.prototype._onXRFrame=function(e){var t=this;Object.keys(this._hands).forEach(function(i){var n;t._hands[i].handObject.updateFromXRFrame(e,t._xrSessionManager.referenceSpace,null===(n=t.options.jointMeshes)||void 0===n?void 0:n.scaleFactor)})},t.prototype._detachHand=function(e){this._hands[e]&&(this.onHandRemovedObservable.notifyObservers(this._hands[e].handObject),this._hands[e].handObject.dispose())},t._idCounter=0,t.Name=Mo.HAND_TRACKING,t.Version=1,t}(zo);Io.AddWebXRFeature(Af.Name,function(e,t){return function(){return new Af(e,t)}},Af.Version,!1);var Pf=function(e){function t(t,i,n){var r=e.call(this,t,Cf["left-right"],i,n)||this;return r._mapping={defaultButton:{valueNodeName:"VALUE",unpressedNodeName:"UNPRESSED",pressedNodeName:"PRESSED"},defaultAxis:{valueNodeName:"VALUE",minNodeName:"MIN",maxNodeName:"MAX"},buttons:{"xr-standard-trigger":{rootNodeName:"SELECT",componentProperty:"button",states:["default","touched","pressed"]},"xr-standard-squeeze":{rootNodeName:"GRASP",componentProperty:"state",states:["pressed"]},"xr-standard-touchpad":{rootNodeName:"TOUCHPAD_PRESS",labelAnchorNodeName:"squeeze-label",touchPointNodeName:"TOUCH"},"xr-standard-thumbstick":{rootNodeName:"THUMBSTICK_PRESS",componentProperty:"state",states:["pressed"]}},axes:{"xr-standard-touchpad":{"x-axis":{rootNodeName:"TOUCHPAD_TOUCH_X"},"y-axis":{rootNodeName:"TOUCHPAD_TOUCH_Y"}},"xr-standard-thumbstick":{"x-axis":{rootNodeName:"THUMBSTICK_X"},"y-axis":{rootNodeName:"THUMBSTICK_Y"}}}},r.profileId="microsoft-mixed-reality",r}return Object(h.d)(t,e),t.prototype._getFilenameAndPath=function(){return{filename:"left"===this.handedness?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,path:t.MODEL_BASE_URL+"default/"}},t.prototype._getModelLoadingConstraints=function(){var e=ar.IsPluginForExtensionAvailable(".glb");return e||m.a.Warn("glTF / glb loaded was not registered, using generic controller instead"),e},t.prototype._processLoadedModel=function(e){var t=this;this.rootMesh&&(this.getComponentIds().forEach(function(e,i){if(!t.disableAnimation&&e&&t.rootMesh){var n=t._mapping.buttons[e],r=n.rootNodeName;if(!r)return void m.a.Log("Skipping unknown button at index: "+i+" with mapped name: "+e);var o=t._getChildByName(t.rootMesh,r);if(!o)return void m.a.Warn("Missing button mesh with name: "+r);if(n.valueMesh=t._getImmediateChildByName(o,t._mapping.defaultButton.valueNodeName),n.pressedMesh=t._getImmediateChildByName(o,t._mapping.defaultButton.pressedNodeName),n.unpressedMesh=t._getImmediateChildByName(o,t._mapping.defaultButton.unpressedNodeName),n.valueMesh&&n.pressedMesh&&n.unpressedMesh){var a=t.getComponent(e);a&&a.onButtonStateChangedObservable.add(function(e){t._lerpTransform(n,e.value)},void 0,!0)}else m.a.Warn("Missing button submesh under mesh with name: "+r)}}),this.getComponentIds().forEach(function(e,i){var n=t.getComponent(e);n.isAxes()&&["x-axis","y-axis"].forEach(function(i){if(t.rootMesh){var r=t._mapping.axes[e][i],o=t._getChildByName(t.rootMesh,r.rootNodeName);o?(r.valueMesh=t._getImmediateChildByName(o,t._mapping.defaultAxis.valueNodeName),r.minMesh=t._getImmediateChildByName(o,t._mapping.defaultAxis.minNodeName),r.maxMesh=t._getImmediateChildByName(o,t._mapping.defaultAxis.maxNodeName),r.valueMesh&&r.minMesh&&r.maxMesh?n&&n.onAxisValueChangedObservable.add(function(e){var n="x-axis"===i?e.x:e.y;t._lerpTransform(r,n,!0)},void 0,!0):m.a.Warn("Missing axis submesh under mesh with name: "+r.rootNodeName)):m.a.Warn("Missing axis mesh with name: "+r.rootNodeName)}})}))},t.prototype._setRootMesh=function(e){var t;this.rootMesh=new be.a(this.profileId+" "+this.handedness,this.scene),this.rootMesh.isPickable=!1;for(var i=0;i<e.length;i++){var n=e[i];n.isPickable=!1,n.parent||(t=n)}t&&t.setParent(this.rootMesh),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=a.b.FromEulerAngles(0,Math.PI,0))},t.prototype._updateModel=function(){},t.MODEL_BASE_URL="https://controllers.babylonjs.com/microsoft/",t.MODEL_LEFT_FILENAME="left.glb",t.MODEL_RIGHT_FILENAME="right.glb",t}(Lo);Uo.RegisterController("windows-mixed-reality",function(e,t){return new Pf(t,e.gamepad,e.handedness)});var Cf={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{xr_standard_trigger_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_trigger_pressed_value",minNodeName:"xr_standard_trigger_pressed_min",maxNodeName:"xr_standard_trigger_pressed_max"}}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{xr_standard_squeeze_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_squeeze_pressed_value",minNodeName:"xr_standard_squeeze_pressed_min",maxNodeName:"xr_standard_squeeze_pressed_max"}}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{xr_standard_touchpad_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_pressed_value",minNodeName:"xr_standard_touchpad_pressed_min",maxNodeName:"xr_standard_touchpad_pressed_max"},xr_standard_touchpad_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_pressed_value",minNodeName:"xr_standard_touchpad_xaxis_pressed_min",maxNodeName:"xr_standard_touchpad_xaxis_pressed_max"},xr_standard_touchpad_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_pressed_value",minNodeName:"xr_standard_touchpad_yaxis_pressed_min",maxNodeName:"xr_standard_touchpad_yaxis_pressed_max"},xr_standard_touchpad_xaxis_touched:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_touched_value",minNodeName:"xr_standard_touchpad_xaxis_touched_min",maxNodeName:"xr_standard_touchpad_xaxis_touched_max"},xr_standard_touchpad_yaxis_touched:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_touched_value",minNodeName:"xr_standard_touchpad_yaxis_touched_min",maxNodeName:"xr_standard_touchpad_yaxis_touched_max"},xr_standard_touchpad_axes_touched:{componentProperty:"state",states:["touched","pressed"],valueNodeProperty:"visibility",valueNodeName:"xr_standard_touchpad_axes_touched_value"}},touchPointNodeName:"xr_standard_touchpad_axes_touched_value"},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{xr_standard_thumbstick_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_pressed_value",minNodeName:"xr_standard_thumbstick_pressed_min",maxNodeName:"xr_standard_thumbstick_pressed_max"},xr_standard_thumbstick_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_xaxis_pressed_value",minNodeName:"xr_standard_thumbstick_xaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_xaxis_pressed_max"},xr_standard_thumbstick_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_yaxis_pressed_value",minNodeName:"xr_standard_thumbstick_yaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_yaxis_pressed_max"}}}},gamepadMapping:"xr-standard",rootNodeName:"microsoft-mixed-reality-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{xr_standard_trigger_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_trigger_pressed_value",minNodeName:"xr_standard_trigger_pressed_min",maxNodeName:"xr_standard_trigger_pressed_max"}}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{xr_standard_squeeze_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_squeeze_pressed_value",minNodeName:"xr_standard_squeeze_pressed_min",maxNodeName:"xr_standard_squeeze_pressed_max"}}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{xr_standard_touchpad_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_pressed_value",minNodeName:"xr_standard_touchpad_pressed_min",maxNodeName:"xr_standard_touchpad_pressed_max"},xr_standard_touchpad_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_pressed_value",minNodeName:"xr_standard_touchpad_xaxis_pressed_min",maxNodeName:"xr_standard_touchpad_xaxis_pressed_max"},xr_standard_touchpad_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_pressed_value",minNodeName:"xr_standard_touchpad_yaxis_pressed_min",maxNodeName:"xr_standard_touchpad_yaxis_pressed_max"},xr_standard_touchpad_xaxis_touched:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_touched_value",minNodeName:"xr_standard_touchpad_xaxis_touched_min",maxNodeName:"xr_standard_touchpad_xaxis_touched_max"},xr_standard_touchpad_yaxis_touched:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_touched_value",minNodeName:"xr_standard_touchpad_yaxis_touched_min",maxNodeName:"xr_standard_touchpad_yaxis_touched_max"},xr_standard_touchpad_axes_touched:{componentProperty:"state",states:["touched","pressed"],valueNodeProperty:"visibility",valueNodeName:"xr_standard_touchpad_axes_touched_value"}},touchPointNodeName:"xr_standard_touchpad_axes_touched_value"},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{xr_standard_thumbstick_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_pressed_value",minNodeName:"xr_standard_thumbstick_pressed_min",maxNodeName:"xr_standard_thumbstick_pressed_max"},xr_standard_thumbstick_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_xaxis_pressed_value",minNodeName:"xr_standard_thumbstick_xaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_xaxis_pressed_max"},xr_standard_thumbstick_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_yaxis_pressed_value",minNodeName:"xr_standard_thumbstick_yaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_yaxis_pressed_max"}}}},gamepadMapping:"xr-standard",rootNodeName:"microsoft-mixed-reality-right",assetPath:"right.glb"}},Rf=function(e){function t(t,i,n,r,o){void 0===r&&(r=!1),void 0===o&&(o=!1);var a=e.call(this,t,xf[n],i,n)||this;return a._forceLegacyControllers=o,a.profileId="oculus-touch",a}return Object(h.d)(t,e),t.prototype._getFilenameAndPath=function(){return{filename:"left"===this.handedness?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,path:this._isQuest()?t.QUEST_MODEL_BASE_URL:t.MODEL_BASE_URL}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){var t=this,i=this._isQuest(),n="right"===this.handedness?-1:1;this.getComponentIds().forEach(function(e){var r=e&&t.getComponent(e);r&&r.onButtonStateChangedObservable.add(function(r){if(t.rootMesh&&!t.disableAnimation)switch(e){case"xr-standard-trigger":return void(i||(t._modelRootNode.getChildren()[3].rotation.x=.2*-r.value,t._modelRootNode.getChildren()[3].position.y=.005*-r.value,t._modelRootNode.getChildren()[3].position.z=.005*-r.value));case"xr-standard-squeeze":return void(i||(t._modelRootNode.getChildren()[4].position.x=n*r.value*.0035));case"xr-standard-thumbstick":return;case"a-button":case"x-button":return void(i||(r.pressed?t._modelRootNode.getChildren()[1].position.y=-.001:t._modelRootNode.getChildren()[1].position.y=0));case"b-button":case"y-button":return void(i||(r.pressed?t._modelRootNode.getChildren()[2].position.y=-.001:t._modelRootNode.getChildren()[2].position.y=0))}},void 0,!0)})},t.prototype._setRootMesh=function(e){this.rootMesh=new be.a(this.profileId+" "+this.handedness,this.scene),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=a.b.FromEulerAngles(0,Math.PI,0)),e.forEach(function(e){e.isPickable=!1}),this._isQuest()?this._modelRootNode=e[0]:(this._modelRootNode=e[1],this.rootMesh.position.y=.034,this.rootMesh.position.z=.052),this._modelRootNode.parent=this.rootMesh},t.prototype._updateModel=function(){},t.prototype._isQuest=function(){return!!navigator.userAgent.match(/Quest/gi)&&!this._forceLegacyControllers},t.MODEL_BASE_URL="https://controllers.babylonjs.com/oculus/",t.MODEL_LEFT_FILENAME="left.babylon",t.MODEL_RIGHT_FILENAME="right.babylon",t.QUEST_MODEL_BASE_URL="https://controllers.babylonjs.com/oculusQuest/",t}(Lo);Uo.RegisterController("oculus-touch",function(e,t){return new Rf(t,e.gamepad,e.handedness)}),Uo.RegisterController("oculus-touch-legacy",function(e,t){return new Rf(t,e.gamepad,e.handedness,!0)});var xf={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"x-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"x_button",visualResponses:{}},"y-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"y_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"a-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"a_button",visualResponses:{}},"b-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"b_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-right",assetPath:"right.glb"}},Of=function(e){function t(t,i,n){var r=e.call(this,t,Mf[n],i,n)||this;return r.profileId="htc-vive",r}return Object(h.d)(t,e),t.prototype._getFilenameAndPath=function(){return{filename:t.MODEL_FILENAME,path:t.MODEL_BASE_URL}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){var t=this;this.getComponentIds().forEach(function(e){var i=e&&t.getComponent(e);i&&i.onButtonStateChangedObservable.add(function(i){if(t.rootMesh&&!t.disableAnimation)switch(e){case"xr-standard-trigger":return void(t._modelRootNode.getChildren()[6].rotation.x=.15*-i.value);case"xr-standard-touchpad":case"xr-standard-squeeze":return}},void 0,!0)})},t.prototype._setRootMesh=function(e){this.rootMesh=new be.a(this.profileId+" "+this.handedness,this.scene),e.forEach(function(e){e.isPickable=!1}),this._modelRootNode=e[1],this._modelRootNode.parent=this.rootMesh,this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=a.b.FromEulerAngles(0,Math.PI,0))},t.prototype._updateModel=function(){},t.MODEL_BASE_URL="https://controllers.babylonjs.com/vive/",t.MODEL_FILENAME="wand.babylon",t}(Lo);Uo.RegisterController("htc-vive",function(e,t){return new Of(t,e.gamepad,e.handedness)});var Mf={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc-vive-none",assetPath:"none.glb"}}},function(e,t,i){"use strict";i.d(t,"a",function(){return g});var n=i(34),r=function(){function e(){this.children=[]}return e.prototype.isValid=function(e){return!0},e.prototype.process=function(e,t){var i="";if(this.line){var r=this.line,o=t.processor;o&&(o.lineProcessor&&(r=o.lineProcessor(r,t.isFragment)),o.attributeProcessor&&n.a.StartsWith(this.line,"attribute")?r=o.attributeProcessor(this.line):o.varyingProcessor&&n.a.StartsWith(this.line,"varying")?r=o.varyingProcessor(this.line,t.isFragment):(o.uniformProcessor||o.uniformBufferProcessor)&&n.a.StartsWith(this.line,"uniform")&&(/uniform (.+) (.+)/.test(this.line)?o.uniformProcessor&&(r=o.uniformProcessor(this.line,t.isFragment)):o.uniformBufferProcessor&&(r=o.uniformBufferProcessor(this.line,t.isFragment),t.lookForClosingBracketForUniformBuffer=!0)),o.endOfUniformBufferProcessor&&t.lookForClosingBracketForUniformBuffer&&-1!==this.line.indexOf("}")&&(t.lookForClosingBracketForUniformBuffer=!1,r=o.endOfUniformBufferProcessor(this.line,t.isFragment))),i+=r+"\r\n"}return this.children.forEach(function(n){i+=n.process(e,t)}),this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true"),i},e}(),o=function(){function e(){}return Object.defineProperty(e.prototype,"currentLine",{get:function(){return this._lines[this.lineIndex]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canRead",{get:function(){return this.lineIndex<this._lines.length-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lines",{set:function(e){this._lines=[];for(var t=0,i=e;t<i.length;t++){var n=i[t];if("#"!==n[0])for(var r=n.split(";"),o=0;o<r.length;o++){var a=r[o];(a=a.trim())&&this._lines.push(a+(o!==r.length-1?";":""))}else this._lines.push(n)}},enumerable:!1,configurable:!0}),e}(),a=i(1),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.d)(t,e),t.prototype.process=function(e,t){for(var i=0;i<this.children.length;i++){var n=this.children[i];if(n.isValid(e))return n.process(e,t)}return""},t}(r),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.d)(t,e),t.prototype.isValid=function(e){return this.testExpression.isTrue(e)},t}(r),l=function(){function e(){}return e.prototype.isTrue=function(e){return!0},e.postfixToInfix=function(t){for(var i=[],n=0,r=t;n<r.length;n++){var o=r[n];if(void 0===e._OperatorPriority[o])i.push(o);else{var a=i[i.length-1],s=i[i.length-2];i.length-=2,i.push("("+s+o+a+")")}}return i[i.length-1]},e.infixToPostfix=function(t){for(var i=[],n=-1,r=function(){""!==(l=l.trim())&&(i.push(l),l="")},o=function(t){n<e._Stack.length-1&&(e._Stack[++n]=t)},a=function(){return e._Stack[n]},s=function(){return-1===n?"!!INVALID EXPRESSION!!":e._Stack[n--]},c=0,l="";c<t.length;){var u=t.charAt(c),h=c<t.length-1?t.substr(c,2):"";if("("===u)l="",o(u);else if(")"===u){for(r();-1!==n&&"("!==a();)i.push(s());s()}else if(e._OperatorPriority[h]>1){for(r();-1!==n&&e._OperatorPriority[a()]>=e._OperatorPriority[h];)i.push(s());o(h),c++}else l+=u;c++}for(r();-1!==n;)"("===a()?s():i.push(s());return i},e._OperatorPriority={")":0,"(":1,"||":2,"&&":3},e._Stack=["","","","","","","","","","","","","","","","","","","",""],e}(),u=function(e){function t(t,i){void 0===i&&(i=!1);var n=e.call(this)||this;return n.define=t,n.not=i,n}return Object(a.d)(t,e),t.prototype.isTrue=function(e){var t=void 0!==e[this.define];return this.not&&(t=!t),t},t}(l),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.d)(t,e),t.prototype.isTrue=function(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)},t}(l),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.d)(t,e),t.prototype.isTrue=function(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)},t}(l),f=function(e){function t(t,i,n){var r=e.call(this)||this;return r.define=t,r.operand=i,r.testValue=n,r}return Object(a.d)(t,e),t.prototype.isTrue=function(e){var t=e[this.define];void 0===t&&(t=this.define);var i=!1,n=parseInt(t),r=parseInt(this.testValue);switch(this.operand){case">":i=n>r;break;case"<":i=n<r;break;case"<=":i=n<=r;break;case">=":i=n>=r;break;case"==":i=n===r}return i},t}(l),p=i(21),_=/defined\s*?\((.+?)\)/g,m=/defined\s*?\[(.+?)\]/g,g=function(){function e(){}return e.Process=function(e,t,i,n){var r=this;this._ProcessIncludes(e,t,function(e){var o=r._ProcessShaderConversion(e,t,n);i(o)})},e._ProcessPrecision=function(e,t){var i=t.shouldUseHighPrecisionShader;return-1===e.indexOf("precision highp float")?e=i?"precision highp float;\n"+e:"precision mediump float;\n"+e:i||(e=e.replace("precision highp float","precision mediump float")),e},e._ExtractOperation=function(e){var t=/defined\((.+)\)/.exec(e);if(t&&t.length)return new u(t[1].trim(),"!"===e[0]);for(var i="",n=0,r=0,o=["==",">=","<=","<",">"];r<o.length&&(i=o[r],!((n=e.indexOf(i))>-1));r++);if(-1===n)return new u(e);var a=e.substring(0,n).trim(),s=e.substring(n+i.length).trim();return new f(a,i,s)},e._BuildSubExpression=function(e){e=e.replace(_,"defined[$1]");for(var t=[],i=0,n=l.infixToPostfix(e);i<n.length;i++){var r=n[i];if("||"!==r&&"&&"!==r)t.push(r);else if(t.length>=2){var o=t[t.length-1],a=t[t.length-2];t.length-=2;var s="&&"==r?new d:new h;"string"==typeof o&&(o=o.replace(m,"defined($1)")),"string"==typeof a&&(a=a.replace(m,"defined($1)")),s.leftOperand="string"==typeof a?this._ExtractOperation(a):a,s.rightOperand="string"==typeof o?this._ExtractOperation(o):o,t.push(s)}}var c=t[t.length-1];return"string"==typeof c&&(c=c.replace(m,"defined($1)")),"string"==typeof c?this._ExtractOperation(c):c},e._BuildExpression=function(e,t){var i=new c,n=e.substring(0,t),r=e.substring(t);return r=r.substring(0,(r.indexOf("//")+1||r.length+1)-1).trim(),i.testExpression="#ifdef"===n?new u(r):"#ifndef"===n?new u(r,!0):this._BuildSubExpression(r),i},e._MoveCursorWithinIf=function(e,t,i){for(var n=e.currentLine;this._MoveCursor(e,i);){var o=(n=e.currentLine).substring(0,5).toLowerCase();if("#else"===o){var a=new r;return t.children.push(a),void this._MoveCursor(e,a)}if("#elif"===o){var s=this._BuildExpression(n,5);t.children.push(s),i=s}}},e._MoveCursor=function(e,t){for(;e.canRead;){e.lineIndex++;var i=e.currentLine,n=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/.exec(i);if(n&&n.length)switch(n[0]){case"#ifdef":var o=new s;t.children.push(o);var a=this._BuildExpression(i,6);o.children.push(a),this._MoveCursorWithinIf(e,o,a);break;case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":o=new s,t.children.push(o),a=this._BuildExpression(i,7),o.children.push(a),this._MoveCursorWithinIf(e,o,a);break;case"#if":o=new s,a=this._BuildExpression(i,3),t.children.push(o),o.children.push(a),this._MoveCursorWithinIf(e,o,a)}else{var c=new r;if(c.line=i,t.children.push(c),"#"===i[0]&&"d"===i[1]){var l=i.replace(";","").split(" ");c.additionalDefineKey=l[1],3===l.length&&(c.additionalDefineValue=l[2])}}}return!1},e._EvaluatePreProcessors=function(e,t,i){var n=new r,a=new o;return a.lineIndex=-1,a.lines=e.split("\n"),this._MoveCursor(a,n),n.process(t,i)},e._PreparePreProcessors=function(e){for(var t={},i=0,n=e.defines;i<n.length;i++){var r=n[i].replace("#define","").replace(";","").trim().split(" ");t[r[0]]=r.length>1?r[1]:""}return t.GL_ES="true",t.__VERSION__=e.version,t[e.platformName]="true",t},e._ProcessShaderConversion=function(e,t,i){var n=this._ProcessPrecision(e,t);if(!t.processor)return n;if(-1!==n.indexOf("#version 3"))return n.replace("#version 300 es","");var r=t.defines,o=this._PreparePreProcessors(t);return t.processor.preProcessor&&(n=t.processor.preProcessor(n,r,t.isFragment)),n=this._EvaluatePreProcessors(n,o,t),t.processor.postProcessor&&(n=t.processor.postProcessor(n,r,t.isFragment,i)),n},e._ProcessIncludes=function(t,i,n){for(var r=this,o=/#include<(.+)>(\((.*)\))*(\[(.*)\])*/g,a=o.exec(t),s=new String(t),c=!1;null!=a;){var l=a[1];if(-1!==l.indexOf("__decl__")&&(l=l.replace(/__decl__/,""),i.supportsUniformBuffers&&(l=(l=l.replace(/Vertex/,"Ubo")).replace(/Fragment/,"Ubo")),l+="Declaration"),!i.includesShadersStore[l]){var u=i.shadersRepository+"ShadersInclude/"+l+".fx";return void e._FileToolsLoadFile(u,function(e){i.includesShadersStore[l]=e,r._ProcessIncludes(s,i,n)})}var h=i.includesShadersStore[l];if(a[2])for(var d=a[3].split(","),f=0;f<d.length;f+=2){var p=new RegExp(d[f],"g"),_=d[f+1];h=h.replace(p,_)}if(a[4]){var m=a[5];if(-1!==m.indexOf("..")){var g=m.split(".."),v=parseInt(g[0]),b=parseInt(g[1]),y=h.slice(0);h="",isNaN(b)&&(b=i.indexParameters[g[1]]);for(var T=v;T<b;T++)i.supportsUniformBuffers||(y=y.replace(/light\{X\}.(\w*)/g,function(e,t){return t+"{X}"})),h+=y.replace(/\{X\}/g,T.toString())+"\n"}else i.supportsUniformBuffers||(h=h.replace(/light\{X\}.(\w*)/g,function(e,t){return t+"{X}"})),h=h.replace(/\{X\}/g,m)}s=s.replace(a[0],h),c=c||h.indexOf("#include<")>=0,a=o.exec(t)}c?this._ProcessIncludes(s.toString(),i,n):n(s)},e._FileToolsLoadFile=function(e,t,i,n,r,o){throw p.a.WarnImport("FileTools")},e}()},function(e,t,i){"use strict";i(26).a.prototype._readTexturePixels=function(e,t,i,n,r,o){void 0===n&&(n=-1),void 0===r&&(r=0),void 0===o&&(o=null);var a=this._gl;if(!a)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){var s=a.createFramebuffer();if(!s)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=s}a.bindFramebuffer(a.FRAMEBUFFER,this._dummyFramebuffer),n>-1?a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+n,e._webGLTexture,r):a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e._webGLTexture,r);var c=void 0!==e.type?this._getWebGLTextureType(e.type):a.UNSIGNED_BYTE;switch(c){case a.UNSIGNED_BYTE:o||(o=new Uint8Array(4*t*i)),c=a.UNSIGNED_BYTE;break;default:o||(o=new Float32Array(4*t*i)),c=a.FLOAT}return a.readPixels(0,0,t,i,a.RGBA,c,o),a.bindFramebuffer(a.FRAMEBUFFER,this._currentFramebuffer),o}},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.shadowsFragmentFunctions="#ifdef SHADOWS\n#ifndef SHADOWFLOAT\n\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\n#define inline\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nreturn depth>shadow ? darkness : 1.0;\n}\n#define inline\nfloat computeShadowWithPoissonSamplingCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;\n#else\nif (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;\n#endif\nreturn min(1.0,visibility+darkness);\n}\n#define inline\nfloat computeShadowWithESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn esm;\n}\n#define inline\nfloat computeShadowWithCloseESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn esm;\n}\n#ifdef WEBGL2\n#define inline\nfloat computeShadowCSM(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nvec3 uvLayer=vec3(uv.x,uv.y,layer);\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uvLayer));\n#else\nfloat shadow=texture2D(shadowSampler,uvLayer).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n#endif\n#define inline\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadow=texture2D(shadowSampler,uv).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n}\n#define inline\nfloat computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n\n#ifndef SHADOWFLOAT\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[0]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[1]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[2]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[3]*mapSize))<shadowPixelDepth) visibility-=0.25;\n#else\nif (texture2D(shadowSampler,uv+poissonDisk[0]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[1]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[2]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[3]*mapSize).x<shadowPixelDepth) visibility-=0.25;\n#endif\nreturn computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#ifdef WEBGL2\n#define GREATEST_LESS_THAN_ONE 0.99999994\n\n#define inline\nfloat computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat shadow=texture(shadowSampler,uvDepthLayer);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\n#define inline\nfloat computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\n#define inline\nfloat computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n#define inline\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat shadow=texture2D(shadowSampler,uvDepth);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n#define inline\nfloat computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n#define inline\nfloat computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\nconst vec3 PoissonSamplers32[64]=vec3[64](\nvec3(0.06407013,0.05409927,0.),\nvec3(0.7366577,0.5789394,0.),\nvec3(-0.6270542,-0.5320278,0.),\nvec3(-0.4096107,0.8411095,0.),\nvec3(0.6849564,-0.4990818,0.),\nvec3(-0.874181,-0.04579735,0.),\nvec3(0.9989998,0.0009880066,0.),\nvec3(-0.004920578,-0.9151649,0.),\nvec3(0.1805763,0.9747483,0.),\nvec3(-0.2138451,0.2635818,0.),\nvec3(0.109845,0.3884785,0.),\nvec3(0.06876755,-0.3581074,0.),\nvec3(0.374073,-0.7661266,0.),\nvec3(0.3079132,-0.1216763,0.),\nvec3(-0.3794335,-0.8271583,0.),\nvec3(-0.203878,-0.07715034,0.),\nvec3(0.5912697,0.1469799,0.),\nvec3(-0.88069,0.3031784,0.),\nvec3(0.5040108,0.8283722,0.),\nvec3(-0.5844124,0.5494877,0.),\nvec3(0.6017799,-0.1726654,0.),\nvec3(-0.5554981,0.1559997,0.),\nvec3(-0.3016369,-0.3900928,0.),\nvec3(-0.5550632,-0.1723762,0.),\nvec3(0.925029,0.2995041,0.),\nvec3(-0.2473137,0.5538505,0.),\nvec3(0.9183037,-0.2862392,0.),\nvec3(0.2469421,0.6718712,0.),\nvec3(0.3916397,-0.4328209,0.),\nvec3(-0.03576927,-0.6220032,0.),\nvec3(-0.04661255,0.7995201,0.),\nvec3(0.4402924,0.3640312,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.)\n);\nconst vec3 PoissonSamplers64[64]=vec3[64](\nvec3(-0.613392,0.617481,0.),\nvec3(0.170019,-0.040254,0.),\nvec3(-0.299417,0.791925,0.),\nvec3(0.645680,0.493210,0.),\nvec3(-0.651784,0.717887,0.),\nvec3(0.421003,0.027070,0.),\nvec3(-0.817194,-0.271096,0.),\nvec3(-0.705374,-0.668203,0.),\nvec3(0.977050,-0.108615,0.),\nvec3(0.063326,0.142369,0.),\nvec3(0.203528,0.214331,0.),\nvec3(-0.667531,0.326090,0.),\nvec3(-0.098422,-0.295755,0.),\nvec3(-0.885922,0.215369,0.),\nvec3(0.566637,0.605213,0.),\nvec3(0.039766,-0.396100,0.),\nvec3(0.751946,0.453352,0.),\nvec3(0.078707,-0.715323,0.),\nvec3(-0.075838,-0.529344,0.),\nvec3(0.724479,-0.580798,0.),\nvec3(0.222999,-0.215125,0.),\nvec3(-0.467574,-0.405438,0.),\nvec3(-0.248268,-0.814753,0.),\nvec3(0.354411,-0.887570,0.),\nvec3(0.175817,0.382366,0.),\nvec3(0.487472,-0.063082,0.),\nvec3(-0.084078,0.898312,0.),\nvec3(0.488876,-0.783441,0.),\nvec3(0.470016,0.217933,0.),\nvec3(-0.696890,-0.549791,0.),\nvec3(-0.149693,0.605762,0.),\nvec3(0.034211,0.979980,0.),\nvec3(0.503098,-0.308878,0.),\nvec3(-0.016205,-0.872921,0.),\nvec3(0.385784,-0.393902,0.),\nvec3(-0.146886,-0.859249,0.),\nvec3(0.643361,0.164098,0.),\nvec3(0.634388,-0.049471,0.),\nvec3(-0.688894,0.007843,0.),\nvec3(0.464034,-0.188818,0.),\nvec3(-0.440840,0.137486,0.),\nvec3(0.364483,0.511704,0.),\nvec3(0.034028,0.325968,0.),\nvec3(0.099094,-0.308023,0.),\nvec3(0.693960,-0.366253,0.),\nvec3(0.678884,-0.204688,0.),\nvec3(0.001801,0.780328,0.),\nvec3(0.145177,-0.898984,0.),\nvec3(0.062655,-0.611866,0.),\nvec3(0.315226,-0.604297,0.),\nvec3(-0.780145,0.486251,0.),\nvec3(-0.371868,0.882138,0.),\nvec3(0.200476,0.494430,0.),\nvec3(-0.494552,-0.711051,0.),\nvec3(0.612476,0.705252,0.),\nvec3(-0.578845,-0.768792,0.),\nvec3(-0.772454,-0.090976,0.),\nvec3(0.504440,0.372295,0.),\nvec3(0.155736,0.065157,0.),\nvec3(0.391522,0.849605,0.),\nvec3(-0.620106,-0.328104,0.),\nvec3(0.789239,-0.419965,0.),\nvec3(-0.545396,0.538133,0.),\nvec3(-0.178564,-0.596057,0.)\n);\n\n\n\n\n\n#define inline\nfloat computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,vec3(uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nelse\n{\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);\nvec4 filterRadius=vec4(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec4 offset=vec4(poissonSamplers[i],0.);\n\noffset=vec4(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);\nshadow+=texture2D(shadowSampler,uvDepthLayer+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n\n\n#define inline\nfloat computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nelse\n{\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);\nfloat filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec3 offset=poissonSamplers[i];\n\noffset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);\nshadow+=texture2D(shadowSampler,uvDepth+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,depthMetric-avgBlockerDepth);\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n}\n#define inline\nfloat computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);\n}\n#define inline\nfloat computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);\n}\n#define inline\nfloat computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);\n}\n#define inline\nfloat computeShadowWithCSMPCSS16(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#define inline\nfloat computeShadowWithCSMPCSS32(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#define inline\nfloat computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#endif\n#endif\n"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.reflectionFunction="vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {\n\nvec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;\nvec3 halfSize=cubeSize*0.5;\nvec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;\nvec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;\n\nvec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);\n\nfloat distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);\n\nvec3 intersectPositionWS=vertexPos+origVec*distance;\n\nreturn intersectPositionWS-cubePos;\n}\nvec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(s,t,0);\n}\nvec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(1.0-s,t,0);\n}\nvec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);\nvec3 r=normalize(reflect(cameraToVertex,worldNormal));\nr=vec3(reflectionMatrix*vec4(r,0));\nfloat lon=atan(r.z,r.x);\nfloat lat=acos(r.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(s,t,0);\n}\nvec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)\n{\nvec3 viewDir=normalize(vec3(view*worldPos));\nvec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));\nvec3 r=reflect(viewDir,viewNormal);\nr=vec3(reflectionMatrix*vec4(r,0));\nr.z=r.z-1.0;\nfloat m=2.0*length(r);\nreturn vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);\n}\nvec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 viewDir=worldPos.xyz-eyePosition;\nvec3 coords=normalize(reflect(viewDir,worldNormal));\nreturn vec3(reflectionMatrix*vec4(coords,1));\n}\nvec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 viewDir=normalize(worldPos.xyz-eyePosition);\n\nvec3 coords=reflect(viewDir,worldNormal);\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n}\nvec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)\n{\nvec3 viewDir=normalize(worldPos.xyz-eyePosition);\n\nvec3 coords=reflect(viewDir,worldNormal);\ncoords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n}\nvec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)\n{\nreturn vec3(reflectionMatrix*(view*worldPos));\n}\nvec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)\n{\nreturn vec3(reflectionMatrix*vec4(positionW,1.));\n}\n#ifdef REFLECTION\nvec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nreturn computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nreturn computeFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nreturn computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nreturn computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nreturn computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_CUBIC\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nreturn computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);\n#else\nreturn computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn computeProjectionCoords(worldPos,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn computeSkyBoxCoords(vPositionUVW,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\n#endif\n}\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.bumpFragmentMainFunctions="#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform mat4 normalMatrix;\n#endif\nvec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)\n{\n#ifdef NORMALXYSCALE\nnormal=normalize(normal*vec3(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*normal);\n}\nvec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)\n{\nreturn perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)\n{\n\nuv=gl_FrontFacing ? uv : -uv;\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;\n\ntangent*=tangentSpaceParams.x;\nbitangent*=tangentSpaceParams.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(bitangent,bitangent)));\nreturn mat3(tangent*invmax,bitangent*invmax,normal);\n}\n#endif\n"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.bumpFragmentFunctions="#if defined(BUMP)\n#if BUMPDIRECTUV == 1\n#define vBumpUV vMainUV1\n#elif BUMPDIRECTUV == 2\n#define vBumpUV vMainUV2\n#else\nvarying vec2 vBumpUV;\n#endif\nuniform sampler2D bumpSampler;\nvec3 perturbNormal(mat3 cotangentFrame,vec2 uv)\n{\nreturn perturbNormal(cotangentFrame,texture2D(bumpSampler,uv).xyz,vBumpInfos.y);\n}\n#endif\n#if defined(DETAIL)\n#if DETAILDIRECTUV == 1\n#define vDetailUV vMainUV1\n#elif DETAILDIRECTUV == 2\n#define vDetailUV vMainUV2\n#else\nvarying vec2 vDetailUV;\n#endif\nuniform sampler2D detailSampler;\n#endif\n#if defined(BUMP)\nvec3 perturbNormal(mat3 cotangentFrame,vec3 color)\n{\nreturn perturbNormal(cotangentFrame,color,vBumpInfos.y);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\nreturn cotangent_frame(normal,p,uv,vTangentSpaceParams);\n}\n#endif\n#if defined(BUMP) && defined(PARALLAX)\nconst float minSamples=4.;\nconst float maxSamples=15.;\nconst int iMaxSamples=15;\n\nvec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {\nfloat parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;\nparallaxLimit*=parallaxScale;\nvec2 vOffsetDir=normalize(vViewDirCoT.xy);\nvec2 vMaxOffset=vOffsetDir*parallaxLimit;\nfloat numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));\nfloat stepSize=1.0/numSamples;\n\nfloat currRayHeight=1.0;\nvec2 vCurrOffset=vec2(0,0);\nvec2 vLastOffset=vec2(0,0);\nfloat lastSampledHeight=1.0;\nfloat currSampledHeight=1.0;\nfor (int i=0; i<iMaxSamples; i++)\n{\ncurrSampledHeight=texture2D(bumpSampler,vBumpUV+vCurrOffset).w;\n\nif (currSampledHeight>currRayHeight)\n{\nfloat delta1=currSampledHeight-currRayHeight;\nfloat delta2=(currRayHeight+stepSize)-lastSampledHeight;\nfloat ratio=delta1/(delta1+delta2);\nvCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;\n\nbreak;\n}\nelse\n{\ncurrRayHeight-=stepSize;\nvLastOffset=vCurrOffset;\nvCurrOffset+=stepSize*vMaxOffset;\nlastSampledHeight=currSampledHeight;\n}\n}\nreturn vCurrOffset;\n}\nvec2 parallaxOffset(vec3 viewDir,float heightScale)\n{\n\nfloat height=texture2D(bumpSampler,vBumpUV).w;\nvec2 texCoordOffset=heightScale*viewDir.xy*height;\nreturn -texCoordOffset;\n}\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.bumpFragment="vec2 uvOffset=vec2(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nfloat normalScale=1.0;\n#elif defined(BUMP)\nfloat normalScale=vBumpInfos.y;\n#else\nfloat normalScale=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#elif defined(BUMP)\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vBumpUV);\n#else\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vDetailUV,vec2(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#else\nmat3 TBN=cotangent_frame(normalW,vPositionW,vMainUV1,vec2(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nmat3 invTBN=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);\nvec2 detailNormalRG=detailColor.wy*2.0-1.0;\nfloat detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));\nvec3 detailNormal=vec3(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\nnormalW=normalize(texture2D(bumpSampler,vBumpUV).xyz*2.0-1.0);\nnormalW=normalize(mat3(normalMatrix)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,vBumpUV+uvOffset);\n#else\nvec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;\n\n#if DETAIL_NORMALBLENDMETHOD == 0\ndetailNormal.xy*=vDetailInfos.z;\nvec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD == 1\ndetailNormal.xy*=vDetailInfos.z;\nbumpNormal+=vec3(0.0,0.0,1.0);\ndetailNormal*=vec3(-1.0,-1.0,1.0);\nvec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal.xy*=vDetailInfos.z;\nnormalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.lightFragment="#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n\n#else\n#ifdef PBR\n\n#ifdef SPOTLIGHT{X}\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(POINTLIGHT{X})\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(HEMILIGHT{X})\npreInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(DIRLIGHT{X})\npreInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#endif\npreInfo.NdotV=NdotV;\n\n#ifdef SPOTLIGHT{X}\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\npreInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\npreInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\npreInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\npreInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#elif defined(POINTLIGHT{X})\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#endif\n#else\npreInfo.attenuation=1.0;\n#endif\n\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=roughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);\n#elif defined(SS_TRANSLUCENCY)\ninfo.diffuse=computeDiffuseAndTransmittedLighting(preInfo,light{X}.vLightDiffuse.rgb,subSurfaceOut.transmittance);\n#else\ninfo.diffuse=computeDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef SPECULARTERM\n#ifdef ANISOTROPIC\ninfo.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#else\ninfo.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n#endif\n\n#ifdef SHEEN\n#ifdef SHEEN_LINKWITHALBEDO\n\npreInfo.roughness=sheenOut.sheenIntensity;\n#else\n#ifdef HEMILIGHT{X}\npreInfo.roughness=sheenOut.sheenRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n#endif\ninfo.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef CLEARCOAT\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=clearcoatOut.clearCoatRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\ninfo.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light{X}.vLightDiffuse.rgb);\n#ifdef CLEARCOAT_TINT\n\nabsorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);\ninfo.diffuse*=absorption;\n#ifdef SPECULARTERM\ninfo.specular*=absorption;\n#endif\n#endif\n\ninfo.diffuse*=info.clearCoat.w;\n#ifdef SPECULARTERM\ninfo.specular*=info.clearCoat.w;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w;\n#endif\n#endif\n#else\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightSampler{X},textureProjectionMatrix{X});\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++)\n{\n#ifdef SHADOWCSM_RIGHTHANDED{X}\ndiff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;\n#else\ndiff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;\n#endif\nif (diff{X}>=0.) {\nindex{X}=i;\nbreak;\n}\n}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nif (index{X}>=0)\n#endif\n{\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nshadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nshadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];\n#endif\n#ifndef SHADOWCSMNOBLEND{X}\nfloat frustumLength=frustumLengths{X}[index{X}];\nfloat diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};\nif (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)\n{\nindex{X}+=1;\nfloat nextShadow=0.;\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nnextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nnextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nnextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\nshadow=mix(nextShadow,shadow,diffRatio);\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);\n#endif\n}\n#endif\n}\n#elif defined(SHADOWCLOSEESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;\nshadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor.rgb*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\n#ifdef SHADOWCSMDEBUG{X}\ndiffuseBase+=info.diffuse*shadowDebug{X};\n#else\ndiffuseBase+=info.diffuse*shadow;\n#endif\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#ifdef CLEARCOAT\nclearCoatBase+=info.clearCoat.rgb*shadow;\n#endif\n#ifdef SHEEN\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#endif\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.fogFragment="#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.fogVertexDeclaration="#ifdef FOG\nvarying vec3 vFogDistance;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.shadowsVertex="#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvPositionFromCamera{X}=view*worldPos;\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {\nvPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;\nvDepthMetric{X}[i]=((vPositionFromLight{X}[i].z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n}\n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\nvDepthMetric{X}=((vPositionFromLight{X}.z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n#endif\n#endif"},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.Eval=function(t,i){return"true"===(t=t.match(/\([^\(\)]*\)/g)?t.replace(/\([^\(\)]*\)/g,function(t){return t=t.slice(1,t.length-1),e._HandleParenthesisContent(t,i)}):e._HandleParenthesisContent(t,i))||"false"!==t&&e.Eval(t,i)},e._HandleParenthesisContent=function(t,i){var n;i=i||function(e){return"true"===e};var r=t.split("||");for(var o in r)if(r.hasOwnProperty(o)){var a=e._SimplifyNegation(r[o].trim()),s=a.split("&&");if(s.length>1)for(var c=0;c<s.length;++c){var l=e._SimplifyNegation(s[c].trim());if(!(n="true"!==l&&"false"!==l?"!"===l[0]?!i(l.substring(1)):i(l):"true"===l)){a="false";break}}if(n||"true"===a){n=!0;break}n="true"!==a&&"false"!==a?"!"===a[0]?!i(a.substring(1)):i(a):"true"===a}return n?"true":"false"},e._SimplifyNegation=function(e){return"!true"===(e=(e=e.replace(/^[\s!]+/,function(e){return(e=e.replace(/[\s]/g,function(){return""})).length%2?"!":""})).trim())?e="false":"!false"===e&&(e="true"),e},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.ExponentialBackoff=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=500),function(i,n,r){return 0!==n.status||r>=e||-1!==i.indexOf("file:")?-1:Math.pow(2,r)*t}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this._isDepthTestDirty=!1,this._isDepthMaskDirty=!1,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!1,this._isFrontFaceDirty=!1,this.reset()}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isDepthFuncDirty||this._isDepthTestDirty||this._isDepthMaskDirty||this._isCullFaceDirty||this._isCullDirty||this._isZOffsetDirty||this._isFrontFaceDirty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zOffset",{get:function(){return this._zOffset},set:function(e){this._zOffset!==e&&(this._zOffset=e,this._isZOffsetDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cullFace",{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,this._isCullFaceDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cull",{get:function(){return this._cull},set:function(e){this._cull!==e&&(this._cull=e,this._isCullDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthFunc",{get:function(){return this._depthFunc},set:function(e){this._depthFunc!==e&&(this._depthFunc=e,this._isDepthFuncDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return this._depthMask},set:function(e){this._depthMask!==e&&(this._depthMask=e,this._isDepthMaskDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._isDepthTestDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontFace",{get:function(){return this._frontFace},set:function(e){this._frontFace!==e&&(this._frontFace=e,this._isFrontFaceDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._depthMask=!0,this._depthTest=!0,this._depthFunc=null,this._cullFace=null,this._cull=null,this._zOffset=0,this._frontFace=null,this._isDepthTestDirty=!0,this._isDepthMaskDirty=!0,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!1,this._isFrontFaceDirty=!1},e.prototype.apply=function(e){this.isDirty&&(this._isCullDirty&&(this.cull?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this._isCullDirty=!1),this._isCullFaceDirty&&(e.cullFace(this.cullFace),this._isCullFaceDirty=!1),this._isDepthMaskDirty&&(e.depthMask(this.depthMask),this._isDepthMaskDirty=!1),this._isDepthTestDirty&&(this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this._isDepthTestDirty=!1),this._isDepthFuncDirty&&(e.depthFunc(this.depthFunc),this._isDepthFuncDirty=!1),this._isZOffsetDirty&&(this.zOffset?(e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(this.zOffset,0)):e.disable(e.POLYGON_OFFSET_FILL),this._isZOffsetDirty=!1),this._isFrontFaceDirty&&(e.frontFace(this.frontFace),this._isFrontFaceDirty=!1))},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(2),r=function(){function e(){this._isStencilTestDirty=!1,this._isStencilMaskDirty=!1,this._isStencilFuncDirty=!1,this._isStencilOpDirty=!1,this.reset()}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isStencilTestDirty||this._isStencilMaskDirty||this._isStencilFuncDirty||this._isStencilOpDirty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilFunc",{get:function(){return this._stencilFunc},set:function(e){this._stencilFunc!==e&&(this._stencilFunc=e,this._isStencilFuncDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilFuncRef",{get:function(){return this._stencilFuncRef},set:function(e){this._stencilFuncRef!==e&&(this._stencilFuncRef=e,this._isStencilFuncDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilFuncMask",{get:function(){return this._stencilFuncMask},set:function(e){this._stencilFuncMask!==e&&(this._stencilFuncMask=e,this._isStencilFuncDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpStencilFail",{get:function(){return this._stencilOpStencilFail},set:function(e){this._stencilOpStencilFail!==e&&(this._stencilOpStencilFail=e,this._isStencilOpDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpDepthFail",{get:function(){return this._stencilOpDepthFail},set:function(e){this._stencilOpDepthFail!==e&&(this._stencilOpDepthFail=e,this._isStencilOpDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpStencilDepthPass",{get:function(){return this._stencilOpStencilDepthPass},set:function(e){this._stencilOpStencilDepthPass!==e&&(this._stencilOpStencilDepthPass=e,this._isStencilOpDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilMask",{get:function(){return this._stencilMask},set:function(e){this._stencilMask!==e&&(this._stencilMask=e,this._isStencilMaskDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilTest",{get:function(){return this._stencilTest},set:function(e){this._stencilTest!==e&&(this._stencilTest=e,this._isStencilTestDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._stencilTest=!1,this._stencilMask=255,this._stencilFunc=e.ALWAYS,this._stencilFuncRef=1,this._stencilFuncMask=255,this._stencilOpStencilFail=e.KEEP,this._stencilOpDepthFail=e.KEEP,this._stencilOpStencilDepthPass=e.REPLACE,this._isStencilTestDirty=!0,this._isStencilMaskDirty=!0,this._isStencilFuncDirty=!0,this._isStencilOpDirty=!0},e.prototype.apply=function(e){this.isDirty&&(this._isStencilTestDirty&&(this.stencilTest?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this._isStencilTestDirty=!1),this._isStencilMaskDirty&&(e.stencilMask(this.stencilMask),this._isStencilMaskDirty=!1),this._isStencilFuncDirty&&(e.stencilFunc(this.stencilFunc,this.stencilFuncRef,this.stencilFuncMask),this._isStencilFuncDirty=!1),this._isStencilOpDirty&&(e.stencilOp(this.stencilOpStencilFail,this.stencilOpDepthFail,this.stencilOpStencilDepthPass),this._isStencilOpDirty=!1))},e.ALWAYS=n.a.ALWAYS,e.KEEP=n.a.KEEP,e.REPLACE=n.a.REPLACE,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this._isAlphaBlendDirty=!1,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this._isBlendConstantsDirty=!1,this._alphaBlend=!1,this._blendFunctionParameters=new Array(4),this._blendEquationParameters=new Array(2),this._blendConstants=new Array(4),this.reset()}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isAlphaBlendDirty||this._isBlendFunctionParametersDirty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaBlend",{get:function(){return this._alphaBlend},set:function(e){this._alphaBlend!==e&&(this._alphaBlend=e,this._isAlphaBlendDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.setAlphaBlendConstants=function(e,t,i,n){this._blendConstants[0]===e&&this._blendConstants[1]===t&&this._blendConstants[2]===i&&this._blendConstants[3]===n||(this._blendConstants[0]=e,this._blendConstants[1]=t,this._blendConstants[2]=i,this._blendConstants[3]=n,this._isBlendConstantsDirty=!0)},e.prototype.setAlphaBlendFunctionParameters=function(e,t,i,n){this._blendFunctionParameters[0]===e&&this._blendFunctionParameters[1]===t&&this._blendFunctionParameters[2]===i&&this._blendFunctionParameters[3]===n||(this._blendFunctionParameters[0]=e,this._blendFunctionParameters[1]=t,this._blendFunctionParameters[2]=i,this._blendFunctionParameters[3]=n,this._isBlendFunctionParametersDirty=!0)},e.prototype.setAlphaEquationParameters=function(e,t){this._blendEquationParameters[0]===e&&this._blendEquationParameters[1]===t||(this._blendEquationParameters[0]=e,this._blendEquationParameters[1]=t,this._isBlendEquationParametersDirty=!0)},e.prototype.reset=function(){this._alphaBlend=!1,this._blendFunctionParameters[0]=null,this._blendFunctionParameters[1]=null,this._blendFunctionParameters[2]=null,this._blendFunctionParameters[3]=null,this._blendEquationParameters[0]=null,this._blendEquationParameters[1]=null,this._blendConstants[0]=null,this._blendConstants[1]=null,this._blendConstants[2]=null,this._blendConstants[3]=null,this._isAlphaBlendDirty=!0,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this._isBlendConstantsDirty=!1},e.prototype.apply=function(e){this.isDirty&&(this._isAlphaBlendDirty&&(this._alphaBlend?e.enable(e.BLEND):e.disable(e.BLEND),this._isAlphaBlendDirty=!1),this._isBlendFunctionParametersDirty&&(e.blendFuncSeparate(this._blendFunctionParameters[0],this._blendFunctionParameters[1],this._blendFunctionParameters[2],this._blendFunctionParameters[3]),this._isBlendFunctionParametersDirty=!1),this._isBlendEquationParametersDirty&&(e.blendEquationSeparate(this._blendEquationParameters[0],this._blendEquationParameters[1]),this._isBlendEquationParametersDirty=!1),this._isBlendConstantsDirty&&(e.blendColor(this._blendConstants[0],this._blendConstants[1],this._blendConstants[2],this._blendConstants[3]),this._isBlendConstantsDirty=!1))},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){this.vertexCompilationError=null,this.fragmentCompilationError=null,this.programLinkError=null,this.programValidationError=null}return Object.defineProperty(e.prototype,"isAsync",{get:function(){return this.isParallelCompiled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return!!this.program&&(!this.isParallelCompiled||this.engine._isRenderingStateCompiled(this))},enumerable:!1,configurable:!0}),e.prototype._handlesSpectorRebuildCallback=function(e){e&&this.program&&e(this.program)},e.prototype._getVertexShaderCode=function(){return this.vertexShader?this.engine._getShaderSource(this.vertexShader):null},e.prototype._getFragmentShaderCode=function(){return this.fragmentShader?this.engine._getShaderSource(this.fragmentShader):null},e}()},function(e,t,i){"use strict";var n;i.d(t,"a",function(){return a}),function(e){e[e.Pending=0]="Pending",e[e.Fulfilled=1]="Fulfilled",e[e.Rejected=2]="Rejected"}(n||(n={}));var r=function(){this.count=0,this.target=0,this.results=[]},o=function(){function e(e){var t=this;if(this._state=n.Pending,this._children=new Array,this._rejectWasConsumed=!1,e)try{e(function(e){t._resolve(e)},function(e){t._reject(e)})}catch(e){this._reject(e)}}return Object.defineProperty(e.prototype,"_result",{get:function(){return this._resultValue},set:function(e){this._resultValue=e,this._parent&&void 0===this._parent._result&&(this._parent._result=e)},enumerable:!1,configurable:!0}),e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.then=function(t,i){var r=this,o=new e;return o._onFulfilled=t,o._onRejected=i,this._children.push(o),o._parent=this,this._state!==n.Pending&&setTimeout(function(){if(r._state===n.Fulfilled||r._rejectWasConsumed){var e=o._resolve(r._result);if(null!=e)if(void 0!==e._state){var t=e;o._children.push(t),t._parent=o,o=t}else o._result=e}else o._reject(r._reason)}),o},e.prototype._moveChildren=function(e){var t,i=this;if((t=this._children).push.apply(t,e.splice(0,e.length)),this._children.forEach(function(e){e._parent=i}),this._state===n.Fulfilled)for(var r=0,o=this._children;r<o.length;r++)o[r]._resolve(this._result);else if(this._state===n.Rejected)for(var a=0,s=this._children;a<s.length;a++)s[a]._reject(this._reason)},e.prototype._resolve=function(e){try{this._state=n.Fulfilled;var t=null;if(this._onFulfilled&&(t=this._onFulfilled(e)),null!=t)if(void 0!==t._state){var i=t;i._parent=this,i._moveChildren(this._children),e=i._result}else e=t;this._result=e;for(var r=0,o=this._children;r<o.length;r++)o[r]._resolve(e);this._children.length=0,delete this._onFulfilled,delete this._onRejected}catch(e){this._reject(e,!0)}},e.prototype._reject=function(e,t){if(void 0===t&&(t=!1),this._state=n.Rejected,this._reason=e,this._onRejected&&!t)try{this._onRejected(e),this._rejectWasConsumed=!0}catch(t){e=t}for(var i=0,r=this._children;i<r.length;i++){var o=r[i];this._rejectWasConsumed?o._resolve(null):o._reject(e)}this._children.length=0,delete this._onFulfilled,delete this._onRejected},e.resolve=function(t){var i=new e;return i._resolve(t),i},e._RegisterForFulfillment=function(e,t,i){e.then(function(e){return t.results[i]=e,t.count++,t.count===t.target&&t.rootPromise._resolve(t.results),null},function(e){t.rootPromise._state!==n.Rejected&&t.rootPromise._reject(e)})},e.all=function(t){var i=new e,n=new r;if(n.target=t.length,n.rootPromise=i,t.length)for(var o=0;o<t.length;o++)e._RegisterForFulfillment(t[o],n,o);else i._resolve([]);return i},e.race=function(t){var i=new e;if(t.length)for(var n=0,r=t;n<r.length;n++)r[n].then(function(e){return i&&(i._resolve(e),i=null),null},function(e){i&&(i._reject(e),i=null)});return i},e}(),a=function(){function e(){}return e.Apply=function(e){void 0===e&&(e=!1),(e||"undefined"==typeof Promise)&&(window.Promise=o)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r}),i.d(t,"b",function(){return o});var n=i(57),r=function(){function e(e){void 0===e&&(e=30),this._enabled=!0,this._rollingFrameTime=new o(e)}return e.prototype.sampleFrame=function(e){if(void 0===e&&(e=n.a.Now),this._enabled){if(null!=this._lastFrameTimeMs){var t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}},Object.defineProperty(e.prototype,"averageFrameTime",{get:function(){return this._rollingFrameTime.average},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageFrameTimeVariance",{get:function(){return this._rollingFrameTime.variance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instantaneousFrameTime",{get:function(){return this._rollingFrameTime.history(0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageFPS",{get:function(){return 1e3/this._rollingFrameTime.average},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instantaneousFPS",{get:function(){var e=this._rollingFrameTime.history(0);return 0===e?0:1e3/e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSaturated",{get:function(){return this._rollingFrameTime.isSaturated()},enumerable:!1,configurable:!0}),e.prototype.enable=function(){this._enabled=!0},e.prototype.disable=function(){this._enabled=!1,this._lastFrameTimeMs=null},Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._enabled},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()},e}(),o=function(){function e(e){this._samples=new Array(e),this.reset()}return e.prototype.add=function(e){var t;if(this.isSaturated()){var i=this._samples[this._pos];t=i-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(i-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length},e.prototype.history=function(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;var t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]},e.prototype.isSaturated=function(){return this._sampleCount>=this._samples.length},e.prototype.reset=function(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0},e.prototype._wrapPosition=function(e){var t=this._samples.length;return(e%t+t)%t},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i(0),r=function(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new n.e(0,0,0),this._diffPositionForCollisions=new n.e(0,0,0),this._collisionResponse=!0}},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var n=i(33),r=i(0),o=i(2),a=function(){function e(e,t,i,r,o){void 0===i&&(i=null),void 0===r&&(r=null),void 0===o&&(o=null),this.index=e,this._opaqueSubMeshes=new n.a(256),this._transparentSubMeshes=new n.a(256),this._alphaTestSubMeshes=new n.a(256),this._depthOnlySubMeshes=new n.a(256),this._particleSystems=new n.a(256),this._spriteManagers=new n.a(256),this._edgesRenderers=new n.b(16),this._scene=t,this.opaqueSortCompareFn=i,this.alphaTestSortCompareFn=r,this.transparentSortCompareFn=o}return Object.defineProperty(e.prototype,"opaqueSortCompareFn",{set:function(t){this._opaqueSortCompareFn=t,this._renderOpaque=t?this.renderOpaqueSorted:e.renderUnsorted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaTestSortCompareFn",{set:function(t){this._alphaTestSortCompareFn=t,this._renderAlphaTest=t?this.renderAlphaTestSorted:e.renderUnsorted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transparentSortCompareFn",{set:function(t){this._transparentSortCompareFn=t||e.defaultTransparentSortCompare,this._renderTransparent=this.renderTransparentSorted},enumerable:!1,configurable:!0}),e.prototype.render=function(e,t,i,n){if(e)e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);else{var r=this._scene.getEngine();0!==this._depthOnlySubMeshes.length&&(r.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),r.setColorWrite(!0)),0!==this._opaqueSubMeshes.length&&this._renderOpaque(this._opaqueSubMeshes),0!==this._alphaTestSubMeshes.length&&this._renderAlphaTest(this._alphaTestSubMeshes);var a=r.getStencilBuffer();if(r.setStencilBuffer(!1),t&&this._renderSprites(),i&&this._renderParticles(n),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),0!==this._transparentSubMeshes.length&&(r.setStencilBuffer(a),this._renderTransparent(this._transparentSubMeshes),r.setAlphaMode(o.a.ALPHA_DISABLE)),r.setStencilBuffer(!1),this._edgesRenderers.length){for(var s=0;s<this._edgesRenderers.length;s++)this._edgesRenderers.data[s].render();r.setAlphaMode(o.a.ALPHA_DISABLE)}r.setStencilBuffer(a)}},e.prototype.renderOpaqueSorted=function(t){return e.renderSorted(t,this._opaqueSortCompareFn,this._scene.activeCamera,!1)},e.prototype.renderAlphaTestSorted=function(t){return e.renderSorted(t,this._alphaTestSortCompareFn,this._scene.activeCamera,!1)},e.prototype.renderTransparentSorted=function(t){return e.renderSorted(t,this._transparentSortCompareFn,this._scene.activeCamera,!0)},e.renderSorted=function(t,i,n,a){for(var s,c=0,l=n?n.globalPosition:e._zeroVector;c<t.length;c++)(s=t.data[c])._alphaIndex=s.getMesh().alphaIndex,s._distanceToCamera=r.e.Distance(s.getBoundingInfo().boundingSphere.centerWorld,l);var u=t.data.slice(0,t.length);for(i&&u.sort(i),c=0;c<u.length;c++){if(s=u[c],a){var h=s.getMaterial();if(h&&h.needDepthPrePass){var d=h.getScene().getEngine();d.setColorWrite(!1),d.setAlphaMode(o.a.ALPHA_DISABLE),s.render(!1),d.setColorWrite(!0)}}s.render(a)}},e.renderUnsorted=function(e){for(var t=0;t<e.length;t++)e.data[t].render(!1)},e.defaultTransparentSortCompare=function(t,i){return t._alphaIndex>i._alphaIndex?1:t._alphaIndex<i._alphaIndex?-1:e.backToFrontSortCompare(t,i)},e.backToFrontSortCompare=function(e,t){return e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0},e.frontToBackSortCompare=function(e,t){return e._distanceToCamera<t._distanceToCamera?-1:e._distanceToCamera>t._distanceToCamera?1:0},e.prototype.prepare=function(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this._spriteManagers.reset(),this._edgesRenderers.reset()},e.prototype.dispose=function(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()},e.prototype.dispatch=function(e,t,i){void 0===t&&(t=e.getMesh()),void 0===i&&(i=e.getMaterial()),null!=i&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTesting()?(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer))},e.prototype.dispatchSprites=function(e){this._spriteManagers.push(e)},e.prototype.dispatchParticles=function(e){this._particleSystems.push(e)},e.prototype._renderParticles=function(e){if(0!==this._particleSystems.length){var t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(var i=0;i<this._particleSystems.length;i++){var n=this._particleSystems.data[i];if(0!==(t&&t.layerMask&n.layerMask)){var r=n.emitter;r.position&&e&&-1===e.indexOf(r)||this._scene._activeParticles.addCount(n.render(),!1)}}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}},e.prototype._renderSprites=function(){if(this._scene.spritesEnabled&&0!==this._spriteManagers.length){var e=this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for(var t=0;t<this._spriteManagers.length;t++){var i=this._spriteManagers.data[t];0!==(e&&e.layerMask&i.layerMask)&&i.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}},e._zeroVector=r.e.Zero(),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(e,t){this.distance=e,this.mesh=t}},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return e.GenerateBase64StringFromTexture=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=0);var n=e.getInternalTexture();if(!n)return null;var r=e.readPixels(t,i);if(!r)return null;var o=e.getSize(),a=o.width,s=o.height;if(r instanceof Float32Array){for(var c=r.byteLength/r.BYTES_PER_ELEMENT,l=new Uint8Array(c);--c>=0;){var u=r[c];u<0?u=0:u>1&&(u=1),l[c]=255*u}r=l}var h=document.createElement("canvas");h.width=a,h.height=s;var d=h.getContext("2d");if(!d)return null;var f=d.createImageData(a,s);if(f.data.set(r),d.putImageData(f,0,0),n.invertY){var p=document.createElement("canvas");p.width=a,p.height=s;var _=p.getContext("2d");return _?(_.translate(0,s),_.scale(1,-1),_.drawImage(h,0,0),p.toDataURL("image/png")):null}return h.toDataURL("image/png")},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return f});var n=i(1),r=i(0),o=i(8),a=i(31),s=i(7),c=i(41),l=i(46),u=i(4),h=i(43),d=i(12);s.a._instancedMeshFactory=function(e,t){var i=new f(e,t);if(t.instancedBuffers)for(var n in i.instancedBuffers={},t.instancedBuffers)i.instancedBuffers[n]=t.instancedBuffers[n];return i};var f=function(e){function t(t,i){var n=e.call(this,t,i.getScene())||this;n._indexInSourceMeshInstanceArray=-1,i.addInstance(n),n._sourceMesh=i,n._unIndexed=i._unIndexed,n.position.copyFrom(i.position),n.rotation.copyFrom(i.rotation),n.scaling.copyFrom(i.scaling),i.rotationQuaternion&&(n.rotationQuaternion=i.rotationQuaternion.clone()),n.animations=d.b.Slice(i.animations);for(var r=0,o=i.getAnimationRanges();r<o.length;r++){var a=o[r];null!=a&&n.createAnimationRange(a.name,a.from,a.to)}return n.infiniteDistance=i.infiniteDistance,n.setPivotMatrix(i.getPivotMatrix()),n.refreshBoundingInfo(),n._syncSubMeshes(),n}return Object(n.d)(t,e),t.prototype.getClassName=function(){return"InstancedMesh"},Object.defineProperty(t.prototype,"lightSources",{get:function(){return this._sourceMesh._lightSources},enumerable:!1,configurable:!0}),t.prototype._resyncLightSources=function(){},t.prototype._resyncLightSource=function(e){},t.prototype._removeLightSource=function(e,t){},Object.defineProperty(t.prototype,"receiveShadows",{get:function(){return this._sourceMesh.receiveShadows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._sourceMesh.material},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._sourceMesh.visibility},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skeleton",{get:function(){return this._sourceMesh.skeleton},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._sourceMesh.renderingGroupId},set:function(e){this._sourceMesh&&e!==this._sourceMesh.renderingGroupId&&o.a.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")},enumerable:!1,configurable:!0}),t.prototype.getTotalVertices=function(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0},t.prototype.getTotalIndices=function(){return this._sourceMesh.getTotalIndices()},Object.defineProperty(t.prototype,"sourceMesh",{get:function(){return this._sourceMesh},enumerable:!1,configurable:!0}),t.prototype.createInstance=function(e){return this._sourceMesh.createInstance(e)},t.prototype.isReady=function(e){return void 0===e&&(e=!1),this._sourceMesh.isReady(e,!0)},t.prototype.getVerticesData=function(e,t){return this._sourceMesh.getVerticesData(e,t)},t.prototype.setVerticesData=function(e,t,i,n){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,i,n),this.sourceMesh},t.prototype.updateVerticesData=function(e,t,i,n){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,i,n),this.sourceMesh},t.prototype.setIndices=function(e,t){return void 0===t&&(t=null),this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh},t.prototype.isVerticesDataPresent=function(e){return this._sourceMesh.isVerticesDataPresent(e)},t.prototype.getIndices=function(){return this._sourceMesh.getIndices()},Object.defineProperty(t.prototype,"_positions",{get:function(){return this._sourceMesh._positions},enumerable:!1,configurable:!0}),t.prototype.refreshBoundingInfo=function(e){if(void 0===e&&(e=!1),this._boundingInfo&&this._boundingInfo.isLocked)return this;var t=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getPositionData(e),t),this},t.prototype._preActivate=function(){return this._currentLOD&&this._currentLOD._preActivate(),this},t.prototype._activate=function(e,t){if(this._sourceMesh.subMeshes||o.a.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>0!=this._getWorldMatrixDeterminant()>0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1},t.prototype._postActivate=function(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)},t.prototype.getWorldMatrix=function(){if(this._currentLOD&&this._currentLOD.billboardMode!==l.a.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){var t=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,r.c.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),r.c.Matrix[0].copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(r.c.Vector3[7]),this._currentLOD._masterMesh=t,r.c.Matrix[0]}return e.prototype.getWorldMatrix.call(this)},Object.defineProperty(t.prototype,"isAnInstance",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.getLOD=function(e){if(!e)return this;var t=this.getBoundingInfo();return this._currentLOD=this.sourceMesh.getLOD(e,t.boundingSphere),this._currentLOD===this.sourceMesh?this.sourceMesh:this._currentLOD},t.prototype._preActivateForIntermediateRendering=function(e){return this.sourceMesh._preActivateForIntermediateRendering(e)},t.prototype._syncSubMeshes=function(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(var e=0;e<this._sourceMesh.subMeshes.length;e++)this._sourceMesh.subMeshes[e].clone(this,this._sourceMesh);return this},t.prototype._generatePointsArray=function(){return this._sourceMesh._generatePointsArray()},t.prototype._updateBoundingInfo=function(){return this._boundingInfo?this._boundingInfo.update(this.worldMatrixFromCache):this._boundingInfo=new h.a(this.absolutePosition,this.absolutePosition,this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this},t.prototype.clone=function(e,t,i){void 0===t&&(t=null);var n=this._sourceMesh.createInstance(e);if(c.a.DeepCopy(this,n,["name","subMeshes","uniqueId","parent","lightSources","receiveShadows","material","visibility","skeleton","sourceMesh","isAnInstance","facetNb","isFacetDataEnabled","isBlocked","useBones","hasInstances","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances"],[]),this.refreshBoundingInfo(),t&&(n.parent=t),!i)for(var r=0;r<this.getScene().meshes.length;r++){var o=this.getScene().meshes[r];o.parent===this&&o.clone(o.name,n)}return n.computeWorldMatrix(!0),n},t.prototype.dispose=function(t,i){void 0===i&&(i=!1),this._sourceMesh.removeInstance(this),e.prototype.dispose.call(this,t,i)},t}(a.a);s.a.prototype.edgesShareWithInstances=!1,s.a.prototype.registerInstancedBuffer=function(e,t){if(this.removeVerticesData(e),!this.instancedBuffers){this.instancedBuffers={};for(var i=0,n=this.instances;i<n.length;i++)n[i].instancedBuffers={};this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{}}}this.instancedBuffers[e]=null,this._userInstancedBuffersStorage.strides[e]=t,this._userInstancedBuffersStorage.sizes[e]=32*t,this._userInstancedBuffersStorage.data[e]=new Float32Array(this._userInstancedBuffersStorage.sizes[e]),this._userInstancedBuffersStorage.vertexBuffers[e]=new u.b(this.getEngine(),this._userInstancedBuffersStorage.data[e],e,!0,!1,t,!0),this.setVerticesBuffer(this._userInstancedBuffersStorage.vertexBuffers[e]);for(var r=0,o=this.instances;r<o.length;r++)o[r].instancedBuffers[e]=null},s.a.prototype._processInstancedBuffers=function(e,t){var i=e.length;for(var n in this.instancedBuffers){for(var r=this._userInstancedBuffersStorage.sizes[n],o=this._userInstancedBuffersStorage.strides[n],a=(i+1)*o;r<a;)r*=2;this._userInstancedBuffersStorage.data[n].length!=r&&(this._userInstancedBuffersStorage.data[n]=new Float32Array(r),this._userInstancedBuffersStorage.sizes[n]=r,this._userInstancedBuffersStorage.vertexBuffers[n]&&(this._userInstancedBuffersStorage.vertexBuffers[n].dispose(),this._userInstancedBuffersStorage.vertexBuffers[n]=null));var s=this._userInstancedBuffersStorage.data[n],c=0;t&&((h=this.instancedBuffers[n]).toArray?h.toArray(s,c):h.copyToArray(s,c),c+=o);for(var l=0;l<i;l++){var h;(h=e[l].instancedBuffers[n]).toArray?h.toArray(s,c):h.copyToArray(s,c),c+=o}this._userInstancedBuffersStorage.vertexBuffers[n]?this._userInstancedBuffersStorage.vertexBuffers[n].updateDirectly(s,0):(this._userInstancedBuffersStorage.vertexBuffers[n]=new u.b(this.getEngine(),this._userInstancedBuffersStorage.data[n],n,!0,!1,o,!0),this.setVerticesBuffer(this._userInstancedBuffersStorage.vertexBuffers[n]))}},s.a.prototype._disposeInstanceSpecificData=function(){for(this._instanceDataStorage.instancesBuffer&&(this._instanceDataStorage.instancesBuffer.dispose(),this._instanceDataStorage.instancesBuffer=null);this.instances.length;)this.instances[0].dispose();for(var e in this.instancedBuffers)this._userInstancedBuffersStorage.vertexBuffers[e]&&this._userInstancedBuffersStorage.vertexBuffers[e].dispose();this.instancedBuffers={}}},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n=function(){function e(){}return Object.defineProperty(e,"UniqueId",{get:function(){var e=this._UniqueIdCounter;return this._UniqueIdCounter++,e},enumerable:!1,configurable:!0}),e._UniqueIdCounter=0,e}()},function(e,t,i){"use strict";var n=i(26),r=i(88);n.a.prototype.createUniformBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");var i=new r.a(t);return this.bindUniformBuffer(i),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},n.a.prototype.createDynamicUniformBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");var i=new r.a(t);return this.bindUniformBuffer(i),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},n.a.prototype.updateUniformBuffer=function(e,t,i,n){this.bindUniformBuffer(e),void 0===i&&(i=0),void 0===n?t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,i,t):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,i,new Float32Array(t)):t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,t.subarray(i,i+n)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(t).subarray(i,i+n)),this.bindUniformBuffer(null)},n.a.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e?e.underlyingResource:null)},n.a.prototype.bindUniformBufferBase=function(e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e?e.underlyingResource:null)},n.a.prototype.bindUniformBlock=function(e,t,i){var n=e.program,r=this._gl.getUniformBlockIndex(n,t);this._gl.uniformBlockBinding(n,r,i)}},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.lightsFragmentFunctions="\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w == 0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\n\nfloat cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\n\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn textureColor;\n}"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.logDepthFragment="#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.bumpVertex="#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvec3 tbnNormal=normalize(normalUpdated);\nvec3 tbnTangent=normalize(tangentUpdated.xyz);\nvec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;\nvTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);\n#endif\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.fogVertex="#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.logDepthVertex="#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif"},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.prePassDeclaration="#ifdef PREPASS\n#extension GL_EXT_draw_buffers : require\n#ifdef WEBGL2\nlayout(location=0) out highp vec4 glFragData[{X}];\nhighp vec4 gl_FragColor;\n#endif\n#ifdef PREPASS_DEPTHNORMAL\nvarying highp vec3 vViewPos;\n#endif\n#ifdef PREPASS_VELOCITY\nvarying highp vec4 vCurrentPosition;\nvarying highp vec4 vPreviousPosition;\n#endif\n#endif\n"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.fresnelFunction="#ifdef FRESNEL\nfloat computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)\n{\nfloat fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);\nreturn clamp(fresnelTerm,0.,1.);\n}\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.depthPrePass="#ifdef DEPTHPREPASS\ngl_FragColor=vec4(0.,0.,0.,1.0);\nreturn;\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.prePassVertexDeclaration="#ifdef PREPASS\n#ifdef PREPASS_DEPTHNORMAL\nvarying vec3 vViewPos;\n#endif\n#ifdef PREPASS_VELOCITY\nuniform mat4 previousWorld;\nuniform mat4 previousViewProjection;\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#endif"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.bumpVertexDeclaration="#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#endif\n"},function(e,t,i){"use strict";i(5).a.IncludesShadersStore.prePassVertex="#ifdef PREPASS_DEPTHNORMAL\nvViewPos=(view*worldPos).rgb;\n#endif\n#if defined(PREPASS_VELOCITY) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*worldPos;\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;\npreviousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*previousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif"},function(e,t,i){"use strict";var n=i(5),r=(i(115),i(110),"colorPixelShader");n.a.ShadersStore[r]="#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\n#ifdef VERTEXCOLOR\ngl_FragColor=vColor;\n#else\ngl_FragColor=color;\n#endif\n}"},function(e,t,i){"use strict";var n=i(5),r=(i(78),i(117),i(79),i(80),i(81),i(111),"colorVertexShader");n.a.ShadersStore[r]="\nattribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<clipPlaneVertexDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#include<clipPlaneVertex>\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n}"},function(e,t,i){"use strict";(function(e){i.d(t,"b",function(){return h}),i.d(t,"a",function(){return d});var n=i(1),r=i(8),o=i(13),a=i(102),s=i(27),c=i(2),l=i(89),u=i(74),h=function(){this.renderWidth=512,this.renderHeight=256,this.textureSize=512,this.deterministicLockstep=!1,this.lockstepMaxSteps=4},d=function(t){function i(i){void 0===i&&(i=new h);var n=t.call(this,null)||this;o.a.Instances.push(n),void 0===i.deterministicLockstep&&(i.deterministicLockstep=!1),void 0===i.lockstepMaxSteps&&(i.lockstepMaxSteps=4),n._options=i,u.a.SetMatrixPrecision(!!i.useHighPrecisionMatrix),n._caps={maxTexturesImageUnits:16,maxVertexTextureImageUnits:16,maxCombinedTexturesImageUnits:32,maxTextureSize:512,maxCubemapTextureSize:512,maxRenderTextureSize:512,maxVertexAttribs:16,maxVaryingVectors:16,maxFragmentUniformVectors:16,maxVertexUniformVectors:16,standardDerivatives:!1,astc:null,pvrtc:null,etc1:null,etc2:null,bptc:null,maxAnisotropy:0,uintIndices:!1,fragmentDepthSupported:!1,highPrecisionShaderSupported:!0,colorBufferFloat:!1,textureFloat:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloat:!1,textureHalfFloatLinearFiltering:!1,textureHalfFloatRender:!1,textureLOD:!1,drawBuffersExtension:!1,depthTextureExtension:!1,vertexArrayObject:!1,instancedArrays:!1,canUseTimestampForTimerQuery:!1,maxMSAASamples:1,blendMinMax:!1},r.a.Log("Babylon.js v"+o.a.Version+" - Null engine");var a="undefined"!=typeof self?self:void 0!==e?e:window;return"undefined"==typeof URL&&(a.URL={createObjectURL:function(){},revokeObjectURL:function(){}}),"undefined"==typeof Blob&&(a.Blob=function(){}),n}return Object(n.d)(i,t),i.prototype.isDeterministicLockStep=function(){return this._options.deterministicLockstep},i.prototype.getLockstepMaxSteps=function(){return this._options.lockstepMaxSteps},i.prototype.getHardwareScalingLevel=function(){return 1},i.prototype.createVertexBuffer=function(e){var t=new l.a;return t.references=1,t},i.prototype.createIndexBuffer=function(e){var t=new l.a;return t.references=1,t},i.prototype.clear=function(e,t,i,n){void 0===n&&(n=!1)},i.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._options.renderWidth},i.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._options.renderHeight},i.prototype.setViewport=function(e,t,i){this._cachedViewport=e},i.prototype.createShaderProgram=function(e,t,i,n,r){return{__SPECTOR_rebuildProgram:null}},i.prototype.getUniforms=function(e,t){return[]},i.prototype.getAttributes=function(e,t){return[]},i.prototype.bindSamplers=function(e){this._currentEffect=null},i.prototype.enableEffect=function(e){this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e)},i.prototype.setState=function(e,t,i,n){void 0===t&&(t=0),void 0===n&&(n=!1)},i.prototype.setIntArray=function(e,t){return!0},i.prototype.setIntArray2=function(e,t){return!0},i.prototype.setIntArray3=function(e,t){return!0},i.prototype.setIntArray4=function(e,t){return!0},i.prototype.setFloatArray=function(e,t){return!0},i.prototype.setFloatArray2=function(e,t){return!0},i.prototype.setFloatArray3=function(e,t){return!0},i.prototype.setFloatArray4=function(e,t){return!0},i.prototype.setArray=function(e,t){return!0},i.prototype.setArray2=function(e,t){return!0},i.prototype.setArray3=function(e,t){return!0},i.prototype.setArray4=function(e,t){return!0},i.prototype.setMatrices=function(e,t){return!0},i.prototype.setMatrix3x3=function(e,t){return!0},i.prototype.setMatrix2x2=function(e,t){return!0},i.prototype.setFloat=function(e,t){return!0},i.prototype.setFloat2=function(e,t,i){return!0},i.prototype.setFloat3=function(e,t,i,n){return!0},i.prototype.setBool=function(e,t){return!0},i.prototype.setFloat4=function(e,t,i,n,r){return!0},i.prototype.setAlphaMode=function(e,t){void 0===t&&(t=!1),this._alphaMode!==e&&(this.alphaState.alphaBlend=e!==c.a.ALPHA_DISABLE,t||this.setDepthWrite(e===c.a.ALPHA_DISABLE),this._alphaMode=e)},i.prototype.bindBuffers=function(e,t,i){},i.prototype.wipeCaches=function(e){this.preventCacheWipeBetweenFrames||(this.resetTextureCache(),this._currentEffect=null,e&&(this._currentProgram=null,this.stencilState.reset(),this.depthCullingState.reset(),this.alphaState.reset()),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null)},i.prototype.draw=function(e,t,i,n){},i.prototype.drawElementsType=function(e,t,i,n){},i.prototype.drawArraysType=function(e,t,i,n){},i.prototype._createTexture=function(){return{}},i.prototype._releaseTexture=function(e){},i.prototype.createTexture=function(e,t,i,n,r,o,a,l,u,h,d,f){void 0===r&&(r=c.a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===o&&(o=null),void 0===a&&(a=null),void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=null),void 0===d&&(d=null);var p=new s.a(this,s.b.Url),_=String(e);return p.url=_,p.generateMipMaps=!t,p.samplingMode=r,p.invertY=i,p.baseWidth=this._options.textureSize,p.baseHeight=this._options.textureSize,p.width=this._options.textureSize,p.height=this._options.textureSize,h&&(p.format=h),p.isReady=!0,o&&o(),this._internalTexturesCache.push(p),p},i.prototype.createRenderTargetTexture=function(e,t){var i=new a.a;void 0!==t&&"object"==typeof t?(i.generateMipMaps=t.generateMipMaps,i.generateDepthBuffer=void 0===t.generateDepthBuffer||t.generateDepthBuffer,i.generateStencilBuffer=i.generateDepthBuffer&&t.generateStencilBuffer,i.type=void 0===t.type?c.a.TEXTURETYPE_UNSIGNED_INT:t.type,i.samplingMode=void 0===t.samplingMode?c.a.TEXTURE_TRILINEAR_SAMPLINGMODE:t.samplingMode):(i.generateMipMaps=t,i.generateDepthBuffer=!0,i.generateStencilBuffer=!1,i.type=c.a.TEXTURETYPE_UNSIGNED_INT,i.samplingMode=c.a.TEXTURE_TRILINEAR_SAMPLINGMODE);var n=new s.a(this,s.b.RenderTarget),r=e.width||e,o=e.height||e;return n._depthStencilBuffer={},n._framebuffer={},n.baseWidth=r,n.baseHeight=o,n.width=r,n.height=o,n.isReady=!0,n.samples=1,n.generateMipMaps=!!i.generateMipMaps,n.samplingMode=i.samplingMode,n.type=i.type,n._generateDepthBuffer=i.generateDepthBuffer,n._generateStencilBuffer=!!i.generateStencilBuffer,this._internalTexturesCache.push(n),n},i.prototype.updateTextureSamplingMode=function(e,t){t.samplingMode=e},i.prototype.bindFramebuffer=function(e,t,i,n,r){this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._currentFramebuffer=e._MSAAFramebuffer?e._MSAAFramebuffer:e._framebuffer,this._cachedViewport&&!r&&this.setViewport(this._cachedViewport,i,n)},i.prototype.unBindFramebuffer=function(e,t,i){void 0===t&&(t=!1),this._currentRenderTarget=null,i&&(e._MSAAFramebuffer&&(this._currentFramebuffer=e._framebuffer),i()),this._currentFramebuffer=null},i.prototype.createDynamicVertexBuffer=function(e){var t=new l.a;return t.references=1,t.capacity=1,t},i.prototype.updateDynamicTexture=function(e,t,i,n,r){void 0===n&&(n=!1)},i.prototype.areAllEffectsReady=function(){return!0},i.prototype.getError=function(){return 0},i.prototype._getUnpackAlignement=function(){return 1},i.prototype._unpackFlipY=function(e){},i.prototype.updateDynamicIndexBuffer=function(e,t,i){void 0===i&&(i=0)},i.prototype.updateDynamicVertexBuffer=function(e,t,i,n){},i.prototype._bindTextureDirectly=function(e,t){return this._boundTexturesCache[this._activeChannel]!==t&&(this._boundTexturesCache[this._activeChannel]=t,!0)},i.prototype._bindTexture=function(e,t){e<0||this._bindTextureDirectly(0,t)},i.prototype._deleteBuffer=function(e){},i.prototype.releaseEffects=function(){},i.prototype.displayLoadingUI=function(){},i.prototype.hideLoadingUI=function(){},i.prototype._uploadCompressedDataToTextureDirectly=function(e,t,i,n,r,o,a){void 0===o&&(o=0),void 0===a&&(a=0)},i.prototype._uploadDataToTextureDirectly=function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=0)},i.prototype._uploadArrayBufferViewToTexture=function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=0)},i.prototype._uploadImageToTexture=function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=0)},i}(o.a)}).call(this,i(159))},function(e,t,i){"use strict";i.r(t),function(e){i.d(t,"Debug",function(){return l});var n=i(127),r=i(99);i.d(t,"AbstractScene",function(){return n.AbstractScene}),i.d(t,"AbstractActionManager",function(){return n.AbstractActionManager}),i.d(t,"Action",function(){return n.Action}),i.d(t,"ActionEvent",function(){return n.ActionEvent}),i.d(t,"ActionManager",function(){return n.ActionManager}),i.d(t,"Condition",function(){return n.Condition}),i.d(t,"ValueCondition",function(){return n.ValueCondition}),i.d(t,"PredicateCondition",function(){return n.PredicateCondition}),i.d(t,"StateCondition",function(){return n.StateCondition}),i.d(t,"SwitchBooleanAction",function(){return n.SwitchBooleanAction}),i.d(t,"SetStateAction",function(){return n.SetStateAction}),i.d(t,"SetValueAction",function(){return n.SetValueAction}),i.d(t,"IncrementValueAction",function(){return n.IncrementValueAction}),i.d(t,"PlayAnimationAction",function(){return n.PlayAnimationAction}),i.d(t,"StopAnimationAction",function(){return n.StopAnimationAction}),i.d(t,"DoNothingAction",function(){return n.DoNothingAction}),i.d(t,"CombineAction",function(){return n.CombineAction}),i.d(t,"ExecuteCodeAction",function(){return n.ExecuteCodeAction}),i.d(t,"SetParentAction",function(){return n.SetParentAction}),i.d(t,"PlaySoundAction",function(){return n.PlaySoundAction}),i.d(t,"StopSoundAction",function(){return n.StopSoundAction}),i.d(t,"InterpolateValueAction",function(){return n.InterpolateValueAction}),i.d(t,"Animatable",function(){return n.Animatable}),i.d(t,"_IAnimationState",function(){return n._IAnimationState}),i.d(t,"Animation",function(){return n.Animation}),i.d(t,"TargetedAnimation",function(){return n.TargetedAnimation}),i.d(t,"AnimationGroup",function(){return n.AnimationGroup}),i.d(t,"AnimationPropertiesOverride",function(){return n.AnimationPropertiesOverride}),i.d(t,"EasingFunction",function(){return n.EasingFunction}),i.d(t,"CircleEase",function(){return n.CircleEase}),i.d(t,"BackEase",function(){return n.BackEase}),i.d(t,"BounceEase",function(){return n.BounceEase}),i.d(t,"CubicEase",function(){return n.CubicEase}),i.d(t,"ElasticEase",function(){return n.ElasticEase}),i.d(t,"ExponentialEase",function(){return n.ExponentialEase}),i.d(t,"PowerEase",function(){return n.PowerEase}),i.d(t,"QuadraticEase",function(){return n.QuadraticEase}),i.d(t,"QuarticEase",function(){return n.QuarticEase}),i.d(t,"QuinticEase",function(){return n.QuinticEase}),i.d(t,"SineEase",function(){return n.SineEase}),i.d(t,"BezierCurveEase",function(){return n.BezierCurveEase}),i.d(t,"RuntimeAnimation",function(){return n.RuntimeAnimation}),i.d(t,"AnimationEvent",function(){return n.AnimationEvent}),i.d(t,"AnimationKeyInterpolation",function(){return n.AnimationKeyInterpolation}),i.d(t,"AnimationRange",function(){return n.AnimationRange}),i.d(t,"KeepAssets",function(){return n.KeepAssets}),i.d(t,"InstantiatedEntries",function(){return n.InstantiatedEntries}),i.d(t,"AssetContainer",function(){return n.AssetContainer}),i.d(t,"Analyser",function(){return n.Analyser}),i.d(t,"AudioEngine",function(){return n.AudioEngine}),i.d(t,"AudioSceneComponent",function(){return n.AudioSceneComponent}),i.d(t,"Sound",function(){return n.Sound}),i.d(t,"SoundTrack",function(){return n.SoundTrack}),i.d(t,"WeightedSound",function(){return n.WeightedSound}),i.d(t,"AutoRotationBehavior",function(){return n.AutoRotationBehavior}),i.d(t,"BouncingBehavior",function(){return n.BouncingBehavior}),i.d(t,"FramingBehavior",function(){return n.FramingBehavior}),i.d(t,"AttachToBoxBehavior",function(){return n.AttachToBoxBehavior}),i.d(t,"FadeInOutBehavior",function(){return n.FadeInOutBehavior}),i.d(t,"MultiPointerScaleBehavior",function(){return n.MultiPointerScaleBehavior}),i.d(t,"PointerDragBehavior",function(){return n.PointerDragBehavior}),i.d(t,"SixDofDragBehavior",function(){return n.SixDofDragBehavior}),i.d(t,"Bone",function(){return n.Bone}),i.d(t,"BoneIKController",function(){return n.BoneIKController}),i.d(t,"BoneLookController",function(){return n.BoneLookController}),i.d(t,"Skeleton",function(){return n.Skeleton}),i.d(t,"ArcRotateCameraGamepadInput",function(){return n.ArcRotateCameraGamepadInput}),i.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return n.ArcRotateCameraKeyboardMoveInput}),i.d(t,"ArcRotateCameraMouseWheelInput",function(){return n.ArcRotateCameraMouseWheelInput}),i.d(t,"ArcRotateCameraPointersInput",function(){return n.ArcRotateCameraPointersInput}),i.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return n.ArcRotateCameraVRDeviceOrientationInput}),i.d(t,"FlyCameraKeyboardInput",function(){return n.FlyCameraKeyboardInput}),i.d(t,"FlyCameraMouseInput",function(){return n.FlyCameraMouseInput}),i.d(t,"FollowCameraKeyboardMoveInput",function(){return n.FollowCameraKeyboardMoveInput}),i.d(t,"FollowCameraMouseWheelInput",function(){return n.FollowCameraMouseWheelInput}),i.d(t,"FollowCameraPointersInput",function(){return n.FollowCameraPointersInput}),i.d(t,"FreeCameraDeviceOrientationInput",function(){return n.FreeCameraDeviceOrientationInput}),i.d(t,"FreeCameraGamepadInput",function(){return n.FreeCameraGamepadInput}),i.d(t,"FreeCameraKeyboardMoveInput",function(){return n.FreeCameraKeyboardMoveInput}),i.d(t,"FreeCameraMouseInput",function(){return n.FreeCameraMouseInput}),i.d(t,"FreeCameraMouseWheelInput",function(){return n.FreeCameraMouseWheelInput}),i.d(t,"FreeCameraTouchInput",function(){return n.FreeCameraTouchInput}),i.d(t,"FreeCameraVirtualJoystickInput",function(){return n.FreeCameraVirtualJoystickInput}),i.d(t,"CameraInputTypes",function(){return n.CameraInputTypes}),i.d(t,"CameraInputsManager",function(){return n.CameraInputsManager}),i.d(t,"Camera",function(){return n.Camera}),i.d(t,"TargetCamera",function(){return n.TargetCamera}),i.d(t,"FreeCamera",function(){return n.FreeCamera}),i.d(t,"FreeCameraInputsManager",function(){return n.FreeCameraInputsManager}),i.d(t,"TouchCamera",function(){return n.TouchCamera}),i.d(t,"ArcRotateCamera",function(){return n.ArcRotateCamera}),i.d(t,"ArcRotateCameraInputsManager",function(){return n.ArcRotateCameraInputsManager}),i.d(t,"DeviceOrientationCamera",function(){return n.DeviceOrientationCamera}),i.d(t,"FlyCamera",function(){return n.FlyCamera}),i.d(t,"FlyCameraInputsManager",function(){return n.FlyCameraInputsManager}),i.d(t,"FollowCamera",function(){return n.FollowCamera}),i.d(t,"ArcFollowCamera",function(){return n.ArcFollowCamera}),i.d(t,"FollowCameraInputsManager",function(){return n.FollowCameraInputsManager}),i.d(t,"GamepadCamera",function(){return n.GamepadCamera}),i.d(t,"AnaglyphArcRotateCamera",function(){return n.AnaglyphArcRotateCamera}),i.d(t,"AnaglyphFreeCamera",function(){return n.AnaglyphFreeCamera}),i.d(t,"AnaglyphGamepadCamera",function(){return n.AnaglyphGamepadCamera}),i.d(t,"AnaglyphUniversalCamera",function(){return n.AnaglyphUniversalCamera}),i.d(t,"StereoscopicArcRotateCamera",function(){return n.StereoscopicArcRotateCamera}),i.d(t,"StereoscopicFreeCamera",function(){return n.StereoscopicFreeCamera}),i.d(t,"StereoscopicGamepadCamera",function(){return n.StereoscopicGamepadCamera}),i.d(t,"StereoscopicUniversalCamera",function(){return n.StereoscopicUniversalCamera}),i.d(t,"UniversalCamera",function(){return n.UniversalCamera}),i.d(t,"VirtualJoysticksCamera",function(){return n.VirtualJoysticksCamera}),i.d(t,"VRCameraMetrics",function(){return n.VRCameraMetrics}),i.d(t,"VRDeviceOrientationArcRotateCamera",function(){return n.VRDeviceOrientationArcRotateCamera}),i.d(t,"VRDeviceOrientationFreeCamera",function(){return n.VRDeviceOrientationFreeCamera}),i.d(t,"VRDeviceOrientationGamepadCamera",function(){return n.VRDeviceOrientationGamepadCamera}),i.d(t,"OnAfterEnteringVRObservableEvent",function(){return n.OnAfterEnteringVRObservableEvent}),i.d(t,"VRExperienceHelper",function(){return n.VRExperienceHelper}),i.d(t,"WebVRFreeCamera",function(){return n.WebVRFreeCamera}),i.d(t,"Collider",function(){return n.Collider}),i.d(t,"DefaultCollisionCoordinator",function(){return n.DefaultCollisionCoordinator}),i.d(t,"PickingInfo",function(){return n.PickingInfo}),i.d(t,"IntersectionInfo",function(){return n.IntersectionInfo}),i.d(t,"_MeshCollisionData",function(){return n._MeshCollisionData}),i.d(t,"BoundingBox",function(){return n.BoundingBox}),i.d(t,"BoundingInfo",function(){return n.BoundingInfo}),i.d(t,"BoundingSphere",function(){return n.BoundingSphere}),i.d(t,"Octree",function(){return n.Octree}),i.d(t,"OctreeBlock",function(){return n.OctreeBlock}),i.d(t,"OctreeSceneComponent",function(){return n.OctreeSceneComponent}),i.d(t,"Ray",function(){return n.Ray}),i.d(t,"AxesViewer",function(){return n.AxesViewer}),i.d(t,"BoneAxesViewer",function(){return n.BoneAxesViewer}),i.d(t,"DebugLayerTab",function(){return n.DebugLayerTab}),i.d(t,"DebugLayer",function(){return n.DebugLayer}),i.d(t,"PhysicsViewer",function(){return n.PhysicsViewer}),i.d(t,"RayHelper",function(){return n.RayHelper}),i.d(t,"SkeletonViewer",function(){return n.SkeletonViewer}),i.d(t,"DeviceInputSystem",function(){return n.DeviceInputSystem}),i.d(t,"DeviceType",function(){return n.DeviceType}),i.d(t,"PointerInput",function(){return n.PointerInput}),i.d(t,"DualShockInput",function(){return n.DualShockInput}),i.d(t,"XboxInput",function(){return n.XboxInput}),i.d(t,"SwitchInput",function(){return n.SwitchInput}),i.d(t,"DeviceSource",function(){return n.DeviceSource}),i.d(t,"DeviceSourceManager",function(){return n.DeviceSourceManager}),i.d(t,"Constants",function(){return n.Constants}),i.d(t,"ThinEngine",function(){return n.ThinEngine}),i.d(t,"Engine",function(){return n.Engine}),i.d(t,"EngineStore",function(){return n.EngineStore}),i.d(t,"NullEngineOptions",function(){return n.NullEngineOptions}),i.d(t,"NullEngine",function(){return n.NullEngine}),i.d(t,"_OcclusionDataStorage",function(){return n._OcclusionDataStorage}),i.d(t,"_forceTransformFeedbackToBundle",function(){return n._forceTransformFeedbackToBundle}),i.d(t,"EngineView",function(){return n.EngineView}),i.d(t,"WebGLPipelineContext",function(){return n.WebGLPipelineContext}),i.d(t,"WebGL2ShaderProcessor",function(){return n.WebGL2ShaderProcessor}),i.d(t,"NativeEngine",function(){return n.NativeEngine}),i.d(t,"ShaderCodeInliner",function(){return n.ShaderCodeInliner}),i.d(t,"PerformanceConfigurator",function(){return n.PerformanceConfigurator}),i.d(t,"KeyboardEventTypes",function(){return n.KeyboardEventTypes}),i.d(t,"KeyboardInfo",function(){return n.KeyboardInfo}),i.d(t,"KeyboardInfoPre",function(){return n.KeyboardInfoPre}),i.d(t,"PointerEventTypes",function(){return n.PointerEventTypes}),i.d(t,"PointerInfoBase",function(){return n.PointerInfoBase}),i.d(t,"PointerInfoPre",function(){return n.PointerInfoPre}),i.d(t,"PointerInfo",function(){return n.PointerInfo}),i.d(t,"ClipboardEventTypes",function(){return n.ClipboardEventTypes}),i.d(t,"ClipboardInfo",function(){return n.ClipboardInfo}),i.d(t,"DaydreamController",function(){return n.DaydreamController}),i.d(t,"GearVRController",function(){return n.GearVRController}),i.d(t,"GenericController",function(){return n.GenericController}),i.d(t,"OculusTouchController",function(){return n.OculusTouchController}),i.d(t,"PoseEnabledControllerType",function(){return n.PoseEnabledControllerType}),i.d(t,"PoseEnabledControllerHelper",function(){return n.PoseEnabledControllerHelper}),i.d(t,"PoseEnabledController",function(){return n.PoseEnabledController}),i.d(t,"ViveController",function(){return n.ViveController}),i.d(t,"WebVRController",function(){return n.WebVRController}),i.d(t,"WindowsMotionController",function(){return n.WindowsMotionController}),i.d(t,"XRWindowsMotionController",function(){return n.XRWindowsMotionController}),i.d(t,"StickValues",function(){return n.StickValues}),i.d(t,"Gamepad",function(){return n.Gamepad}),i.d(t,"GenericPad",function(){return n.GenericPad}),i.d(t,"GamepadManager",function(){return n.GamepadManager}),i.d(t,"GamepadSystemSceneComponent",function(){return n.GamepadSystemSceneComponent}),i.d(t,"Xbox360Button",function(){return n.Xbox360Button}),i.d(t,"Xbox360Dpad",function(){return n.Xbox360Dpad}),i.d(t,"Xbox360Pad",function(){return n.Xbox360Pad}),i.d(t,"DualShockButton",function(){return n.DualShockButton}),i.d(t,"DualShockDpad",function(){return n.DualShockDpad}),i.d(t,"DualShockPad",function(){return n.DualShockPad}),i.d(t,"AxisDragGizmo",function(){return n.AxisDragGizmo}),i.d(t,"AxisScaleGizmo",function(){return n.AxisScaleGizmo}),i.d(t,"BoundingBoxGizmo",function(){return n.BoundingBoxGizmo}),i.d(t,"Gizmo",function(){return n.Gizmo}),i.d(t,"GizmoManager",function(){return n.GizmoManager}),i.d(t,"PlaneRotationGizmo",function(){return n.PlaneRotationGizmo}),i.d(t,"PositionGizmo",function(){return n.PositionGizmo}),i.d(t,"RotationGizmo",function(){return n.RotationGizmo}),i.d(t,"ScaleGizmo",function(){return n.ScaleGizmo}),i.d(t,"LightGizmo",function(){return n.LightGizmo}),i.d(t,"CameraGizmo",function(){return n.CameraGizmo}),i.d(t,"PlaneDragGizmo",function(){return n.PlaneDragGizmo}),i.d(t,"EnvironmentHelper",function(){return n.EnvironmentHelper}),i.d(t,"PhotoDome",function(){return n.PhotoDome}),i.d(t,"_forceSceneHelpersToBundle",function(){return n._forceSceneHelpersToBundle}),i.d(t,"VideoDome",function(){return n.VideoDome}),i.d(t,"EngineInstrumentation",function(){return n.EngineInstrumentation}),i.d(t,"SceneInstrumentation",function(){return n.SceneInstrumentation}),i.d(t,"_TimeToken",function(){return n._TimeToken}),i.d(t,"EffectLayer",function(){return n.EffectLayer}),i.d(t,"EffectLayerSceneComponent",function(){return n.EffectLayerSceneComponent}),i.d(t,"GlowLayer",function(){return n.GlowLayer}),i.d(t,"HighlightLayer",function(){return n.HighlightLayer}),i.d(t,"Layer",function(){return n.Layer}),i.d(t,"LayerSceneComponent",function(){return n.LayerSceneComponent}),i.d(t,"LensFlare",function(){return n.LensFlare}),i.d(t,"LensFlareSystem",function(){return n.LensFlareSystem}),i.d(t,"LensFlareSystemSceneComponent",function(){return n.LensFlareSystemSceneComponent}),i.d(t,"Light",function(){return n.Light}),i.d(t,"ShadowLight",function(){return n.ShadowLight}),i.d(t,"ShadowGenerator",function(){return n.ShadowGenerator}),i.d(t,"CascadedShadowGenerator",function(){return n.CascadedShadowGenerator}),i.d(t,"ShadowGeneratorSceneComponent",function(){return n.ShadowGeneratorSceneComponent}),i.d(t,"DirectionalLight",function(){return n.DirectionalLight}),i.d(t,"HemisphericLight",function(){return n.HemisphericLight}),i.d(t,"PointLight",function(){return n.PointLight}),i.d(t,"SpotLight",function(){return n.SpotLight}),i.d(t,"DefaultLoadingScreen",function(){return n.DefaultLoadingScreen}),i.d(t,"_BabylonLoaderRegistered",function(){return n._BabylonLoaderRegistered}),i.d(t,"BabylonFileLoaderConfiguration",function(){return n.BabylonFileLoaderConfiguration}),i.d(t,"SceneLoaderAnimationGroupLoadingMode",function(){return n.SceneLoaderAnimationGroupLoadingMode}),i.d(t,"SceneLoader",function(){return n.SceneLoader}),i.d(t,"SceneLoaderFlags",function(){return n.SceneLoaderFlags}),i.d(t,"BackgroundMaterial",function(){return n.BackgroundMaterial}),i.d(t,"ColorCurves",function(){return n.ColorCurves}),i.d(t,"EffectFallbacks",function(){return n.EffectFallbacks}),i.d(t,"Effect",function(){return n.Effect}),i.d(t,"FresnelParameters",function(){return n.FresnelParameters}),i.d(t,"ImageProcessingConfigurationDefines",function(){return n.ImageProcessingConfigurationDefines}),i.d(t,"ImageProcessingConfiguration",function(){return n.ImageProcessingConfiguration}),i.d(t,"Material",function(){return n.Material}),i.d(t,"MaterialDefines",function(){return n.MaterialDefines}),i.d(t,"ThinMaterialHelper",function(){return n.ThinMaterialHelper}),i.d(t,"MaterialHelper",function(){return n.MaterialHelper}),i.d(t,"MultiMaterial",function(){return n.MultiMaterial}),i.d(t,"PBRMaterialDefines",function(){return n.PBRMaterialDefines}),i.d(t,"PBRBaseMaterial",function(){return n.PBRBaseMaterial}),i.d(t,"PBRBaseSimpleMaterial",function(){return n.PBRBaseSimpleMaterial}),i.d(t,"PBRMaterial",function(){return n.PBRMaterial}),i.d(t,"PBRMetallicRoughnessMaterial",function(){return n.PBRMetallicRoughnessMaterial}),i.d(t,"PBRSpecularGlossinessMaterial",function(){return n.PBRSpecularGlossinessMaterial}),i.d(t,"PushMaterial",function(){return n.PushMaterial}),i.d(t,"ShaderMaterial",function(){return n.ShaderMaterial}),i.d(t,"StandardMaterialDefines",function(){return n.StandardMaterialDefines}),i.d(t,"StandardMaterial",function(){return n.StandardMaterial}),i.d(t,"BaseTexture",function(){return n.BaseTexture}),i.d(t,"ColorGradingTexture",function(){return n.ColorGradingTexture}),i.d(t,"CubeTexture",function(){return n.CubeTexture}),i.d(t,"DynamicTexture",function(){return n.DynamicTexture}),i.d(t,"EquiRectangularCubeTexture",function(){return n.EquiRectangularCubeTexture}),i.d(t,"HDRFiltering",function(){return n.HDRFiltering}),i.d(t,"HDRCubeTexture",function(){return n.HDRCubeTexture}),i.d(t,"HtmlElementTexture",function(){return n.HtmlElementTexture}),i.d(t,"InternalTextureSource",function(){return n.InternalTextureSource}),i.d(t,"InternalTexture",function(){return n.InternalTexture}),i.d(t,"_DDSTextureLoader",function(){return n._DDSTextureLoader}),i.d(t,"_ENVTextureLoader",function(){return n._ENVTextureLoader}),i.d(t,"_KTXTextureLoader",function(){return n._KTXTextureLoader}),i.d(t,"_TGATextureLoader",function(){return n._TGATextureLoader}),i.d(t,"_BasisTextureLoader",function(){return n._BasisTextureLoader}),i.d(t,"MirrorTexture",function(){return n.MirrorTexture}),i.d(t,"MultiRenderTarget",function(){return n.MultiRenderTarget}),i.d(t,"TexturePacker",function(){return n.TexturePacker}),i.d(t,"TexturePackerFrame",function(){return n.TexturePackerFrame}),i.d(t,"CustomProceduralTexture",function(){return n.CustomProceduralTexture}),i.d(t,"NoiseProceduralTexture",function(){return n.NoiseProceduralTexture}),i.d(t,"ProceduralTexture",function(){return n.ProceduralTexture}),i.d(t,"ProceduralTextureSceneComponent",function(){return n.ProceduralTextureSceneComponent}),i.d(t,"RawCubeTexture",function(){return n.RawCubeTexture}),i.d(t,"RawTexture",function(){return n.RawTexture}),i.d(t,"RawTexture2DArray",function(){return n.RawTexture2DArray}),i.d(t,"RawTexture3D",function(){return n.RawTexture3D}),i.d(t,"RefractionTexture",function(){return n.RefractionTexture}),i.d(t,"RenderTargetTexture",function(){return n.RenderTargetTexture}),i.d(t,"Texture",function(){return n.Texture}),i.d(t,"VideoTexture",function(){return n.VideoTexture}),i.d(t,"UniformBuffer",function(){return n.UniformBuffer}),i.d(t,"MaterialFlags",function(){return n.MaterialFlags}),i.d(t,"NodeMaterialBlockTargets",function(){return n.NodeMaterialBlockTargets}),i.d(t,"NodeMaterialBlockConnectionPointTypes",function(){return n.NodeMaterialBlockConnectionPointTypes}),i.d(t,"NodeMaterialBlockConnectionPointMode",function(){return n.NodeMaterialBlockConnectionPointMode}),i.d(t,"NodeMaterialSystemValues",function(){return n.NodeMaterialSystemValues}),i.d(t,"NodeMaterialModes",function(){return n.NodeMaterialModes}),i.d(t,"NodeMaterialConnectionPointCompatibilityStates",function(){return n.NodeMaterialConnectionPointCompatibilityStates}),i.d(t,"NodeMaterialConnectionPointDirection",function(){return n.NodeMaterialConnectionPointDirection}),i.d(t,"NodeMaterialConnectionPoint",function(){return n.NodeMaterialConnectionPoint}),i.d(t,"NodeMaterialBlock",function(){return n.NodeMaterialBlock}),i.d(t,"NodeMaterialDefines",function(){return n.NodeMaterialDefines}),i.d(t,"NodeMaterial",function(){return n.NodeMaterial}),i.d(t,"VertexOutputBlock",function(){return n.VertexOutputBlock}),i.d(t,"BonesBlock",function(){return n.BonesBlock}),i.d(t,"InstancesBlock",function(){return n.InstancesBlock}),i.d(t,"MorphTargetsBlock",function(){return n.MorphTargetsBlock}),i.d(t,"LightInformationBlock",function(){return n.LightInformationBlock}),i.d(t,"FragmentOutputBlock",function(){return n.FragmentOutputBlock}),i.d(t,"ImageProcessingBlock",function(){return n.ImageProcessingBlock}),i.d(t,"PerturbNormalBlock",function(){return n.PerturbNormalBlock}),i.d(t,"DiscardBlock",function(){return n.DiscardBlock}),i.d(t,"FrontFacingBlock",function(){return n.FrontFacingBlock}),i.d(t,"DerivativeBlock",function(){return n.DerivativeBlock}),i.d(t,"FragCoordBlock",function(){return n.FragCoordBlock}),i.d(t,"ScreenSizeBlock",function(){return n.ScreenSizeBlock}),i.d(t,"FogBlock",function(){return n.FogBlock}),i.d(t,"LightBlock",function(){return n.LightBlock}),i.d(t,"TextureBlock",function(){return n.TextureBlock}),i.d(t,"ReflectionTextureBlock",function(){return n.ReflectionTextureBlock}),i.d(t,"CurrentScreenBlock",function(){return n.CurrentScreenBlock}),i.d(t,"InputBlock",function(){return n.InputBlock}),i.d(t,"AnimatedInputBlockTypes",function(){return n.AnimatedInputBlockTypes}),i.d(t,"MultiplyBlock",function(){return n.MultiplyBlock}),i.d(t,"AddBlock",function(){return n.AddBlock}),i.d(t,"ScaleBlock",function(){return n.ScaleBlock}),i.d(t,"ClampBlock",function(){return n.ClampBlock}),i.d(t,"CrossBlock",function(){return n.CrossBlock}),i.d(t,"DotBlock",function(){return n.DotBlock}),i.d(t,"TransformBlock",function(){return n.TransformBlock}),i.d(t,"RemapBlock",function(){return n.RemapBlock}),i.d(t,"NormalizeBlock",function(){return n.NormalizeBlock}),i.d(t,"TrigonometryBlockOperations",function(){return n.TrigonometryBlockOperations}),i.d(t,"TrigonometryBlock",function(){return n.TrigonometryBlock}),i.d(t,"ColorMergerBlock",function(){return n.ColorMergerBlock}),i.d(t,"VectorMergerBlock",function(){return n.VectorMergerBlock}),i.d(t,"ColorSplitterBlock",function(){return n.ColorSplitterBlock}),i.d(t,"VectorSplitterBlock",function(){return n.VectorSplitterBlock}),i.d(t,"LerpBlock",function(){return n.LerpBlock}),i.d(t,"DivideBlock",function(){return n.DivideBlock}),i.d(t,"SubtractBlock",function(){return n.SubtractBlock}),i.d(t,"StepBlock",function(){return n.StepBlock}),i.d(t,"OneMinusBlock",function(){return n.OneMinusBlock}),i.d(t,"ViewDirectionBlock",function(){return n.ViewDirectionBlock}),i.d(t,"FresnelBlock",function(){return n.FresnelBlock}),i.d(t,"MaxBlock",function(){return n.MaxBlock}),i.d(t,"MinBlock",function(){return n.MinBlock}),i.d(t,"DistanceBlock",function(){return n.DistanceBlock}),i.d(t,"LengthBlock",function(){return n.LengthBlock}),i.d(t,"NegateBlock",function(){return n.NegateBlock}),i.d(t,"PowBlock",function(){return n.PowBlock}),i.d(t,"RandomNumberBlock",function(){return n.RandomNumberBlock}),i.d(t,"ArcTan2Block",function(){return n.ArcTan2Block}),i.d(t,"SmoothStepBlock",function(){return n.SmoothStepBlock}),i.d(t,"ReciprocalBlock",function(){return n.ReciprocalBlock}),i.d(t,"ReplaceColorBlock",function(){return n.ReplaceColorBlock}),i.d(t,"PosterizeBlock",function(){return n.PosterizeBlock}),i.d(t,"WaveBlockKind",function(){return n.WaveBlockKind}),i.d(t,"WaveBlock",function(){return n.WaveBlock}),i.d(t,"GradientBlockColorStep",function(){return n.GradientBlockColorStep}),i.d(t,"GradientBlock",function(){return n.GradientBlock}),i.d(t,"NLerpBlock",function(){return n.NLerpBlock}),i.d(t,"WorleyNoise3DBlock",function(){return n.WorleyNoise3DBlock}),i.d(t,"SimplexPerlin3DBlock",function(){return n.SimplexPerlin3DBlock}),i.d(t,"NormalBlendBlock",function(){return n.NormalBlendBlock}),i.d(t,"Rotate2dBlock",function(){return n.Rotate2dBlock}),i.d(t,"ReflectBlock",function(){return n.ReflectBlock}),i.d(t,"RefractBlock",function(){return n.RefractBlock}),i.d(t,"DesaturateBlock",function(){return n.DesaturateBlock}),i.d(t,"PBRMetallicRoughnessBlock",function(){return n.PBRMetallicRoughnessBlock}),i.d(t,"SheenBlock",function(){return n.SheenBlock}),i.d(t,"AnisotropyBlock",function(){return n.AnisotropyBlock}),i.d(t,"ReflectionBlock",function(){return n.ReflectionBlock}),i.d(t,"ClearCoatBlock",function(){return n.ClearCoatBlock}),i.d(t,"RefractionBlock",function(){return n.RefractionBlock}),i.d(t,"SubSurfaceBlock",function(){return n.SubSurfaceBlock}),i.d(t,"ParticleTextureBlock",function(){return n.ParticleTextureBlock}),i.d(t,"ParticleRampGradientBlock",function(){return n.ParticleRampGradientBlock}),i.d(t,"ParticleBlendMultiplyBlock",function(){return n.ParticleBlendMultiplyBlock}),i.d(t,"ModBlock",function(){return n.ModBlock}),i.d(t,"NodeMaterialOptimizer",function(){return n.NodeMaterialOptimizer}),i.d(t,"PropertyTypeForEdition",function(){return n.PropertyTypeForEdition}),i.d(t,"editableInPropertyPage",function(){return n.editableInPropertyPage}),i.d(t,"EffectRenderer",function(){return n.EffectRenderer}),i.d(t,"EffectWrapper",function(){return n.EffectWrapper}),i.d(t,"ShadowDepthWrapper",function(){return n.ShadowDepthWrapper}),i.d(t,"Scalar",function(){return n.Scalar}),i.d(t,"extractMinAndMaxIndexed",function(){return n.extractMinAndMaxIndexed}),i.d(t,"extractMinAndMax",function(){return n.extractMinAndMax}),i.d(t,"Space",function(){return n.Space}),i.d(t,"Axis",function(){return n.Axis}),i.d(t,"Coordinate",function(){return n.Coordinate}),i.d(t,"Color3",function(){return n.Color3}),i.d(t,"Color4",function(){return n.Color4}),i.d(t,"TmpColors",function(){return n.TmpColors}),i.d(t,"ToGammaSpace",function(){return n.ToGammaSpace}),i.d(t,"ToLinearSpace",function(){return n.ToLinearSpace}),i.d(t,"Epsilon",function(){return n.Epsilon}),i.d(t,"Frustum",function(){return n.Frustum}),i.d(t,"Orientation",function(){return n.Orientation}),i.d(t,"BezierCurve",function(){return n.BezierCurve}),i.d(t,"Angle",function(){return n.Angle}),i.d(t,"Arc2",function(){return n.Arc2}),i.d(t,"Path2",function(){return n.Path2}),i.d(t,"Path3D",function(){return n.Path3D}),i.d(t,"Curve3",function(){return n.Curve3}),i.d(t,"Plane",function(){return n.Plane}),i.d(t,"Size",function(){return n.Size}),i.d(t,"Vector2",function(){return n.Vector2}),i.d(t,"Vector3",function(){return n.Vector3}),i.d(t,"Vector4",function(){return n.Vector4}),i.d(t,"Quaternion",function(){return n.Quaternion}),i.d(t,"Matrix",function(){return n.Matrix}),i.d(t,"TmpVectors",function(){return n.TmpVectors}),i.d(t,"PositionNormalVertex",function(){return n.PositionNormalVertex}),i.d(t,"PositionNormalTextureVertex",function(){return n.PositionNormalTextureVertex}),i.d(t,"Viewport",function(){return n.Viewport}),i.d(t,"SphericalHarmonics",function(){return n.SphericalHarmonics}),i.d(t,"SphericalPolynomial",function(){return n.SphericalPolynomial}),i.d(t,"AbstractMesh",function(){return n.AbstractMesh}),i.d(t,"Buffer",function(){return n.Buffer}),i.d(t,"VertexBuffer",function(){return n.VertexBuffer}),i.d(t,"DracoCompression",function(){return n.DracoCompression}),i.d(t,"CSG",function(){return n.CSG}),i.d(t,"Geometry",function(){return n.Geometry}),i.d(t,"GroundMesh",function(){return n.GroundMesh}),i.d(t,"TrailMesh",function(){return n.TrailMesh}),i.d(t,"InstancedMesh",function(){return n.InstancedMesh}),i.d(t,"LinesMesh",function(){return n.LinesMesh}),i.d(t,"InstancedLinesMesh",function(){return n.InstancedLinesMesh}),i.d(t,"_CreationDataStorage",function(){return n._CreationDataStorage}),i.d(t,"_InstancesBatch",function(){return n._InstancesBatch}),i.d(t,"Mesh",function(){return n.Mesh}),i.d(t,"VertexData",function(){return n.VertexData}),i.d(t,"MeshBuilder",function(){return n.MeshBuilder}),i.d(t,"SimplificationSettings",function(){return n.SimplificationSettings}),i.d(t,"SimplificationQueue",function(){return n.SimplificationQueue}),i.d(t,"SimplificationType",function(){return n.SimplificationType}),i.d(t,"QuadraticErrorSimplification",function(){return n.QuadraticErrorSimplification}),i.d(t,"SimplicationQueueSceneComponent",function(){return n.SimplicationQueueSceneComponent}),i.d(t,"Polygon",function(){return n.Polygon}),i.d(t,"PolygonMeshBuilder",function(){return n.PolygonMeshBuilder}),i.d(t,"SubMesh",function(){return n.SubMesh}),i.d(t,"MeshLODLevel",function(){return n.MeshLODLevel}),i.d(t,"TransformNode",function(){return n.TransformNode}),i.d(t,"BoxBuilder",function(){return n.BoxBuilder}),i.d(t,"TiledBoxBuilder",function(){return n.TiledBoxBuilder}),i.d(t,"DiscBuilder",function(){return n.DiscBuilder}),i.d(t,"RibbonBuilder",function(){return n.RibbonBuilder}),i.d(t,"SphereBuilder",function(){return n.SphereBuilder}),i.d(t,"HemisphereBuilder",function(){return n.HemisphereBuilder}),i.d(t,"CylinderBuilder",function(){return n.CylinderBuilder}),i.d(t,"TorusBuilder",function(){return n.TorusBuilder}),i.d(t,"TorusKnotBuilder",function(){return n.TorusKnotBuilder}),i.d(t,"LinesBuilder",function(){return n.LinesBuilder}),i.d(t,"PolygonBuilder",function(){return n.PolygonBuilder}),i.d(t,"ShapeBuilder",function(){return n.ShapeBuilder}),i.d(t,"LatheBuilder",function(){return n.LatheBuilder}),i.d(t,"PlaneBuilder",function(){return n.PlaneBuilder}),i.d(t,"TiledPlaneBuilder",function(){return n.TiledPlaneBuilder}),i.d(t,"GroundBuilder",function(){return n.GroundBuilder}),i.d(t,"TubeBuilder",function(){return n.TubeBuilder}),i.d(t,"PolyhedronBuilder",function(){return n.PolyhedronBuilder}),i.d(t,"IcoSphereBuilder",function(){return n.IcoSphereBuilder}),i.d(t,"DecalBuilder",function(){return n.DecalBuilder}),i.d(t,"CapsuleBuilder",function(){return n.CapsuleBuilder}),i.d(t,"DataBuffer",function(){return n.DataBuffer}),i.d(t,"WebGLDataBuffer",function(){return n.WebGLDataBuffer}),i.d(t,"MorphTarget",function(){return n.MorphTarget}),i.d(t,"MorphTargetManager",function(){return n.MorphTargetManager}),i.d(t,"RecastJSPlugin",function(){return n.RecastJSPlugin}),i.d(t,"RecastJSCrowd",function(){return n.RecastJSCrowd}),i.d(t,"Node",function(){return n.Node}),i.d(t,"Database",function(){return n.Database}),i.d(t,"BaseParticleSystem",function(){return n.BaseParticleSystem}),i.d(t,"BoxParticleEmitter",function(){return n.BoxParticleEmitter}),i.d(t,"ConeParticleEmitter",function(){return n.ConeParticleEmitter}),i.d(t,"CylinderParticleEmitter",function(){return n.CylinderParticleEmitter}),i.d(t,"CylinderDirectedParticleEmitter",function(){return n.CylinderDirectedParticleEmitter}),i.d(t,"HemisphericParticleEmitter",function(){return n.HemisphericParticleEmitter}),i.d(t,"PointParticleEmitter",function(){return n.PointParticleEmitter}),i.d(t,"SphereParticleEmitter",function(){return n.SphereParticleEmitter}),i.d(t,"SphereDirectedParticleEmitter",function(){return n.SphereDirectedParticleEmitter}),i.d(t,"CustomParticleEmitter",function(){return n.CustomParticleEmitter}),i.d(t,"MeshParticleEmitter",function(){return n.MeshParticleEmitter}),i.d(t,"GPUParticleSystem",function(){return n.GPUParticleSystem}),i.d(t,"Particle",function(){return n.Particle}),i.d(t,"ParticleHelper",function(){return n.ParticleHelper}),i.d(t,"ParticleSystem",function(){return n.ParticleSystem}),i.d(t,"ParticleSystemSet",function(){return n.ParticleSystemSet}),i.d(t,"SolidParticle",function(){return n.SolidParticle}),i.d(t,"ModelShape",function(){return n.ModelShape}),i.d(t,"DepthSortedParticle",function(){return n.DepthSortedParticle}),i.d(t,"SolidParticleVertex",function(){return n.SolidParticleVertex}),i.d(t,"SolidParticleSystem",function(){return n.SolidParticleSystem}),i.d(t,"CloudPoint",function(){return n.CloudPoint}),i.d(t,"PointsGroup",function(){return n.PointsGroup}),i.d(t,"PointColor",function(){return n.PointColor}),i.d(t,"PointsCloudSystem",function(){return n.PointsCloudSystem}),i.d(t,"SubEmitterType",function(){return n.SubEmitterType}),i.d(t,"SubEmitter",function(){return n.SubEmitter}),i.d(t,"PhysicsEngine",function(){return n.PhysicsEngine}),i.d(t,"PhysicsEngineSceneComponent",function(){return n.PhysicsEngineSceneComponent}),i.d(t,"PhysicsHelper",function(){return n.PhysicsHelper}),i.d(t,"PhysicsRadialExplosionEventOptions",function(){return n.PhysicsRadialExplosionEventOptions}),i.d(t,"PhysicsUpdraftEventOptions",function(){return n.PhysicsUpdraftEventOptions}),i.d(t,"PhysicsVortexEventOptions",function(){return n.PhysicsVortexEventOptions}),i.d(t,"PhysicsRadialImpulseFalloff",function(){return n.PhysicsRadialImpulseFalloff}),i.d(t,"PhysicsUpdraftMode",function(){return n.PhysicsUpdraftMode}),i.d(t,"PhysicsImpostor",function(){return n.PhysicsImpostor}),i.d(t,"PhysicsJoint",function(){return n.PhysicsJoint}),i.d(t,"DistanceJoint",function(){return n.DistanceJoint}),i.d(t,"MotorEnabledJoint",function(){return n.MotorEnabledJoint}),i.d(t,"HingeJoint",function(){return n.HingeJoint}),i.d(t,"Hinge2Joint",function(){return n.Hinge2Joint}),i.d(t,"CannonJSPlugin",function(){return n.CannonJSPlugin}),i.d(t,"AmmoJSPlugin",function(){return n.AmmoJSPlugin}),i.d(t,"OimoJSPlugin",function(){return n.OimoJSPlugin}),i.d(t,"AnaglyphPostProcess",function(){return n.AnaglyphPostProcess}),i.d(t,"BlackAndWhitePostProcess",function(){return n.BlackAndWhitePostProcess}),i.d(t,"BloomEffect",function(){return n.BloomEffect}),i.d(t,"BloomMergePostProcess",function(){return n.BloomMergePostProcess}),i.d(t,"BlurPostProcess",function(){return n.BlurPostProcess}),i.d(t,"ChromaticAberrationPostProcess",function(){return n.ChromaticAberrationPostProcess}),i.d(t,"CircleOfConfusionPostProcess",function(){return n.CircleOfConfusionPostProcess}),i.d(t,"ColorCorrectionPostProcess",function(){return n.ColorCorrectionPostProcess}),i.d(t,"ConvolutionPostProcess",function(){return n.ConvolutionPostProcess}),i.d(t,"DepthOfFieldBlurPostProcess",function(){return n.DepthOfFieldBlurPostProcess}),i.d(t,"DepthOfFieldEffectBlurLevel",function(){return n.DepthOfFieldEffectBlurLevel}),i.d(t,"DepthOfFieldEffect",function(){return n.DepthOfFieldEffect}),i.d(t,"DepthOfFieldMergePostProcessOptions",function(){return n.DepthOfFieldMergePostProcessOptions}),i.d(t,"DepthOfFieldMergePostProcess",function(){return n.DepthOfFieldMergePostProcess}),i.d(t,"DisplayPassPostProcess",function(){return n.DisplayPassPostProcess}),i.d(t,"ExtractHighlightsPostProcess",function(){return n.ExtractHighlightsPostProcess}),i.d(t,"FilterPostProcess",function(){return n.FilterPostProcess}),i.d(t,"FxaaPostProcess",function(){return n.FxaaPostProcess}),i.d(t,"GrainPostProcess",function(){return n.GrainPostProcess}),i.d(t,"HighlightsPostProcess",function(){return n.HighlightsPostProcess}),i.d(t,"ImageProcessingPostProcess",function(){return n.ImageProcessingPostProcess}),i.d(t,"MotionBlurPostProcess",function(){return n.MotionBlurPostProcess}),i.d(t,"PassPostProcess",function(){return n.PassPostProcess}),i.d(t,"PassCubePostProcess",function(){return n.PassCubePostProcess}),i.d(t,"PostProcess",function(){return n.PostProcess}),i.d(t,"PostProcessManager",function(){return n.PostProcessManager}),i.d(t,"RefractionPostProcess",function(){return n.RefractionPostProcess}),i.d(t,"DefaultRenderingPipeline",function(){return n.DefaultRenderingPipeline}),i.d(t,"LensRenderingPipeline",function(){return n.LensRenderingPipeline}),i.d(t,"SSAO2RenderingPipeline",function(){return n.SSAO2RenderingPipeline}),i.d(t,"SSAORenderingPipeline",function(){return n.SSAORenderingPipeline}),i.d(t,"StandardRenderingPipeline",function(){return n.StandardRenderingPipeline}),i.d(t,"PostProcessRenderEffect",function(){return n.PostProcessRenderEffect}),i.d(t,"PostProcessRenderPipeline",function(){return n.PostProcessRenderPipeline}),i.d(t,"PostProcessRenderPipelineManager",function(){return n.PostProcessRenderPipelineManager}),i.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return n.PostProcessRenderPipelineManagerSceneComponent}),i.d(t,"SharpenPostProcess",function(){return n.SharpenPostProcess}),i.d(t,"StereoscopicInterlacePostProcessI",function(){return n.StereoscopicInterlacePostProcessI}),i.d(t,"StereoscopicInterlacePostProcess",function(){return n.StereoscopicInterlacePostProcess}),i.d(t,"TonemappingOperator",function(){return n.TonemappingOperator}),i.d(t,"TonemapPostProcess",function(){return n.TonemapPostProcess}),i.d(t,"VolumetricLightScatteringPostProcess",function(){return n.VolumetricLightScatteringPostProcess}),i.d(t,"VRDistortionCorrectionPostProcess",function(){return n.VRDistortionCorrectionPostProcess}),i.d(t,"VRMultiviewToSingleviewPostProcess",function(){return n.VRMultiviewToSingleviewPostProcess}),i.d(t,"ScreenSpaceReflectionPostProcess",function(){return n.ScreenSpaceReflectionPostProcess}),i.d(t,"ScreenSpaceCurvaturePostProcess",function(){return n.ScreenSpaceCurvaturePostProcess}),i.d(t,"ReflectionProbe",function(){return n.ReflectionProbe}),i.d(t,"BoundingBoxRenderer",function(){return n.BoundingBoxRenderer}),i.d(t,"DepthRenderer",function(){return n.DepthRenderer}),i.d(t,"DepthRendererSceneComponent",function(){return n.DepthRendererSceneComponent}),i.d(t,"EdgesRenderer",function(){return n.EdgesRenderer}),i.d(t,"LineEdgesRenderer",function(){return n.LineEdgesRenderer}),i.d(t,"GeometryBufferRenderer",function(){return n.GeometryBufferRenderer}),i.d(t,"GeometryBufferRendererSceneComponent",function(){return n.GeometryBufferRendererSceneComponent}),i.d(t,"PrePassRenderer",function(){return n.PrePassRenderer}),i.d(t,"PrePassRendererSceneComponent",function(){return n.PrePassRendererSceneComponent}),i.d(t,"SubSurfaceSceneComponent",function(){return n.SubSurfaceSceneComponent}),i.d(t,"OutlineRenderer",function(){return n.OutlineRenderer}),i.d(t,"RenderingGroup",function(){return n.RenderingGroup}),i.d(t,"RenderingGroupInfo",function(){return n.RenderingGroupInfo}),i.d(t,"RenderingManager",function(){return n.RenderingManager}),i.d(t,"UtilityLayerRenderer",function(){return n.UtilityLayerRenderer}),i.d(t,"Scene",function(){return n.Scene}),i.d(t,"SceneComponentConstants",function(){return n.SceneComponentConstants}),i.d(t,"Stage",function(){return n.Stage}),i.d(t,"Sprite",function(){return n.Sprite}),i.d(t,"SpriteManager",function(){return n.SpriteManager}),i.d(t,"SpriteMap",function(){return n.SpriteMap}),i.d(t,"SpritePackedManager",function(){return n.SpritePackedManager}),i.d(t,"SpriteSceneComponent",function(){return n.SpriteSceneComponent}),i.d(t,"AlphaState",function(){return n.AlphaState}),i.d(t,"DepthCullingState",function(){return n.DepthCullingState}),i.d(t,"StencilState",function(){return n.StencilState}),i.d(t,"AndOrNotEvaluator",function(){return n.AndOrNotEvaluator}),i.d(t,"AssetTaskState",function(){return n.AssetTaskState}),i.d(t,"AbstractAssetTask",function(){return n.AbstractAssetTask}),i.d(t,"AssetsProgressEvent",function(){return n.AssetsProgressEvent}),i.d(t,"ContainerAssetTask",function(){return n.ContainerAssetTask}),i.d(t,"MeshAssetTask",function(){return n.MeshAssetTask}),i.d(t,"TextFileAssetTask",function(){return n.TextFileAssetTask}),i.d(t,"BinaryFileAssetTask",function(){return n.BinaryFileAssetTask}),i.d(t,"ImageAssetTask",function(){return n.ImageAssetTask}),i.d(t,"TextureAssetTask",function(){return n.TextureAssetTask}),i.d(t,"CubeTextureAssetTask",function(){return n.CubeTextureAssetTask}),i.d(t,"HDRCubeTextureAssetTask",function(){return n.HDRCubeTextureAssetTask}),i.d(t,"EquiRectangularCubeTextureAssetTask",function(){return n.EquiRectangularCubeTextureAssetTask}),i.d(t,"AssetsManager",function(){return n.AssetsManager}),i.d(t,"BasisTranscodeConfiguration",function(){return n.BasisTranscodeConfiguration}),i.d(t,"BasisTools",function(){return n.BasisTools}),i.d(t,"DDSTools",function(){return n.DDSTools}),i.d(t,"expandToProperty",function(){return n.expandToProperty}),i.d(t,"serialize",function(){return n.serialize}),i.d(t,"serializeAsTexture",function(){return n.serializeAsTexture}),i.d(t,"serializeAsColor3",function(){return n.serializeAsColor3}),i.d(t,"serializeAsFresnelParameters",function(){return n.serializeAsFresnelParameters}),i.d(t,"serializeAsVector2",function(){return n.serializeAsVector2}),i.d(t,"serializeAsVector3",function(){return n.serializeAsVector3}),i.d(t,"serializeAsMeshReference",function(){return n.serializeAsMeshReference}),i.d(t,"serializeAsColorCurves",function(){return n.serializeAsColorCurves}),i.d(t,"serializeAsColor4",function(){return n.serializeAsColor4}),i.d(t,"serializeAsImageProcessingConfiguration",function(){return n.serializeAsImageProcessingConfiguration}),i.d(t,"serializeAsQuaternion",function(){return n.serializeAsQuaternion}),i.d(t,"serializeAsMatrix",function(){return n.serializeAsMatrix}),i.d(t,"serializeAsCameraReference",function(){return n.serializeAsCameraReference}),i.d(t,"SerializationHelper",function(){return n.SerializationHelper}),i.d(t,"Deferred",function(){return n.Deferred}),i.d(t,"EnvironmentTextureTools",function(){return n.EnvironmentTextureTools}),i.d(t,"MeshExploder",function(){return n.MeshExploder}),i.d(t,"FilesInput",function(){return n.FilesInput}),i.d(t,"CubeMapToSphericalPolynomialTools",function(){return n.CubeMapToSphericalPolynomialTools}),i.d(t,"HDRTools",function(){return n.HDRTools}),i.d(t,"PanoramaToCubeMapTools",function(){return n.PanoramaToCubeMapTools}),i.d(t,"KhronosTextureContainer",function(){return n.KhronosTextureContainer}),i.d(t,"EventState",function(){return n.EventState}),i.d(t,"Observer",function(){return n.Observer}),i.d(t,"MultiObserver",function(){return n.MultiObserver}),i.d(t,"Observable",function(){return n.Observable}),i.d(t,"PerformanceMonitor",function(){return n.PerformanceMonitor}),i.d(t,"RollingAverage",function(){return n.RollingAverage}),i.d(t,"PromisePolyfill",function(){return n.PromisePolyfill}),i.d(t,"SceneOptimization",function(){return n.SceneOptimization}),i.d(t,"TextureOptimization",function(){return n.TextureOptimization}),i.d(t,"HardwareScalingOptimization",function(){return n.HardwareScalingOptimization}),i.d(t,"ShadowsOptimization",function(){return n.ShadowsOptimization}),i.d(t,"PostProcessesOptimization",function(){return n.PostProcessesOptimization}),i.d(t,"LensFlaresOptimization",function(){return n.LensFlaresOptimization}),i.d(t,"CustomOptimization",function(){return n.CustomOptimization}),i.d(t,"ParticlesOptimization",function(){return n.ParticlesOptimization}),i.d(t,"RenderTargetsOptimization",function(){return n.RenderTargetsOptimization}),i.d(t,"MergeMeshesOptimization",function(){return n.MergeMeshesOptimization}),i.d(t,"SceneOptimizerOptions",function(){return n.SceneOptimizerOptions}),i.d(t,"SceneOptimizer",function(){return n.SceneOptimizer}),i.d(t,"SceneSerializer",function(){return n.SceneSerializer}),i.d(t,"SmartArray",function(){return n.SmartArray}),i.d(t,"SmartArrayNoDuplicate",function(){return n.SmartArrayNoDuplicate}),i.d(t,"StringDictionary",function(){return n.StringDictionary}),i.d(t,"Tags",function(){return n.Tags}),i.d(t,"TextureTools",function(){return n.TextureTools}),i.d(t,"TGATools",function(){return n.TGATools}),i.d(t,"Tools",function(){return n.Tools}),i.d(t,"className",function(){return n.className}),i.d(t,"AsyncLoop",function(){return n.AsyncLoop}),i.d(t,"VideoRecorder",function(){return n.VideoRecorder}),i.d(t,"JoystickAxis",function(){return n.JoystickAxis}),i.d(t,"VirtualJoystick",function(){return n.VirtualJoystick}),i.d(t,"WorkerPool",function(){return n.WorkerPool}),i.d(t,"Logger",function(){return n.Logger}),i.d(t,"_TypeStore",function(){return n._TypeStore}),i.d(t,"FilesInputStore",function(){return n.FilesInputStore}),i.d(t,"DeepCopier",function(){return n.DeepCopier}),i.d(t,"PivotTools",function(){return n.PivotTools}),i.d(t,"PrecisionDate",function(){return n.PrecisionDate}),i.d(t,"ScreenshotTools",function(){return n.ScreenshotTools}),i.d(t,"WebRequest",function(){return n.WebRequest}),i.d(t,"InspectableType",function(){return n.InspectableType}),i.d(t,"BRDFTextureTools",function(){return n.BRDFTextureTools}),i.d(t,"RGBDTextureTools",function(){return n.RGBDTextureTools}),i.d(t,"ColorGradient",function(){return n.ColorGradient}),i.d(t,"Color3Gradient",function(){return n.Color3Gradient}),i.d(t,"FactorGradient",function(){return n.FactorGradient}),i.d(t,"GradientHelper",function(){return n.GradientHelper}),i.d(t,"PerfCounter",function(){return n.PerfCounter}),i.d(t,"RetryStrategy",function(){return n.RetryStrategy}),i.d(t,"CanvasGenerator",function(){return n.CanvasGenerator}),i.d(t,"LoadFileError",function(){return n.LoadFileError}),i.d(t,"RequestFileError",function(){return n.RequestFileError}),i.d(t,"ReadFileError",function(){return n.ReadFileError}),i.d(t,"FileTools",function(){return n.FileTools}),i.d(t,"StringTools",function(){return n.StringTools}),i.d(t,"DataReader",function(){return n.DataReader}),i.d(t,"MinMaxReducer",function(){return n.MinMaxReducer}),i.d(t,"DepthReducer",function(){return n.DepthReducer}),i.d(t,"DataStorage",function(){return n.DataStorage}),i.d(t,"SceneRecorder",function(){return n.SceneRecorder}),i.d(t,"KhronosTextureContainer2",function(){return n.KhronosTextureContainer2}),i.d(t,"Trajectory",function(){return n.Trajectory}),i.d(t,"TrajectoryClassifier",function(){return n.TrajectoryClassifier}),i.d(t,"TimerState",function(){return n.TimerState}),i.d(t,"setAndStartTimer",function(){return n.setAndStartTimer}),i.d(t,"AdvancedTimer",function(){return n.AdvancedTimer}),i.d(t,"CopyTools",function(){return n.CopyTools}),i.d(t,"WebXRCamera",function(){return n.WebXRCamera}),i.d(t,"WebXREnterExitUIButton",function(){return n.WebXREnterExitUIButton}),i.d(t,"WebXREnterExitUIOptions",function(){return n.WebXREnterExitUIOptions}),i.d(t,"WebXREnterExitUI",function(){return n.WebXREnterExitUI}),i.d(t,"WebXRExperienceHelper",function(){return n.WebXRExperienceHelper}),i.d(t,"WebXRInput",function(){return n.WebXRInput}),i.d(t,"WebXRInputSource",function(){return n.WebXRInputSource}),i.d(t,"WebXRManagedOutputCanvasOptions",function(){return n.WebXRManagedOutputCanvasOptions}),i.d(t,"WebXRManagedOutputCanvas",function(){return n.WebXRManagedOutputCanvas}),i.d(t,"WebXRState",function(){return n.WebXRState}),i.d(t,"WebXRTrackingState",function(){return n.WebXRTrackingState}),i.d(t,"WebXRSessionManager",function(){return n.WebXRSessionManager}),i.d(t,"WebXRDefaultExperienceOptions",function(){return n.WebXRDefaultExperienceOptions}),i.d(t,"WebXRDefaultExperience",function(){return n.WebXRDefaultExperience}),i.d(t,"WebXRFeatureName",function(){return n.WebXRFeatureName}),i.d(t,"WebXRFeaturesManager",function(){return n.WebXRFeaturesManager}),i.d(t,"WebXRAbstractFeature",function(){return n.WebXRAbstractFeature}),i.d(t,"WebXRHitTestLegacy",function(){return n.WebXRHitTestLegacy}),i.d(t,"WebXRAnchorSystem",function(){return n.WebXRAnchorSystem}),i.d(t,"WebXRPlaneDetector",function(){return n.WebXRPlaneDetector}),i.d(t,"WebXRBackgroundRemover",function(){return n.WebXRBackgroundRemover}),i.d(t,"WebXRMotionControllerTeleportation",function(){return n.WebXRMotionControllerTeleportation}),i.d(t,"WebXRControllerPointerSelection",function(){return n.WebXRControllerPointerSelection}),i.d(t,"IWebXRControllerPhysicsOptions",function(){return n.IWebXRControllerPhysicsOptions}),i.d(t,"WebXRControllerPhysics",function(){return n.WebXRControllerPhysics}),i.d(t,"WebXRHitTest",function(){return n.WebXRHitTest}),i.d(t,"WebXRFeaturePointSystem",function(){return n.WebXRFeaturePointSystem}),i.d(t,"WebXRHand",function(){return n.WebXRHand}),i.d(t,"WebXRHandTracking",function(){return n.WebXRHandTracking}),i.d(t,"WebXRAbstractMotionController",function(){return n.WebXRAbstractMotionController}),i.d(t,"WebXRControllerComponent",function(){return n.WebXRControllerComponent}),i.d(t,"WebXRGenericTriggerMotionController",function(){return n.WebXRGenericTriggerMotionController}),i.d(t,"WebXRMicrosoftMixedRealityController",function(){return n.WebXRMicrosoftMixedRealityController}),i.d(t,"WebXRMotionControllerManager",function(){return n.WebXRMotionControllerManager}),i.d(t,"WebXROculusTouchMotionController",function(){return n.WebXROculusTouchMotionController}),i.d(t,"WebXRHTCViveMotionController",function(){return n.WebXRHTCViveMotionController}),i.d(t,"WebXRProfiledMotionController",function(){return n.WebXRProfiledMotionController});var o=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==o){o.BABYLON=a,o.BABYLON=o.BABYLON||{};var a=o.BABYLON;a.Debug=a.Debug||{};var s=[];for(var c in r)a.Debug[c]=r[c],s.push(c);for(var c in n)a[c]=n[c]}var l={AxesViewer:r.AxesViewer,BoneAxesViewer:r.BoneAxesViewer,PhysicsViewer:r.PhysicsViewer,SkeletonViewer:r.SkeletonViewer}}.call(this,i(159))}])});
},{}],"b7Q5":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../interfaces"),t=r(require("babylonjs"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function s(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}class i{constructor(o,r){s(this,"object",void 0),s(this,"obstacleNode",void 0),s(this,"gameStateProcessor",void 0),s(this,"importMesh",void 0),s(this,"materials",void 0),s(this,"assetPack",void 0),this.assetPack=r,this.gameStateProcessor=new e.DiffProcessor(this),this.obstacleNode=new t.TransformNode("Obstacles",o.scene),this.object=this.obstacleNode,this.obstacleNode.parent=o.onTerrainNode}remove(e){const t=e.id,o=this.obstacleNode.getChildMeshes(!0,function(e){return e.name===`obstacle: ${t}`});o.length>0&&o[0].dispose()}edit(e){const o=this.obstacleNode.getChildMeshes(!0,function(t){return t.name===`obstacle: ${e.id}`});o.length>0&&(o[0].position=new t.Vector3(e.value.location.x,0,e.value.location.y))}async add(e){await this.assetPack.createObstacle(`obstacle: ${e.id}`,new t.Vector3(e.value.location.x,0,e.value.location.y),e.value.texture,this.obstacleNode)}}exports.default=i;
},{"../interfaces":"aUc4","babylonjs":"SZeO"}],"khxL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.diff=f,exports.DiffResult=exports.DiffItem=exports.EDIT=exports.DELETE=exports.ADD=void 0;var t=e(require("lodash.isequal"));function e(t){return t&&t.__esModule?t:{default:t}}function i(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const s="A";exports.ADD="A";const r="D";exports.DELETE="D";const n="E";exports.EDIT="E";class o{constructor(t,e){i(this,"id",void 0),i(this,"value",void 0),this.id=t,this.value=e}}exports.DiffItem=o;class u{constructor(t,e,s){i(this,"addList",void 0),i(this,"deleteList",void 0),i(this,"editList",void 0),this.addList=t,this.deleteList=e,this.editList=s}}function f(t,e){if(!t.length)return new u(d(e),[],[]);const i=c(t,e),s=l(i,e),r=a(i,e),n=p(t,e);return new u(n,r,s)}function d(t){return t.map((t,e)=>({id:e,value:t}))}function c(e,i){const s=[];for(const[r,n]of Object.entries(e))(0,t.default)(n,i[r])||s.push([+r,n,i[r]]);return s}function l(t,e){return t.filter(([t,e,i])=>void 0!==i).map(([t,e,i])=>new o(t,i))}function a(t,e){return t.filter(([t,e,i])=>void 0===i).map(([t,e,i])=>new o(t,e))}function p(t,e){const i=[];for(let s=t.length;s<e.length;s++)i.push(new o(s,e[s]));return i}exports.DiffResult=u;
},{"lodash.isequal":"a1XM"}],"h40A":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../interfaces"),t=a(require("babylonjs"));function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var a={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(a,n,o):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class n{constructor(r,a){i(this,"object",void 0),i(this,"assetPack",void 0),i(this,"interactableNode",void 0),i(this,"importMesh",void 0),i(this,"materials",void 0),i(this,"gameStateProcessor",void 0),this.gameStateProcessor=new e.DiffProcessor(this),this.assetPack=a,this.interactableNode=new t.TransformNode("Interactables",r.scene),this.object=this.interactableNode,this.interactableNode.parent=r.onTerrainNode}remove(e){const t=e.id,r=this.interactableNode.getChildMeshes(!0,function(e){return e.name===`interactable: ${t}`});r.length>0&&r[0].dispose()}async edit(e){const r=this.interactableNode.getChildMeshes(!0,function(t){return t.name===`interactable: ${e.id}`});r.length>0&&(r[0].metadata.type===e.value.type?r[0].position=new t.Vector3(e.value.location.x,0,e.value.location.y):(await this.add(e),r[0].dispose()))}async add(e){await this.assetPack.createInteractable(`interactable: ${e.id}`,e.value.type,new t.Vector3(e.value.location.x,0,e.value.location.y),this.interactableNode)}}exports.default=n;
},{"../interfaces":"aUc4","babylonjs":"SZeO"}],"ijzo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=c;var t=r(require("babylonjs"));function e(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return e=function(){return t},t}function r(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=e();if(r&&r.has(t))return r.get(t);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var i=n?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(o,a,i):o[a]=t[a]}return o.default=t,r&&r.set(t,o),o}const o=new t.Vector3(0,Math.PI,-0),n=new t.Vector3(0,Math.PI/2*3,0),a=new t.Vector3(0,0,0),i=new t.Vector3(0,Math.PI/2,0);function c(t,e){switch(e){case"north":t.rotation!==o&&(t.rotation=o);break;case"east":t.rotation!==n&&(t.rotation=n);break;case"south":t.rotation!==a&&(t.rotation=a);break;case"west":t.rotation!==i&&(t.rotation=i);break;default:console.warn(`${t} was not provided with a valid orientation: ${e}`)}}
},{"babylonjs":"SZeO"}],"bHSW":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rotationAnimation=i,exports.bobbingAnimation=r,exports.createMoveAnimation=a,exports.createWalkAnimation=s,exports.MAX_KEYFRAMES_PER_SECOND=void 0;var e=t(require("babylonjs"));function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function t(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var a=i?Object.getOwnPropertyDescriptor(e,r):null;a&&(a.get||a.set)?Object.defineProperty(o,r,a):o[r]=e[r]}return o.default=e,t&&t.set(e,o),o}const o=24;function i(n){const t=new e.Animation(`${n} rotation`,"rotation.y",1,e.Animation.ANIMATIONTYPE_FLOAT,e.Animation.ANIMATIONLOOPMODE_CYCLE),o=[];return o.push({frame:0,value:0}),o.push({frame:1,value:Math.PI}),o.push({frame:2,value:2*Math.PI}),t.setKeys(o),t}function r(n){const t=new e.Animation(`${n} bobbing`,"position.y",1,e.Animation.ANIMATIONTYPE_FLOAT,e.Animation.ANIMATIONLOOPMODE_CYCLE);return t.setKeys([{frame:0,value:0},{frame:1,value:.3},{frame:2,value:0}]),t.setEasingFunction(new e.SineEase),t}function a(n,t){const o=new e.Animation("move","position",1,e.Animation.ANIMATIONTYPE_VECTOR3,e.Animation.ANIMATIONLOOPMODE_CONSTANT),i=[{frame:0,value:n},{frame:1,value:t}];o.setKeys(i);const r=new e.QuadraticEase;return r.setEasingMode(e.EasingFunction.EASINGMODE_EASEINOUT),o.setEasingFunction(r),o}function s(e,n){e.skeleton.getAnimationRange("runAnimation")&&n.beginAnimation(e.skeleton,10,35,!1)}exports.MAX_KEYFRAMES_PER_SECOND=24;
},{"babylonjs":"SZeO"}],"niX2":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../interfaces"),a=require("babylonjs"),t=i(require("../orientation")),r=require("../animations");function i(e){return e&&e.__esModule?e:{default:e}}function s(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}const o=12;class n{constructor(t,r=a.SceneLoader.ImportMeshAsync){s(this,"object",void 0),s(this,"currentAvatarMesh",void 0),s(this,"scene",void 0),s(this,"avatarNode",void 0),s(this,"markerMaterial",void 0),s(this,"currentAvatarID",void 0),s(this,"gameStateProcessor",void 0),s(this,"importMesh",void 0),s(this,"shaderMaterial",void 0),this.importMesh=r,this.gameStateProcessor=new e.DiffProcessor(this),this.scene=t.scene,this.avatarNode=new a.TransformNode("Avatars",t.scene),this.object=this.avatarNode,this.avatarNode.parent=t.onTerrainNode,this.setupMarkerMaterial(),this.setupShaderMaterial()}setupMarkerMaterial(){this.markerMaterial=new a.StandardMaterial("avatar marker",this.scene),this.markerMaterial.diffuseTexture=new a.Texture("/static/babylon/models/avatar_marker_texture.png",this.scene),this.markerMaterial.specularColor=new a.Color3(0,0,0)}setupShaderMaterial(){this.shaderMaterial=new a.ShaderMaterial("Avatar shader",this.scene,"/static/babylon/models/toonshader",{attributes:["position","normal","uv"],uniforms:["world","worldView","worldViewProjection","view","projection"]}),this.shaderMaterial.setTexture("textureSampler",new a.Texture("/static/babylon/models/avatar_texture.png",this.scene))}remove(e){this.avatarNode.getChildMeshes(!0,function(a){return a.name===`avatar: ${e.value.id}`})[0].dispose()}async add(e){const{meshes:r}=await this.importMesh("avatar","/static/babylon/models/","avatar_model.babylon",this.scene),i=r[0];i.name=`avatar: ${e.value.id}`,i.scaling=new a.Vector3(.2,.2,.2),i.computeBonesUsingShaders=!1,i.material=this.shaderMaterial,i.parent=this.avatarNode,i.position=new a.Vector3(e.value.location.x,0,e.value.location.y),(0,t.default)(i,e.value.orientation),e.value.id===this.currentAvatarID&&(await this.attachMarker(i),this.currentAvatarMesh=i)}edit(e){const i=this.avatarNode.getChildMeshes(!0,function(a){return a.name===`avatar: ${e.value.id}`})[0],s=new a.Vector3(e.value.location.x,0,e.value.location.y),o=(0,r.createMoveAnimation)(i.position,s);this.scene.beginDirectAnimation(i,[o],0,r.MAX_KEYFRAMES_PER_SECOND,!1,1);const n=i;(0,r.createWalkAnimation)(n,this.scene),(0,t.default)(n,e.value.orientation)}async attachMarker(e){const{meshes:t}=await this.importMesh("avatar_marker","/static/babylon/models/","avatar_marker_model.babylon",this.scene),r=t[0];r.material=this.markerMaterial,r.parent=e,r.scaling=new a.Vector3(1.25,1.25,1.25),r.position=new a.Vector3(0,o,0)}setCurrentAvatarID(e){this.currentAvatarID=e}}exports.default=n;
},{"../interfaces":"aUc4","babylonjs":"SZeO","../orientation":"ijzo","../animations":"bHSW"}],"X9K0":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./obstacleManager")),a=require("../diff"),t=r(require("./interactableManager")),s=r(require("./avatarManager"));function r(e){return e&&e.__esModule?e:{default:e}}function i(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}class n{constructor(a,r){i(this,"assetPack",void 0),i(this,"obstacles",void 0),i(this,"interactables",void 0),i(this,"avatars",void 0),this.assetPack=r,this.obstacles=new e.default(a,this.assetPack),this.interactables=new t.default(a,this.assetPack),this.avatars=new s.default(a)}onGameStateUpdate(e,t){var s=[],r=[],i=[];e&&(s=e.obstacles,r=e.interactables,i=e.players);const n=(0,a.diff)(s,t.obstacles),c=(0,a.diff)(r,t.interactables),l=(0,a.diff)(i,t.players);this.obstacles.gameStateProcessor.handleDifferences(n),this.interactables.gameStateProcessor.handleDifferences(c),this.avatars.gameStateProcessor.handleDifferences(l)}setCurrentAvatarID(e){this.avatars.setCurrentAvatarID(e)}}exports.default=n;
},{"./obstacleManager":"b7Q5","../diff":"khxL","./interactableManager":"h40A","./avatarManager":"niX2"}],"Z9rN":[function(require,module,exports) {
"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;class t{constructor(t){e(this,"environment",void 0),this.environment=t,this.environment.engine.runRenderLoop(()=>{this.environment.scene.render()})}showDebugLayer(){setTimeout(()=>{this.environment.scene.debugLayer.show({overlay:!0,showExplorer:!0,showInspector:!0,globalRoot:document.getElementById("root")})},2e3),setTimeout(()=>{document.getElementById("scene-explorer-host").style.setProperty("z-index","15000"),document.getElementById("inspector-host").style.setProperty("z-index","15000")},4e3)}}exports.default=t;
},{}],"iV1v":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("babylonjs"));function e(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return e=function(){return t},t}function i(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=e();if(i&&i.has(t))return i.get(t);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var n=r?Object.getOwnPropertyDescriptor(t,s):null;n&&(n.get||n.set)?Object.defineProperty(o,s,n):o[s]=t[s]}return o.default=t,i&&i.set(t,o),o}function o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const r=5,s=15,n=20,a=6,h=130;class c{constructor(e){o(this,"object",void 0),o(this,"frustum",void 0),o(this,"zoomFactor",void 0),o(this,"view",void 0),o(this,"isCenteredOnUserAvatar",void 0);const i=new t.ArcRotateCamera("camera1",0,.785,50,t.Vector3.Zero(),e.scene);this.frustum=7.5,this.zoomFactor=0,this.object=i,this.isCenteredOnUserAvatar=!1,i.mode=t.Camera.ORTHOGRAPHIC_CAMERA,i.orthoTop=5,i.orthoBottom=-5,i.orthoLeft=-5,i.orthoRight=5,i.upperAlphaLimit=-3*Math.PI/4,i.lowerAlphaLimit=-3*Math.PI/4,i.upperBetaLimit=Math.PI/4,i.lowerBetaLimit=Math.PI/4,i.upperRadiusLimit=50,i.lowerRadiusLimit=50,i.panningInertia=0,i.angularSensibilityX=20,i.angularSensibilityY=20,i.panningDistanceLimit=20,i.attachControl(e.canvas,!0,!1,0),this.updatePanningSensibility(),this.computeCameraView(e.canvas),this.addZoomListener(e.scene,e.canvas)}addZoomListener(e,i){e.onPrePointerObservable.add(t=>{const e=t.event instanceof WheelEvent?t.event:void 0;if(e){let t=0;e.deltaY&&(t=e.deltaY),t&&(this.zoomFactor+=t/n,this.zoomFactor+this.frustum>=s?this.zoomFactor=s-this.frustum:this.zoomFactor+this.frustum<=r&&(this.zoomFactor=r-this.frustum),this.computeCameraView(i),this.updatePanningSensibility())}},t.PointerEventTypes.POINTERWHEEL,!1)}updatePanningSensibility(){this.object.panningSensibility=-a*(this.frustum+this.zoomFactor)+h}computeCameraView(e){this.view=new t.Vector2(e.width,e.height),this.view.normalize(),this.object.orthoTop=(this.frustum+this.zoomFactor)*this.view.y,this.object.orthoBottom=-(this.frustum+this.zoomFactor)*this.view.y,this.object.orthoLeft=-(this.frustum+this.zoomFactor)*this.view.x,this.object.orthoRight=(this.frustum+this.zoomFactor)*this.view.x}centerOn(t){this.isCenteredOnUserAvatar||(this.object.setTarget(t),this.object.panningOriginTarget=t.position.clone(),this.isCenteredOnUserAvatar=!0)}unCenter(t){if(this.isCenteredOnUserAvatar){const e=t.position.clone();this.object.setTarget(e),this.object.panningOriginTarget=e,this.isCenteredOnUserAvatar=!1}}}exports.default=c;
},{"babylonjs":"SZeO"}],"eeez":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("babylonjs");function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class r{constructor(r){t(this,"object",void 0);const i=new e.HemisphericLight("light1",new e.Vector3(0,1,0),r.scene);this.object=i,i.intensity=1.45}}exports.default=r;
},{"babylonjs":"SZeO"}],"I5jE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("babylonjs");function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class r{constructor(r){t(this,"object",void 0),t(this,"assetPack",void 0),this.assetPack=r,this.object=new e.TransformNode("Terrain",this.assetPack.scene),r.createGridOverlay(this.object),r.createTerrain(this.object)}}exports.default=r;
},{"babylonjs":"SZeO"}],"UGif":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("./camera")),t=i(require("./light")),n=i(require("./terrain"));function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class s{constructor(i,s){r(this,"camera",void 0),r(this,"light",void 0),r(this,"terrain",void 0),r(this,"environment",void 0),r(this,"assetPack",void 0),r(this,"resizeBabylonWindow",()=>{this.environment.engine.resize(),this.camera.computeCameraView(this.environment.canvas)}),this.environment=i,this.assetPack=s,this.camera=new e.default(this.environment),this.light=new t.default(this.environment),this.terrain=new n.default(this.assetPack),this.setSceneBackground()}setSceneBackground(){this.environment.scene.clearColor=this.assetPack.backgroundColor}centerOn(e){this.camera.centerOn(e)}unCenter(e){this.camera.unCenter(e)}}exports.default=s;
},{"./camera":"iV1v","./light":"eeez","./terrain":"I5jE"}],"WwOl":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("babylonjs");function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const r={future:{w:31,h:31},prehistory:{w:1,h:1},ancient:{w:1,h:1},modern:{w:31,h:31},grid:{w:31,h:31}};class a{constructor(a,i,s=e.SceneLoader.ImportMeshAsync){t(this,"era",void 0),t(this,"scene",void 0),t(this,"obstacleInfo",void 0),t(this,"terrainInfo",void 0),t(this,"gridInfo",{name:"grid",tileSize:r.grid,materialName:"grid_material",textureURL:"/static/babylon/terrain/grid.png"}),t(this,"interactableMaterials",void 0),t(this,"importMeshAsync",void 0),t(this,"backgroundColor",e.Color4.FromColor3(e.Color3.White())),this.era=a,this.scene=i,this.importMeshAsync=s,this.obstacleInfo=this.getObstacleAssetInfo(),this.terrainInfo=this.getTerrainInfo(),this.interactableMaterials={yellow_orb:this.createInteractableMaterial("yellow_orb")}}createInteractableMaterial(t){const r=`/static/babylon/interactables/${t}_texture.png`,a=new e.StandardMaterial(t,this.scene);return a.specularColor=new e.Color3(0,0,0),a.emissiveColor=new e.Color3(0,0,0),a.diffuseTexture=new e.Texture(r,this.scene),a}async createObstacle(e,t,r,a){const{meshes:i}=await this.importMeshAsync(this.obstacleInfo.name,this.obstacleInfo.modelURL,this.obstacleInfo.modelName,this.scene),s=i[0];return s.name=e,s.position=t,s.parent=a,s}async createInteractable(e,t,r,a){const i=`${t}_model.babylon`,{meshes:s}=await this.importMeshAsync("artefact","/static/babylon/interactables/",i,this.scene),n=s[0];return n.material=this.interactableMaterials[t],n.name=e,n.parent=a,n.position=r,n.metadata={type:t},n}createGridOverlay(t){const r=e.Mesh.CreateTiledGround(this.gridInfo.name,-15,-15,16,16,this.gridInfo.tileSize,{w:1,h:1},this.scene),a=new e.StandardMaterial(this.gridInfo.materialName,this.scene);return a.diffuseColor=e.Color3.Black(),a.specularColor=e.Color3.Black(),a.ambientColor=e.Color3.White(),a.opacityTexture=new e.Texture(this.gridInfo.textureURL,this.scene),r.material=a,r}createTerrain(t){const r=e.Mesh.CreateTiledGround(this.terrainInfo.name,-15,-15,16,16,this.terrainInfo.tileSize,{w:1,h:1},this.scene),a=new e.StandardMaterial(this.terrainInfo.materialName,this.scene);return a.useReflectionOverAlpha=!1,a.diffuseTexture=new e.Texture(this.terrainInfo.textureURL,this.scene),a.diffuseTexture.level=1.2,a.specularColor=e.Color3.Black(),a.ambientColor=e.Color3.White(),r.material=a,r}getTerrainInfo(){return{name:"terrain",tileSize:r[this.era],materialName:`terrain_material_${this.era}`,textureURL:`/static/babylon/terrain/terrain_${this.era}.jpg`}}getObstacleAssetInfo(){return{name:"obstacle",modelURL:"/static/babylon/obstacles/",modelName:`obstacle_model_${this.era}.babylon`,materialName:`obstacle_material_${this.era}`}}getTextureURL(e){return`/static/babylon/obstacles/obstacle_${this.era}_${e}.jpg`}}exports.default=a;
},{"babylonjs":"SZeO"}],"wPGo":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("babylonjs"),t=a(require("./assetPack"));function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class s extends t.default{constructor(t,a){super(t,a),r(this,"obstacleMaterial",void 0),r(this,"backgroundColor",new e.Color4(.75,1,.99)),this.obstacleMaterial=this.makeObstacleMaterial()}makeObstacleMaterial(){const t=new e.StandardMaterial(this.obstacleInfo.materialName,this.scene);return t.diffuseTexture=new e.Texture(this.getTextureURL(1),this.scene),t.specularColor=new e.Color3(0,0,0),t.diffuseColor=new e.Color3(1,1,1),t}async createObstacle(e,t,a,r){const s=await super.createObstacle(e,t,a,r);return s.material=this.obstacleMaterial,s}}exports.default=s;
},{"babylonjs":"SZeO","./assetPack":"WwOl"}],"Hsa4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("./assetPack")),t=require("babylonjs");function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class s extends e.default{constructor(e,a){super(e,a),r(this,"obstacleMaterials",void 0),r(this,"backgroundColor",new t.Color4(.2,.35,.2)),this.obstacleMaterials=this.makeObstacleMaterials()}makeObstacleMaterials(){return[1,2].map(e=>{const a=new t.StandardMaterial(`${this.obstacleInfo.materialName}_${e}`,this.scene);return a.diffuseTexture=new t.Texture(this.getTextureURL(e),this.scene),a.specularColor=new t.Color3(0,0,0),a.diffuseColor=new t.Color3(.7,.8,1),a})}async createObstacle(e,a,r,s){const o=await super.createObstacle(e,a,r,s);return o.material=this.obstacleMaterials[r-1],o.rotate(t.Axis.Y,this.createRandomRotation(),t.Space.WORLD),o}createRandomRotation(){return Math.PI/(Math.floor(Math.random()*Math.floor(4))+1)}}exports.default=s;
},{"./assetPack":"WwOl","babylonjs":"SZeO"}],"StM1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("babylonjs"),t=a(require("./assetPack"));function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class s extends t.default{constructor(t,a){super(t,a),r(this,"obstacleMaterial",void 0),r(this,"backgroundColor",new e.Color4(.93,.89,.82)),this.obstacleMaterial=this.makeObstacleMaterial()}async createInteractable(t,a,r,s){const n=`${a}.babylon`,{meshes:i}=await this.importMeshAsync("artefact","/static/babylon/interactables/ancient/",n,this.scene),o=i[0];return o.name=t,o.parent=s,o.position=r,o.scaling=new e.Vector3(.4,.4,.4),o.metadata={type:a},o}makeObstacleMaterial(){const t=new e.StandardMaterial(this.obstacleInfo.materialName,this.scene);return t.diffuseTexture=new e.Texture(this.getTextureURL(1),this.scene),t.specularColor=new e.Color3(0,0,0),t.diffuseColor=new e.Color3(1,1,1),t}async createObstacle(e,t,a,r){const s=await super.createObstacle(e,t,a,r);return s.material=this.obstacleMaterial,s}}exports.default=s;
},{"babylonjs":"SZeO","./assetPack":"WwOl"}],"pmQL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("./assetPack")),t=require("babylonjs");function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class s extends e.default{constructor(e,a){super(e,a),r(this,"obstacleMaterials",void 0),r(this,"backgroundColor",new t.Color4(.525,.729,.851)),this.obstacleMaterials=this.makeObstacleMaterials()}makeObstacleMaterials(){return[1,2].map(e=>{const a=new t.StandardMaterial(`${this.obstacleInfo.materialName}_${e}`,this.scene);return a.diffuseTexture=new t.Texture(this.getTextureURL(e),this.scene),a.specularColor=new t.Color3(0,0,0),a.diffuseColor=new t.Color3(.7,.8,1),a})}async createObstacle(e,a,r,s){const o=await super.createObstacle(e,a,r,s);return o.material=this.obstacleMaterials[r-1],o.rotate(t.Axis.Y,this.createRandomRotation(),t.Space.WORLD),o}createRandomRotation(){return Math.PI/(Math.floor(Math.random()*Math.floor(4))+1)}}exports.default=s;
},{"./assetPack":"WwOl","babylonjs":"SZeO"}],"ojas":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("babylonjs"),t=a(require("./assetPack"));function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class s extends t.default{constructor(t,a){super(t,a),r(this,"obstacleMaterial",void 0),r(this,"backgroundColor",new e.Color4(.086,.003,.007)),this.obstacleMaterial=this.makeObstacleMaterial()}makeObstacleMaterial(){const t=new e.StandardMaterial(this.obstacleInfo.materialName,this.scene);return t.diffuseTexture=new e.Texture(this.getTextureURL(1),this.scene),t.specularColor=new e.Color3(0,0,0),t.diffuseColor=new e.Color3(1,1,1),t}async createObstacle(e,t,a,r){const s=await super.createObstacle(e,t,a,r);return s.material=this.obstacleMaterial,s}}exports.default=s;
},{"babylonjs":"SZeO","./assetPack":"WwOl"}],"wwDp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=f;var e=s(require("./assetPack")),r=s(require("./future")),u=s(require("./preHistory")),t=s(require("./ancient")),n=s(require("./modern")),a=s(require("./wrongFuture"));function s(e){return e&&e.__esModule?e:{default:e}}function f(s,f){switch(s){case"future":return new r.default(s,f);case"prehistory":return new u.default(s,f);case"ancient":return new t.default(s,f);case"modern":return new n.default(s,f);case"wrongfuture":return new a.default(s,f);default:return new e.default(s,f)}}
},{"./assetPack":"WwOl","./future":"wPGo","./preHistory":"Hsa4","./ancient":"StM1","./modern":"pmQL","./wrongFuture":"ojas"}],"YOc9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("./entities")),t=o(require("./environment")),n=o(require("./environment/environmentManager")),r=s(require("babylonjs")),a=o(require("./assetPacks/getAssetPackForEra"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}function o(e){return e&&e.__esModule?e:{default:e}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class v{constructor(e,t){u(this,"environment",void 0),u(this,"sceneRenderer",void 0),u(this,"assetPack",void 0),u(this,"environmentManager",void 0),u(this,"entities",void 0),u(this,"panHandler",void 0),this.environment=t,this.panHandler=e}onUpdate(e,t){t.gameState&&(""===this.environment.era&&(this.environment.era=t.gameState.era,this.populateMap()),this.onUpdateGameState(e.gameState,t.gameState),this.setCurrentAvatarID(t.currentAvatarID),this.centerOn(t))}populateMap(){this.assetPack=(0,a.default)(this.environment.era,this.environment.scene),this.sceneRenderer=new t.default(this.environment),this.environmentManager=new n.default(this.environment,this.assetPack),this.entities=new e.default(this.environment,this.assetPack),window.addEventListener("resize",this.environmentManager.resizeBabylonWindow),this.addPanListener(this.environment.scene)}setCurrentAvatarID(e){this.entities.setCurrentAvatarID(e)}centerOn(e){if(e.cameraCenteredOnUserAvatar)if(this.entities.avatars.currentAvatarMesh)this.environmentManager.centerOn(this.entities.avatars.currentAvatarMesh);else if(e.gameState.players){const t=this.getAvatarLocation(e.currentAvatarID,e.gameState.players);this.environmentManager.camera.object.setTarget(t),this.environmentManager.camera.object.panningOriginTarget=t}}onUpdateGameState(e,t){this.entities.onGameStateUpdate(e,t)}unmount(){window.removeEventListener("resize",this.environmentManager.resizeBabylonWindow)}addPanListener(e){e.onPrePointerObservable.add(()=>{this.panHandler(),this.environmentManager.unCenter(this.entities.avatars.currentAvatarMesh)},r.PointerEventTypes.POINTERDOWN,!1)}getAvatarLocation(e,t){for(const n in t)if(t[n].id===e){const e=t[n].location;return new r.Vector3(e.x,0,e.y)}return null}}exports.default=v;
},{"./entities":"X9K0","./environment":"Z9rN","./environment/environmentManager":"UGif","babylonjs":"SZeO","./assetPacks/getAssetPackForEra":"wwDp"}],"bO9A":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StandardEnvironment=void 0;var e=require("babylonjs");function n(e,n,i){return n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}class i{constructor(i){n(this,"scene",void 0),n(this,"engine",void 0),n(this,"canvas",void 0),n(this,"onTerrainNode",void 0),n(this,"era",void 0),this.canvas=i,this.engine=new e.Engine(this.canvas,!0,{},!0),this.engine.enableOfflineSupport=!0,this.scene=new e.Scene(this.engine),this.onTerrainNode=new e.TransformNode("On Terrain",this.scene),this.onTerrainNode.position=new e.Vector3(.5,0,.5),this.era=""}}exports.StandardEnvironment=i;
},{"babylonjs":"SZeO"}],"Ujj9":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.PositionedFindMeButton=exports.Compass=exports.LoadingText=exports.Overlay=exports.OverlayElements=exports.LoadingBackgroundOverlay=exports.GameViewLayout=void 0;var e=u(require("styled-components")),t=l(require("react")),n=u(require("prop-types")),r=require("@material-ui/core"),a=u(require("@material-ui/core/Typography")),o=u(require("../FindMeButton")),i=u(require("../../babylon/gameEngine")),s=require("../../babylon/environment/environment");function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=r?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}function u(e){return e&&e.__esModule?e:{default:e}}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=e.default.div`
  grid-area: game-view;
  position: relative;
`;exports.GameViewLayout=c;const m=e.default.div`
  align-items: center;
  background-color: ${e=>e.theme.palette.primary.contrastText};
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  width: 100%;
`;exports.LoadingBackgroundOverlay=m;const f=e.default.div`
  align-items: center;
  display: flex;
  justify-content: space-between;
`;exports.OverlayElements=f;const g=e.default.div`
  position: absolute;
  width: 100%;
  bottom: 0;
`;exports.Overlay=g;const h=(0,e.default)(a.default)`
  padding-top: ${e=>e.theme.spacing(2)}px;
`;exports.LoadingText=h;const v=e.default.img`
  padding-bottom: ${e=>e.theme.spacing()}px;
  padding-left: ${e=>e.theme.spacing()}px;
  position: sticky;
`;exports.Compass=v;const y=(0,e.default)(o.default)`
  right: ${e=>e.theme.spacing(3)}px;
`;exports.PositionedFindMeButton=y;class x extends t.Component{constructor(...e){super(...e),p(this,"onCanvasLoaded",e=>{null!==e&&(this.canvas=e)}),p(this,"handleMapPanned",()=>{this.props.mapPanned()}),p(this,"renderGameView",()=>t.default.createElement("canvas",{style:{width:"100%",height:"100%"},ref:this.onCanvasLoaded})),p(this,"renderLoadingScreen",()=>t.default.createElement(m,null,t.default.createElement(r.CircularProgress,{color:"inherit"}),t.default.createElement(h,{variant:"body1",color:"inherit"},"Building game world..."))),p(this,"renderIcons",()=>t.default.createElement(g,null,t.default.createElement(f,null,t.default.createElement(v,{src:"/static/images/compass.svg"}),t.default.createElement(y,{"aria-label":"Find Me",whenClicked:this.props.centerCameraOnUserAvatar,isCameraCenteredOnUserAvatar:this.props.cameraCenteredOnUserAvatar,id:"find-me-button"}))))}componentDidMount(){var e;this.props.gameLoaded||this.props.connectToGame();const t=null!==(e=this.props.environment)&&void 0!==e?e:new s.StandardEnvironment(this.canvas);this.gameEngine=new i.default(this.handleMapPanned,t)}componentDidUpdate(e){this.gameEngine.onUpdate(e,this.props)}componentWillUnmount(){this.props.gameLoaded&&this.gameEngine.unmount()}render(){return t.default.createElement(c,null,!this.props.gameLoaded&&this.renderLoadingScreen(),this.renderGameView(),this.props.gameLoaded&&this.renderIcons())}}exports.default=x,p(x,"propTypes",{connectToGame:n.default.func,gameLoaded:n.default.bool,cameraCenteredOnUserAvatar:n.default.bool,mapPanned:n.default.func,centerCameraOnUserAvatar:n.default.func,environment:n.default.object});
},{"styled-components":"tFSs","react":"n8MK","prop-types":"D9Od","@material-ui/core":"dT3j","@material-ui/core/Typography":"pi2F","../FindMeButton":"ZroK","../../babylon/gameEngine":"YOc9","../../babylon/environment/environment":"bO9A"}],"Myu4":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Game=void 0;var e=u(require("react")),r=o(require("../../components/GameView")),t=o(require("prop-types")),a=require("react-redux"),n=require("../../redux/features/Game");function o(e){return e&&e.__esModule?e:{default:e}}function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(t,n,o):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}function s(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}class d extends e.Component{render(){return e.default.createElement(e.default.Fragment,null,e.default.createElement(r.default,{connectToGame:this.props.connectToGame,gameState:this.props.gameState,currentAvatarID:this.props.currentAvatarID,gameLoaded:this.props.gameLoaded,cameraCenteredOnUserAvatar:this.props.cameraCenteredOnUserAvatar,mapPanned:this.props.mapPanned,centerCameraOnUserAvatar:this.props.centerCameraOnUserAvatar}))}}exports.Game=d,s(d,"propTypes",{connectToGame:t.default.func,gameState:t.default.object,currentAvatarID:t.default.number,gameLoaded:t.default.bool,centerCameraOnUserAvatar:t.default.func,cameraCenteredOnUserAvatar:t.default.bool,mapPanned:t.default.func});const p={connectToGame:n.actions.socketConnectToGameRequest,mapPanned:n.actions.mapPanned,centerCameraOnUserAvatar:n.actions.centerCameraOnUserAvatar},m=e=>({gameState:e.game.gameState,currentAvatarID:e.game.connectionParameters.currentAvatarID,gameLoaded:e.game.gameLoaded,cameraCenteredOnUserAvatar:e.game.cameraCenteredOnUserAvatar});var f=(0,a.connect)(m,p)(d);exports.default=f;
},{"react":"n8MK","../../components/GameView":"Ujj9","prop-types":"D9Od","react-redux":"jYIL","../../redux/features/Game":"EAAz"}],"zZgR":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("@material-ui/core/SvgIcon")),C=t(require("react"));function t(e){return e&&e.__esModule?e:{default:e}}const l=t=>C.default.createElement(e.default,t,C.default.createElement("g",{id:"Page-1",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},C.default.createElement("g",{id:"Group",transform:"translate(4.000000, 0.000000)",fillRule:"nonzero"},C.default.createElement("g",{id:"Kurono_Logomark_Gamescreen",fill:"#323232"},C.default.createElement("path",{d:"M1.90670769,3.49218462 C1.90670769,2.6165499 2.6165499,1.90670772 3.49218462,1.90670772 C4.36781933,1.90670772 5.07766154,2.6165499 5.07766154,3.49218462 L5.07766154,12.3153231 C5.07766154,13.1909578 4.36781934,13.9008 3.49218462,13.9008 C2.61654989,13.9008 1.90670769,13.1909578 1.90670769,12.3153231 L1.90670769,3.49218462 Z M14.8718769,18.4881231 C13.5293851,20.7214668 11.1143376,22.0875395 8.50855385,22.0875395 C5.90277014,22.0875395 3.48772261,20.7214668 2.14523077,18.4881231 C1.70812629,17.7448106 1.95131862,16.788132 2.69032966,16.3437937 C3.42934071,15.8994555 4.38834725,16.1332993 4.83987692,16.8679385 C5.61484463,18.1542199 7.00685649,18.9406856 8.50855385,18.9406856 C10.0102512,18.9406856 11.4022631,18.1542199 12.1772308,16.8679385 C12.6287604,16.1332993 13.587767,15.8994555 14.326778,16.3437937 C15.0657891,16.788132 15.3089814,17.7448106 14.8718769,18.4881231 L14.8718769,18.4881231 Z M14.7906462,13.2701538 C14.2630386,13.9692865 13.2686296,14.1084641 12.5693538,13.5810462 L6.68455385,9.14510769 C6.28624856,8.84451797 6.05269667,8.37395218 6.05414262,7.87495401 C6.05560205,7.37595584 6.29188978,6.90675785 6.69193846,6.60849231 L12.5767385,2.22129231 C13.2790649,1.70737936 14.2643076,1.8553057 14.7847498,2.55280763 C15.305192,3.25030955 15.1664628,4.23688925 14.4738462,4.76381538 L10.2816,7.88676923 L14.4797538,11.0496 C14.8154459,11.3028359 15.0367906,11.6790535 15.0950943,12.0954887 C15.153398,12.5119238 15.0438846,12.9344638 14.7906462,13.2701538 L14.7906462,13.2701538 Z M16.3126154,14.4192 C16.8711798,13.6796779 17.1128099,12.7484239 16.9842674,11.8306201 C16.855725,10.9128162 16.3675578,10.0837735 15.6273231,9.52615385 L13.4621538,7.89415385 L15.6125538,6.29169231 C16.355625,5.73811542 16.8481663,4.91186282 16.98169,3.9949258 C17.1152138,3.07798877 16.8787674,2.14558147 16.3244308,1.40307692 C15.662699,0.521729311 14.6255612,0.00220337996 13.5234462,-7.8508241e-06 C12.7713204,-0.00160041521 12.0390887,0.241526441 11.4372923,0.692676923 L6.98436923,4.01206154 L6.98436923,3.49513846 C6.98518491,1.56645815 5.42234185,0.00229260517 3.49366154,0.00147692308 C1.56498123,0.000661240985 0.000815682092,1.56350431 0,3.49218462 L0,12.3153231 C0,13.3570879 0.465594339,14.3443348 1.26941538,15.0070154 C-0.0528378726,16.1025397 -0.375249735,18.0002804 0.511015385,19.4710154 C2.19854746,22.2775644 5.23372838,23.9941646 8.50855385,23.9941646 C11.7833793,23.9941646 14.8185602,22.2775644 16.5060923,19.4710154 C17.3923574,18.0002804 17.0699456,16.1025397 15.7476923,15.0070154 C15.9582994,14.8338001 16.1478983,14.6365182 16.3126154,14.4192 Z",id:"Shape"})),C.default.createElement("path",{d:"M1.90670769,3.49218462 C1.90670769,2.6165499 2.6165499,1.90670772 3.49218462,1.90670772 C4.36781933,1.90670772 5.07766154,2.6165499 5.07766154,3.49218462 L5.07766154,12.3153231 C5.07766154,13.1909578 4.36781934,13.9008 3.49218462,13.9008 C2.61654989,13.9008 1.90670769,13.1909578 1.90670769,12.3153231 L1.90670769,3.49218462 Z",id:"Path",fillOpacity:"1.0",fill:"#CDCDCD"}),C.default.createElement("path",{d:"M14.8718769,18.4881231 C13.5293851,20.7214668 11.1143376,22.0875395 8.50855385,22.0875395 C5.90277014,22.0875395 3.48772261,20.7214668 2.14523077,18.4881231 C1.70812629,17.7448106 1.95131862,16.788132 2.69032966,16.3437937 C3.42934071,15.8994555 4.38834725,16.1332993 4.83987692,16.8679385 C5.61484463,18.1542199 7.00685649,18.9406856 8.50855385,18.9406856 C10.0102512,18.9406856 11.4022631,18.1542199 12.1772308,16.8679385 C12.6287604,16.1332993 13.587767,15.8994555 14.326778,16.3437937 C15.0657891,16.788132 15.3089814,17.7448106 14.8718769,18.4881231 L14.8718769,18.4881231 Z",id:"Path",fillOpacity:"1.0",fill:"#CDCDCD"}),C.default.createElement("path",{d:"M14.7906462,13.2701538 C14.2630386,13.9692865 13.2686296,14.1084641 12.5693538,13.5810462 L6.68455385,9.14510769 C6.28624856,8.84451797 6.05269667,8.37395218 6.05414262,7.87495401 C6.05560205,7.37595584 6.29188978,6.90675785 6.69193846,6.60849231 L12.5767385,2.22129231 C13.2790649,1.70737936 14.2643076,1.8553057 14.7847498,2.55280763 C15.305192,3.25030955 15.1664628,4.23688925 14.4738462,4.76381538 L10.2816,7.88676923 L14.4797538,11.0496 C14.8154459,11.3028359 15.0367906,11.6790535 15.0950943,12.0954887 C15.153398,12.5119238 15.0438846,12.9344638 14.7906462,13.2701538 L14.7906462,13.2701538 Z",id:"Path",fillOpacity:"1.0",fill:"#CDCDCD"}))));var a=l;exports.default=a;
},{"@material-ui/core/SvgIcon":"R8TJ","react":"n8MK"}],"DCuC":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.KuronoAppBar=exports.LogoToolbar=exports.NavigationBarLayout=void 0;var e=i(require("react")),t=u(require("styled-components")),r=u(require("@material-ui/core/AppBar")),o=u(require("@material-ui/core/Toolbar")),a=require("@material-ui/core"),n=u(require("../icons/KuronoLogo"));function u(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=o?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(r,a,n):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const f=t.default.nav`
    grid-area: navigation-bar;
`;exports.NavigationBarLayout=f;const s=(0,t.default)(o.default)`
  justify-content: flex-start;
`;exports.LogoToolbar=s;const d=(0,t.default)(r.default)`
  flex-direction: row;
  justify-content: space-between;
`;exports.KuronoAppBar=d;const p=window.appData,b=p&&p.urlForAimmoDashboard?p.urlForAimmoDashboard:"";class m extends e.Component{constructor(...t){super(...t),c(this,"renderLogoToolbar",()=>e.default.createElement(s,null,e.default.createElement(a.IconButton,{href:b,"aria-label":"Kurono dashboard",color:"inherit"},e.default.createElement(n.default,{fontSize:"large"})))),c(this,"renderButtonToolbar",()=>e.default.createElement(o.default,null,e.default.createElement(a.Button,{href:b,variant:"outlined"},"Exit game")))}render(){return e.default.createElement(f,null,e.default.createElement(d,{color:"secondary",position:"sticky"},this.renderLogoToolbar(),this.renderButtonToolbar()))}}exports.default=m;
},{"react":"n8MK","styled-components":"tFSs","@material-ui/core/AppBar":"vztC","@material-ui/core/Toolbar":"OGx2","@material-ui/core":"dT3j","../icons/KuronoLogo":"zZgR"}],"jkQ6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.GamePageLayout=void 0;var e=i(require("react")),t=u(require("styled-components")),r=u(require("../IDE")),a=u(require("../../containers/Game")),n=u(require("../NavigationBar"));function u(e){return e&&e.__esModule?e:{default:e}}function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var u=a?Object.getOwnPropertyDescriptor(e,n):null;u&&(u.get||u.set)?Object.defineProperty(r,n,u):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}const l=t.default.div`
  display: grid;
  grid-template: auto 1fr 290px / 1fr 1fr;
  grid-template-areas: "navigation-bar navigation-bar"
                       "ide-editor game-view"
                       "ide-console game-view";
  width: 100vw;
  height: 100vh;
`;exports.GamePageLayout=l;class f extends e.Component{render(){return e.default.createElement(l,null,e.default.createElement(n.default,null),e.default.createElement(r.default,null),e.default.createElement(a.default,null))}}exports.default=f;
},{"react":"n8MK","styled-components":"tFSs","../IDE":"O9TG","../../containers/Game":"Myu4","../NavigationBar":"DCuC"}],"uBxZ":[function(require,module,exports) {
"use strict";require("core-js/stable"),require("regenerator-runtime/runtime"),require("threads/register");var e=f(require("react")),t=require("react-dom"),r=f(require("webfontloader")),o=require("@material-ui/core/styles"),a=require("styled-components"),i=require("./theme"),n=require("react-redux"),u=f(require("./redux/store")),d=require("immer"),l=f(require("react-ga")),s=f(require("./components/GamePage")),c=require("./components/RunCodeButton"),m=require("./redux/features/Analytics");function f(e){return e&&e.__esModule?e:{default:e}}(0,d.enableMapSet)(),r.default.load({typekit:{id:"mrl4ieu"},google:{families:["Source Code Pro"]}});const q=location.hostname.search(/codeforlife.education/i)>=0;(0,m.hasAnalyticsCookiesConsent)()&&(l.default.initialize("UA-49883146-1",{debug:!1,testMode:!q}),q&&l.default.pageview(`/kurono/play/${h()}`));const g=window.Cypress&&window.initialState||{editor:{code:{code:""},runCodeButton:{status:c.RunCodeButtonStatus.normal}},game:{connectionParameters:{game_id:h()||1},timeoutStatus:!1,gameLoaded:!1,cameraCenteredOnUserAvatar:!0}};function h(){const e=window.location.href;return/\/play\/([0-9]+)/.exec(e)[1]}const w=(0,u.default)(g),y=()=>e.default.createElement(o.StylesProvider,{injectFirst:!0},e.default.createElement(o.MuiThemeProvider,{theme:i.darkTheme},e.default.createElement(a.ThemeProvider,{theme:i.darkTheme},e.default.createElement(n.Provider,{store:w},e.default.createElement(s.default,null)))));window.Cypress&&(window.store=w);const p=document.getElementById("root");(0,t.render)(e.default.createElement(y,null),p);
},{"core-js/stable":"XqIO","regenerator-runtime/runtime":"QVnC","threads/register":"IB1e","react":"n8MK","react-dom":"NKHc","webfontloader":"FryP","@material-ui/core/styles":"UUDD","styled-components":"tFSs","./theme":"QFJf","react-redux":"jYIL","./redux/store":"dPLT","immer":"SSrD","react-ga":"gbPU","./components/GamePage":"jkQ6","./components/RunCodeButton":"b9OB","./redux/features/Analytics":"tGUC"}]},{},["uBxZ"], null)
//# sourceMappingURL=/static/react/src.dcd4e698.js.map